
var myfont_face = "Arial";
var myfont_size = "10px";
var myfont_color = "#FFFFFF";
var myback_color = "#404040";
var mywidth = 80;
var my12_hour = 1;

var dn = ""; var old = "";

function insert_clock() {
    if ( document.all || document.getElementById ) { 
        document.write('<span id="LiveClockIE" style="width:'+mywidth+'px; background-color:'+myback_color+'"></span>');
    }
    else if ( document.layers ) { 
        document.write('<ilayer bgColor="'+myback_color+'" id="ClockPosNS"><layer width="'+mywidth+'" id="LiveClockNS"></layer></ilayer>');
    }
    else { old = "true"; show_clock(); }
}

function change(Name, No) {
    if ((document.images) && (loaded == 1) && (document[Name])) {
	document[Name].src = eval("b_"+ Name + No +".src");
    }
    if (No == 1) {
	lastbutton = Name;
    }
}

function newwin(url) {
    var win;
    win = window.open("","","height=480,width=640,scrollbars");
    win.document.write("<html>\n<head>\n");
    win.document.write("<link rel=stylesheet type=\"text/css\"");
    win.document.write("href=\"stylesheet.css\">\n</head>\n");
    win.document.write("<body>\n<table>\n<tr>\n<td>\n<img src=\""+url+"\"><br>\n");
    win.document.write("<a href=\"javascript:window.close()\">Close Window</a>");
    win.document.write("</td>\n</tr>\n</table>\n</body>\n</html>");
    win.document.close();
    win.focus();
}

function hide() {
  if (document.images && (loaded == 1)) {
    change(lastbutton, 0);
  }
}

function mHigh() {
  event.srcElement.style.filter = "invert";
}

function mBack() {
  event.srcElement.style.filter = "";
}

function show_clock() {

	//show clock in NS 4
	if (document.layers) document.ClockPosNS.visibility="show"
	if (old == "die") { return; }

	var Digital = new Date();
	var hours = Digital.getHours();
	var minutes = Digital.getMinutes();
	var seconds = Digital.getSeconds();

	if (my12_hour) {
		dn = "AM";
		if (hours > 12) { dn = "PM"; hours = hours - 12; }
		if (hours == 0) { hours = 12; }
	} else {
		dn = "";
	}
	if (minutes <= 9) { minutes = "0"+minutes; }
	if (seconds <= 9) { seconds = "0"+seconds; }

	myclock = '';
	myclock += '<font style="color:'+myfont_color+'; font-family:'+myfont_face+'; font-size:'+myfont_size+';">';
	myclock += hours+':'+minutes+':'+seconds+' '+dn;
	myclock += '</font>';

	if (old == "true") {
		document.write(myclock);
		old = "die"; return;
	}

	if (document.layers) {
		clockpos = document.ClockPosNS;
		liveclock = clockpos.document.LiveClockNS;
		liveclock.document.write(myclock);
		liveclock.document.close();
	} else if (document.all) {
		LiveClockIE.innerHTML = myclock;
	} else if (document.getElementById) {
		document.getElementById("LiveClockIE").innerHTML = myclock;
	}

	setTimeout("show_clock()",1000);
}


