function viewImage(iname,icap,iht,wname,wsize,hsize) {
  var bldArg = 'width=' + wsize + ',height=' + hsize + ',left=10,top=10,screenX=10,screenY=10';
  bldArg = bldArg + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=0';
     if(!(iname=="")) {
      popupWin=window.open('',wname,bldArg);
        if (!popupWin.opener) { 
            popupWin.opener = self;
        }
      popupWin.document.open();
      popupWin.document.writeln("<head>");
      popupWin.document.writeln("<title>Afbeelding</title>");
      popupWin.document.writeln("<SCRIPT language='JavaScript'>");
      popupWin.document.writeln("if (window.focus) {");
      popupWin.document.writeln(" self.focus();");
      popupWin.document.writeln("}");
      popupWin.document.writeln("function killWindow() {");
      popupWin.document.writeln("  killWin = window.close();");
      popupWin.document.writeln("}");
      popupWin.document.writeln("</SCRIPT>");
      popupWin.document.writeln("</head>");
      popupWin.document.writeln("<body text='black' marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>");
      popupWin.document.writeln("<center>");
      popupWin.document.writeln("<a href='' onClick='killWindow();'><img src='" + iname + "' border=0></a><br><font size=2>" + icap + "</font>");
      popupWin.document.writeln("</center>");
      popupWin.document.close();
      } else {
          popupWin=window.open('noimage.htm');
          if (!popupWin.opener) { 
            popupWin.opener = self;
            }
      }
   }

function MM_swapImgRestore() { //v3.0
  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_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 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_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+' moet een e-mailadres zijn.\n';
      } else if (test!='R') {
        if (isNaN(val)) errors+='- '+nm+' moet een getal zijn.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (val<min || max<val) errors+='- '+nm+' moet een getal zijn tussen '+min+' en '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is verplicht.\n'; }
  } 

  

   if(document.frm.noDescription.value=="1"){
		// do nothing
   }else{
   		document.frm.Omschrijving.value = Description.innerHTML;
   }

   if(document.frm.noContent.value=="1"){
		// do nothing
   }else{
   		document.frm.Inhoud.value = Content.innerHTML;
   }
	


//		if (document.frm.Inhoud.value == "") errors += '- Content is verplicht.\n';
//		if (document.frm.Omschrijving.value == "") errors += '- Omschrijving is verplicht.\n';

if (errors) alert('De volgende fouten zijn ontstaan:\n'+errors);
	
  document.MM_returnValue = (errors == '');
     if(document.MM_returnValue){
         Save()
     }
}

function MK_dynamicForm() { //v4.0 
  var obj,l,args=MK_dynamicForm.arguments; val=document.MM_returnValue; val=(val==null)?true:val;
  if(val){obj=MM_findObj(args[0]);l=args.length; if(obj){if(l>2){for (i=2; i<(l-1); i+=2)
  {eval("obj."+args[i]+"='"+args[i+1]+"';")}} eval("obj."+args[1]+"();");}}
  document.MM_returnValue = false;
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function Click_image() { 
   arg = Click_image.arguments[0]
   pic = document.images[arg].src.split("/")[document.images[arg].src.split("/").length -1]

   if (pic != (arg +".gif")){
      document.images[arg].src = "../images/"+arg+".gif";
   }else{
      document.images[arg].src = "../images/"+arg+"_click.gif";
   }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function showmenu(elmnt)
{
	document.all(elmnt).style.visibility="visible"
}

function hidemenu(elmnt)
{
	document.all(elmnt).style.visibility="hidden"
}


function openSimplePopup(url,width,height){
  var args = 'width='+width+',height='+height+',left=10,top=10,screenX=10,screenY=10';
  	  args = args + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,toolbar=1';
      window.open(url,'GemeenteKessel',args);
}
function openFaq(url){
  var args = 'width=500,height=550,left=10,top=10,screenX=10,screenY=10';
  	  args = args + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0';
      window.open(url,'faq',args);
}
function openEmail(url){
  var args = 'width=500,height=550,left=10,top=10,screenX=10,screenY=10';
  	  args = args + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0';
      window.open(url,'email',args);
}
function openPics(url){
  var args = 'width=500,height=550,left=10,top=10,screenX=10,screenY=10';
  	  args = args + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0';
      window.open(url,'pics',args);
}
function openSpecs(url){
  var args = 'width=500,height=550,left=10,top=10,screenX=10,screenY=10';
  	  args = args + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=1';
      window.open(url,'specificaties',args);
}

function MakeDate(){
	document.frmJob[tarVeld].value = document.frmJob.datum.value
	document.frmJob["date"+tarVeld].value = document.frmJob.datum.value
}

function showPic (whichpic) {
    if (document.getElementById) {
        document.getElementById('placeholder').src = whichpic.href;
        return false;
    } else {
        return true;
    }
}

function openLink(URI){
 win = window.open(URI,"secWin","width=800,height=600,left=10, top=10,menubar=yes, status=yes, toolbar=yes, directories=yes, scrollbars=yes,resizable=yes,location=yes");
 win.focus;
}
function openCalendarInfo(url){
  var args = 'width=450,height=300,left=10,top=10,screenX=10,screenY=10';
  	  args = args + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0';
      info = window.open(url,'',args);
      info.focus;
}
function openCalendar(url){
  var args = 'width=810,height=600,left=10,top=10,screenX=10,screenY=10';
  	  args = args + ',channelmode=0,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=0';
      cal = window.open(url,'evenement',args);
}

