function spawn(url, x, y) {
	window.open(url, 'casestudy', 'height=650,width=550,scrollbars=1,resizable=0,menubar=0,toolbar=0,status=1,location=0,directories=0,left=' + x + ',top=' + y + '');
}
function startList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}

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() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var contentHeight = document.getElementById('wrapper').offsetHeight;
					var footerElement = document.getElementById('footer');
					var footerHeight  = footerElement.offsetHeight;
					
						footerElement.style.position = 'fixed';
						footerElement.style.bottom = '0';
						footerElement.style.margin = '0';
						footerElement.style.left = '50%';
						footerElement.style.marginLeft = '-498px';					
				}
			}
		}
		var agt=navigator.userAgent.toLowerCase();
		var is_gecko = (agt.indexOf('gecko') != -1);
			
		window.onload = function() {			
			if(is_gecko){
				setFooter();
			}
			startList();
		}
		window.onresize = function() {
			if(is_gecko){
				setFooter();
			}
		}
