// browser test:
version = "1";
bannerID = 1;
vcbase="http://www71.valueclick.com/cgi-bin/cycle?host=h0081936&b=";

// preload images:
if (version == "1") {

menu1=new Image();
menu1.src="/pics/gamesmenugray.gif";
menu1_mouse=new Image();
menu1_mouse.src="/pics/gamesmenublue.gif";

menu2=new Image();
menu2.src="/pics/greetingsmenugray.gif";
menu2_mouse=new Image();
menu2_mouse.src="/pics/greetingsmenublue.gif";

menu3=new Image();
menu3.src="/pics/jmenugray.gif";
menu3_mouse=new Image();
menu3_mouse.src="/pics/jmenublue.gif";

c0=new Image();
c0.src="/pics/clock/0.gif";
c1=new Image();
c1.src="/pics/clock/1.gif";
c2=new Image();
c2.src="/pics/clock/2.gif";
c3=new Image();
c3.src="/pics/clock/3.gif";
c4=new Image();
c4.src="/pics/clock/4.gif";
c5=new Image();
c5.src="/pics/clock/5.gif";
c6=new Image();
c6.src="/pics/clock/6.gif";
c7=new Image();
c7.src="/pics/clock/7.gif";
c8=new Image();
c8.src="/pics/clock/8.gif";
c9=new Image();
c9.src="/pics/clock/9.gif";
cb=new Image();
cb.src="/pics/clock/b.gif";
am=new Image();
am.src="/pics/clock/am.gif";
pm=new Image();
pm.src="/pics/clock/pm.gif";


}

function updateClock() {
	var time = new Date();
	var h = time.getHours();// + 1;
	var td = "am";
	if (h > 12) { 
		h = h - 12; 
		td = "pm";
	}
	else if (h == 0) { h=12; }
	if (h < 10) { hours = "b"+h; }
	else { hours = ""+h; }
	var m = time.getMinutes();
	if (m < 10) { minutes = "0"+m; }
	else { minutes = ""+m; }
	
	var h1 = hours.charAt(0);
	var h2 = hours.charAt(1);
	var m1 = minutes.charAt(0);
	var m2 = minutes.charAt(1);
	
	hiLite('ch1','c'+h1);
	hiLite('ch2','c'+h2);
	hiLite('ch3','c'+m1);
	hiLite('ch4','c'+m2);
	hiLite('ampm',td);
	
	updt = setTimeout ("updateClock()", 60000);
}

function updateBanner() {
	bannerID = bannerID + 1;
	document.vc.src = vcbase + bannerID;
	//updtb = setTimeout ("updateBanner()", 60000);
}

function bannerClick() {
	window.open("http://www71.valueclick.com/cgi-bin/redirect?host=h0081936&b="+bannerID,"b"+bannerID,"width=640,height=480,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes");
	return false;
}

function hiLite(imgDocID,imgObjName) {
//   imgDocID - the name or number of the document image to be replaced
//   imgObjName - the name of the image object to be swapped in

	if (version == "1") {
		document.images[imgDocID].src = eval(imgObjName + ".src")
		//document[imgDocID].src = eval(imgObjName + ".src");
	}	
}

function showStatus(toshow) {
	window.status=toshow;
	return true;
}

function MM_showHideLayers() { //v2.0
  var i, visStr, args, theObj;
  args = MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) { //with arg triples (objNS,objIE,visStr)
    visStr   = args[i+2];
    if (navigator.appName == 'Netscape' && document.layers != null) {
      theObj = eval(args[i]);
      if (theObj) theObj.visibility = visStr;
    } else if (document.all != null) { //IE
      if (visStr == 'show') visStr = 'visible'; //convert vals
      if (visStr == 'hide') visStr = 'hidden';
      theObj = eval(args[i+1]);
      if (theObj) theObj.style.visibility = visStr;
  } }
}

function hideAll() {
	hiLite('m1','menu1'); 
	hiLite('m2','menu2'); 
	hiLite('m3','menu3'); 
	MM_showHideLayers('document.layers[\'gamesmenu\']','document.all[\'gamesmenu\']','hide'); 
	MM_showHideLayers('document.layers[\'greetingsmenu\']','document.all[\'greetingsmenu\']','hide'); 
	MM_showHideLayers('document.layers[\'jmenu\']','document.all[\'jmenu\']','hide');
	showStatus(' ');
	return false;
}

function topBar() {
document.write('\n<table border="0" cellspacing="0" cellpadding="0" width="100%">');
document.write('\n<tr>');
document.write('\n	<td width="9" height="20"><a href="#" onclick="return false;" onmouseover="hideAll();"><img src="/pics/barleft.gif" width="9" height="20" border="0"></a></td>');
document.write('\n	<td height="20" width="31" valign="top" align="center"><a href="#" onclick="return hideAll();" onmouseover="hideAll(); hiLite(\'m3\',\'menu3_mouse\'); MM_showHideLayers(\'document.layers[\\\'jmenu\\\']\',\'document.all[\\\'jmenu\\\']\',\'show\');"><img src="/pics/jmenugray.gif" width="31" height="20" alt="J" border="0" name="m3"></a></td>');
document.write('\n	<td width="53" height="20"><a href="#" onclick="return hideAll();" onmouseover="hideAll(); hiLite(\'m1\',\'menu1_mouse\'); MM_showHideLayers(\'document.layers[\\\'gamesmenu\\\']\',\'document.all[\\\'gamesmenu\\\']\',\'show\');"><img src="/pics/gamesmenugray.gif" width="53" height="20" border="0" name="m1" alt="Games"></a></td>');
document.write('\n	<td width="72" height="20"><a href="#" onclick="return hideAll();" onmouseover="hideAll(); hiLite(\'m2\',\'menu2_mouse\'); MM_showHideLayers(\'document.layers[\\\'greetingsmenu\\\']\',\'document.all[\\\'greetingsmenu\\\']\',\'show\');"><img src="/pics/greetingsmenugray.gif" width="72" height="20" border="0" name="m2" alt="Greetings"></a></td>');
document.write('\n	<td background="/pics/barfiller.gif" height="20" width="1000"><a href="#" onclick="return false;" onmouseover="hideAll();"><img src="/pics/barfiller.gif" width="400" height="20" border="0" alt="-"></a></td>');
document.write('\n	<td width="8" height="20"><img name="ch1" src="/pics/clock/b.gif" width="8" height="20"></td>');
document.write('\n	<td width="8" height="20"><img name="ch2" src="/pics/clock/b.gif" width="8" height="20"></td>');
document.write('\n	<td width="4" height="20"><img src="/pics/clock/c.gif" width="4" height="20"></td>');
document.write('\n	<td width="8" height="20"><img name="ch3" src="/pics/clock/b.gif" width="8" height="20"></td>');
document.write('\n	<td width="8" height="20"><img name="ch4" src="/pics/clock/b.gif" width="8" height="20"></td>');
document.write('\n	<td width="24" height="20"><img name="ampm" src="/pics/clock/b.gif" width="24" height="20"></td>');
document.write('\n	<td width="7" height="20"><img src="/pics/barright.gif" width="7" height="20"></td>');
document.write('\n</tr>');
document.write('\n</table>');
document.write('\n<table border="0" cellspacing="0" cellpadding="0" width="100%">');
document.write('\n<tr>');
document.write('\n	<td height="4"><img src"/pics/tpixel.gif" width="1" height="4"></td>');
document.write('\n</tr>');
document.write('\n<tr>');
document.write('\n	<td align="center" valign="middle" width="468">');
//document.write('\n			<!-- VC -->');
//document.write('\n			<CENTER>');
//document.write('\n			<A TARGET="main" HREF="#" onclick="return bannerClick();"><IMG WIDTH=468 HEIGHT=60 name="vc" border="0" ALT="Please support JGames.com by visiting our sponsor." SRC="/pics/tpixel.gif"></A>');
//document.write('\n			</FONT>');
//document.write('\n			</CENTER>');
//document.write('\n			<!-- vc -->');
document.write('\n<img src="/pics/tagline1.gif" width="468" height="60" alt="Free Java Games image">');
document.write('\n	</td>');
document.write('\n	<td align="left" valign="middle" width="185" height="60"><a href="http://www.jgames.com/"><img src="/pics/jgameslogo.gif" width="185" height="60" alt="Free Java Games picture" border="0"></a></td>');
document.write('\n</tr>');
document.write('\n<tr>');
document.write('\n	<td height="4"><img src"/pics/tpixel.gif" width="1" height="4"></td>');
document.write('\n</tr>');
document.write('\n</table>');
document.write('\n');
}

function showHeader(whatgame) {
document.write('\n<table border="0" cellspacing="0" cellpadding="0" width="100%" height="20">');
document.write('\n<tr>');
document.write('\n	<td colspan="2" bgcolor="#aac2da" height="1" width="100%"><img src="/pics/tpixel.gif" width="1" height="1"></td>');
document.write('\n</tr>');
document.write('\n<tr>');
document.write('\n	<td bgcolor="#336699" height="20" width="90%" valign="middle"><h3 style="line-height: 20px; padding-top: 4px;">');
document.write('\n	<font size="2" color="white" face="Verdana">&nbsp;&raquo;&nbsp;'+whatgame);
if (whatgame == 'Home' || whatgame == 'Contact Us') document.write(' :: Free Java Games');
else document.write(' Game');
document.write('\n	</h3></td><td width="10%" height="20" bgcolor="#336699"><g:plusone></g:plusone></td>');
document.write('\n<tr>');
document.write('\n	<td colspan="2" bgcolor="#191970" height="1" width="100%"><img src="/pics/tpixel.gif" width="1" height="1"></td>');
document.write('\n</tr>');
document.write('\n</table>');
}

menuLoaded = true;

