var thePlatform = "PC";

if (navigator.platform.indexOf("Mac") != -1 || navigator.appName.indexOf("Netscape") != -1) {
	thePlatform = "Mac";
}

var thePath = "../";
if(document.title.indexOf("Home") != -1) {
	thePath = ""
}

//document.write('<link rel="stylesheet" type="text/css" href="' + thePath + 'resources/sv' + thePlatform + '.css">');

var imgPath = "images/";
var imgType = ".jpg";
var lockedBG = false;

function swapImage(imageName,imageState) {
	document.images[imageName].src = thePath + "images/common/" + imageName + "_" + imageState + ".gif";
}

var width =	1024;
var height = 768;
function resizeWindow() {
	/*if (screen.availWidth < width) {
		width = screen.availWidth;
	}
	if (screen.availHeight < height) {
		height = screen.availHeight;
	}*/
	window.resizeTo(width,height);
	window.moveTo(0,0);
}

function showQuote(idNum) {
	for (i = 1; i < 48; i ++) {
		eval("document.getElementById('quote_" + i + "').style.display = 'none'");
	}
	eval("document.getElementById('quote_" + idNum + "').style.display = 'block'");
}

function hideQuote(idNum) {
	eval("document.getElementById('quote_" + idNum + "').style.display = 'none'");
}

var i = 0;
var browserdetect;
var colors = new Array("707088", "797991", "80809a", "8989a4", "9090ab", "a0a0b5", "a9a9bc", "b0b0c6", "b9b9cd", "c0c0d7", "d0d0ee")
function homeFade() {
	if (i < 11) {
		opaque1 = i / 10;
		if (navigator.userAgent.indexOf("Safari") != -1) {
			document.getElementById('homeTitle').style.opacity = opaque1;
			document.getElementById('homeNav').style.opacity = opaque1;
			i ++;
			timer = setTimeout("homeFade()", 600);
		} else if (navigator.userAgent.indexOf("MSIE 6") != -1 || navigator.userAgent.indexOf("MSIE 5") != -1) {
			//var xx = 0xff - 0x88;
			//alert(xx);
			document.getElementById('homeTitle').style.color = colors[i];
			document.getElementById('homeNav').style.color = colors[i];
			i ++;
			timer = setTimeout("homeFade()", 400);
		} else if (navigator.userAgent.indexOf("Netscape") != -1 && parseInt(navigator.appVersion) >= 5 ) {
			document.getElementById('homeTitle').style.MozOpacity = opaque1;
			document.getElementById('homeNav').style.MozOpacity = opaque1;
			i ++;
			timer = setTimeout("homeFade()", 600);
		} else if (navigator.userAgent.indexOf("Firefox") != -1) {
			document.getElementById('homeTitle').style.MozOpacity = opaque1;
			document.getElementById('homeNav').style.MozOpacity = opaque1;
			i ++;
			timer = setTimeout("homeFade()", 600);
		} else {
			return;
		}
	} else {
		if (navigator.userAgent.indexOf("Safari") != -1) {
			document.getElementById('titleBar').style.opacity = 1.0;
		}
		if (navigator.userAgent.indexOf("Firefox") != -1) {
			document.getElementById('titleBar').style.MozOpacity = 1.0;
		}
		return;
	}
}

var fontColor;
function liveLink(elementID,msg) {
	//fontColor = document.getElementById(elementID).style.color;
	document.getElementById(elementID).style.cursor = 'hand';
	document.getElementById(elementID).style.cursor = 'pointer';
	document.getElementById(elementID).style.textDecoration = 'underline';
	document.getElementById(elementID).style.color = '#5C7E31';
	window.status = msg;
	return true;
}

function killLink(elementID) {
	document.getElementById(elementID).style.color = '#ffffff';
	document.getElementById(elementID).style.textDecoration = 'none';
	window.status = '';
	return true;
}

function goTo(theURL) {
	window.location.href = theURL;
}

function showFootnote(theFootnote) {
	footnoteNum = theFootnote.replace(/footnote/gi, "");
	for (i = footnoteNum - 5; i < footnoteNum + 5; i ++) {
		footnoteOther = 'footnote' + i;
		if (theFootnote != footnoteOther) {
			hideFootnote(footnoteOther);
		}
	}
	theReference = theFootnote.replace(/footnote/gi, "reference");
	y = event.clientY;
	if (document.documentElement.scrollTop) {
		 y += document.documentElement.scrollTop;
	}
	if (document.getElementById(theFootnote).style.display != 'block') {
		document.getElementById(theFootnote).style.top = y - 12 + "px";
		document.getElementById(theFootnote).style.display = 'block';
	}
}

function hideFootnote(theFootnote) {
	if (document.getElementById(theFootnote)) {
		document.getElementById(theFootnote).style.display = 'none';
	}
}