    function getHour()
    {
        var time = new Date()
        var h=time.getHours()
        if(h>6 && h<18)
        {
            document.body.className="day";
            document.getElementById("clockBg").className="clockBg_day";
        }
        else
        {
            document.body.className="night";
            document.getElementById("clockBg").className="clockBg_night";
        }
    }
    
    function lead0(val) {
      // add leading 0s when necessary
      return val<10 ? "0"+val.toString() : val
     }
     
    function showAjax()
    {
      var time = new Date()
      var h=time.getHours()
      var xmlHttp;
      try
        {    
        // Firefox, Opera 8.0+, Safari    
        xmlHttp=new XMLHttpRequest();    
        }
      catch (e)
        {    
        // Internet Explorer    
        try
          {      
          xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");      
          }
        catch (e)
          {      
          try
            {        
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");        
            }
          catch (e)
            {        
            alert("Your browser does not support AJAX!");        
            return false;        
            }      
           }    
          }

      xmlHttp.onreadystatechange=function()
      {
        if(xmlHttp.readyState==4)
        {
          document.getElementById("AjaxLayer").innerHTML = xmlHttp.responseText;
        }
      }
      var url="clocktips.asp";
      url=url+"?h="+h+"&h2="+getTime();  
      xmlHttp.open("GET",url,true);
      xmlHttp.send(null);  
    }

    function getTime() {
      var time = new Date()
      var ampm = " am"
      var h=time.getHours()
      // fix military time and determine ampm
      if (h > 12) {h = h - 12; ampm = " pm";}  
      //document.getElementById("myHour").innerHTML = h+":"+lead0(time.getMinutes())+":"+ lead0(time.getSeconds()) + ampm;
      return h+":"+lead0(time.getMinutes()) + ampm;
    }
