// Error blocker
function blockError(){return true;}
window.onerror = blockError;

// Image swap
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.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_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];}
}

// Printvriendelijk
var AutoPrint = true; // Indien 'false' wordt de pagina niet automatisch uitgeprint

function PrintPagina(){
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<BODY>\n';
var PrintKlaarElem = document.getElementById("PrintKlaar");
if (PrintKlaarElem != null){
html += PrintKlaarElem.innerHTML;}
html += '\n</BO' + 'DY>\n</HT' + 'ML>';
var printWin = window.open("","PrintPagina");
printWin.document.open();
printWin.document.write(html);
printWin.document.close();
if (AutoPrint)printWin.print();}}

// POP-UP
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=720,height=701');");
}

// Menu
function topframe_tab_over(obj, img_name) {
	obj.style.backgroundImage = "url("+img_name+")";
	obj.childNodes[0].style.color = "#FFFFFF";
	obj.childNodes[0].style.fontWeight = "bold";
}
function topframe_tab_out(obj) {
	obj.style.backgroundImage = "";
	obj.childNodes[0].style.color = "#E1E1E1";
	obj.childNodes[0].style.fontWeight = "bold";
}

//Groeten
function greeting()
{
   var today = new Date();
   var hrs = today.getHours();
   document.write("Goede");
   if (hrs < 12)
      document.write("morgen, ");
   else if (hrs <= 17)
      document.write("middag, ");
   else
      document.write("navond, ");
}

//Image Fade
    var imgs; 
     
    function initImgs() { 
      imgs = new Array(img1, img2, img3, img4); // vul hier het aantal plaatjes in... ( volgende wordt dus img5 etc.. ) voor als je er meer wilt
    } 
     
    function fadeImg(img, selected) { 
      var c = selected?"opacity1":"opacity2"; 
      for (var i=0; i<imgs.length; i++) 
        if (imgs[i]!=img) imgs[i].className = c; 
    } 

//Postcode
function vulAanMet(s, c, n, l) {
   var j= s.length;
   if (s.length>=n) return s.substring(0, n);
   else {
      for (var i=0; i< n-j; i++) {
         if (l) {
            s= c + '' +s;
         } else {
            s= s+ '' +c;
         }
      }
      return s;
   }
   s.value = s;
}

function combineFields(f){
	f.pcalf.value=f.pcalf.value.toUpperCase();
	f.postcode.value=f.pcnum.value + ' ' + f.pcalf.value;
	f.telefoon.value=f.telnet.value + '-' + f.telabo.value;	
	return true;	
}

//sIFR
if(sIFR != null && sIFR.replaceElement != null){
	sIFR.replaceElement("h1", "swf/colonna_mt.swf", "#000000", "#000000", "#999999", null, 30, 0, 30, 0, "textalign=center&offsetTop=6");
	sIFR.replaceElement("h2", "swf/calibri.swf", "#000000", null, null, null, 0, 0, 0, 0);
	sIFR.replaceElement("h3", "swf/calibri.swf", "#660000", null, null, null, 0, 0, 0, 0);
	sIFR.replaceElement("h4", "swf/calibri.swf", "#660000", null, null, null, 0, 0, 0, 0);
};

