// JavaScript Document
function popUp(URL){
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=920,height=540,left = 190,top = 100');");
}

function SetHeight(){
	//Get Screen Height By Remco Koemans

	var isiPad  = navigator.userAgent.match(/iPad/i) != null;   
	var isiPhone= navigator.userAgent.match(/iPhone/i) != null;     
	var isiPod  = navigator.userAgent.match(/iPod/i) != null;
	
	if (isiPad || isiPhone || isiPod){
		return false;	
	}
	
	if (self.innerHeight){
 		y = self.innerHeight;
	}else if(document.documentElement && document.documentElement.clientHeight){
		y = document.documentElement.clientHeight;
	}else if(document.body){
		y = document.body.clientHeight;
	}
	
	if (y < 600){
		y = 600;
	}
	
	var maincontent = document.getElementById('maincontent');
	if (maincontent){
		maincontent.style.height = (y-259)+'px';
	}
	var content = document.getElementById('content');
	if (content){
		content.style.height = (y-259)+'px';
	}
	var welkomtext = document.getElementById('welkomtext');
	if (welkomtext){
		welkomtext.style.height = (y-346)+'px';
	}
	scrollToElement();
}

function scrollToElement(){
	var url = window.location.href;
	var spl = url.split('#');
	if (spl.length > 1){
		var div = document.getElementById('div' + spl[1]);
		if (div && ''+spl[1] > ''){
			div.offsetParent.scrollTop = div.offsetTop;
		}
	}
}

function setPrice(type,price,amount){
	var b = document.getElementById(type + '_totaal');
	if (b){
		var tot = price*amount;
		tot = tot.toFixed(2);
		b.innerHTML = 'prijs: &euro; ' + tot + '';	
	}
	var choice = document.getElementById('choice');
	if (choice){
		choice.value = amount;	
	}
}

function checkChoice(){
	var choice = document.getElementById('choice');
	if (choice){
		if (choice.value == ''){
			alert('Kies een aantal...');
			return false;
		}else{
			return true;
		}
	}
}
