function ToggleWishdate(id){
		Typ = document.getElementById(id).style.display;
		if(Typ == 'none'){
		ObjT = document.getElementById(id).style.display = "block";
    } else {
    ObjT = document.getElementById(id).style.display = "none";	   	
    }

}

function trim(str) {
			str = str.replace(/_/g,"");
			str = str.replace(/-/g,"");
			str = str.replace(/\./g,"");
			return str.replace(/\s/g,"");
} // end function trime

		function emailCheck(emailStr) {
			/* The following pattern is used to check if the entered e-mail address
			   fits the user@domain format.  It also is used to separate the username
			   from the domain. */
			var emailPat=/^(.+)@(.+)$/
			/* The following string represents the pattern for matching all special
			   characters.  We don't want to allow special characters in the address.
			   These characters include ( ) < > @ , ; : \ " . [ ]    */
			var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
			/* The following string represents the range of characters allowed in a
			   username or domainname.  It really states which chars aren't allowed. */
			var validChars="\[^\\s" + specialChars + "\]"
			/* The following pattern applies if the "user" is a quoted string (in
			   which case, there are no rules about which characters are allowed
			   and which aren't; anything goes).  E.g. "jiminy cricket"@disney.com
			   is a legal e-mail address. */
			var quotedUser="(\"[^\"]*\")"
			/* The following pattern applies for domains that are IP addresses,
			   rather than symbolic names.  E.g. joe@[123.124.233.4] is a legal
			   e-mail address. NOTE: The square brackets are required. */
			var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
			/* The following string represents an atom (basically a series of
			   non-special characters.) */
			var atom=validChars + '+'
			/* The following string represents one word in the typical username.
			   For example, in john.doe@somewhere.com, john and doe are words.
			   Basically, a word is either an atom or quoted string. */
			var word="(" + atom + "|" + quotedUser + ")"
			// The following pattern describes the structure of the user
			var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
			/* The following pattern describes the structure of a normal symbolic
			   domain, as opposed to ipDomainPat, shown above. */
			var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")


			/* Finally, let's start trying to figure out if the supplied address is
			   valid. */

			/* Begin with the coarse pattern to simply break up user@domain into
				   different pieces that are easy to analyze. */
			var matchArray=emailStr.match(emailPat)
			if (matchArray==null) {
			  /* Too many/few @'s or something; basically, this address doesn't
			     even fit the general mould of a valid e-mail address. */
				return false
			}
			var user=matchArray[1]
			var domain=matchArray[2]

			// See if "user" is valid
			if (user.match(userPat)==null) {
			    // user is not valid
			    return false
			}

			/* if the e-mail address is at an IP address (as opposed to a symbolic
			   host name) make sure the IP address is valid. */
			var IPArray=domain.match(ipDomainPat)
			if (IPArray!=null) {
			    // this is an IP address
				  for (var i=1;i<=4;i++) {
				    if (IPArray[i]>255) {
						return false
				    }
			    }
			    return true
			}

			// Domain is symbolic name
			var domainArray=domain.match(domainPat)
			if (domainArray==null) {
			    return false
			}

			/* domain name seems valid, but now make sure that it ends in a
			   three/six-letter word (like com, edu, gov, info, museum) or a two-letter word,
			   representing country (uk, nl), and that there's a hostname preceding
			   the domain or country. */

			/* Now we need to break up the domain to get a count of how many atoms it consists of. */
			var atomPat=new RegExp(atom,"g")
			var domArr=domain.match(atomPat)
			var len=domArr.length
			if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>6) {
			   // the address must end in a two letter or three/six letter word.
			   return false
			}

			// Make sure there's a host name preceding the domain.
			if (len<2) {
			   return false
			}

			// If we've gotten this far, everything's valid!
			return true;
		}
		
function SubmitForm(){
              formobject1 = document.getElementById('extraoptions');
// Telco Telco Start
        HideDiv('ErrorBoardTelco');	
        TelcoObj = formobject1.telcotelco;
        var Telco = 'default';
        var AcceptTelco;
        	for(var i = 0; i < TelcoObj.length; i++) {
        		if(TelcoObj[i].checked) {
        			Telco = TelcoObj[i].value;
        		}
        	}
if (Telco == "default") {
								ShowDiv('ErrorBoardTelco');
	              var ErrorBoxTelco  =  document.getElementById( 'gegevensErrorBoxTelco' );
    					  ErrorBoxTelco.innerHTML = '';
	              ErrorBoxTelco.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vraag niet beantwoord: Heeft u al ADSL ?<br />';
								AcceptTelco = false;
	} else {
    HideDiv('ErrorBoardTelco');	
		AcceptTelco = true;
		}

// Telco Telco End


// Connection Form Start
     					var LineType;
        			var ValidConnectionForm;
        			var ValidPhone 		    = new RegExp("^[0][1-57][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$");
        			// check phonenumber if current linetype = PSTN or CABL
        		  var ValidConnectionForm = false;

    		      
    		      var Errorbox           = document.getElementById( 'gegevensErrorBox' );
    		      		Errorbox.innerHTML = '';	
              var ErrorBoxProducts   =  document.getElementById( 'gegevensErrorBoxProducts' );
    					    ErrorBoxProducts.innerHTML = '';
    					
    					var ErrorBoxConnection =  document.getElementById( 'gegevensErrorBoxConnection' );
                  ErrorBoxConnection.innerHTML = '';
              
              var ErrorBoxVoorwaarden = document.getElementById('gegevensErrorBoxVoorwaarden');
                  ErrorBoxVoorwaarden.innerHTML = '';
        
        PhoneNumber = formobject1.cli.value;
        LineTypeObj = formobject1.currentlinetype;
        
        
        	for(var i = 0; i < LineTypeObj.length; i++) {
        		if(LineTypeObj[i].checked) {
        			LineType = LineTypeObj[i].value;
        		}
        	}
        
        	if (LineType == null ){
        
        ErrorBoxConnection.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Kies uw huidige situatie.<br />';
        ShowDiv('ErrorBoardConnection');
        	} else {
        		
        HideDiv('ErrorBoardConnection');		
        }
        
        
        	if(LineType == 'PSTN' || LineType == 'CABL'){
        	
        	 	if(PhoneNumber.match(ValidPhone)){
        		ValidConnectionForm = true;	
        		        HideDiv('ErrorBoardConnection');
        	 } else {
            ShowDiv('ErrorBoardConnection');
        		ErrorBoxConnection.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" />Ongeldig telefoonnummer.<br />';        		
        		}
          } else if (LineType == 'NONE'){
          	
          	 NLSIndex  = formobject1.ChosenNLSCli.selectedIndex;
          	 NLSChosen = formobject1.ChosenNLSCli.options[NLSIndex].value;
          	 if(NLSChosen.match(ValidPhone)){
          	 	ValidConnectionForm = true;
          	 	        HideDiv('ErrorBoardConnection');
          	 	} else {
          	 						ErrorBoxConnection.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Kies een telefoonnummer.<br />';
          	 		        ShowDiv('ErrorBoardConnection');
          	 		}
          	
          } else if (LineType == "ISDN"){
            ShowDiv('ErrorBoardConnection');
        		ErrorBoxConnection.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" />Helaas, op dit moment kunnen we geen ISDN lijnen leveren.<br />';        		
           	
          	
          	}
          	
          	
          	
          	
// Connection Form End
// Product Form Start
var DslPackage;
var ValidDSLForm ;
ValidDSLForm = true;


// Product Form End	

// Customer Form Start
			var send = true;
			var hide = true;
			var ValidZip   		    = new RegExp("^[1-9][0-9][0-9][0-9][a-zA-Z][a-zA-Z]$");
			var ValidHouse 		    = new RegExp("^[1-9][0-9]*$");
			var ValidContactPhone = new RegExp("^[0][1-7][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$");
			var ValidPhone 		    = new RegExp("^[0][1-57][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$");
			var ValidEmail        = new RegExp("^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]*\.)+[a-zA-Z]{2,9})$");
			var ValidName		      = new RegExp("^[a-zA-Z]$");
			var ValidNr			      = new RegExp(/^\d+$/ );
			theFocus = true;

			// Show Errorboard

			thePostcode = trim(formobject1.postcode.value).toUpperCase();
			theHousenr = trim(formobject1.huisnr.value);

			var bnrL = trim(formobject1.banknr.value).length;
			//var telCheck = formobject1.telnummerbereik[formobject1.nummerbereik.length-1].checked;
			var telnrL = trim(formobject1.telnummer.value).length;

			if (formobject1.initials.value == "") {
				//document.getElementById( 'initialsError' ).style.visibility = "visible";
				
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub uw voorletter(s) in.<br />';
				
				formobject1.initials.focus();
				theFocus = false;
				send = false;
			} else {
				//document.getElementById( 'initialsError' ).style.visibility = "hidden";
			}

			if (formobject1.naam.value=="") {
				//document.getElementById( 'naamError' ).style.visibility = "visible";
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub uw achternaam in.<br />';
				if (theFocus) {
					formobject1.naam.focus();
					theFocus = false;
				}
				send = false;
			} else {
				//document.getElementById( 'naamError' ).style.visibility = "hidden";
			}



			if(!formobject1.sex[0].checked && !formobject1.sex[1].checked){
				//document.getElementById( 'sexError' ).style.visibility = "visible";
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Selecteer aub uw geslacht.<br />';
				send = false;
			} else {
				//document.getElementById( 'sexError' ).style.visibility = "hidden";
			}

			if (formobject1.postcode.length == 0 || thePostcode == "") {
				//document.getElementById( 'postcodeError' ).style.visibility = "visible";
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub uw postcode in.<br />';
				//warningSet(document.getElementById('warnTxt1'),formobject1.input_postcode,"Vul uw postcode in",true);
				if (theFocus) {
					formobject1.postcode.focus();
					theFocus = false;
				}
				send = false;
			} else if (!thePostcode.match(ValidZip)) {
				//document.getElementById( 'postcodeError' ).style.visibility = "visible";
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub een geldige postcode in.<br />';
				//warningSet(document.getElementById('warnTxt1'),formobject1.input_postcode,"Vul een geldige postcode in",true);
				if (theFocus) {
					formobject1.postcode.focus();
					theFocus = false;
				}
				send = false;
			} else {
				//document.getElementById( 'postcodeError' ).style.visibility = "hidden";
				//warningSet(document.getElementById('warnTxt1'),formobject1.input_postcode,"Postcode",false);
			}

			if (formobject1.huisnr.length == 0 ||theHousenr=="") {
				//document.getElementById( 'huisnrError' ).style.visibility = "visible";
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub uw huisnummer in.<br />';
				//warningSet(document.getElementById('warnTxt2'),formobject1.input_huisnummer,"Vul een<br>  huisnummer in",true);
				if (theFocus) {
					formobject1.huisnr.focus();
					theFocus = false;
				}
				send = false;
			} else if (!theHousenr.match(ValidHouse)) {
				//document.getElementById( 'huisnrError' ).style.visibility = "visible";
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub uw huisnummer in.<br />';
				//warningSet(document.getElementById('warnTxt2'),formobject1.input_huisnummer,"Vul een geldig<br>  huisnummer in",true);
				if (theFocus) {
					formobject1.huisnr.focus();
					theFocus = false;
				}
				send = false;
			} else {
				//document.getElementById( 'huisnrError' ).style.visibility = "hidden";
				//warningSet(document.getElementById('warnTxt2'),formobject1.input_huisnummer,"Huisnummer",false);
			}



			if (!trim(formobject1.telnummer.value).match(ValidContactPhone)) {
				//document.getElementById( 'telnummerError' ).style.visibility = "visible";
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub uw contact telefoonnummer in.<br />';
				//warningSet(document.getElementById('warnTxt4'),formobject1.telnummer,"Vul uw telefoonnummer in!",true);
				if (theFocus) {
					formobject1.telnummer.focus();
					theFocus = false;
				}
				send = false;
			} else {
				//document.getElementById( 'telnummerError' ).style.visibility = "hidden";
				//warningSet(document.getElementById('warnTxt4'),formobject1.telnummer,"Anders, nl",false);
				formobject1.telnummer.value = trim(formobject1.telnummer.value);
			}

			if (!emailCheck(formobject1.email.value) && formobject1.email.value != ""){
				//document.getElementById( 'emailError' ).style.visibility = "visible";
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub een geldig e-mailadres in.<br />';
				//warningSet(document.getElementById('warnTxt5'),formobject1.email,"Vul een geldig emailadres in!",true);
				if (theFocus) {
					formobject1.email.focus();
					theFocus = false;
				}
				send = false;
			} else {
				//document.getElementById( 'emailError' ).style.visibility = "hidden";
				//warningSet(document.getElementById('warnTxt5'),formobject1.emailadres,"E-mail adres",false);
			}

			if (bnrL == 0) {
				//document.getElementById( 'banknrError' ).style.visibility = "visible";
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub uw rekeningnummer in.<br />';
				//warningSet(document.getElementById('warnTxt6'),formobject1.banknr,"Vul uw bank- of gironummer in!",true);
				if (theFocus) {
					formobject1.banknr.focus();
					theFocus = false;
				}
				send = false;
			} else if ( bnrL < 3 || bnrL == 8 || bnrL > 9 || trim(formobject1.banknr.value) == 123456789 || !trim(formobject1.banknr.value).match(ValidNr)) {
				//document.getElementById( 'banknrError' ).style.visibility = "visible";
				Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub een geldig rekeningnummer in.<br />';
				//warningSet(document.getElementById('warnTxt6'),formobject1.banknr,"Dit is geen geldig rekeningnummer!",true);
				if (theFocus) {
					formobject1.banknr.focus();
					theFocus = false;
				}
				send = false;
			} else if ( bnrL == 9 ) {
				checkBR = new Array();
				var checkBRsum = 0;
				for (x = 0; x < 9; x++) { checkBRsum += (9 - x) * trim(formobject1.banknr.value).charAt(x); }
				if ((checkBRsum % 11 != 0) || checkBRsum == 0) {
					//document.getElementById( 'banknrError' ).style.visibility = "visible";
					Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul aub een geldig rekeningnummer in.<br />';
					//warningSet(document.getElementById('warnTxt6'),formobject1.banknr,"Dit is geen geldig rekeningnummer!",true);
					if (theFocus) {
						formobject1.banknr.focus();
						theFocus = false;
					}
					send = false;
				} else {
					//document.getElementById( 'banknrError' ).style.visibility = "hidden";
					//warningSet(document.getElementById('warnTxt6'),formobject1.banknr,"Bank- of gironummer voor automatische incasso",false);
					formobject1.banknr.value = trim(formobject1.banknr.value);
				}
			} else {
				//document.getElementById( 'banknrError' ).style.visibility = "hidden";
				//warningSet(document.getElementById('warnTxt6'),formobject1.banknr,"Bank- of gironummer voor automatische incasso",false);
				formobject1.banknr.value = trim(formobject1.banknr.value);
			}

					if (formobject1.tnvbank.value=="") {
			
				  Errorbox.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Vul in: ten name van.<br />';
			  	if (theFocus) {
			  		formobject1.tnvbank.focus();
	  				theFocus = false;
	  			}
	   	   		send = false;
		     	} else {
				//document.getElementById( 'naamError' ).style.visibility = "hidden";
	   		}
		
		
		
		
		  var ConditionsAccepted ;
			if (formobject1.voorwaarden && !formobject1.voorwaarden.checked) {
				ConditionsAccepted= false;
				ErrorBoxVoorwaarden.innerHTML += '<img src="images/error_icon.gif" style="margin-right: 15px;" /> Gaat u akkoord met de voorwaarden?<br />';
				ShowDiv('ErrorBoardVoorwaarden');
	    	
	    		} else{
			  HideDiv('ErrorBoardVoorwaarden');
			  ConditionsAccepted = true;
			}

if (send == false){
	document.getElementById('ErrorBoard').style.display = 'block';
}


// Customer Form End

// Send Form
     if (ValidConnectionForm && ValidDSLForm && send && ConditionsAccepted) {
     document.sointakeform.submit()	
     }	

     } // end submitform




function MM_swapImgRestore() { 
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}
	
function ShowError(msg,id){
document.getElementById(id).style.display = "block";	
document.getElementById(id).innerHTML = msg;	
}

function HideError(id){
document.getElementById(id).style.display = "none";			
}




     function toggleDiv( div ){
     			document.getElementById( currentDiv ).style.display = "none";
     			document.getElementById( div ).style.display = "block";
     
     			currentDiv = div;
     		}

		function showdiv(div, show){

			document.getElementById( div ).style.display = show;

		}


       // set the radio button with the given value as being checked
       // do nothing if there are no radio buttons
       // if the given value does not exist, all the radio buttons
       // are reset to unchecked
       function setCheckedValue(radioObj, newValue) {
       	if(!radioObj)
       		return;
       	var radioLength = radioObj.length;
       	if(radioLength == undefined) {
       		radioObj.checked = (radioObj.value == newValue.toString());
       		return;
       	}
       	for(var i = 0; i < radioLength; i++) {
       		radioObj[i].checked = false;
       		if(radioObj[i].value == newValue.toString()) {
       			radioObj[i].checked = true;
       		}
       	}
       }

		function scarletmobiel( noclick ){
			document.getElementById( 'one_simonly' ).checked = false;			
			// Set simonly to false
			setCheckedValue( document.getElementById( 'one_simonly' ),'off');
			if(document.getElementById( 'one_mobiel' ).checked){
				document.getElementById( 'scarlet_mobieldiv' ).style.display = "block";
				document.getElementById( 'sim_onlydiv' ).style.display = "none";
			} else if( noclick){
				document.getElementById( 'scarlet_mobieldiv' ).style.display = "block";
				document.getElementById( 'one_mobiel' ).checked = true;
			} else {
				document.getElementById( 'scarlet_mobieldiv' ).style.display = "none";
			}



			showdiv('bundelnr1', 'none');showdiv('bundelnr2', 'none');
			update1();
		}

		function simonly( noclick ){

			document.getElementById( 'one_mobiel' ).checked = false;

			if(document.getElementById( 'one_simonly' ).checked){
				document.getElementById( 'scarlet_mobieldiv' ).style.display = "none";
				document.getElementById( 'sim_onlydiv' ).style.display = "block";
			} else if( noclick ){
				document.getElementById( 'sim_onlydiv' ).style.display = "block";
				document.getElementById( 'one_simonly' ).checked = true;
			} else {
				document.getElementById( 'sim_onlydiv' ).style.display = "none";
			}


			showdiv('simnr1', 'none');showdiv('simnr2', 'none');showdiv('simnr3', 'none');showdiv('simnr4', 'none');showdiv('simnr5', 'none');
			update2();
		}

		function update1(){
			for(var i=1; i < 2; i++){

				if(i <= document.getElementById( 'aantalbundels' ).selectedIndex){
					document.getElementById( 'bundel' + (i + 1) ).style.display = 'block';
				} else {
					document.getElementById( 'bundel' + (i + 1) ).style.display = 'none';
				}

			}
		}
		function update2(){
			for(var i=1; i < 5; i++){

				if(i <= document.getElementById( 'aantalsim' ).selectedIndex){
					document.getElementById( 'sim' + (i + 1) ).style.display = 'block';
				} else {
					document.getElementById( 'sim' + (i + 1) ).style.display = 'none';
				}

			}
		}

	
	
	function ToggleExistingCust(){
	
					CustomerFormObj = document.getElementById('customerformid');
        
	      	for(var i = 0; i < CustomerFormObj.length; i++) {
        		if(CustomerFormObj[i].checked) {
        			ExistingCust = CustomerFormObj[i].value;
        		}
        	}
					if (ExistingCust == 'nee'){
					showdiv('existingcustomer_number','none');
					showdiv('customerdata','block');
				} else if (ExistingCust == 'ja'){
					showdiv('existingcustomer_number','block');
					showdiv('customerdata','block');
					}

	
	
	}

function prequalformsubmit(){

    	var ValidForm;
	
			var ValidZip   		    = new RegExp("^[1-9][0-9][0-9][0-9]$");
			var ValidAddon 		    = new RegExp("^[a-zA-Z][a-zA-Z]$");
			
			var ValidHouse 		    = new RegExp("^[1-9][0-9]*$");
			var ValidContactPhone = new RegExp("^[0][1-7][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$");
			var ValidEmail        = new RegExp("^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]*\.)+[a-zA-Z]{2,9})$");
			var ValidName		      = new RegExp("^[a-zA-Z]$");
			var ValidNr			      = new RegExp(/^\d+$/ );
			ValidForm = false;
			theFocus = true;
			
			formobject = document.getElementById('prequalformid');
		 	
	  	
    			thePostcode = formobject.postcode.value;
    			theAddon    = formobject.postcode_addon.value;
					theHousenr  = formobject.huisnr.value;
	    
	    if (formobject.postcode.length == 0 || thePostcode == "") {
		  //lege postcode	  
		  ShowError('geen postcode ingevuld','errors');
		} else if (!thePostcode.match(ValidZip) || !theAddon.match(ValidAddon)) {
			// ongeldige postcode			
			ShowError('geen geldige postcode <BR>ingevuld','errors');
			
		} else if (!theHousenr.match(ValidHouse)){
			// ongeldig huisnummer
			ShowError('Ongeldig huisnummer','errors');
		} else {
			// No errors found
			document.getElementById('evenwachten').style.display = "block";	
			ValidForm = true;
			}
	
	
	
	if(ValidForm){
		
		document.prequalform.submit();
		} 
	
	}
	
function ShowError(msg,id){
document.getElementById(id).style.display = "block";	
document.getElementById(id).innerHTML = msg;
	
	}
	
function ShowDiv(id){
document.getElementById(id).style.display = "block";
}	

	function HideDiv(id){
document.getElementById(id).style.display = "none";
}	

function voorwaardenPopUp(URL) {
			//input window name
			var wndName="Scarlet";

			//input attributes
			wndAttributes = "width=700,height=500,scrollbars=1,top=40";
			window.open(URL,wndName,wndAttributes);
}


// AUTO TAB
		var isNN = (navigator.appName.indexOf("Netscape")!=-1);
		function autoTab(input,len, e) {
		var keyCode = (isNN) ? e.which : e.keyCode;
		var filter = (isNN) ? [0,8,9] : [0,8,9,16,17,18,37,38,39,40,46];
		if(input.value.length >= len && !containsElement(filter,keyCode)) {
		input.value = input.value.slice(0, len);
		input.form[(getIndex(input)+1) % input.form.length].focus();
		}
		function containsElement(arr, ele) {
		var found = false, index = 0;
		while(!found && index < arr.length)
		if(arr[index] == ele)
		found = true;
		else
		index++;
		return found;
		}
		function getIndex(input) {
		var index = -1, i = 0, found = false;
		while (i < input.form.length && index == -1)
		if (input.form[i] == input)index = i;
		else i++;
		return index;
		}
		return true;
		}
		
		
// TOGGLE DIV PACKAGE SELECTOR


		function ToggleDSL(){
		document.getElementById('selected_campaign_id').value = document.getElementById('mart').value ;
		choice = document.getElementById('mart').value;
			
			
			for (var x = 0; x <= 15; x++)
			   {
				if (choice == x){
					if(document.getElementById( x )){
						document.getElementById( x ).style.display = 'block';
					}
				} else {
					if(document.getElementById( x )){
					document.getElementById( x ).style.display = 'none';
					}
				}
			
			   }
			
			

		}