<!--

//POPUP
function popUp(url, breedte, hoogte, scrolling) {
	day = new Date();
	id = day.getTime();
	deHoogte = hoogte;//screen.height - 100;
	eval("page" + id + " = window.open(url, '" + id + "', 'toolbar=0,scrollbars=" + scrolling + ",location=0,statusbar=1,menubar=0,resizable=0,top=0,left=0,width=" + breedte + ",height=" + deHoogte + "');");
}

//SWITCH CLASS
function SwitchMe(obj,classNaam, teller) {
	obj.className=classNaam;
//	if (document.getElementById("colornav" + teller)) {
//		if (document.getElementById("colornav" + teller).align=='right'){
//			document.getElementById("colornav" + teller).align='left';
//		}else{
//			document.getElementById("colornav" + teller).align='right';
//		}
//	}
}

function changePic(objId,img) {
	document.getElementById(objId).src='../images/lists/' + img;
}

function  NavOver(tekst) {
	
	self.status = tekst;
	return true;
}

function  NavOut() {
	self.status = '';
	return true;
}

//SELECT CHOICE
function MoveMe(url, val) {
	if (val != '') {	
		document.location = url + val;
	}
}

//CHECK FORMS

function checkWaarden(fouttext) {
	var form = document.forms["formulier"];
	var fouten = false;
	var color = "#9ca9e4";
	
	if (jsRequired != '') {
		
		requireds = jsRequired.split(";");
		for (x=0; x<requireds.length ;x++) {
			if(form[requireds[x]].value.length != ""){
				//form[requireds[x]].style.backgroundColor = "";
				form[requireds[x]].style.borderColor = "";
			} else {
				fouten = true;
				//form[requireds[x]].style.backgroundColor = color;
				form[requireds[x]].style.borderColor = color;
			}
		}
	}
	if (jsNRequired != '') {
	
		requireds = jsNRequired.split(";");
		for (x=0; x<requireds.length ;x++) {
			if(form[requireds[x]].value.length != ""  && IsNumeric(form[requireds[x]].value)){
				form[requireds[x]].style.borderColor = "";
			} else {
				fouten = true;
				form[requireds[x]].style.borderColor = color;
			}
		}
	}
	if (jsERequired != '') {
	
		requireds = jsERequired.split(";");
		for (x=0; x<requireds.length ;x++) {
			if(form[requireds[x]].value.length != ""  && echeck(form[requireds[x]].value)){
				form[requireds[x]].style.borderColor = "";
			} else {
				fouten = true;
				form[requireds[x]].style.borderColor = color;
			}

		}
	}

	// is controle goed --> verdergaan, niet goed --> terug
	if(fouten){
		if (document.getElementById("error")){
			document.getElementById("error").innerHTML = "<FONT color='" + color + "'>" + fouttext + "</FONT>";
		}
		//return false;
	}else{
		form.submit();
		//return true;
	}
}

function KleurRequired() {
	var form = document.forms["formulier"];
	var fouten = false;
	//
	var color = "#e7ecf9";
	
	if (jsRequired != '') {
		
		requireds = jsRequired.split(";");
		for (x=0; x<requireds.length ;x++) {
			form[requireds[x]].style.backgroundColor = color;
		}
	}
	if (jsNRequired != '') {
	
		requireds = jsNRequired.split(";");
		for (x=0; x<requireds.length ;x++) {
			form[requireds[x]].style.backgroundColor = color;
		}
	}
	if (jsERequired != '') {
		requireds = jsERequired.split(";");
		for (x=0; x<requireds.length ;x++) {
			form[requireds[x]].style.backgroundColor = color;
		}
	}
}
//CHECK EMAIL

function checkEmail(fouttext) {
	var form = document.forms["news"];
	var fouten = false;
	var color = "#e63a39";
	
	if(form.nbEmail.value.length != ""  && echeck(form.nbEmail.value)) {
		form.nbEmail.style.borderColor = "";
	} else {
		fouten = true;
		form.nbEmail.style.borderColor = color;
	}
	
	// is controle goed --> verdergaan, niet goed --> terug
	if(fouten){
		document.getElementById("nbError").innerHTML = "<FONT color='" + color + "'>" + fouttext + "</FONT>";
	}else{
		form.submit();
	}
}

//CHECK LOGIN

function checkLogin(fouttext) {
	var form = document.forms["login"];
	var fouten = false;
	var color = "#8DE3FF";
	
	//if(form.slogin.value.length != ""  && echeck(form.slogin.value)) {
	if(form.slogin.value.length != "") {
		form.slogin.style.backgroundColor = "";
	} else {
		fouten = true;
		form.slogin.style.backgroundColor = color;
	}
	
	if(form.pasw.value.length != "") {
		form.pasw.style.backgroundColor = "";
	} else {
		fouten = true;
		form.pasw.style.backgroundColor = color;
	}
	
	// is controle goed --> verdergaan, niet goed --> terug
	if(fouten){
		//document.getElementById("error").innerHTML = "<FONT color='" + color + "'>" + fouttext + "</FONT>";
	}else{
		form.submit();
	}
}

//CHECK ITEM

function checkItem(formke, itemke) {
	var form = document.forms[formke];
	var fouten = false;
	var color = "#8DE3FF";
	
	if(form[itemke].value.length != ""  && IsNumeric(form[itemke].value) && form[itemke].value != 0) {
		form[itemke].style.backgroundColor = "";
	} else {
		fouten = true;
		form[itemke].style.backgroundColor = color;
	}
	
	// is controle goed --> verdergaan, niet goed --> terug
	if(fouten){
		//document.getElementById("error").innerHTML = "<FONT color='" + color + "'>" + fouttext + "</FONT>";
	}else{
		form.submit();
	}
}

function IsNumeric(string) {
	if (!string) return false; // als de string leeg is
	var Chars = "0123456789/-."; // mogelijke karakters in de string
	for (var i = 0; i < string.length; i++) { // alle karakters overlopen van de string
	   if (Chars.indexOf(string.charAt(i)) == -1) // als het zoveelste karakter in de string NIET in char voorkomt
		  return false;
	}
	return true;
}

function echeck(str) {
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)

	if (str.indexOf(at)==-1) {
		//alert("Invalid E-mail ID")
		
		return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr) {
		//alert("Invalid E-mail ID")

		return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr) {
		//alert("Invalid E-mail ID")

		return false
	}

	if (str.indexOf(at,(lat+1))!=-1) {
		//alert("Invalid E-mail ID")
		
		return false
	}

	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot) {
		//alert("Invalid E-mail ID")

		return false
	}

	if (str.indexOf(dot,(lat+2))==-1) {
		//alert("Invalid E-mail ID")

		return false
	}

	if (str.indexOf(" ")!=-1) {
		//alert("Invalid E-mail ID")
		
		return false
	}

	return true													   
}

function showHide(ItemId) {
	if (document.getElementById(ItemId).style.display == "none") {
		document.getElementById(ItemId).style.display = "block";
	} else {
		document.getElementById(ItemId).style.display = "none";
	}
}

function changeInfo(txt,kleur) {
	document.getElementById("info").style.backgroundColor = kleur;
	document.getElementById("info").innerHTML = txt;
}

function activate(id) {
	var obj = $('downloads');
	var tag_li = document.getElementsByTagName('li');
	var tag_tbl = document.getElementsByTagName('div');
	
	for (var tag = 0; tag < tag_li.length; tag++) {
		if (tag_li[tag].id.substr(0, 6) == 'dl_li_') {
			tag_li[tag].className = 'inactive';
		}
	}
	for (var tag = 0; tag < tag_tbl.length; tag++) {
		if (tag_tbl[tag].id.substr(0, 7) == 'dl_tbl_') {
			tag_tbl[tag].className = 'inactive';
		}
	}
	var act_li = $('dl_li_'+id);
	if (act_li) { act_li.className = ''; }
	var act_tbl = $('dl_tbl_'+id);
	if (act_tbl) { act_tbl.className = ''; }
}

function $(id) {
	return document.getElementById(id);
}

//-->
