function doblend(imageid, imagefile, millisec) {
	//change source
	theimg = document.getElementById(imageid)
		//changeOpac(0,imageid);
		var speed = Math.round(millisec / 100);
		var timer = 0;
		//fade in image
		//for(i == 0; i <= 100; i++) {
		//		setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed));
		//		timer++;
		//}
		//set final opacity to 100 to be sure
		//IE does not always handle images correctly...
		changeOpac(100,imageid)
		theimg.style.visibility = 'visible'
		theimg.style.display = 'inline'
		theimg.src = imagefile
}

function doSwitch(imageid, imagefile) {
	//change source
	theimg = document.getElementById(imageid)
		theimg.style.visibility = 'visible'
		theimg.style.display = 'inline'
		theimg.src = imagefile
}

//opacity
function opacity(id, opacStart, opacEnd, millisec) { 
    //speed for each frame 
    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++; 
        } 
    } 
} 

//change the opacity for different browsers 
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 + ")"; 
}


function Checkform(frm) {

	var msg = '';
	if (frm.naam.value == "") {
		msg = msg + "\n- Gelieve uw naam in te vullen." }
	if (frm.email.value == "") {
		msg = msg + "\n- Gelieve uw e-mail adres in te vullen." }
	if (!CheckEmail(frm.email.value)) {
		msg = msg + "\n- Het e-mail adres is niet juist." }
	if (msg != '') {
		alert("Uw formulier bevat volgende fouten:" + msg);
		return false; }
	return true;
}


function CheckEmail(str)
{
   if (str != '')
   {
		if (str.indexOf('@') == -1)
			 return false;
		len = str.length;
		for (i = 0; i < len; i++)
		{
			 if (  ( str.charAt(i) < 'a' || str.charAt(i) > 'z' ) && isNaN(str.charAt(i)) )
				  if (str.charAt(i) < 'A' || str.charAt(i) > 'Z')
					   if (str.charAt(i) != '.' && str.charAt(i) != '-' && str.charAt(i) != '_' && str.charAt(i) != '@' && str.charAt(i) != '\'')
							return false;
		}
   }
   return true;
}


