// DROPDOWN FIX IE6

sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


// ACCORDION FAQ

function loadAccordion() {
	var accordion = new Accordion ('h4.atStart', 'div.atStart',
		{
			opacity: true,
			onActive: function (toggler, element) {
				toggler.setStyle('color', '#0F69AE');
			},
			
			onBackground: function(toggler, element) {
				toggler.setStyle('color', '#498DC1');
			},
			alwaysHide: true,
			// Quirck: To force that the first element is not being collapsed
			display: 9999
		},
		$('faq')
	);
}

// POPUP SCRIPT

var win = null;

function openPopup(theURL,winName,w,h){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes, resizable=no'
	win = window.open(theURL,winName,settings)
}

//Check forms

function checkData(){
	var correct = true
	var regexpemail =/^[a-zA-Z0-9\-\.\_]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; //regexp for e-mail address
	var str = document.contactform.email.value; // value to compare
	if (document.contactform.voornaam.value == '') {correct = false; alert("Vul uw voornaam in.");document.contactform.voornaam.focus(); return correct}
	if (document.contactform.achternaam.value == '') {correct = false; alert("Vul uw achternaam in.");document.contactform.achternaam.focus(); return correct}
	if (document.contactform.bedrijf.value == '') {correct = false; alert("Vul een bedrijfsnaam in.");document.contactform.bedrijf.focus(); return correct}
	if (document.contactform.functie.value == '') {correct = false; alert("Vul uw functie in.");document.contactform.functie.focus(); return correct}
	if (document.contactform.adres_bezoek.value == '') {correct = false; alert("Vul het bezoekadres in.");document.contactform.adres_bezoek.focus(); return correct}
	if (document.contactform.postcode_bezoek.value == '') {correct = false; alert("Vul de postcode van het bezoekadres in.");document.contactform.postcode_bezoek.focus(); return correct}
	if (document.contactform.plaats_bezoek.value == '') {correct = false; alert("Vul de plaatnaam van het bezoekadres in.");document.contactform.plaats_bezoek.focus(); return correct}
	if (document.contactform.telefoonnummer_algemeen.value == '') {correct = false; alert("Vul een telefoonnummer in.");document.contactform.telefoonnummer_algemeen.focus(); return correct}
	//if (document.contactform.akkoord.checked == false) {correct = false; alert("U dient akkoord te gaan met de voorwaarden.");document.contactform.akkoord.focus(); return correct}
	if (regexpemail.test(str) == false){
	correct = false; alert("Vul een geldig e-mailadres in.");document.contactform.email.focus(); return correct}
	return correct;
}

function checkData_loginform(){
	var correct = true
	var regexpemail =/^[a-zA-Z0-9\-\.\_]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; //regexp for e-mail address
	var str = document.loginform.username.value; // value to compare
	if (regexpemail.test(str) == false){
	correct = false; alert("Vul uw e-mailadres in.");document.loginform.username.focus(); return correct}
	if (document.loginform.password.value == '') {correct = false; alert("Vul uw toegangscode in.");document.loginform.password.focus(); return correct}
	return correct;
}

function checkData_lostpass(){
	var correct = true
	var regexpemail =/^[a-zA-Z0-9\-\.\_]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/; //regexp for e-mail address
	var str = document.lostpass.email.value; // value to compare
	if (regexpemail.test(str) == false){
	correct = false; alert("Vul uw e-mailadres in.");document.lostpass.email.focus(); return correct}
	return correct;
}