function windowSizeFits(thisHeight, thisWidth){
	//get window dimensions
	var windowWidth, windowHeight, d=document;
	if (typeof window.innerWidth!='undefined') {
		windowWidth = window.innerWidth;
		windowHeight = window.innerHeight;
	} 
	else if ( d.documentElement && typeof d.documentElement.clientWidth!='undefined' && d.documentElement.clientWidth!=0 ) {
		windowWidth = d.documentElement.clientWidth;
		windowHeight = d.documentElement.clientHeight;
	} 
	else if ( d.body && typeof d.body.clientWidth!='undefined') {
		windowWidth = d.body.clientWidth;
		windowHeight = d.body.clientHeight;
	}
	//if 1024x768 or less show smaller version
   	if(windowHeight <= thisHeight || windowWidth <= thisWidth){
   		return false;
   	}
   	else{
   		return true;
   	}
}
		

function resizeWrapper(){
	var headerHeight = document.getElementById("header").offsetHeight;
	var contentHeight = document.getElementById("content").offsetHeight;
	var footSpaceHeight = document.getElementById("footSpacer").offsetHeight;
            
	var viewPortHeight, d=document;
	if (typeof window.innerWidth!='undefined') {
		viewPortHeight = window.innerHeight;
	} 
	else {
		if (d.documentElement && typeof d.documentElement.clientWidth!='undefined' && d.documentElement.clientWidth!==0) {
			viewPortHeight = d.documentElement.clientHeight;
		} 
		else {
			if (d.body && typeof d.body.clientWidth!='undefined') {
				viewPortHeight = d.body.clientHeight;
			}
		}
	}
			
    var footHeight = viewPortHeight - (headerHeight + contentHeight + footSpaceHeight);
    if(footHeight > 0){
		document.getElementById("footWrapper").style.height = footHeight + "px";
	}
}

function setActiveNav(){
  	for(var i = 1; i < 6; i++){
  		var currNav = document.getElementById("nav_" + i);
  		var pageVal = currNav.attributes.getNamedItem("href").value;
   		if(location.href.indexOf(pageVal) != -1){
   			currNav.className += " on";
   		}
   	}
 }