/* -------------- STANDARD FUNCTIONS -------------- */
function openWin(doclocation,width,height) {
	height=height+19;
	newwindow = window.open(doclocation,"subwin","resizable,WIDTH="+width+",HEIGHT="+height+"screenX=0,screenY=0");
}

function imgWin(doclocation,width,height) {
	height=height+19+130;
	width=width+20;
	if(width < 748) { width = 748 }
	newwindow = window.open(doclocation,"subwin","resizable,WIDTH="+width+",HEIGHT="+height+"screenX=0,screenY=0");
}

function toggleLayer(layerid) {
	var thelayer = document.getElementById(layerid);
	thelayer.style.display = (thelayer.style.display == 'block') ? 'none' : 'block';
}

function preload() {
	var args = preload.arguments; document.imageArray = new Array(args.length);
	for(var i=0; i<args.length; i++) {
	    document.imageArray[i] = new Image;
    	document.imageArray[i].src = args[i];
	}
}

/* -------------- LAYER POSITION FUNCTIONS -------------- */
function getRealLeft(el) {
	xPos = el.offsetLeft;
	tempEl = el.offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetLeft;
		tempEl = tempEl.offsetParent;
	}
	return xPos;
}
function getRealTop(el) {
	xPos = el.offsetTop;
	tempEl = el.offsetParent;
	while (tempEl != null) {
		xPos += tempEl.offsetTop;
		tempEl = tempEl.offsetParent;
	}
	return xPos;
}

function openMenu() {
}

function closeMenus() {
	
}

/* -------------- STYLE FUNCTIONS -------------- */
function getexpirydate(nodays){ // gets and expire date for cookies
	var UTCstring;
	Today = new Date();
	nomilli=Date.parse(Today);
	Today.setTime(nomilli+nodays*24*60*60*1000);
	UTCstring = Today.toUTCString();
	return UTCstring;
}
function getcookie(cookiename) { // gets cookie values
	var cookiestring=""+document.cookie;
	var index1=cookiestring.indexOf(cookiename);
	if (index1==-1 || cookiename=="") return ""; 
	var index2=cookiestring.indexOf(';',index1);
	if (index2==-1) index2=cookiestring.length; 
	return unescape(cookiestring.substring(index1+cookiename.length+1,index2));
}


// ************ CLOCK FUNCTIONS ************ //
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December")

function getClientDate() {
	var mydate=new Date();
	var year=mydate.getYear();
	if (year < 1000) {
		year+=1900;
	}
	var month=mydate.getMonth();
	var daym=mydate.getDate();
	if (daym<10) {
		daym="0"+daym;
	}
	var hours=mydate.getHours();
	var minutes=mydate.getMinutes();
	var seconds=mydate.getSeconds();
	var dn="am";
	if (hours>=12) {
		dn="pm";
	}
	if (hours>12) { 
		hours=hours-12;
	}
	if(hours==0) {
		hours=12;
	}
	if(minutes<=9) {
		minutes="0"+minutes;
	}
	if (seconds<=9) {
		seconds="0"+seconds;
	}
	//change font size here
	var cdate=hours+":"+minutes+":"+seconds+dn+" ~ "+montharray[month]+" "+daym+", "+year+"";
	document.getElementById("localclock").innerHTML=cdate
}

function startTime() {
	if (document.all || document.getElementById) {
		setInterval("getClientDate()",1000);
	}
}
window.onload=startTime;