
var resizeTimeout;

function checkHeight() {
	var winHeight = document.documentElement.clientHeight;
	
	if (winHeight == 0) {
		winHeight = window.innerHeight;
	}
	
	clearTimeout(resizeTimeout);
	
	if (winHeight < 670) {
		if (document.getElementById('main').style.top!='335px') {
			//resizeTimeout = setTimeout("document.getElementById('main').style.top='297px'; document.body.style.background=\"url('images/background.jpg') center 0px no-repeat\";",100);
			resizeTimeout = setTimeout("document.getElementById('main').style.top='335px';",100);
		} 
	} else {
		if (document.getElementById('main').style.top!='50%') {
			//resizeTimeout = setTimeout("document.getElementById('main').style.top='50%'; document.body.style.background=\"url('images/background.jpg') center center no-repeat fixed\";",100);
			resizeTimeout = setTimeout("document.getElementById('main').style.top='50%';",100);
		}
	}
	
}



var tmpObj;
var tmpClass;

function setSelected(obj) {
	//alert(obj.className);
	if (tmpObj!=null) {
		if (tmpObj!=obj) {
			tmpObj.className = tmpClass;
			tmpClass = obj.className;
			obj.className += " active";
			tmpObj = obj;
		} else {
			obj.className = tmpClass;
			tmpClass = "";
			tmpObj = null;
		}
	} else {
		tmpClass = obj.className;
		obj.className += " active";
		tmpObj = obj;
	}
	//alert(obj.className);
}



var timeout;

function setPrice(price) {	
	clearTimeout(timeout);
	//document.getElementById("price").className=price;
}

function clearPrice() {	
	//timeout = setTimeout("document.getElementById('price').className='';",100);
}

function correctAmount(code) {
	if (code != '') {
		alert("Met een promocode kunt u maar 1 koffer bestellen!");
		document.questions.amount.selectedIndex=1;
	}
}

function correctCode(amount) {
	if (amount > 1) {
		alert("Met een promocode kunt u maar 1 koffer bestellen!");
		document.questions.code.value = '';
	}
}