  //variables
  var btn_active = '0';
  //functions  
  function setResolution() {
	w = window.screen.availWidth;
	h = window.screen.availHeight;
	window.resizeTo(w,h);
	window.moveTo(0,0);
	window.focus();
  }

  function writeEmailAddress(nme, dom, cou, cla){
           document.write("<a href='mailto:"+nme+"@"+dom+"."+cou+"' class="+cla+" >"+nme+"@"+dom+"."+cou+"</a>");
  }
  
  function changeTitle(tit){
			document.getElementById("changetitle").innerHTML = tit;
			document.title = document.getElementById("changetitle").innerHTML;
			document.getElementById("changetitle").innerHTML = "";
  }

 function changePhoto(img, btn_id){
	document.getElementById('btn'+btn_active).className="menulink";
	btn_active = btn_id;
	document.getElementById('btn'+btn_active).className="menulink_active";
	document.getElementById('photo').innerHTML='<img src="'+img+'" alt="" />';
	window.focus();
 }
 
 function hideDiv(id){
	document.getElementById(id).style.display="none";
 }
 
 function showDiv(id){
	document.getElementById(id).style.display="block";
 }
 
 function changeImg(id, img){
	document.getElementById(id).childNodes[0].src = img;
 }
 
 function setLink(id){
	var lnk_txt = document.getElementById(id).innerHTML;
	var lnk_lnk = document.getElementById(id).href;
	var lnkr = new SWFObject("fontreplacer_helveticathincondensed.swf", "mc", "100%", "100%", "9", "#ffffff");
	lnkr.addVariable("txt",lnk_txt);
	lnkr.addVariable("lnk",lnk_lnk);
	lnkr.write(id);
}
function ttlReplacement(id){
	if(document.getElementById("ttl"+id)){
		var fr_txt = document.getElementById("ttl"+id).innerHTML;
		var fr = new SWFObject("/media/swf/fontreplacer_officinasansitalic.swf", "mc", "100%", "22", "9", "#ffffff");
		fr.addParam("wmode","transparent");
		fr.addVariable("txt",fr_txt);
		fr.write("ttl"+id);
	}
}

/*function brochures(id){
	//alert(id);
	if(id == 'Aanvraag brochure' || id == 'Inschrijven voor een opleiding'){
		document.getElementById('brochures').style.display = "";
		document.getElementById('brochures').style.paddingBottom = "20px";
	}else{
		document.getElementById('brochures').style.display = "none";
		document.getElementById('brochures').style.paddingBottom = "0px";
	}
}*/

function checkvalues(){
	var naam = document.getElementById('naam');
	var voornaam = document.getElementById('voornaam');
	var straat = document.getElementById('straat');
	var postcode = document.getElementById('postcode');
	var plaats = document.getElementById('plaats');
	var telefoon = document.getElementById('telefoon');
	var email = document.getElementById('email');
	/*var opmerking = document.getElementById('opmerking');
	var land = document.getElementById('land');
	var landnew = document.getElementById('landnew');	
	var functie = document.getElementById('functie');
	var functienew = document.getElementById('functienew');*/
	
	//check naam	
	if(naam.value.length==0 || voornaam.value.length==0){
		window.alert("Naam invullen a.u.b.");
		return false;
	}
	//check functie
	/*if(functie.value == "null"){
		window.alert("Functie selecteren a.u.b.");
		return false;
	}*/
		
	/*if(functie.value == "ander" && functienew.value.length==0){
		window.alert("Functie invullen a.u.b.");
		return false;
	}*/
	//check straat
	if(straat.value.length==0){
		window.alert("Straat en nummer invullen a.u.b.");
		return false;
	}
	//check postcode
	if(postcode.value.length==0){
		window.alert("Postcode invullen a.u.b.");
		return false;
	}
	//check plaats
	if(plaats.value.length==0){
		window.alert("Plaats invullen a.u.b.");
		return false;
	}
	//check land
	/*if(land.value == "null"){
		window.alert("Land selecteren a.u.b.");
		return false;
	}
		
	if(land.value == "ander" && landnew.value.length==0){
		window.alert("Land invullen a.u.b");
		return false;
	}*/
	//check telefoon
	if(telefoon.value.length==0){
		window.alert("Telefoon nummer invullen a.u.b.");
		return false
	}
	//check email
	if(!validMail(email.value)){
		window.alert("Correct e-mail adres invullen a.u.b.");
		return false;
	}
	/*//check telefoon
	if(opmerking.value.length==0){
		window.alert("Opmerking invullen a.u.b.");
		return false
	}
	*/
	//submit	
	return true;
}

function validMail(str){
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if(str.indexOf(at)==-1){return false;}
	if(str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){return false;}
	if(str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){return false;}
	if(str.indexOf(at,(lat+1))!=-1){return false;}
	if(str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){return false;}
	if(str.indexOf(dot,(lat+2))==-1){return false;}	
	if(str.indexOf(" ")!=-1){return false;}
	return true;		
}
