function customBodyLoad(a,b){(new Url).page()=="verkooppunten.aspx"&&initGoogleMap()}function customBodyResize(a,b){}function customBodyScroll(a){}
function initGoogleMap(){var a=new Url;if(document.getElementById("divGoogle"))if(GBrowserIsCompatible()){baseIcon=new GIcon;baseIcon.image=server+"img/"+imgRoot+"/mapsIcon.png";baseIcon.iconSize=new GSize(37,38);baseIcon.shadow=server+"img/"+imgRoot+"/mapsShadow.png";baseIcon.shadowSize=new GSize(53,38);baseIcon.iconAnchor=new GPoint(18,19);baseIcon.infoWindowAnchor=new GPoint(18,19);orangeIcon=new GIcon;orangeIcon.image=server+"img/"+imgRoot+"/mapsIcon.png";orangeIcon.iconSize=new GSize(37,38);
orangeIcon.shadow=server+"img/"+imgRoot+"/mapsShadow.png";orangeIcon.shadowSize=new GSize(53,38);orangeIcon.iconAnchor=new GPoint(18,19);orangeIcon.infoWindowAnchor=new GPoint(18,19);greenIcon=new GIcon;greenIcon.image=server+"img/"+imgRoot+"/mapsIconGreen.png";greenIcon.iconSize=new GSize(37,38);greenIcon.shadow=server+"img/"+imgRoot+"/mapsShadow.png";greenIcon.shadowSize=new GSize(53,38);greenIcon.iconAnchor=new GPoint(18,19);greenIcon.infoWindowAnchor=new GPoint(18,19);map=new GMap2(document.getElementById("divGoogle"));
center=new GLatLng(52.17,5.45);map.setCenter(center,7);map.addControl(new GLargeMapControl);map.addControl(new GMapTypeControl);map.addControl(new GOverviewMapControl)}else alert("Helaas is uw browser niet geschikt voor deze kaart.")}var map,center,orangeIcon,greenIcon;markers=[];
function onGetMarkers(a,b){a=GXml.parse(a).documentElement.getElementsByTagName("item");b=document.getElementById("divVerkooppunten");for(var c="",d=0;d<markers.length;d++)map.removeOverlay(markers[d]);markers=[];for(d=0;d<Math.min(a.length,90);d++){var e="mapsIcon.png";if(a[d].getAttribute("assortiment")=="1")e="mapsIconGreen.png";c+='<a class="list" href="javascript:popup( '+d+' );">\t<span style="width:200px; float:left"> \t<span style="font-weight:bold;">'+a[d].getAttribute("name")+"</span>\t<span>"+
a[d].getAttribute("straat")+" "+a[d].getAttribute("huisnr")+"</span>\t<span>"+a[d].getAttribute("stad")+"</span>"+(a[d].getAttribute("telefoon")!=""?"<span>T: "+a[d].getAttribute("telefoon")+"</span>":"")+'\t</span> \t<span style="float:left; width:50px;"> \t\t<img onclick="popup( '+d+' )" src="'+server+"img/"+imgRoot+"/"+e+'"/>\t</span> </a>';markers[d]=getMarker(a[d])}if(b){if(c=="")c="Er zijn geen verkooppunten gevonden.";b.innerHTML=c}}
function getMarker(a){var b=parseFloat(a.getAttribute("lat")),c=parseFloat(a.getAttribute("lng")),d=new GIcon(orangeIcon);if(isNaN(b)||isNaN(c))return null;if(a.getAttribute("assortiment")=="1")d=new GIcon(greenIcon);var e=new GMarker(new GLatLng(b,c),d);map.addOverlay(e);e.info='<div class="mapsTitle">'+a.getAttribute("name")+'</div><div class="mapsContent">\t<span>'+a.getAttribute("straat")+" "+a.getAttribute("huisnr")+"</span>\t<span>"+a.getAttribute("stad")+"</span>"+(a.getAttribute("telefoon")!=
""?"T: "+a.getAttribute("telefoon"):"")+"</div>";GEvent.addListener(e,"click",function(){e.openInfoWindowHtml(e.info,{maxWidth:420})});return e}function edtPostcodeChange(a,b){if(a.value&&String(a.value).length>=1&&String(a.value)!="uw postcode/plaatsnaam"){b=new Url;b=b.replacePage("misc/getVerkooppunten.aspx");b=b.add("edtPostcode",a.value);b=b.add("rnd",rndString());GDownloadUrl(b,onGetMarkers)}else{alert("Vul uw postcode, plaatsnaam of een gedeelte daarvan in.");a.focus()}}
function edtPostcodeSuggest(a){a.element.value=a.value;edtPostcodeChange(a.element)}function edtPostcodeGetData(a){a=a.element.value;var b=[];if(a!=null)a=a.toLowerCase();for(var c=0;c<cities.length;c++){if(a==null||cities[c].toLowerCase().contains(a))b.add(cities[c]);if(b.length>9)break}return b}function popup(a){markers[a].openInfoWindowHtml(markers[a].info,{maxWidth:420})}Product=function(a,b,c,d,e,f){this.ID=a;this.name=b;this.prijs=parseFloat(c);this.aantal=d;this.nummer=e;this.inhoud=f};
function getProduct(a){var b=a.parentNode.parentNode.id.split("|");return b.length>5&&b[0]=="tr"?new Product(b[1],b[2],b[3],a.value,b[4],b[5]):null}
function edtProductChange(a,b){var c=getProduct(a);Log.write("product != null",c!=null);if(c!=null){b=bestelling.items.getRow("ID",c.ID);Log.write("row",b);Log.write("product.aantal",c.aantal);Log.write("parseInt( product.aantal ) > 0",parseInt(c.aantal)>0);if(c.aantal&&parseInt(c.aantal)>0)if(b==null)b=bestelling.items.addRow(c.ID,c.name,c.prijs,c.aantal,c.nummer,c.inhoud);else b.fields.aantal.value(c.aantal);else if(b!=null){bestelling.items.removeRow(b);a.value=""}Log.write("row",b);if(bestelling.gegevens.rows.length)b=
bestelling.gegevens.rows[0];else{b=bestelling.gegevens.addRow();b.fields.accoord.value(false)}for(c=a=0;c<bestelling.items.rows.length;c++)a+=bestelling.items.rows[c].fields.prijs.value()*bestelling.items.rows[c].fields.aantal.value();b.fields.totaal.value(a);a>50?b.fields.verzendkosten.value(0):b.fields.verzendkosten.value(5)}else{b.returnValue=false;b.cancelBubble=true;return false}}
function bestel(){for(var a=0,b=0;b<bestelling.items.rows.length;b++)a+=bestelling.items.rows[b].fields.aantal.value();if(a>0)document.location.href=(new Url).add("bestel",1);else alert("U heeft nog niets besteld.")}function openBestelling(a){(a=window.open(a,"frmBestelling","width=640,height=800,scrollbars=1,resizable=1"))&&a.focus()}function betaalwijzeChange(a,b){if(b=Html.get("divWarning"))b.style.display=a.value()==0?"":"none"}
function iDeal(){if(bestelling.gegevens.rows[0].fields.aanhef.value())if(bestelling.gegevens.rows[0].fields.voorletters.value())if(bestelling.gegevens.rows[0].fields.achternaam.value())if(bestelling.gegevens.rows[0].fields.adres.value())if(bestelling.gegevens.rows[0].fields.huisnr.value())if(bestelling.gegevens.rows[0].fields.postcode.value())if(bestelling.gegevens.rows[0].fields.plaats.value())if(bestelling.gegevens.rows[0].fields.telefoon.value())if(bestelling.gegevens.rows[0].fields.email.value())if(isEmail(bestelling.gegevens.rows[0].fields.email.value()))if(bestelling.gegevens.rows[0].fields.email2.value())if(bestelling.gegevens.rows[0].fields.email.value()!=bestelling.gegevens.rows[0].fields.email2.value()){alert("Uw e-mailadres en de bevestiging komen niet overeen.");
document.getElementById("edtEmail2").focus()}else if(bestelling.gegevens.rows[0].fields.betaalwijze.value()==null){alert("U heeft nog geen betaalwijze ingevuld.");document.getElementById("rBtnBetaalwijze1").focus()}else if(!bestelling.gegevens.rows[0].fields.rekeningnr.value()&&bestelling.gegevens.rows[0].fields.betaalwijze.value()==2){alert("U heeft uw rekeningnummer nog niet ingevuld.");document.getElementById("edtRekeningnummer").focus()}else if(bestelling.gegevens.rows[0].fields.accoord.value()!=
true){alert("U bent nog niet accoord gegaan met de voorwaarden.");document.getElementById("cbAccoord").focus()}else{var a=new Url;document.location.href=a.replacePage("misc/specific/payment.aspx")}else{alert("U heeft de bevestiging van uw e-mailadres nog niet ingevuld.");document.getElementById("edtEmail2").focus()}else{alert("U heeft een foutief e-mailadres nog ingevuld.");document.getElementById("edtEmail").focus()}else{alert("U heeft uw e-mailadres nog niet ingevuld.");document.getElementById("edtEmail").focus()}else{alert("U heeft uw telefoonnummer nog niet ingevuld.");
document.getElementById("edtTelefoonnummer").focus()}else{alert("U heeft uw woonplaats nog niet ingevuld.");document.getElementById("edtPlaats").focus()}else{alert("U heeft uw postcode nog niet ingevuld.");document.getElementById("edtPostcode").focus()}else{alert("U heeft uw huisnummer nog niet ingevuld.");document.getElementById("edtHuisnr").focus()}else{alert("U heeft uw adres nog niet ingevuld.");document.getElementById("edtAdres").focus()}else{alert("U heeft uw achternaam nog niet ingevuld.");
document.getElementById("edtAchternaam").focus()}else{alert("U heeft uw voorletters nog niet ingevuld.");document.getElementById("edtVoorletters").focus()}else{alert("U heeft de aanhef nog niet ingevuld.");document.getElementById("rBtnAanhefM").focus()}};

