var ie6     = navigator.appVersion.indexOf('MSIE 6') > 0;

if (ie6)
	{
		if (document.all && document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule)
			document.styleSheets[0].addRule('.hotfix', 'behavior: url(js/iepngfix.htc)');			
	}
	
function replaceAll( str, from, to )
	{
	    var idx = str.indexOf( from );
	    while ( idx > -1 ) {
	        str = str.replace( from, to );
	        idx = str.indexOf( from );
	    }
	    return str;
	}

function isEmailAdres(string)
	{
	  var patroon =
	    /^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/;
	  return patroon.test(string);
	}

function isTel(string)
	{
		if(string.length!=10) return false;
		return isTelefoon(string) || isMobile(string);
	}	
	
function isTelefoon(string)
	{
	  var patroon =
	    /^0[1-9][0-9]{1,2}(-{0,1})[1-9][0-9]{5,6}$/;
	  return patroon.test(string);
	}

function SubmitForm()
	{
		var sError = "";
		var bReturn = true;
		
		if (document.frmInfo.Voornaam.value == ""){sError = sError + "- Voornaam\n"; bReturn = false;}
		if (document.frmInfo.Achternaam.value == ""){sError = sError + "- Achternaam\n"; bReturn = false;}
		if ((!document.frmInfo.Geslacht[0].checked)&&(!document.frmInfo.Geslacht[1].checked)){sError = sError + "- Aanhef\n"; bReturn = false;}
		
		document.frmInfo.Telefoon.value = replaceAll(document.frmInfo.Telefoon.value,"-","");
		if (document.frmInfo.Telefoon.value == ""){sError = sError + "- Telefoon\n"; bReturn = false;}
		if(!isEmailAdres(document.frmInfo.Email.value)){sError = sError + "- E-mailadres\n"; bReturn = false;}
															
		if (sError == "")
		{
			document.frmInfo.submit();	
		}
		else
		{
			alert ("Gelieve de volgende velden in te vullen:\n\n" + sError);
			bReturn = false;
		}
		return bReturn;
	}
	
// Onload event koppelen
if (window.attachEvent){
	window.attachEvent("onload", initMenu)}
else	{
	window.addEventListener("load", initMenu, false)}




function initMenu() { 
   if (document.all&&document.getElementById) { 
   // Main menu
      navRootTotal = document.getElementById("sitemenu");
	  navRoot = navRootTotal.getElementsByTagName("li"); 
      for (i=0; i<navRoot.length; i++) { 
         node = navRoot[i]; 
         if (node.nodeName=="LI") { 
            node.onmouseover=function() { 
               this.className+=" over"; 
            } 
            node.onmouseout=function() { 
               this.className=this.className.replace(" over", ""); 
            } 
         } 
      } 
  }
}
