function openSite(url)
{
    var maxx = screen.width;
    var maxy = screen.height;
    windowprops = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=100,height=100,left=100,top=100";

    window.open(url+"&maxx="+maxx+"&maxy="+maxy,"",windowprops);
}


function MM_validateForm() { //v4.0
	if (document.getElementById) {
		var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
		for (i=0; i<(args.length-2); i+=3) { 
			test=args[i+2]; 
			val=document.getElementById(args[i]);
			if (val) { 
				nm=val.name;
				if(nm=='polisnummer') {
					if(document.getElementById('abonnement_bun').checked) {
						if (isNaN(val.value)) {
							errors += '- polisnummer is niet geldig\n';
						} else if(val.value=='') {
							errors += '- polisnummer is verplicht.\n';
						} else if(val.value.length < 8 || val.value.length > 10) {
							errors += '- polisnummer is niet geldig\n';					
						}
					} 
				} else if ((val=val.value)!="") {
					if (test.indexOf('isEmail')!=-1) { 
						p=val.indexOf('@');
						if (p<1 || p==(val.length-1)) errors+='- '+nm+' is geen geldig adres.\n';
					} else if (test!='R' && test!='S') { 
						num = parseFloat(val);
						if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
						if (test.indexOf('inRange') != -1) { 
							p=test.indexOf(':');
							min=test.substring(8,p); max=test.substring(p+1);
							if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
						} 
					} 
				} else if (test.charAt(0) == 'R') {	
					errors += '- '+nm+' is verplicht.\n'; 
				} 
				if (test.charAt(0) == 'S') {
					if (document.getElementById(args[i]).selectedIndex == 0) {
						errors += '- '+nm+' is verplicht.\n';
					}
				}
			}
		} 
		
		if (errors) alert('Het formulier is niet volledig ingevuld:\n'+errors);
		document.MM_returnValue = (errors == '');
	} 
}

function playvideo(URLStr)
{
    var maxx = screen.width;
    var maxy = screen.height;
	var w = 320;
	var h = 260;
	var x = Math.floor((maxx-w)/2);
	var y = Math.floor((maxy-h)/2);
    windowprops = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+w+",height="+h+",left="+x+",top="+y+"";
    window.open("/site/lib/videoplayer.php?file="+URLStr,"",windowprops);
}

function hide(id) {
	document.getElementById(id).style.display = 'none';
}
function show(id) {
	document.getElementById(id).style.display = 'block';
}
