// JavaScript Document

function accPopup(theURL,winName,features) {
		var newwindow=window.open(theURL,winName,features);
		return false;
}

function getWindowHeight() {
	var windowHeight=0;
	if (typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	} else {
		if (document.documentElement&&document.documentElement.clientHeight) {
			windowHeight=document.documentElement.clientHeight;
		} else {
			if (document.body&&document.body.clientHeight) {
				windowHeight=document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function setFooter() { //courtesy Bobby van der Sluis, http://www.alistapart.com/articles/footers
	if (document.getElementById) {
		var windowHeight=getWindowHeight();
		if (windowHeight>0) {
			if (document.getElementById('content')) {
			var contentHeight=document.getElementById('content').offsetHeight;
			}
			var footerElement=document.getElementById('footer');
			var footerHeight=footerElement.offsetHeight;
			if (windowHeight-(contentHeight+footerHeight)>=52) {
				footerElement.style.top=(windowHeight-(contentHeight+footerHeight+51))+'px';
			} else {
				footerElement.style.top='0px';
			}
		}
	}
}

function showOneDiv(targetId) {
	if (document.getElementById){
		oldTarget = document.getElementById(oldTargetId);
		target = document.getElementById(targetId);
		oldTarget.className="hidden";
		target.className="shown";
		oldTargetId = targetId;
		setFooter();
		return false;
	}
}

function formHiLite() {
	var f = document.forms[0];
	for(var i = 0; i < f.elements.length; i++) {
        var e = f.elements[i];
		if (e.type == "text" || e.type == "textarea" || e.type == "select-one") {
			e.onfocus = function() {this.style.backgroundColor='#FFFFFF'};
        	e.onblur = function() {this.style.backgroundColor='#FAF8EF'};
			}
    }
}

window.onload = function() {
	setFooter();
}

window.onresize = function() {
	setFooter();
}


