function ConnectionFailure(){
    document.getElementById("Hotels").innerHTML = "<div>Error: Could not connect to events database.</div>";
}
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

 function setAndExecute(divId, innerHTML)  
{  
   var div = document.getElementById(divId);  
   div.innerHTML = innerHTML;  
   var x = div.getElementsByTagName("script");
   for(var i=0;i<x.length;i++)
   {  
       eval(x[i].text);  
   }  
}  

function displayEvents(){
    new Ajax.Request('/my_Modules/OMHotels/dirmod.asp?' + window.location.search.substring(1), {
    method: 'get',
    onSuccess: function(transport) {
        setAndExecute("Hotels", transport.responseText);
},  onFailure: function(transport) {
        ConnectionFailure();
    }});
}
addLoadEvent(displayEvents);





