function showImagePopUp(strImageUrl){
	window.open("image.asp?img="+strImageUrl,"ImagePopUp",'width=200,height=200,location=no,toolbar=no,scrollbars=no,resizable=no,left=100,top=100');
}

function printPage(PageId){
	window.open("base.asp?print=true&" + PageId);
}

function setFrameHeight(){
	if(document.all){
		document.getElementById("formFrame").height = formFrame.document.getElementById("mainDiv").offsetHeight;
	}else{
		document.getElementById("formFrame").height = formFrame.document.getElementById("mainDiv").offsetHeight + 20;
	}
}

function submitSearchForm(strLanguage){
	switch(strLanguage){
		case "nl":{
			if(document.getElementById("searchOn").value==""){
				//alert("ERROR NL");
				return false;
			}
			document.getElementById("searchForm").action = "http://www.qdelft.nl/nl/12/zoeken.html";
			break;
		}
		case "uk":{
			if(document.getElementById("searchOn").value==""){
				//alert("ERROR UK");
				return false;
			}
			document.getElementById("searchForm").action = "http://www.qdelft.nl/uk/12/search.html";
			break;
		}
	}
	document.getElementById("searchForm").submit();
}

function submitContactForm(strLanguage){
	switch(strLanguage){
		case "nl":{
			if(document.getElementById("naam").value==""){
				alert("Er is geen naam opgegeven!");
				document.getElementById("naam").focus();
				return false;
			}
			if(document.getElementById("organisatie").value==""){
				alert("Er is geen organisatie opgegeven!");
				document.getElementById("organisatie").focus();
				return false;
			}
			if(document.getElementById("emailadres").value==""){
				alert("Er is geen emailadres opgegeven!");
				document.getElementById("emailadres").focus();
				return false;
			}
			var str=document.getElementById("emailadres")
			var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
				if (!filter.test(str.value)){
				alert("\"" + str.value + "\" is geen geldig e-mailadres!")
				str.focus();
				return false;
			}
			break;
		}
		case "uk":{
			if(document.getElementById("naam").value==""){
				alert("Name ia a required field!");
				document.getElementById("naam").focus();
				return false;
			}
			if(document.getElementById("organisatie").value==""){
				alert("Organisation ia a required field!");
				document.getElementById("organisatie").focus();
				return false;
			}
			if(document.getElementById("emailadres").value==""){
				alert("E-mailaddress ia a required field!");
				document.getElementById("emailadres").focus();
				return false;
			}
			var str=document.getElementById("emailadres")
			var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
				if (!filter.test(str.value)){
				alert("Please fill in a valid email address!")
				str.focus();
				return false;
			}
			break;
		}
	}
	return true;
}
