﻿// JScript File
 <!--

            if (top.location!=this.location) top.location=this.location;

	function clientSideInclude(id, url) {
	  var req = false;
	  // For Safari, Firefox, and other non-MS browsers
	  if (window.XMLHttpRequest) {
	    try {
	      req = new XMLHttpRequest();
	    } catch (e) {
	      req = false;
	    }
	  } else if (window.ActiveXObject) {
	    // For Internet Explorer on Windows
	    try {
	      req = new ActiveXObject("Msxml2.XMLHTTP");
	    } catch (e) {
	      try {
	        req = new ActiveXObject("Microsoft.XMLHTTP");
	      } catch (e) {
	        req = false;
	      }
	    }
	  }
	 var element = document.getElementById(id);
	 if (!element) {
	  alert("Bad id " + id + 
	   "passed to clientSideInclude." +
	   "You need a div or span element " +
	   "with this id in your page.");
	  return;
	 }
	  if (req) {
	    // Synchronous request, wait till we have it all
	    req.open('GET', url, false);
	    req.send(null);
	    element.innerHTML = req.responseText;
	  } else {
	    element.innerHTML =
	   "Sorry, your browser does not support " +
	      "XMLHTTPRequest objects. This page requires " +
	      "Internet Explorer 5 or better for Windows, " +
	      "or Firefox for any system, or Safari. Other " +
	      "compatible browsers may also exist.";
	  }
	}
	            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];}
            }
            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];}}
            }

            var win = null;
	            function NewWindow(mypage,myname,w,h,scroll){
	            LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	            TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	            settings =
	            'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	            win = window.open(mypage,myname,settings)
            }

            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+', met een geldig emailadres \n';
                  } else if (test!='R') {
                    if (isNaN(val)) errors+='- '+nm+' moet een getal bevatten.\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+' must contain a number between '+min+' and '+max+'.\n';
                } } } else if (test.charAt(0) == 'R') errors += '- '+nm+'\n'; }
              } if (errors) alert('De volgende velden zijn verplicht:\n'+errors);
              document.MM_returnValue = (errors == '');
            }

            function print_page() {
                self.focus();
                self.print()
            }
            
            // ' ############# UITKLAPMENU'S #############' //
            
            function MM_showHideLayers() { //v6.0
              var i,p,v,obj,args=MM_showHideLayers.arguments;
              for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
                if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
                obj.visibility=v; }
            }

function CurrentAction(PanelName) {
//alert(Action);
MM_showHideLayers(PanelName,'','show');
}

            var timeOut1;
            var timeOut2;
            var timeOut3;
            function hideSubMenu(PanelName) {           
	            //if (timeOut1) {
		            clearTimeout (timeOut1);
	            //}
	            timeOut1 = setTimeout("MM_showHideLayers('" + PanelName + "','','hide')",200);
	            
	            //if (timeOut2) {
		            clearTimeout (timeOut2);
	            //}
	            timeOut2 = setTimeout("MM_showHideLayers('" + PanelName + "','','hide')",200);
	            //if (timeOut3) {
		            clearTimeout (timeOut3);
	            //}
	            timeOut3 = setTimeout("MM_showHideLayers('" + PanelName + "','','hide')",200);
            }
            function hideEmptySubMenu(PanelName) {           
	            //if (timeOut1) {
		            clearTimeout (timeOut1);
	            //}
	            timeOut1 = setTimeout("MM_showHideLayers('" + PanelName + "','','hide')",100);
	            
	            //if (timeOut2) {
		            clearTimeout (timeOut2);
	            //}
	            timeOut2 = setTimeout("MM_showHideLayers('" + PanelName + "','','hide')",100);
	            //if (timeOut3) {
		            clearTimeout (timeOut3);
	            //}
	            timeOut3 = setTimeout("MM_showHideLayers('" + PanelName + "','','hide')",100);
            }
             // ' ############# // UITKLAPMENU'S #############' //
             
             
            // ' ############# VESTIGINGEN #############' //
            
            var KeepProvincie = ""
            var KeepHideProvincie = ""
	    var timeoutProvincie
            function hideVestigingen(Provincie) {
	            if (Provincie != "" && KeepHideProvincie != Provincie) {
		           KeepHideProvincie = Provincie
			   KeepProvincie = ""
                   	   if (timeoutProvincie) clearTimeout (timeoutProvincie)
	            	   timeoutProvincie = setTimeout("MM_showHideLayers('BoxVestigingen','','hide')",1500);
	            }
            }
            
            var SelectedDivisies = ""
            function ShowVestigingen(Provincie,type) {
               var arrDivisies = ""
               SelectedDivisies = document.getElementsByName('Divisie')
               if (SelectedDivisies.length >0) {
                   for (i=0;i<SelectedDivisies.length;i++) {
                       if (SelectedDivisies[i].checked) {
                          if (arrDivisies.length > 0) {
                             arrDivisies = arrDivisies + ","
                          }
                          arrDivisies = arrDivisies + SelectedDivisies[i].value
                        }
                    }
               } 
               if (type ==1) {
                 if (Provincie != "" && KeepProvincie != Provincie) {
		   KeepProvincie = Provincie
		   KeepHideProvincie = ""
                    if (timeoutProvincie) clearTimeout (timeoutProvincie)
                    if (Provincie == "ZE") Provincie = "ZL" //foute provinciecode vanuit flash
                    if (Provincie == "LI") Provincie = "LB" //foute provinciecode vanuit flash
                    clientSideInclude('BoxVestigingen', 'Vestigingen_lijst.aspx?Provincie=' + Provincie + "&SelectedDivisies=" + arrDivisies)
                    MM_showHideLayers('BoxVestigingen','','show') 
                 }
               }   
               else if (type ==2) {
                    if (Provincie == "ZE") Provincie = "ZL" //foute provinciecode vanuit flash
                    if (Provincie == "LI") Provincie = "LB" //foute provinciecode vanuit flash
                    document.location='Vestigingen_provincie.aspx?Provincie=' + Provincie + "&SelectedDivisies=" + arrDivisies
               }       
            }
            
            // ' ############# // VESTIGINGEN #############' //
            
            // ' ############# ZOEKEN #############' //
            
            var trefwoord
            function SearchSite() {
                trefwoord = document.getElementById("Zoeken_Trefwoord")
                trefwoord = trefwoord.value
                if (trefwoord != "" && trefwoord != "op trefwoord") {
                   document.location='Zoeken_trefwoord.aspx?Trefwoord=' + trefwoord
                }
                else if (trefwoord == "" || trefwoord == "op trefwoord") {
                    alert("Vul een trefwoord in")
                }
            }
            
            var postcode
            function SearchPostcode() {
                postcode = document.getElementById("Zoeken_Postcode")
                postcode = postcode.value
                if (postcode != "" && postcode != "op postcode") {
                   document.location='Zoeken_postcode.aspx?Postcode=' + postcode
                }
                else if (postcode == "" || postcode == "op postcode") {
                    alert("Vul een postcode in")
                }
            }
            
            var postcode2
            var SelectedDivisies2 = ""
            function SearchPostcode2() {
               var arrDivisies2 = ""
                postcode2 = document.getElementById("Postcode")
                postcode2 = postcode2.value
                if (postcode2 != "" && postcode2 != "postcode") {
                    SelectedDivisies2 = document.getElementsByName('Divisie')
                    if (SelectedDivisies2.length >0) {
                        for (i=0;i<SelectedDivisies2.length;i++) {
                            if (SelectedDivisies2[i].checked) {
                                if (arrDivisies2.length > 0) {
                                 arrDivisies2 = arrDivisies2 + ","
                                }
                                arrDivisies2 = arrDivisies2 + SelectedDivisies2[i].value
                            }
                        }    
                        document.location='Zoeken_postcode.aspx?Postcode=' + postcode2 + "&SelectedDivisies=" + arrDivisies2
                    } 
                    else {
                        document.location='Zoeken_postcode.aspx?Postcode=' + postcode2
                    }
                }
                else if (postcode2 == "" || postcode2 == "postcode") {
                    alert("Vul een postcode in")
                }
            }
            
            function RemoveTextTr(oTextbox) {
                if (oTextbox.value == "op trefwoord") {
                    oTextbox.value =""
                }
            }
            function RefillBoxTr(oTextbox) {
                if (oTextbox.value == "") {
                    oTextbox.value ="op trefwoord"
                }
            }
            
            function RemoveTextPc(oTextbox) {
                if (oTextbox.value == "op postcode") {
                    oTextbox.value =""
                }
            }
            function RefillBoxPc(oTextbox) {
                if (oTextbox.value == "") {
                    oTextbox.value ="op postcode"
                }
            }
            
            // voor gebruik in vestigingen.aspx
                function RemoveTextPcV(oTextbox) {
                    if (oTextbox.value == "postcode") {
                        oTextbox.value =""
                    }
                }
                function RefillBoxPcV(oTextbox) {
                    if (oTextbox.value=='') oTextbox.value ='postcode'
                }
            
            // ' ############# // ZOEKEN #############' //
            
        var TO = null;
        var DN = null;
        function HeaderNavigationMouseIn(DivName)
        {
          if (TO && (DivName == DN)) clearTimeout(TO); 
          var LLL =   document.getElementById(DivName); 
          if (LLL.className!='panel_navigation_1_now') TO=setTimeout("document.getElementById('" + DivName + "').className='panel_navigation_1_now'",0);
          MM_showHideLayers('" + DivName + "','','show');clearTimeout(timeOut1);clearTimeout(timeOut2);clearTimeout(timeOut3);
          DN = DivName;
        }
        
        function HeaderNavigationMouseOut(DivName,DefaultStyle)
        {
          if (TO && (DivName == DN)) clearTimeout(TO); 
          var LLL =   document.getElementById(DivName);
          if (LLL.className!="'" + DefaultStyle + "'") TO=setTimeout("document.getElementById('" + DivName + "').className='" + DefaultStyle + "'",0);
          DN = DivName;
        }

        //-->

function Topper(left,top)
{
    window.scrollTo(left,top);      // als het moet scrollen naar de top van de content dan: window.scrollTo(0,300);
}