function checkTimeZone() {
  var rightNow = new Date();
  rightNow = new Date(rightNow.getFullYear(), rightNow.getMonth(), rightNow.getDate(), rightNow.getHours(), rightNow.getMinutes(), rightNow.getSeconds());
  var temp = rightNow.toGMTString();
  var rightNow2 = new Date(temp.substring(0, temp.lastIndexOf(" ")));
  var hoursDiffRightNow = (rightNow - rightNow2) / (1000 * 3600);
  var date1 = new Date(rightNow.getFullYear(), 0, 1, 0, 0, 0, 0);
  var date2 = new Date(rightNow.getFullYear(), 6, 1, 0, 0, 0, 0);
  var temp = date1.toGMTString();
  var date3 = new Date(temp.substring(0, temp.lastIndexOf(" ")));
  temp = date2.toGMTString();
  var date4 = new Date(temp.substring(0, temp.lastIndexOf(" ")));
  var minutesDiffStdTime = (date1 - date3) / (1000 * 60);
  var hoursDiffStdTime = minutesDiffStdTime / 60;
  var longitude = "your longitude is ";
  if (hoursDiffStdTime < 0)
    longitude += (hoursDiffStdTime * -15 + 7.5) + " W (+/- about 10°)";
  else
    longitude += (hoursDiffStdTime * 15 + 7.5) + " E (+/- about 10°)";
  var fraction = ".0"
  if (minutesDiffStdTime % 60 != 0)
    fraction = "";
  var hoursDiffDaylightTime = (date2 - date4) / (1000 * 3600);
  var inDST = "Daylight Saving Time is currently in effect"
  if (hoursDiffStdTime == hoursDiffRightNow)
    inDST = "Daylight Saving Time is not currently in effect"
  if (hoursDiffStdTime == hoursDiffDaylightTime)
    alert("your time zone is UTC " + hoursDiffStdTime + fraction + "\nYou do not observe Daylight Saving Time\n" + longitude);
  else if (hoursDiffStdTime < hoursDiffDaylightTime)
    alert("\nyou live at a Northern latitude\n" + longitude + "\nyour \"Standard Time\" zone is UTC " + hoursDiffStdTime + fraction + "\n" + inDST);
  else
    alert("you live at a Southern latitude\n" + longitude + "\nyour \"Standard Time\" zone is UTC " + hoursDiffStdTime + fraction + "\n" + inDST);
}

function popUp(dir, name, w, h) {
  var ExpireDate;
  if (document.cookie.length<=0 || document.cookie.indexOf("popUp=")==-1) {
    ExpireDate=new Date();
    ExpireDate.setTime(ExpireDate.getTime()+120000);
    document.cookie="popUp="+name+"; expires="+ExpireDate.toGMTString();
//    if(h>screen.height-32){
//      alert('Your resolution is '+screen.width+'x'+screen.height);
//      h=screen.height-32;
//      window.open(dir+name+".htm",name,'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,width='+w+',height='+h+',left=0,top=0');    }
//    else
//     window.open(dir+name+".htm",name,'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,width='+w+',height='+h+',left=0,top=0');
     window.open(dir+name+".htm",name);

    this.focus();
  }
}

function deleteCookie() {
  if (document.cookie.length>0 && document.cookie.indexOf("song=")>-1) {
    document.cookie="song=playing; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}
 
function playSong(name, duration) {
  var ExpireDate;
  if (document.cookie.length<=0 || document.cookie.indexOf("song=")==-1) {
    ExpireDate=new Date();
    ExpireDate.setTime(ExpireDate.getTime()+duration*1000);
    document.cookie="song=playing; expires="+ExpireDate.toGMTString();
    window.open(name+"_qt.htm",name,'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,width=200,height=100,left=0,top=0');
    this.focus();
  }
}

function delaySong(name, duration) {
  setTimeout("playSong('"+name+"', "+duration+")",1000);
}

function counter(id) {
<!--
scWidth="na";
scDepth="na";
java="na";
visitor_id="new visitor";
old_visitor="";
url = document.URL;
referer = document.referrer;
refererLength = referer.length;
if (referer.length == 0) 
  {referer = "direct access"}
else
  {referer=escape(referer)}

brName=navigator.appName
brVersion = navigator.appVersion;
brCode = navigator.appCodeName;
osPlatform = navigator.platform;
scWidth=screen.width;
if (brName != "Netscape") 
	{scDepth=screen.colorDepth} 
else 
	{scDepth=screen.pixelDepth}
java=navigator.javaEnabled()

// This is likely to be confusing but...
//   the variable "visitor_id" is used to represent the new cookie "visitor3ID"
//   while the variable "old_visitor" represents any possible original-version counterServlet cookie named "visitorID"
// In other words, the cookie name has changed from "visitorID" to "visitor3ID", but we continue to use
//   the old "visitor_id" column / variable name to represent this new "visitor3ID" cookie
//   (while a new column / variable "old_visitor" will store any old "visitorID" cookie)

if (document.cookie.length>0) {
	begin=document.cookie.indexOf("visitor3ID=");
	if (begin!=-1) {
		begin+=11;
		end = document.cookie.indexOf(";", begin);
		if (end==-1)
			end=document.cookie.length;
		visitor_id=unescape(document.cookie.substring(begin, end));
	}
	begin=document.cookie.indexOf("visitorID=");
	if (begin!=-1) {
		begin+=10;
		end = document.cookie.indexOf(";", begin);
		if (end==-1)
			end=document.cookie.length;
		old_visitor=unescape(document.cookie.substring(begin, end));
	}
}

NS2Ch=0
if (navigator.appName == "Netscape" && navigator.appVersion.charAt(0) == "2") 
	{NS2Ch=1}
if (NS2Ch == 0) {
	userdata="&id=" + id + "&visitor_id=" + visitor_id + "&old_visitor=" + old_visitor + "&url=" + url + "&referer=" + referer + "&size=" + scWidth + "&colors=" + scDepth + "&java=" + java + "&browser=" + brName + "&os=" + osPlatform;
	document.write("<IMG SRC=\"http://j2ee-consultants.com/counter?" + userdata + "\" BORDER=0>")
	}

with (document) {
  write("<NOSCRIPT>");
  write("<IMG SRC=\"/counter?&id="+id+"\" ALT=\"Thomas Fly's songlist\" BORDER=0>");
  write("</NOSCRIPT>");
}
}
