function popJuke (page){
	window.open(page, "jukebox", "height=123,width=314,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no");
}﻿

function popWin(page){
	window.open(page, "formu", "height=600,width=580,status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes");
}

function windowPop(page, h, w){
	window.open(page, "winpop", "height="+h+",width="+w+",status=no,toolbar=no,directories=no,menubar=no,location=no,resizable=no,scrollbars=no");
}


function showhide(what){
	/*if (document.getElementById(what).style.display != "block"){
		document.getElementById(what).style.display = "block";
		document.getElementById(lever).className="on"
	}else{
		document.getElementById(what).style.display = "none"
		document.getElementById(lever).className="off"
	}*/
	
	/*if (document.getElementById(what).className != "hidden"){
		document.getElementById(what).className = "hidden";
		if(lever!=null){
		document.getElementById(lever).className="off";
		}
	}else{
		document.getElementById(what).className = "";
		if(lever!=null){
		document.getElementById(lever).className="on";
		}
	}*/

	if (!document.getElementById) return false;
	if (!what) return false;
	
	var nav = document.getElementById(what);
	
	var navItem = nav.getElementsByTagName("ul");
	if(navItem[0].style.display==""){
		navItem[0].style.display= "none";
	}
	
	if (navItem[0].style.display == "none") {
		navItem[0].style.display = "block";
	}else if (navItem[0].style.display == "block"){
		navItem[0].style.display= "none";
	}
}


function openBox(ceci, that){
	if (!document.getElementById) return false;
	if (!ceci) return false;
	
	//alert(document.getElementById(ceci).checked)
	
	if(document.getElementById(ceci).checked==true){
		document.getElementById(that).style.display="block";
	}else{
		document.getElementById(that).style.display="none";
	}
}


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 getWindowWidth() {
	var windowWidth = 0;
	if (typeof(window.innerWidth) == 'number') {
		windowWidth = window.innerWidth;
	}
	else {
		if (document.documentElement && document.documentElement.clientWidth) {
			windowWidth = document.documentElement.clientWidth;
		}
		else {
			if (document.body && document.body.clientWidth) {
				windowWidth = document.body.clientWidth;
			}
		}
	}
	return (windowWidth);
}

function setFooter() {
	if (document.getElementById && document.getElementById('box')) {
		var windowHeight = getWindowHeight();
		var windowWidth = getWindowWidth();
		/*var footerElement = document.getElementById('footer');
		var mainnavElement = document.getElementById('mainnav');*/
		//alert(windowWidth)
		var boxElement = document.getElementById('box');
		
		if(windowWidth<=1024 && windowWidth>1000){
			boxElement.style.width="100%";
		}else{
			boxElement.style.width="1000px";
		}

		boxElement.style.height="auto";
		//alert(document.body.offsetHeight +" - "+windowHeight+" - "+boxElement.offsetHeight)
		var heightDiff=windowHeight-document.body.offsetHeight
		//alert(heightDiff);
		/*/if()
		}else*/ if(windowHeight<boxElement.offsetHeight){
			boxElement.style.height="auto";
			//boxElement.style.height=boxElement.offsetHeight+"px";
		}else{
			//alert(document.body.offsetHeight +" - "+windowHeight+" - "+boxElement.style.height+" - 1")
			//alert(windowHeight)
			boxElement.style.height="100%";
			//boxElement.style.height = boxElement.offsetHeight+heightDiff+"px";
		}
		
		
		
	}
	
	
}

window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}
