var loggedonuser=false;function setUserLoggedOn(){loggedonuser=true;}
function verderWinkelen(){document.location.href="/product/vlag_introductie/&category=43&nav_active=1010";}
function bestelWinkelwagen(){if(loggedonuser){document.location.href="/bestellen/adres/";}
else{document.location.href="/bestellen/registreren/";}}
function addToWinkelwagen(){if(!document.productform){return false;}
var total=0;for(var j=0;j<document.productform.elements.length;j++)
if(document.productform.elements[j].name=="count[]")
if(isInt(document.productform.elements[j].value))
total+=document.productform.elements[j].value;else{alert(document.productform.elements[j].value+" is geen geldig aantal.");return false;}
if(total==0)
alert("U heeft geen producten geselecteerd welke u in de winkelwagen wenst te plaatsen.");else
document.productform.submit();return false;}
function viewWinkelwagen(){document.location.href="/winkelwagen/&nav_active=420";}
function updateWinkelwagen(product,aantal,warning){if(!isInt(aantal)){if(warning)
alert(aantal+" is geen geldig aantal.");}
else{var query={"ct":"winkelwagenajax","__cms_Wmwinkelwagen":"true","__function_Wmwinkelwagen":"update","product":product,"count":aantal};ajaxEngine.sendRequest("winkelwagenUpdate",{parameters:query},{onComplete:WinkelwagenUpdater.ajaxUpdate});if(aantal==0){document.getElementById('row_'+product).style.display="none";}}}
function isInt(value){if(value==undefined)
return false;var numbers="0123456789";var chr;var result=true;if(value.length==0)return false;for(i=0;i<value.length&&result==true;i++){chr=value.charAt(i);if(numbers.indexOf(chr)==-1)
result=false;}
return result;}
function textValue(node){if(node.textContent==undefined)
return node.text;else
return node.textContent;}
var WinkelwagenUpdater=Class.create();WinkelwagenUpdater.prototype={initialize:function(){},ajaxUpdate:function(ajaxResponse){var ajaxResponse=ajaxResponse.getElementsByTagName("winkelwagenUpdate");ajaxResponse=ajaxResponse[0];if(ajaxResponse.getAttribute("total")==0){viewWinkelwagen();}
else{for(var i=0;i<ajaxResponse.childNodes.length;i++){node=ajaxResponse.childNodes[i];if(node.nodeName=="winkelwagen"){document.getElementById(textValue(node.getElementsByTagName('uitvoering_id')[0])+"_stukprijs").innerHTML=textValue(node.getElementsByTagName('prijs')[1]);document.getElementById(textValue(node.getElementsByTagName('uitvoering_id')[0])+"_subtotaal").innerHTML=textValue(node.getElementsByTagName('prijs')[0]);}
else if(node.nodeName=="kostenoverzicht"){document.getElementById('subtotaal').innerHTML=textValue(node.getElementsByTagName('subtotaal')[0]);document.getElementById('verzendkosten').innerHTML=textValue(node.getElementsByTagName('verzendkosten')[0]);if(document.getElementById('handlingkosten')){document.getElementById('handlingkosten').innerHTML=textValue(node.getElementsByTagName('handlingkosten')[0]);}
document.getElementById('subtotaalverzendkosten').innerHTML=textValue(node.getElementsByTagName('subtotaalverzendkosten')[0]);document.getElementById('btw').innerHTML=textValue(node.getElementsByTagName('btw')[0]);document.getElementById('totaal').innerHTML=textValue(node.getElementsByTagName('totaal')[0]);}}}}}
function stepBack(step){if(step==100){document.location.href="/winkelwagen/&nav_active=420";return;}
document.orderform.__cms_Wmshipmateorderwizard.value="false";document.orderform.step.value=step;document.orderform.submit();}
function stepForward(){document.orderform.submit();}
var klantFields=new Array(new Array("f_bedrijf",1),new Array("f_klantnummer",0),new Array("f_naam",0),new Array("f_adresgegevens",0),new Array("f_login",0),new Array("f_gevondenvia",0),new Array("f_tel",0),new Array("f_btw",1),new Array("f_website",1));var show="block";var hide="none";function showKlantForm(zakelijk){hideAllFields();if(zakelijk==""){return;}
else{if((zakelijk==1)||(zakelijk=="ja"))
zakelijk=true;else if((zakelijk==0)||(zakelijk=="nee"))
zakelijk=false;showAppropriateFields(zakelijk);}}
function showBezorgAdres(show,elementname){if(show){document.getElementById("bezorgadres").style.display='block';clearAdres();}
else{if(typeof(lastSelectedBezorg)!="undefined"&&elementname!="bezorg"){$A(document.orderform.getInputs("radio","bezorg")).each(function(radiobutton){if(radiobutton.value==lastSelectedBezorg){radiobutton.checked=true;}});}
document.getElementById("bezorgadres").style.display='none';}}
function showFactuurAdres(show,elementname){if(show){document.getElementById("factuuradres").style.display='block';clearFactuur();}
else{if(typeof(lastSelectedFactuur)!="undefined"&&elementname!="factuur"){$A(document.orderform.getInputs("radio","factuur")).each(function(input){if(input.value==lastSelectedFactuur){input.checked=true;}});}
document.getElementById("factuuradres").style.display='none';}}
function showAppropriateFields(zakelijk){for(var i=0;i<klantFields.length;i++)
if(klantFields[i][1]==1){if(zakelijk)
displayField(klantFields[i],show);}
else
displayField(klantFields[i],show);}
function hideAllFields(){for(var i=0;i<klantFields.length;i++)
displayField(klantFields[i],hide);}
function displayField(field,display){document.getElementById(field[0]).style.display=display;}
function clearAdres(){if(typeof(document.orderform.bezorg.length)=="undefined"){document.orderform.bezorg.checked=false;}
else{for(var i=0;i<document.orderform.bezorg.length;i++){document.orderform.bezorg[i].checked=false;}}}
function clearFactuur(){if(typeof(document.orderform.factuur.length)=="undefined"){document.orderform.factuur.checked=false;}
else{for(var i=0;i<document.orderform.factuur.length;i++){document.orderform.factuur[i].checked=false;}}}
function showProductFoto(foto,border,producttype,remake){var producttype=(producttype!="product")?producttype:"";var extraclassinfo=(producttype!="")?" pos_"+producttype+"popup stl_"+producttype+"popup":"";if(document.getElementById("productfotopopup")){if(remake){var html="<div class='pos_productfotopopupclose stl_productfotopopupclose'>";html+="<a href='#' onclick='document.getElementById(\"productfotopopup\").style.visibility=\"hidden\"; return false'>Sluit venster X</a></div>";html+="<img alt='Product foto' src='"+foto+"_shadow.gif'/></div>";document.getElementById("productfotopopup").innerHTML=html;document.getElementById("productfotopopup").style.visibility="visible";}
else{document.getElementById("productfotopopup").style.visibility="visible";}}
else{var html="<div id='productfotopopup' class='pos_productfotopopup stl_productfotopopup "+extraclassinfo+"'>";html+="<div class='pos_productfotopopupclose stl_productfotopopupclose'>";html+="<a href='#' onclick='document.getElementById(\"productfotopopup\").style.visibility=\"hidden\"; return false'>Sluit venster X</a></div>";if(border==true){html+="<img alt='Product foto' src='"+foto+"_shadow.gif'/></div>";}
else{html+="<img class='pos_noshadow stl_noshadow' alt='Product foto' src='"+foto+"'/></div>";}
var newdiv=document.body.appendChild(document.createElement("div"));newdiv.innerHTML=html;}
return false;}
function fotoError(image,size){image.src="/images/geenafbeelding"+size+".gif";if($("fotovergroten")){$("fotovergroten").innerHTML="";}}
function showPopup(link){document.getElementById('meerinfopopup').style.visibility="visible";ajaxEngine.registerRequest('infoBrowser','/index.php');ajaxEngine.registerAjaxElement('infoBrowser',document.getElementById('meerinfopopupcontent'));ajaxEngine.sendRequest('infoBrowser',{parameters:"ct=ajaxtekst&dt=ajax&page="+link});return true;}
function wizardPopup(link){document.getElementById('meerinfopopup').style.visibility="visible";ajaxEngine.registerRequest('infoBrowser','/index.php');ajaxEngine.registerAjaxElement('infoBrowser',document.getElementById('meerinfopopupcontent'));ajaxEngine.sendRequest('infoBrowser',{parameters:"ct=ajaxtekst&dt=Wmmastwizard&page="+link});return true;}
function showPopuplevering(link){document.getElementById('meerinfopopup').style.visibility="visible";}
function showPopupleveringsvoorwaarden(link){showPopup(link);}
var InfoBrowser=Class.create();InfoBrowser.prototype={initialize:function(){},ajaxUpdate:function(ajaxResponse){if(ajaxResponse.childNodes.length>0){document.getElementById("popuptitle").innerHTML=textValue(ajaxResponse.getElementsByTagName("titel")[0]);document.getElementById("popuptekst").innerHTML=textValue(ajaxResponse.getElementsByTagName("tekst")[0]);if(ajaxResponse.getElementsByTagName("image")[0])
document.getElementById("popupimage").innerHTML="<img alt='Shipmate Product' src='"+textValue(ajaxResponse.getElementsByTagName("image")[0])+"'/>";else
document.getElementById("popupimage").innerHTML="";}}};var searchedFrom;var LandenSearcher=Class.create();LandenSearcher.prototype={initialize:function(){},ajaxUpdate:function(ajaxResponse){if(ajaxResponse.childNodes[0].childNodes.length>0){sDiv=this.createSuggestionDiv();this.fillSuggestionDiv(ajaxResponse.childNodes[0].childNodes,sDiv);sDiv.style.display='block';input=document.getElementById(searchedFrom+"_container");}},fillSuggestionDiv:function(nodes,sDiv){for(var i=0;i<nodes.length;i++)
if(nodes[i].textContent!=undefined)
this.addLandOption(textValue(nodes[i]),sDiv);else
this.addLandOption(textValue(nodes[i]),sDiv);},addLandOption:function(land,div){div.innerHTML+="<div onclick='selectLand(\""+searchedFrom+"\", \""+escape(land)+"\");'>"+land+"</div>";},createSuggestionDiv:function(){var div=document.getElementById('suggestions');if(!div){input=document.getElementById(searchedFrom+"_container");div=input.appendChild(document.createElement('div'));div.className='pos_landsuggest stl_landsuggest';div.id='suggestions';}
else{input=document.getElementById(searchedFrom+"_container");div=input.appendChild(div);}
div.innerHTML="";return div;}};function selectLand(id,land){var div=document.getElementById('suggestions');div.style.display="none";document.getElementById(id).value=unescape(land);document.getElementById(id).form.submit();}
function searchLanden(portion,category,id){if(document.getElementById('suggestions')){document.getElementById('suggestions').innerHTML="";}
if(portion==""){if(document.getElementById('suggestions'))
document.getElementById('suggestions').style.display="none";return;}
searchedFrom=id;ajaxEngine.sendRequest("landenSearch","ct=landensearch","query="+portion,"category="+category);}