function setTimeDifference(timeDiff, netDelay) {
	milliSecs=timeDiff;
	if (timeDiff == -999)	table_visible("table1");

	table_invisible("table2");

}


function table_visible(objectname) {
	if(navigator.appName == "Netscape")
	{
		document.getElementById(objectname).style.visibility = 'visible';
	} else {
	
	     var t1 = document.all.item(objectname);
	     if (t1 != null && t1.length != null)
		  {
		       for (i=0; i<t1.length; i++)
			    {
				 t1(i).style.display = "";
			    }

		  }
	}
}



function table_invisible(objectname) {
	if(navigator.appName == "Netscape")
	{
		document.getElementById(objectname).style.visibility = 'hidden';
	
	} else {
	
		     var t1 = document.all.item(objectname);
		     if (t1 != null && t1.length != null)
			  {
			       for (i=0; i<t1.length; i++)
				    {
					 t1(i).style.display = "none";
				    }

			  }
	}
}



function chgMode(){
	if (mode=="shorthour")
		mode="longhour";
	else 
		mode="shorthour";
}




function dotime(d){

	hr= d.getHours()+100;
	mn= d.getMinutes()+100;
	se= d.getSeconds()+100;


	if(mode=="longhour"){
		//alert("longhour");
		if(hr==100){hr=100;am_pm='blank';}
			else if(hr<112){am_pm='blank';}
			else if(hr==112){am_pm='blank';}
			else if(hr>112){am_pm='blank';hr=(hr-0);}
		}

	else if (mode=="shorthour"){
		//alert("shorthour");
		if(hr==100){hr=112;am_pm='am';}
			else if(hr<112){am_pm='am';}
			else if(hr==112){am_pm='pm';}
			else if(hr>112){am_pm='pm';hr=(hr-12);}
		}
	tot=''+hr+mn+se;
	document.hr1.src = 'images/c/dg'+tot.substring(1,2)+'.gif';
	document.hr2.src = 'images/c/dg'+tot.substring(2,3)+'.gif';
	document.mn1.src = 'images/c/dg'+tot.substring(4,5)+'.gif';
	document.mn2.src = 'images/c/dg'+tot.substring(5,6)+'.gif';
	document.se1.src = 'images/c/dg'+tot.substring(7,8)+'.gif';
	document.se2.src = 'images/c/dg'+tot.substring(8,9)+'.gif';
	document.ampm.src= 'images/c/dg'+am_pm+'.gif';

	theTime=setTimeout('dotime(gettimeDiff(new Date()))',1000);

//setTimeDifference(se, 1000);

}



function gettimeDiff(d)	{
	msSecs = (1000)
	msMins = (msSecs * 60)
	msHours = (msMins * 60)
	numHours = Math.floor(milliSecs/msHours)
	numMins = Math.floor((milliSecs - (numHours * msHours)) / msMins)
	numSecs = Math.floor((milliSecs - (numHours * msHours) - (numMins * msMins))/ msSecs)


	if (numSecs < 10){
	  numSecs = numSecs	//.toString
	}
	if (numMins < 10){
	  numMins = numMins	//.toString
	}

	//alert(numHours + ":" + numMins + ":" + numSecs);
	//alert(numHours);
	//alert(numMins);
	//alert(numSecs);


	hr= d.getHours();
	mn= d.getMinutes();
	se= d.getSeconds();
	//alert(hr + ":" + mn + ":" + se);

	se=se+numSecs;
	if (se>=60)	{
		se=se-60;
		mn=mn+1;
	}
	if (se<0) {
		se=se+60;
		mn=mn-1;
	}

	mn=mn+numMins;
	if (mn>=60)	{
		mn=mn-60;
		hr=hr+1;
	}
	if (mn<0) {
		mn=mn+60;
		hr=hr-1;
	}

	hr=hr+numHours;
	if (hr>=24)	hr=0;
	if (hr<0) hr=hr+Math.abs(numHours);


	var newdate = new Date("1/1/2001 "+hr+":"+mn+":"+se);
	return newdate

}
