var directionsPanel,directions,toAddress;function customBodyLoad(a){if(typeof Map!="undefined"){a=Map.icon;a=new GIcon;a.image=Map.domain+"img/mapIcon.png";a.iconSize=new GSize(40,40);a.iconAnchor=new GPoint(20,40);Map.init("divGoogleMap",a)}}function customBodyResize(a,b){}function customBodyScroll(a){}var googlemap,bounds;
function MapInit(a){googlemap=a;directionsPanel=document.getElementById("route");directions=new GDirections(a.map,directionsPanel);bounds=new GLatLngBounds;for(var b=0;b<locations.length;b++){markerOptions={icon:a.icon};var c=locations[b],d=new GMarker(c.point,markerOptions);bounds.extend(c.point);d.ID=c.ID;d.name=c.name;d.address1=c.address1;d.address2=c.address2;d.telephone=c.telephone;d.fax=c.fax;GEvent.addListener(d,"click",function(){openLocationDetails(this.ID)});a.markers[c.ID]=d;a.map.addOverlay(d)}if(locations.length>
0){a.map.setZoom(a.map.getBoundsZoomLevel(bounds));a.map.getZoom()>14&&a.map.setZoom(14);a.map.setCenter(bounds.getCenter())}}
function showRoute(a){var b=$("routediv"),c=$("locations");if(b&&c){var d=Map.markers[a];toAddress=d.address1+", "+d.address2;b.style.display="";c.style.display="none";for(var e in Map.markers)isNumeric(e)&&Map.markers[e].ID!=a&&Map.markers[e].hide()}sIFR.replace(SansaConStd,{selector:"h2.sansa18Red",wmode:"transparent",ratios:[7,1.82,10,1.81,18,1.72,21,1.71,24,1.7,34,1.68,45,1.67,61,1.66,62,1.65,67,1.66,70,1.65,71,1.66,76,1.65,78,1.66,1.65],css:[".sIFR-root{font-weight: bold; color:#E5352C; text-align:left; letter-spacing:0;} a{color:#E5352C; text-decoration:none;} a:hover{color:#E5352C;}"]})}
function planRoute(){var a=$("fromAddress").value;directions.load("from:"+a+" to: "+toAddress)}function closeRoute(){var a=$("routediv"),b=$("locations");if(a&&b){a.style.display="none";b.style.display=""}for(var c in Map.markers)isNumeric(c)&&Map.markers[c].show();directions.clear()}var newsLetterLightbox;function showNewsLetter(){newsLetterLightbox=new TLightBox("newsletter_lightbox");newsLetterLightbox.show()}function hideNewsletter(){newsLetterLightbox.hide()}
function openLocationDetails(a){JQ.query("div[id ^= 'location_detail_']").css("display","none");JQ.query("div[id = 'location_detail_"+a+"']").css("display","block");googlemap.map.setCenter(Map.markers[a].getPoint())}function closeLocationDetails(){JQ.query("div[id ^= 'location_detail_']").css("display","none")}function submitKenteken(){var a=$("frmKenteken");a&&checkKenteken()&&a.submit()}
function customFrmMaillistSubmit(a,b,c){var d=a.elements.edtName,e=a.elements.edtLetters;a=a.elements.selAanhef;if(d&&String(d.value)==""){alert("U heeft uw naam nog niet ingevuld.");d.focus();return b.returnValue=false}aanhef=a.value;if(c)c.value="<profile><aanhef>"+aanhef+"</aanhef><name>"+d.value.htmlEncode()+"</name><letters>"+e.value.htmlEncode()+"</letters></profile>";return true}function searchVakgarage(){$("frmSearchVakgarage").submit()}
function zoekVakgarage(a){var b=$("frmSearchVakgarage_"+a),c=$("zipcode_"+a).value;if(checkZipcode(c))b&&b.submit();else{alert("U heeft geen geldige postcode ingevoerd");$("zipcode_"+a).focus()}}function checkKenteken(){var a=$("kenteken");if(a)if(a.value.length==0){alert("U heeft nog geen kenteken ingevuld");a.focus();return false}else return true;return false}var garageLightbox;
function displayMijnGarage(){garageLightbox=new TLightBox("mijngarage");garageLightbox.show();$("frmMijnGarage").src="http://new.mijngarage.nl/home.aspx?PartnerName=dQBwAEUAYwAvAFoAUABhAFkARABwAG8AVgBuAFgAcgBHADkASgBVAHAAdwA9AD0A"}function closeMijnGarage(){garageLightbox.hide()}function checkZipcode(a){if(a.length>=4){a=a.substring(0,4);if(isNumeric(a))return true}return false}
function onSubmitZipcode(a){if(checkZipcode(a.search.value))return true;else{alert("U heeft geen geldige postcode ingevoerd");a.search.focus();return false}}function positionShoppingCart(){var a=document.getElementById("orderList");a=document.body.clientWidth}function placeOrder(a){if(confirm("Uw bestelling wordt direct geplaatst, klopt uw bestelling?"))location.href=a}
function bereken(a){if(a.value.length==0)a.value=0;var b=a.name.split("_");document.getElementById("totaal_"+b[1]).innerHTML=formatCurrency(document.getElementById("prijs_"+b[1]).innerText*a.value)}
function formatCurrency(a){a=a.toString().replace(/\$|\,/g,"");if(isNaN(a))a="0";sign=a==(a=Math.abs(a));a=Math.floor(a*100+0.50000000001);cents=a%100;a=Math.floor(a/100).toString();if(cents<10)cents="0"+cents;for(var b=0;b<Math.floor((a.length-(1+b))/3);b++)a=a.substring(0,a.length-(4*b+3))+"."+a.substring(a.length-(4*b+3));return(sign?"":"-")+""+a+","+cents}
function deleteOrder(a,b){if(confirm("Weet u zeker dat u dit product uit uw winkelwagen wilt verwijderen?")){var c=new Url;location.href=c.add("action","delete").add("bstNr",a).add("nextAction",b)}}function toggleOrderList(){var a=document.getElementById("orderList");if(a)a.style.display=a.style.display=="none"?"":"none"}
function openFlipbook(a){a=(new Url("misc/vkgFlipbook.aspx")).add("itmID",a);(a=window.open(a,"frmFlipbook","menubar=0,location=0,toolbar=0,scrollbars=0,resizable=0,status=0,width=720,height=650"))&&a.focus()};

