// Common Javascript functions
var timer_on=0;
function TimeRefresh()
{
   if (window.XMLHttpRequest)
   {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
   }
   else
   {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
   }
   xmlhttp.onreadystatechange=function()
   {
      if (xmlhttp.readyState==4 && xmlhttp.status==200)
      {
         document.getElementById('hdtxttime').innerHTML=xmlhttp.responseText;
      }
   }
   xmlhttp.open("GET","gettime.asp",true);
   xmlhttp.send();
   var t=setTimeout("TimeRefresh()",60000);
}
function SetTimer()
{  TimeRefresh();
   var t=setTimeout("TimeRefresh()",60000);
}
function preLoadImages()
{  if(document.images)
   {  var imgFiles=preLoadImages.arguments;
      var preLoadArray=new Array();
      for(var i=0; i<imgFiles.length; i++)
      {  preLoadArray[i]=new Image;
         preLoadArray[i].src=imgFiles[i];
      }
   }
}
function FindImage(name)
{  var theImage=false;
   if(document.images)
   {  theImage=document.images[name]; }
   if(theImage) { return theImage; }
   return (false);
}
function butchg(img,m)
{  var bsrc,p,t;
   if(img)
   {  bsrc=img.src;
      p=bsrc.indexOf('.gif');
      if(p>=0)
      {  t=bsrc.substr(p-1,1);
         if(m==0)
         {  bsrc=bsrc.substr(0,p-1)+'b.gif'; }
         else
         {  bsrc=bsrc.substr(0,p-1)+'o.gif'; }
         img.src=bsrc;
      }
   }
}             
function swap(id,newsrc)
{  var theImage=FindImage(id);
   if(theImage) { theImage.src=newsrc; }
}
function chgbut(id,newsrc)
{  var theBut=FindBut(id);
   if(theBut) theBut.src=newsrc;
}
function FindBut(id)
{	var theBut=false
	if(document.forms)
	{  theBut=document.getElementById(id); }
	if(theBut) { return theBut; }
	return (false);
}
function swapbut(id,nsrc)
{  var theBut=FindBut(id);
   if(theBut) theBut.src=nsrc;
}
function ChangeBut(it,onit)
{  if(onit==true)
   {  it.style.backgroundColor="#ff0000";
//      if(it.parentElement.style) it.parentElement.style.backgroundColor="#ff0000";
   }
   else
   {  it.style.backgroundColor="#ffd700";
//      if(it.parentElement.style) it.parentElement.style.backgroundColor="#ffd700";
   }
}
function ChangeObBut(it,onit)
{  if(onit==true)
   {  it.style.backgroundColor="#E8E8E8";
//      if(it.parentElement.style) it.parentElement.style.backgroundColor="#E8E8E8";
   }
   else
   {  it.style.backgroundColor="#C0C0C0";
//      if(it.parentElement.style) it.parentElement.style.backgroundColor="#C0C0C0";
   }
}
function InitPage()
{  document.body.aLink="#000066";
   document.body.vLink="#000066";
   document.body.link="#000066";
}
function HideWelcome()
{  var dv;
   dv=document.getElementById('welc');
   if(dv)
   {  dv.style.visibility='hidden'; }
   dv=document.getElementById('welcft');
   if(dv)
   {  dv.style.visibility='hidden'; }
   dv=document.getElementById('welcdet');
   if(dv)
   {  dv.style.visibility='hidden'; }
   dv=document.getElementById('welchd');
   if(dv)
   {  dv.style.visibility='hidden'; }
   dv=document.getElementById('welchide');
   if(dv)
   {  dv.style.visibility='hidden'; }
}

