var GB_ROOT_DIR = "./js/greybox/";
var GB_STR_CLOSE = " Sluiten";
	
	var newwin = null;
	function catalogus_zoom(url) {
		if (newwin && newwin.open && !newwin.closed) newwin.close();
		 var width  = 1024;
		 var height = 800;
		 var left   = (screen.width  - width)/2;
		 var top    = (screen.height - height)/2;
		 var params = 'width='+width+', height='+height;
		 params += ', top='+top+', left='+left;
		 params += ', directories=no';
		 params += ', location=no';
		 params += ', menubar=no';
		 params += ', resizable=no';
		 params += ', scrollbars=no';
		 params += ', status=no';
		 params += ', toolbar=no';
		 newwin=window.open(url,'Catalogus_2009', params);
		 if (window.focus) {newwin.focus()}
			return false;
	}


function hideViewSelector(){
if (document.getElementById) {
	top.page_edit_top.document.getElementById('viewLabel').style.visibility = 'hidden';
	top.page_edit_top.document.getElementById('view').style.visibility = 'hidden';
	}
else if (document.all) {
	top.page_edit_top.document.all.viewLabel.style.visibility = 'hidden';
	top.page_edit_top.document.all.view.style.visibility = 'hidden';
	}
else if (document.layers) {
	var l = 'viewLabel';
	eval('document.' + l + '.visibility="hide"');
	}
}

function deleteWebpage(){
	if (pid == home_pid){
		alert("U kunt de home pagina niet verwijderen.")
		}else{
		if (isPageEditor == ''){
			alert("Deze actie is nu niet beschikbaar. Ga eerst naar de Pagina Editor en probeer het opnieuw.")
		}else{
			if (confirm("Wilt u deze pagina definitief verwijderen?\nDit kan NIET ongedaan gemaakt worden!")){
		window.top.location.href="page_update.asp?view="+view+"&responseid="+pid+"&field=delPage";
			}
		}
	}
}

function modalWin(x) {
	if (isPageEditor == '' || typeof isPageEditor == 'undefined' || typeof view == 'undefined' ){
		alert("Deze actie is nu niet beschikbaar. Ga eerst naar de Pagina Editor en probeer het opnieuw.")
	}else{
	if (window.showModalDialog) {
		showModalDialog(x,window,"resizable:no;help:no;status:no;scroll:no;");
	} else {
		leftPos = 0
		topPos = 0
		if (screen) {
			leftPos = (screen.width / 2) - 251
			topPos = (screen.height / 2) - 162
	eval("window.open(x,window,'height=350,width=350,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes,left="+leftPos+",top="+topPos+"')");
		}else{
	window.open(x,window,'height=350,width=350,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes');
		}
	}
	}
}

function stopRKey(evt) {
	var evt  = (evt) ? evt : ((event) ? event : null);
	var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
	if ((evt.keyCode == 13) && (node.type=="text")) { return false; }
}


function launchwin(winurl,winname,winfeatures){
	newwin = window.open(winurl,winname,winfeatures);
}
function showmenu(elmnt) { 
	document.all(elmnt).style.visibility="visible" 
	} 
function hidemenu(elmnt) { 
	document.all(elmnt).style.visibility="hidden" 
	}
function showMenuDesc(x){
	window.status = x
	return true
}
function wipeMenuDesc(){
	window.status = ""
	return true
}
function checkDelProduct(){
	if (confirm("Wilt u deze produkt informatie definitief verwijderen?")){
		document.productInfo.submit()
	}
}
function checkEmail(){
	if(IsEmail(document.emailadres.email.value)){
		document.emailadres.submit()
	}else{
		alert("U heeft geen geldig e-mail adres ingevoerd.")
		document.emailadres.email.focus()
	}

}

function IsEmail(email) {
	var tmp = "" + email + "", s = tmp.replace(/^\s*|\s*$/g, "");
	var re = /^(\w|[^_]\.|[\-])+((\@){1}([^_]))(([a-z]|[\d]|[\-]|\.)+|([^_]\.[^_])*)+\.[a-z]{2,3}$/i
	if (!re.test(s)) {return false;}
	re = /\.(a[c-gil-oq-uwz]|b[a-bd-jm-or-tvwyz]|c[acdf-ik-orsuvx-z]|d[ejkmoz]|e[ceghr-u]|f[i-kmorx]|g[abd-ilmnp-uwy]|h[kmnrtu]|i[delm-oq-t]|j[emop]|k[eg-imnprwyz]|l[a-cikr-vy]|m[acdghk-z]|n[ace-giloprtuz]|om|p[ae-hk-nrtwy]|qa|r[eouw]|s[a-eg-ort-vyz]|t[cdf-hjkm-prtvwz]|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[admrw]|com|edu|net|org|mil|gov|biz)$/i
	if (!re.test(s)) {return false;}
	re = /\@\@/
	return(!re.test(s));
}

function showPage(){
	nw=window.open(document.navMenu.subs.options[document.navMenu.subs.options.selectedIndex].value,"_parent")
}
