<!-- Hide from old browsers
var clock_logowidth=200; // width of div in pixels
var clock_leftwidth=75; // width of left div in pixels
var clock_rightwidth=125; // width of right div in pixels
var clock_Hoffset=10; // number of pixels from right side of browser window
var clock_Voffset=5; // number of pixels from top of browser window
var clock_script_location = "/games/"; // used by this script to locate images

var clock_isItvisible=0;
var clock_hideTimer = null;
var clock_interval = null;

var clock_refer=true;
wzone=0;
wisitlocal=true;
wampm='';

var div_pos = (is_ie7) ? 'fixed' : 'absolute';
//var div_pos = 'fixed';
//var div_pos = 'absolute';

// the following defines the clock dialog div
if (!((is_ie4up && is_mac) || (is_gecko && (is_rev <1)) || (is_opera && (is_major < 5))) && (document.all || document.getElementById)) {
	document.write('<div align="center" id="clock_block" style="position:'+div_pos+'; left:5px; visibility:hidden;">');
	document.write('<div id="clock_topbar">');
	document.write('<a href="javascript:hide_clock()" title="Close Clock / Calendar"><img src="'+clock_script_location+'close_n.gif" ');
	document.write('width=11 height=11 hspace=1 vspace=2 border=0 alt="x" align="right"></a>&nbsp;Clock / Calendar</div>');

	document.write('<div style="float:left; width:' + clock_leftwidth + 'px; text-align:center;">');
	
	document.write('<br /><br />Click a date for some history<br />');

function openhor() {
	 window.open('http://nickeysurf.com/coding/php/horoscopes/horoscope.php','Remote', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=550,height=380');
	}
	
	document.write('<br /><br /><a href="javascript:openhor()">Today\'s<br />Horoscope</a><br />');

	document.write('</div>');
	
	document.write('<div style="float:right; text-align:center; width:' + clock_rightwidth + 'px;">');
	
	document.write('<form action="" name="where" id="where" style="display: inline;">' + 
	'<div id="clock_contents" style="position:absolute; width:95px; height:14px; z-index:1; visibility:hidden">' + 
	'<select name="city" size="1" style="font:10px Arial; width:95px;height:14px;" onChange="updateclock(this);" id="worldselect"> ' + 
	'<option value="" selected>Local Time</option>' + 
	'<option value="0">London GMT</option> ' + 
	'<option value="1">Rome</option>' + 
	'<option value="7">Bangkok</option>' + 
	'<option value="8">Hong Kong</option>' + 
	'<option value="9">Tokyo</option> ' + 
	'<option value="10">Sydney</option>' + 
	'<option value="12">Fiji</option>' + 
	'<option value="-10">Hawaii</option>' + 
	'<option value="-8">San Francisco</option> ' + 
	'<option value="-5">New York</option>' + 
	'<option value="-3">Buenos Aires</option>' + 
	'</select></form></div>');
	
	document.write('<table border="0" cellspacing="0" cellpadding="0">\n<tr>');
	document.write('<td width="100" align="center"><span id="worldtitle"><a href="javascript:clock_combo()" ' + 
	'style="font:bold 11px Arial; color:black; text-decoration: none;" title="Click to change clock location">Click Here</a></span></td>\n</tr>\n<tr>\n' + 
	'<td align="center">');


	document.write('<span id="worldclock" style="font:bold 14px Arial;"></span><br>');

	


month_name="font-family:verdana,arial,helvetica,sans-serif;font-size:7pt;font-style:normal;font-weight:bold;background-color:#FFFFFF;color:#000000;";

week_days="font-family:verdana,arial,helvetica,sans-serif;font-size:6pt;font-style:normal;font-weight:normal;background-color:#8B96AB;color:#FFFFFF;";

month_days="font-family:verdana,arial,helvetica,sans-serif;font-size:6pt;font-style:normal;font-weight:normal;background-color:#FFFFFF;color:#000000;";

current_day="font-family:verdana,arial,helvetica,sans-serif;font-size:6pt;font-style:normal;font-weight:bold;background-color:#FFFFCC;color:#000000;";

no_day="font-family:verdana,arial,helvetica,sans-serif;font-size:6pt;font-style:normal;font-weight:normal;background-color:#AAAAAA;color:#000000;";

link_style="color:#000000;text-decoration:none;";

monthnames = new Array("January","Februrary","March","April","May","June","July","August","September",
"October","November","Decemeber");

monthdays = new Array(31,28,31,30,31,30,31,31,30,31,30,31);

todayDate=new Date();
thisday=todayDate.getDay();
thismonth=todayDate.getMonth();
thisdate=todayDate.getDate();
thisyear=todayDate.getYear();
thisyear = thisyear % 100;
thisyear = ((thisyear < 50) ? (2000 + thisyear) : (1900 + thisyear));

if (((thisyear % 4 == 0) && !(thisyear % 100 == 0)) || (thisyear % 400 == 0))
	monthdays[1]++;

function addlink(month, day, href) { this.month = month; this.day = day; this.href = href; }

linkdays = new Array();

for( var x=0; x<=monthdays[thismonth]; x++) {
	if( x == thisdate) theurl="javascript:openhis(-1,-1)";
	else theurl="javascript:openhis("+thismonth+","+x+")";
	linkdays[x]= new addlink(thismonth+1,x,theurl);
	}

startspaces=thisdate;

while (startspaces > 7) startspaces-=7;

startspaces = thisday - startspaces + 1;

if (startspaces < 0) startspaces+=7;

document.write("<table border=0 bgcolor=black cellpadding=1 cellspacing=1 align=right>\n");
document.write("<tr>\n<td colspan=7 align=center style=\""+month_name+"\">" + monthnames[thismonth] + " " + thisyear + "</td>\n</tr>\n");
document.write("<tr>\n<td align=center style=\""+week_days+"\">S</td>\n");
document.write("<td align=center style=\""+week_days+"\">M</td>\n");
document.write("<td align=center style=\""+week_days+"\">T</td>\n");
document.write("<td align=center style=\""+week_days+"\">W</td>\n");
document.write("<td align=center style=\""+week_days+"\">T</td>\n");
document.write("<td align=center style=\""+week_days+"\">F</td>\n");
document.write("<td align=center style=\""+week_days+"\">S</td></tr>\n<tr>\n\n"); 

for (s=0;s<startspaces;s++) document.write("<td style=\""+no_day+"\">&nbsp;</td>");

count=1;
while (count <= monthdays[thismonth]) {
	if(startspaces==0) document.write("<tr>\n");
	for (b = startspaces;b<7;b++) {
		linktrue=false;
		document.write("<td align=right style=\"");
		if(count==thisdate) document.write(current_day);
		else if(count <= monthdays[thismonth]) document.write(month_days);
		else document.write(no_day);
		document.write("\">");
		for (c=0;c<linkdays.length;c++)	{
			if (linkdays[c] != null) {
				if ((linkdays[c].month==thismonth + 1) && (linkdays[c].day==count)) {
					document.write("<a href=\"" + linkdays[c].href + "\" style=\""+link_style+"\">");
					linktrue=true;
					}
				}
			}
		if (count==thisdate) document.write("<strong>");
		if (count <= monthdays[thismonth]) document.write(count);
		else document.write("&nbsp;");
		if (count==thisdate) document.write("</strong>");
		if (linktrue) document.write("</a>");
		document.write("</td>\n");
		count++;
		}
	document.write("</tr>\n");
	startspaces=0;
	}
document.write("</table>\n");

function openhis(damonth,daday)
	{
	if(damonth == -1) disurl="http://history.nickeysurf.com/cgi-bin/today2p.cgi";
	else disurl="http://history.nickeysurf.com/cgi-bin/today2xp.cgi?themonth="+monthnames[damonth]+"&theday="+daday+"&theyear=All&events=yes&birthday=yes&death=yes&usetext=without&thetext=";
	 window.open(disurl,'Remote', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=550,height=380');
	}


	document.write('</td>\n</tr>\n</table></div>');
	document.write('</div>');

	var clock_obj = is_ie4up ? document.all.clock_block : document.getElementById ? document.getElementById("clock_block") : document.clock_block;
	
// below writes the link to clock
	document.write('<a href="javascript:show_clock();"><img src="'+clock_script_location+'icon-clock.png" width="16" height="16" hspace="0" vspace="0" border="0" alt="- Click to view Clock / Calendar -" title="Click to view Clock / Calendar" onMouseover="update_clock_icon()" name="Iclock_icon" id="Iclock_icon"><\/a>');
	}

function update_clock_icon() {
	var icon_time = WorldClock(1);
	document.Iclock_icon.alt = document.Iclock_icon.title = 'Click to view Clock / Calendar '+icon_time+' '+monthnames[thismonth]+' '+thisdate+' '+thisyear;
	}

function clock_combo() {
	if (clock_refer) {
		document.getElementById('clock_contents').style.visibility="visible";
		clock_refer=false;
		}
	else {
		document.getElementById('clock_contents').style.visibility="hidden";
		clock_refer=true;
		}
	}

function updateclock(wzzz) {
	wzone=wzzz.options[wzzz.selectedIndex].value;
	wisitlocal=(wzzz.options[0].selected)?true:false;
	document.getElementById("worldtitle").innerHTML="<a href=\"javascript:clock_combo()\" style=\"font:bold 12px Arial; color:black; text-decoration: none;\" title=\"Click to change clock location\">"+wzzz.options[wzzz.selectedIndex].text+"</a>";
	clock_combo();
	}

function WorldClock(return_time) {
	wnow=new Date();
	wofst=wnow.getTimezoneOffset()/60;
	wsecs=wnow.getSeconds();
	wsec=-1.57+Math.PI*wsecs/30;
	wmins=wnow.getMinutes();
	wmin=-1.57+Math.PI*wmins/30;
	whr=(wisitlocal)?wnow.getHours():(wnow.getHours() + parseInt(wofst)) + parseInt(wzone);
	whrs=-1.575+Math.PI*whr/6+Math.PI*parseInt(wnow.getMinutes())/360;
	if (whr < 0) whr+=24;
	if (whr > 23) whr-=24;
	wampm = (whr > 11)?"PM":"AM";
	wstatusampm = wampm.toLowerCase();

	whr2 = whr;
	if (whr2 == 0) whr2=12;
	(whr2 < 13)?whr2:whr2 %= 12;
	if (whr2<10) whr2="0"+whr2

	var wfinaltime=whr2+':'+((wmins < 10)?"0"+wmins:wmins)+':'+((wsecs < 10)?"0"+wsecs:wsecs)+' '+wstatusampm;

	if(return_time) return wfinaltime;
	
	else {
		if (document.all) worldclock.innerHTML=wfinaltime
		else if (document.getElementById) document.getElementById("worldclock").innerHTML=wfinaltime
		else if (document.layers) {
			document.worldclockns.document.worldclockns2.document.write(wfinaltime)
			document.worldclockns.document.worldclockns2.document.close()
			}
		}
	}

function clock_positionit()
	{
	 var clock_dsocleft=is_ie4up? document.body.scrollLeft : pageXOffset;
	 var clock_dsoctop=is_ie4up? document.body.scrollTop : pageYOffset;
	 var clock_window_width=is_ie4up? document.body.clientWidth : window.innerWidth-20;
	 if (is_ie4up||document.getElementById)
		{
		 clock_obj.style.left=parseInt(clock_dsocleft)+parseInt(clock_window_width)-clock_logowidth-clock_Hoffset+'px';
		 clock_obj.style.top=parseInt(clock_dsoctop)+5+clock_Voffset+'px';
		}
	}

function hide_clock() {
	clock_obj.style.visibility="hidden";
	clearInterval(clock_interval);
	clock_isItvisible=0;
	}

function show_clock() {
	if(! clock_isItvisible) {
		clock_positionit();
		clock_obj.style.visibility="visible";
		clock_isItvisible=1;
		clock_interval=setInterval("clock_positionit()",50);
		}
	}

if (!((is_ie4up && is_mac) || (is_gecko && (is_rev <1)) || (is_opera && (is_major < 5))) && (document.all || document.getElementById)) {
//	clock_positionit();
//	clock_obj.style.visibility="hidden";
	setInterval('WorldClock()',1000);
	}

// -->
