
/* Remove dots */


function RemoveDot()
{
for (a in document.links) document.links[a].onfocus = document.links[a].blur;
}
if (document.all)
{
document.onmousedown = RemoveDot;
}


/* Print Page Script */

function PrintPage() {
	var bAutoPrint = true;
	
	if(document.getElementById != null) {
		var html = '<HTML>\n<HEAD>\n';
		if(document.getElementsByTagName != null) {
			var headTags = document.getElementsByTagName("head");
			if(headTags.length > 0)	html += headTags[0].innerHTML;
		}
		html += '\n</HE' + 'AD>\n<BO' + 'DY><style type="text/css">body { background: none #FFFFFF; color:#000000; text-align:left; }</style>\n';
		var PrintKlaarElem = document.getElementById("PrintKlaar");
		if(PrintKlaarElem != null) html += PrintKlaarElem.innerHTML;
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","PrintPage");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if(bAutoPrint) printWin.print();
	}
}


/* Date */
var months = new Array("01","02","03","04","05","06","07","08","09","10","11","12");
var now = new Date();
today = now.getDate() + "/" + months[now.getMonth()] + "/"  + now.getYear();

/* Validate form */

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0
  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=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
      } else if (test!='R') { 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 required.\n'; }
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
}


		function validate() {
		var err = "";
		if (frmSubscribe.txtNaam.value=="") err+=" - Please fill out your name\n";
		if (frmSubscribe.txtTelefoon.value=="") err+=" - Please fill out your telephone number\n";
		p=frmSubscribe.txtMail.value.indexOf("@");
		if (p<1 || p==(frmSubscribe.txtMail.value.length-1)) err+=" - E-mailaddress invalid\n";
		if (frmSubscribe.txtOpmerking.value=="") err+=" - Please specify your remark\n";		
		if(err!="") {
			alert("The following errors occured:\n"+err);
			return false;
		}
	}


/* Calender function */

function ShowDate(date_form, date_field)
{
	url='calendar.asp?date_form=' + date_form + '&date_field=' + date_field;
	window.open(url,"_blank","height=215,width=390, resizable=yes");
}



