




// JavaScript Document

function MM_openBrWindow(theURL,winName,features) {window.open(theURL,winName,features);}
function Rowin(me)	{me.style.backgroundColor='#ff9900';}
function Rowout(me)	{me.style.backgroundColor='';}



var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only

if (document.getElementById){ 
document.write('<style type="text/css">\n')
document.write('.submenuA{display: none;}\n')
document.write('</style>\n')
}
if (document.getElementById){ 
document.write('<style type="text/css">\n')
document.write('.submenuB{display: none;}\n')
document.write('</style>\n')
}


function SwitchMenuA(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("navA").getElementsByTagName("ul"); 
		if(el.style.display != "block"){ 
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenuA") 
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function SwitchMenuB(obj){
	if(document.getElementById){
	var el = document.getElementById(obj);
	var ar = document.getElementById("navB").getElementsByTagName("ul"); 
		if(el.style.display != "block"){ 
			for (var i=0; i<ar.length; i++){
				if (ar[i].className=="submenuB") 
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}else{
			el.style.display = "none";
		}
	}
}

function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) { 
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function onloadfunction(){
if (persistmenu=="yes"){
	
	
// A	
var cookiename=(persisttype=="sitewide")? "CookieA" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"

// B	
var cookiename=(persisttype=="sitewide")? "CookieB" : window.location.pathname
var cookievalue=get_cookie(cookiename)
if (cookievalue!="")
document.getElementById(cookievalue).style.display="block"
}
}

function savemenustate(){
	
// A
var inc=1, blockid=""
while (document.getElementById("subA"+inc)){
if (document.getElementById("subA"+inc).style.display=="block"){
blockid="subA"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "CookieA" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue

// B
var inc=1, blockid=""
while (document.getElementById("subB"+inc)){
if (document.getElementById("subB"+inc).style.display=="block"){
blockid="subB"+inc
break
}
inc++
}
var cookiename=(persisttype=="sitewide")? "CookieB" : window.location.pathname
var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
document.cookie=cookiename+"="+cookievalue

}

if (window.addEventListener)
window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
window.onunload=savemenustate

function SwitchLinkColor(){ 
teller=0 
while(document.getElementsByTagName('a')[teller]){ 
if(document.getElementsByTagName('a')[teller].href==location.href){ 
document.getElementsByTagName('a')[teller].style.color="#ff9024" 
} 
teller++ 
} 
} 


// VOOR CAMPAGNE
function checkemail(str){
var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str))		return true;
return false;
}		
function KeuzeControle() 
{ 
//alert("keuzecontrole1");
var Fmv=0;
var A=0;
var B=0;
var C=0;
var D=0;
var E=0;
var OK=0;

for (var i = 0; i < document.FORMULIER.elements.length; i++)
	{
	if (document.FORMULIER[i].checked==true)
		{
		//alert(document.FORMULIER[i].name+' = '+document.FORMULIER[i].value);
		if (document.FORMULIER[i].name=="Fmv") {Fmv=1;}
		if (document.FORMULIER[i].name=="A") {A=1;}
		if (document.FORMULIER[i].name=="B") {B=1;}
		if (document.FORMULIER[i].name=="C") {C=1;}
		if (document.FORMULIER[i].name=="D") {D=1;}
		if (document.FORMULIER[i].name=="E") {E=1;}
		if (document.FORMULIER[i].name=="OK") {OK=1;}
		}
	}
//alert("keuzecontrole1");
if(document.FORMULIER.Fvoorletters.value.length<1){alert ("Voorletters invullen svp");return false;}
if(document.FORMULIER.Fachternaam.value.length<3){alert ("Achternaam invullen svp");return false;}
//alert("keuzecontrole1b");
//if(Fmv==0){alert ("Man/Vrouw invullen svp");return false;}
//if(document.FORMULIER.Fgeboortedatum.value.length<6){alert ("Geboortedatum invullen svp");return false;}
//alert("keuzecontrole1c");
if(document.FORMULIER.Fadres.value.length<3){alert ("Adres invullen svp");return false;}
if(document.FORMULIER.Fpostcode.value.length<3){alert ("Postcode invullen svp");return false;}
if(document.FORMULIER.Fplaats.value.length<3){alert ("Plaats invullen svp");return false;}
if(document.FORMULIER.Fland.value.length<3){alert ("Land invullen svp");return false;}
if(checkemail(document.FORMULIER.Femail.value)==false){alert ("Email niet juist");return false;}


if(A==0){alert ("Vragen invullen svp");return false;}
if(B==0){alert ("Vragen invullen svp");return false;}
if(C==0){alert ("Vragen invullen svp");return false;}
if(D==0){alert ("Vragen invullen svp");return false;}
if(E==0){alert ("Vragen invullen svp");return false;}
//alert("keuzecontrole2");
//dubbelaar ingevuld? 
var VD=0;
if(document.FORMULIER.V1naam.value.length>1){VD=1;}
if(document.FORMULIER.V2naam.value.length>1){VD=1;}
if(document.FORMULIER.V3naam.value.length>1){VD=1;}
if(document.FORMULIER.V1email.value.length>1){VD=1;}
if(document.FORMULIER.V2email.value.length>1){VD=1;}
if(document.FORMULIER.V2email.value.length>1){VD=1;}
//alert("vd="+VD);
if(VD==1)
{
//	alert ("Controle verdubbelaar");
// controles verdubbelaar
if(document.FORMULIER.V1naam.value.length<3){alert ("Verdubbelaar: Naam 1 invullen svp");return false;}
if(checkemail(document.FORMULIER.V1email.value)==false){alert ("Verdubbelaar: Email 1 niet juist");return false;}
if(document.FORMULIER.V2naam.value.length<3){alert ("Verdubbelaar: Naam 2 invullen svp");return false;}
if(checkemail(document.FORMULIER.V2email.value)==false){alert ("Verdubbelaar: Email 2 niet juist");return false;}
if(document.FORMULIER.V3naam.value.length<3){alert ("Verdubbelaar: Naam 3 invullen svp");return false;}
if(checkemail(document.FORMULIER.V3email.value)==false){alert ("Verdubbelaar: Email 3 niet juist");return false;}
}
if(OK==0){alert ("Vink aan dat u akkoord bent met de algemene voorwaarden.");return false;}
//alert("keuzecontrole3");
return true;
}

function Klaar()
{
//alert("controle staat uit ivm testen");
//return true;
if(KeuzeControle()==false)
	{	return false;}
	return true;
}	

function Dubbel()
{
//alert("controle staat uit ivm testen");
//return true;
if(document.FORMULIER.V1naam.value.length<3){alert ("Naam 1 invullen svp");return false;}
if(checkemail(document.FORMULIER.V1email.value)==false){alert ("Email 1 niet juist");return false;}
if(document.FORMULIER.V2naam.value.length<3){alert ("Naam 2 invullen svp");return false;}
if(checkemail(document.FORMULIER.V2email.value)==false){alert ("Email 2 niet juist");return false;}
if(document.FORMULIER.V3naam.value.length<3){alert ("Naam 3 invullen svp");return false;}
if(checkemail(document.FORMULIER.V3email.value)==false){alert ("Email 3 niet juist");return false;}
return true;
}



