function Validator(theForm) {
  if (theForm.contactpersoon.value=='')
    {
      alert("Wat is de contactpersoon?");
      theForm.contactpersoon.focus();
      return (false);
    }
  if (theForm.email.value=='')
    {
      alert("Wat is uw e-mailadres?");
      theForm.email.focus();
      return (false);
    }
  if (theForm.email.value.indexOf('@',0)==-1 | theForm.email.value.indexOf('.',0)==-1)
    {
      alert("Dit is geen geldig e-mailadres");
      theForm.email.focus();
      return (false);
    }

  return (true)
}

function NewWindow( url, name, width, height, scrollbars ) { 
				var top  = "100"; 
				var left = "200"; 
			   	
				if( scrollbars == null ) scrollbars = "0"; 
			 
				str  = ""; 
				str += "resizable=0,titlebar=1,menubar=0,"; 
				str += "toolbar=0,location=0,directories=0,status=0,"; 
				str += "scrollbars=" + scrollbars + ","; 
				str += "width=" + width + ","; 
				str += "height=" + height + ","; 
				str += "top=" + top + ","; 
				str += "left=" + left; 
			 
				window.open( url, name, str ); 
} 
						
			
function checkIt(s) {
		
	if (document.Emailform.name.value  == ''){
       alert('Please fill in your name.');
       return false;
     }  

	//email check
	if (!document.Emailform.email.value  == ''){
	
		var emailStr = document.Emailform.email.value
		var emailPat=/^(.+)@(.+)$/
		var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
		var validChars="\[^\\s" + specialChars + "\]"
		var quotedUser="(\"[^\"]*\")"
		var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
		var atom=validChars + '+'
		var word="(" + atom + "|" + quotedUser + ")"
		var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
		var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")
		
		var matchArray=emailStr.match(emailPat)
		if (matchArray==null) {
			alert("Email address seems incorrect (check @ and .'s)")
			return false
		}
		var user=matchArray[1]
		var domain=matchArray[2]
		
		if (user.match(userPat)==null) {
		    // user is not valid
		    alert("Email address seems incorrect (The username doesn't seem to be valid.))")
		    return false
		}
		
		var IPArray=domain.match(ipDomainPat)
		if (IPArray!=null) {
		    // this is an IP address
			  for (var i=1;i<=4;i++) {
			    if (IPArray[i]>255) {
			        alert("Email address seems incorrect (Destination IP address is invalid)")
				return false
			    }
		    }
		    return true
		}
		
		var domainArray=domain.match(domainPat)
		if (domainArray==null) {
			alert("Email address seems incorrect (The domain name doesn't seem to be valid.)")
		    return false
		}
		
		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>4) {
		   // the address must end in a two letter or three letter word.
		   alert("Email address seems incorrect (The address must end in a max. four-letter domain, or two letter country.)")
		   return false
		}
		
		if (len<2) {
		   var errStr=("Email address seems incorrect (This address is missing a hostname)")
		   alert(errStr)
		   return false
		}
	} 
	//einde email check
    return true;
}
			
	
function showPic (whichpic) { 
	if (document.getElementById) { 
		document.getElementById('placeholder').src = whichpic.href; 
		if (whichpic.title) { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title; 
		} else { 
			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
		} 
		return false; 
	} else { 
		return true; 
	} 
}


  	
function popupPage(src) {
	var NewWindow=open('','Popup','height=682,width=1024,location=no,scrollbars=no,menubars=no,toolbars=no,resizable=no,top=140px,left=180px');
	NewWindow.focus();
	window.open(src, target="Popup");
}
	
	
