function checkFields() {
	var needed=0; var score=0; 

	needed++; if(document.forms['subscribe'].Voornaam.value!='') score++;
	needed++; if(document.forms['subscribe'].Naam.value!='') score++;
	needed++; if(document.forms['subscribe'].Adres.value!='') score++;
	needed++; if(document.forms['subscribe'].Postcode.value!='') score++;
	needed++; if(document.forms['subscribe'].Gemeente.value!='') score++;
	needed++; if(document.forms['subscribe'].Telefoon.value!='') score++;
	needed++; if(document.forms['subscribe'].Email.value!='') score++;
	
	if(needed == score) {
		document.forms['subscribe'].submit();
	} else {
		alert('Opgelet, al de velden in het vet zijn verplicht in te vullen.');	
	}
}
function checkPost(form_name) {
	var needed=0; var score=0; 

	needed++; if(document.forms[form_name].Name.value!='') score++;
	needed++; if(document.forms[form_name].Email.value!='') score++;
	needed++; if(document.forms[form_name].Subject.value!='') score++;
	needed++; if(document.forms[form_name].Description.value!='') score++;
	
	if(needed == score) {
		document.forms[form_name].submit();
	} else {
		alert('Opgelet, al de velden zijn verplicht in te vullen.');	
	}
}


function confirmAction(page) {
	if (window.confirm('Bent u zeker van deze actie?')) {
		document.location = page;
	}
}
function confirmActionSubmit(form_name) {
	if (window.confirm('Bent u zeker van deze actie?')) {
		document.forms[form_name].submit();
	}
}
function rollOver(name) {
	document.getElementById('menu-'+name).style.background = 'url(images/'+name+'1.png%29';
} 
function rollOut(name) {
	document.getElementById('menu-'+name).style.background = 'url(images/'+name+'0.png%29';
}


/*
Form field Limiter script- By Dynamic Drive
For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
This credit MUST stay intact for use
*/

var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}


function displaylimit(thename, theid, thelimit){
var theform=theid!=""? document.getElementById(theid) : thename
var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b> characters remaining'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
}
}

// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function numbersonly(myfield, e, dec)
{
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
// control keys
if ((key==null) || (key==0) || (key==8) || 
(key==9) || (key==13) || (key==27) )
return true;
// numbers
else if ((("0123456789").indexOf(keychar) > -1))
return true;
// decimal point jump
else if (dec && (keychar == "."))
{
myfield.form.elements[dec].focus();
return false;
}
else
return false;
}

// copyright 1999 Idocs, Inc. http://www.idocs.com
// Distribute this script freely but keep this notice in place
function letternumber(e)
{
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();
// control keys
if ((key==null) || (key==0) || (key==8) || 
(key==9) || (key==13) || (key==27) )
return true;
// alphas and numbers
else if ((("abcdefghijklmnopqrstuvwxyz0123456789").indexOf(keychar) > -1))
return true;
else
return false;
}

function show_hide(id, show) {
	if (el = document.getElementById(id)) {
		if (null==show) show = el.style.display=='none';
		el.style.display = (show ? '' : 'none');
	}
}

//Change opacity script

function opacity(id, opacStart, opacEnd) {
	//speed for each frame
	var millisec = 1000;
	var speed = Math.round(millisec/100);
	var timer = 0;

	//determine the direction for the blending, if start and end are the same nothing happens
	if(opacStart > opacEnd) {
		for(i = opacStart; i >= opacEnd; i--) {
			setTimeout("changeOpac("+i+ ",'"+id+"')",(timer*speed));
			timer++;
		}
	} else if(opacStart < opacEnd) {
		for(i = opacStart; i <= opacEnd; i++)
			{
			setTimeout("changeOpac("+i+",'"+id+"')",(timer*speed));
			timer++;
		}
	}
}

function changeOpac(opacity,id) {
	var object = document.getElementById(id).style; 
	object.opacity = (opacity/100);
	object.MozOpacity = (opacity/100);
	object.KhtmlOpacity = (opacity/100);
	object.filter = "alpha(opacity="+opacity+")";
}