/**
  * hdsblHandler will cope with menus, and if index page the siteupdate text
  * @author R.E.SHINE
  **/
  

// var strMenuFile = 'cgi-bin/templates/menu.src';
var strMenuFile = 'cgi-bin/html_menus.cgi';

Event.observe(window, 'load', function() {
   // Load the menus
   if  ( window.addEventListener ) {
     this.clientSideInclude( 'menusystem', strMenuFile, true);
   } else if ( window.attachEvent ) { 
     this.clientSideInclude( 'menusystem', strMenuFile, false);
     navHover();
   } 
   if ( $('hdsbl_siteupdate') ) {
     // new Ajax.PeriodicalUpdater('hdsbl_siteupdate', 'hdsbl_siteupdaterss.html?ms=' + new Date().getTime(), {
     //  new Ajax.PeriodicalUpdater('hdsbl_siteupdate', 'cgi-bin/html_siteupdates.cgi', {
       new Ajax.PeriodicalUpdater('hdsbl_siteupdate', 'rss2html.php?XMLFILE=hdsbl_siteupdaterss.xml&TEMPLATE=siteupdate_template.htm&MAXITEMS=-8', {
       method: 'post', 
       frequency: 1200, decay: 1
       });
   }
  
   // Following handles the contactUs Form
   if ( $('frm_contactus') ) {
      // var define = frmcontactus.Class.define;
//      var define = Frmcontactus.define;
      
      // Event.observe('sendToCombo', 'onload' , 
 //     try {
// Event.observe('frm_contactus', 'onload', Frmcontactus.initialize());
//        Event.observe('frm_contactus', 'onload', function() {
//            salert("here I am");
//            contactus = new Frmcontactus("cgi-bin/");
//         }, true);
 //     } catch (ex) {}
            
         // Frmcontactus.create());
   
   
   
   }

});


// Event.observe($('menusystem'),'onload', function() { 

// This changes the handlers for for IE.
function navHover () {
  // clientSideInclude('menusystem', strMenuFile); 
  // Need to write this for IE6
  
   // var lis = $$('LI#navmenu');
   var lis = document.getElementById("navmenu").getElementsByTagName("LI");
   for (var i=0; i<lis.length; i++) {
      lis[i].onmouseover=function() {
         this.className+=" iehover";
      }
      lis[i].onmouseout=function() {
         this.className=this.className.replace(new RegExp(" iehover\\b"), "");
      }
   }
} 





function clientSideInclude (id, url, async) {

   if ($(id)) {
      new Ajax.Request(url, {
         asynchronous: async,
         method: 'get',
         onSuccess: function(transport) {
            $(id).innerHTML = transport.responseText;
         },
         onFailure: function(transport) {
            $(id).innerHTML = "Sorry, your browser does not support " +
                              "XMLHTTPRequest objects. This page requires " +
                              "Internet Explorer 5 or better for Windows, " +
                              "or Firefox for any system, or Safari. Other " +
                              "compatible browsers may also exist.";
         }
      });
   } else {
      alert("Bad id " + id +
            "passed to clientSideInclude." +
            "You need a div or span element " +
            "with this id in your page."); 
   }
}
 
 
 