
///////////// MAINFORMULES /////////////
function popup(URL,fotohor,fotover,scrolls) {
midhor=""
midver=""
minhor=(screen.availwidth-8)
minver=(screen.availheight-35)
Day = new Date()
id = Day.getTime()

if ((screen.availheight < fotover) || (screen.availwidth < fotohor))
{eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=" + scrolls + ",location=0,statusbar=0,menubar=0,resizable=0,width=" + minhor + ",height=" + minver + ",left = 0,top = 0');");
}
else
{midhor=((screen.availwidth-fotohor)/2);
midver=((screen.availheight-fotover)/2);
if(fotover == 0){fotover = screen.availheight - 75;
	midver=0;
}
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=" + scrolls + ",location=0,statusbar=0,menubar=0,resizable=0,width=" + fotohor + ",height=" + fotover + ",left = " + midhor + ",top = " + midver + "');");
}
}

function check_email(e) {
	ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";

	for(i=0; i < e.length ;i++){
		if(ok.indexOf(e.charAt(i))<0){ 
			return false;
		}	
	} 
		
	if (document.images) {
		re = /(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/;
		re_two = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
		if (!e.match(re) && e.match(re_two)) {
			return -1;		
		} 
	}
}

	
///////////// GASTENBOEK /////////////
function valid_gastenboek_signup(formnm){
	if(formnm.gastenboekentrynaam.value==""){
		alert("U heeft geen naam ingevuld!");
		formnm.gastenboekentrynaam.focus();
		return false;
	}
	if(!check_email(formnm.gastenboekentryemail.value)){
		alert("U heeft geen geldig E-mail adres ingevuld! (uw e-mailadres wordt niet getoond)");
		formnm.gastenboekentryemail.focus();
		return false;
	}
	if(formnm.gastenboekentrytext.value==""){
		alert("U heeft geen bericht ingevuld!");
		formnm.gastenboekentrytext.focus();
		return false;
	}
}

/////////////// NIEUWSBRIEF ////////////
function valid_nieuwsbrief_signup(formnm){
	if(!check_email(formnm.nieuwsbriefemail.value)){
		alert("U heeft geen geldig E-mail adres ingevuld!");
		formnm.nieuwsbriefemail.focus();
		return false;
	}
}

