
function parseNumber(string){return parseFloat(string.replace('.','').replace(',','.'));}
function formatCurrency(num){num=num.toString().replace(/\$|\,/g,'');if(isNaN(num))
num="0";sign=(num==(num=Math.abs(num)));num=Math.floor(num*100+0.50000000001);cents=num%100;num=Math.floor(num/100).toString();if(cents<10)
cents="0"+cents;for(var i=0;i<Math.floor((num.length-(1+i))/3);i++)
num=num.substring(0,num.length-(4*i+3))+'.'+
num.substring(num.length-(4*i+3));return(num+','+cents);}
function el(id){return document.getElementById(id);}
function setCookie(name,value,days,path,domain,secure){var expires,date;if(typeof days=="number"){date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));expires=date.toGMTString();}
document.cookie=name+"="+escape(value)+
((expires)?"; expires="+expires:"")+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+
((secure)?"; secure":"");}
function getCookie(name){var nameq=name+"=";var c_ar=document.cookie.split(';');for(var i=0;i<c_ar.length;i++){var c=c_ar[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameq)==0)return unescape(c.substring(nameq.length,c.length));}
return null;}
function deleteCookie(name,path,domain){if(getCookie(name)){document.cookie=name+"="+
((path)?"; path="+path:"")+
((domain)?"; domain="+domain:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";}}
function switchdisplayByClass(container,value,classname){if(value){newclassname=' none';}else{newclassname='';}
newclassname=classname+newclassname;element=el(container);if(element.tagName=='DIV'){for(i=0;i<element.childNodes.length;i++){subelement=element.childNodes[i];if(subelement.tagName=='DIV'&&subelement.className.indexOf(classname)>=0){subelement.className=newclassname;}}}else{rows=table.rows.length;for($i=0;$i<rows;$i++){row=table.rows[$i];if(row.className.indexOf(classname)>=0){row.className=newclassname;}}}}
function setFilter(name,value,newurl){var url='/apps/js_php_call.php?function=setFilterVariable&value='+name+';'+value;if(typeof newurl!="undefined"){document.location=newurl+'/FilterVariable='+name+';'+value;}else{doAjax(url,1);}}
function doAjax(url,update){if(typeof(Ajax)!='undefined'){new Ajax.Request(url,{method:'get',onSuccess:function(transport){if(update==1){pageupdate();}
if(typeof update=='string'){if(eval('typeof '+update)=='function'){eval(update);}}},onFailure:function(transport){alert(transport);}});}else{document.location=url+'&pageback=true';}}
function doObjAjax(obj,id,method,array){var url='/apps/js_php_call.php?function=doObjAjax';var str_array='';for(i=0;i<array.length;i++){str_array+='&array['+i+']='+array[i];}
new Ajax.Request(url,{method:'post',postBody:'obj='+obj+'&method='+method+str_array+'&id='+id,onSuccess:function(transport){pageupdate();},onFailure:function(transport){}});}
function update(url){if(String(url).indexOf('/?')==-1){append='/?';}else{append='&';}
url=url+append+'callajax=true';new Ajax.Updater('page',url,{method:'get'});return false;}
function urlupdate(url){update(url);}
function pageupdate(){var url=document.location;return update(url);}
function setSort(sort){var url='/apps/js_php_call.php?function=setSort&value='+sort;doAjax(url,1);}
function delFilter(name){var url='/apps/js_php_call.php?function=delFilterVariable&value='+name;doAjax(url,1);}
function makemenu(){con=el('HEADER_TABS');for(i=0;i<con.childNodes.length;i++){if(con.childNodes[i].tagName=="A"){con.childNodes[i].onmouseover=showsubmenu;}}}
function hidemenu(){con=el('HEADER_SUBMENU');for(i=0;i<con.childNodes.length;i++){if(con.childNodes[i].tagName=="DIV"){con.childNodes[i].className='none';}}}
function showsubmenu(){hidemenu();id=this.id.replace('head_item_','subitem_');element=el(id);element.className='';}
function product_in_cookie_array(productid,set){if(set){days=180;}else{days=-1;}
setCookie("product["+productid+"]",productid,days,"/");new Ajax.Updater('showSelectedContainer_top','/apps/js_php_call.php?function=selectedProduct&value='+productid+';'+set+';top',{method:'get'});new Ajax.Updater('showSelectedContainer_bottom','/apps/js_php_call.php?function=selectedProduct&value='+productid+';'+set+';bottom',{method:'get'});}
function updateAddress(div,addressid,contactid){new Ajax.Updater(div,'/apps/js_php_call.php?function=getaddress&value='+addressid+';'+contactid,{method:'get'});}
function registerUpadateAddresses(){delivery=el('delivery');delivery.onchange=function(){updateAddress('deliverybox',this.value,el('deliveryuser').value);}
invoice=el('invoice');invoice.onchange=function(){updateAddress('invoicebox',this.value,el('invoiceuser').value);}
delivery=el('deliveryuser');delivery.onchange=function(){updateAddress('deliverybox',el('delivery').value,this.value);}
invoice=el('invoiceuser');invoice.onchange=function(){updateAddress('invoicebox',el('invoice').value,this.value);}}
function setSession(name,value){var url='/apps/js_php_call.php?function=setSessionVariable&value='+name+';'+value;doAjax(url,0);}
function showAltText(event){element=el(event);element.style.display='block';element2='description'+event;elementdescription=el(element2)
element3='showspecdescription'+event;elementshowspecdescription=el(element3)}
function showHideExplanation(event){element=el(event);if(element.style.display!='block'){element.style.display='block';}else{element.style.display='none';}}
function highlight(id,aantal){if(!aantal){aantal=0;}
for(i=0;i<aantal;i++){document.getElementById('feature_group_'+i).style.borderStyle='none';}
document.getElementById('feature_group_'+id).style.border='thin solid #00638b';}
function productInshoppingcart(product,location,parent){new Ajax.Request('/apps/js_php_call.php?function=addProductTotal&value='+product,{method:'get',onSuccess:function(transport){if(parent==1){top.opener.document.location=location;}else{document.location=location;}},onFailure:function(transport){alert('Er is een fout opgetreden uw product is niet toegevoegd aan de winkelwagen. Neem contact met ons op.');}})}
function ListinShoppingCart(){var nameq='product';var c_ar=document.cookie.split(';');for(var i=0;i<c_ar.length;i++){var c=c_ar[i];if(c.substring(1,(nameq.length+1))==nameq){product=(c.substring(c.indexOf('=')+1));inShoppingCart(product,'','',false);}}
return true;}
function inShoppingCart(product,type,location,asynchronousvalue){if(typeof(asynchronous)=='undefined'){asynchronous=true;}
if(location!=''&&typeof(location)!='undefined'){new Ajax.Request('/apps/js_php_call.php?function=addProduct&value='+product+';'+type,{method:'get',asynchronous:asynchronousvalue,onSuccess:function(transport){document.location=location;},onFailure:function(transport){alert('Er is een fout opgetreden uw product is niet toegevoegd aan de winkelwagen. Neem contact met ons op.');}})}else{new Ajax.Updater('HEADER_CONTAINER_RIGHT','/apps/js_php_call.php?function=addProduct&value='+product+';'+type,{method:'get'});new Ajax.Updater('shoppingBasket','/apps/js_php_call.php?function=getShoppingcart',{method:'get'});}}
function changeProductamount(element,product,bool,minimum){var object=el(element);if(object.tagName=='INPUT'){var objectValue=object.value;}else{var objectValue=object.innerHTML;}
if(bool){objectValue++;}else{if(objectValue>minimum){objectValue--;}}
setProductInSession(product,'',objectValue,'amount','local');}
function addAccessoryToProduct(id,productid,value,type){amount=1;if(!value){amount=0;}
setProductInSession(id,productid,amount,type);}
function updateShoppingCartReturnBig(product,amount,type){new Ajax.Request('/apps/js_php_call.php?function=updateProduct&value='+product+';'+amount+';1',{method:'get',onSuccess:function(transport){element=el('shopcontent');if(!element){element=el('page');}
element.innerHTML=transport.responseText;new Ajax.Updater('shoppingBasket','js_php_call.php?function=getShoppingcart',{method:'get'});new Ajax.Updater('HEADER_CONTAINER_RIGHT','/apps/js_php_call.php?function=getShoppcartsmall',{method:'get'});}});}
function setProductInSession(productid,id,amount,type,local){if(type=='accessory'){var accessoryPrice=parseNumber(el('price_'+id).innerHTML);if(amount<0||isNaN(amount)){amount=0;}}else if(type=='warranty'){var accessoryPrice=parseNumber(el('priceWarranty_'+id).innerHTML);if(amount<0||isNaN(amount)){amount=0;el('w_'+id).value=0;}}else if(type=='amount'){if(amount<=0||isNaN(amount)){amount=1;}
var accessoryPrice=parseNumber(el('prodprice').innerHTML);el('product_amount').innerHTML=amount;}
localelement=el(local);localprice=0;if(localelement&&localelement.checked){localprice=1;}
new Ajax.Request('/apps/js_php_call.php?function=setProductInSession&value='+productid+';'+id+';'+amount+';'+type+';'+localprice,{method:'get',onSuccess:function(transport){var array=eval('('+transport.responseText+')');if(array[0]==''&&array[1]==''){el('accessoryText').style.display='none';el('onlinePriceNormal').style.display='none';el('onlinePriceAdvantage').style.display='none';}else{el('accessoryText').style.display='block';el('onlinePriceNormal').style.display='block';el('onlinePriceAdvantage').style.display='block';}
if(array[0]!=''&&array[1]!=''){array[0]=array[0]+"<br>";}
el('textAccessory').innerHTML=array[0];el('textWarranty').innerHTML=array[1];if(type=='accessory'){var accessoryPrice=parseNumber(el('price_'+id).innerHTML);var normalAccessoryPrice=parseNumber(el('standardprice_'+id).innerHTML);var oldAmount=array[3];}else if(type=='warranty'){var accessoryPrice=parseNumber(el('priceWarranty_'+id).innerHTML);var normalAccessoryPrice=parseNumber(el('standardPriceWarranty_'+id).innerHTML);var oldAmount=array[3];}else if(type=='amount'){var accessoryPrice=parseNumber(el('prodprice').innerHTML);var normalAccessoryPrice=parseNumber(el('prodprice').innerHTML);var oldAmount=array[4];}
var totalAccessoryPriceOld=oldAmount*accessoryPrice;var totalPrice=(el('totalPrice').innerHTML);var newTotalPrice=totalPrice-totalAccessoryPriceOld;var totalAccessoryPrice=array[2]*accessoryPrice;newTotalPrice=newTotalPrice+totalAccessoryPrice;var newTotalPriceInc=newTotalPrice*1.19;el('totalPrice').innerHTML=(newTotalPrice);var totalNormalAccessoryPriceOld=oldAmount*normalAccessoryPrice;var totalPriceNormal=(el('totalPriceNormal').innerHTML);var newTotalPriceNormal=totalPriceNormal-totalNormalAccessoryPriceOld;var totalAccessoryPriceNormal=array[2]*normalAccessoryPrice;newTotalPriceNormal=newTotalPriceNormal+totalAccessoryPriceNormal;el('totalPriceNormal').innerHTML=(newTotalPriceNormal);if(newTotalPriceNormal>newTotalPrice){var priceAdvantage=newTotalPriceNormal-newTotalPrice;el('onlinePriceAdvantage').innerHTML='Door gelijktijdig te bestellen bespaart u &euro; '+formatCurrency(priceAdvantage*1.19)+'.';}
el('onlinePriceEx').innerHTML=formatCurrency(newTotalPrice);el('onlinePriceInc').innerHTML=formatCurrency(newTotalPriceInc);var url='/apps/js_php_call.php?function=setTotalPriceInSession&value='+productid+';'+newTotalPrice+';'+newTotalPriceNormal;doAjax(url,0);},onFailure:function(transport){}})}
function updatesupplybrand(value,target){updatesupplyfields();updateoptions(target,'/apps/js_php_call.php?function=getsupplybrands&value='+value);}
function updatesupplyproductline(value,target){updatesupplyfields();updateoptions(target,'/apps/js_php_call.php?function=getsupplyproductline&value='+value);}
function updatelampproductline(value,target){updateoptions(target,'/apps/js_php_call.php?function=getlampproductline&value='+value);}
function showHideObject(source,failurevalue,target){var obj=document.getElementById(target);if(source.value==failurevalue||source.value==null){obj.style.display='none';}else{obj.style.display='block';}}
function hideObjectIfNotValue(source,succesvalue,target){var obj=document.getElementById(target);if(source.value!=succesvalue){obj.style.display='none';}else{obj.style.display='block';}}
function updatesupplyfields(){sup1=el('sup_niveau1');sup2=el('sup_niveau2');sup3=el('sup_niveau3');button=el('supSearch');if(sup1.value==999){sup2.disabled=true;sup3.disabled=true;}
if(sup3.value!=999){button.style.display='block';}}
function updateoptions(target,url){var obj=document.getElementById(target);new Ajax.Request(url,{method:'get',onSuccess:function(transport){var items=eval('('+transport.responseText+')');obj.options.length=0;for(i=0;i<items.value.length;i++){obj.options[obj.options.length]=new Option(items.title[i],items.value[i]);}
if(i>1){obj.disabled=false;}else{obj.disabled=true;}},onFailure:function(transport){}});}
function enableDisableObjects(source,failurevalue,target){var obj=document.getElementById(target);if(source.value==failurevalue||source.value==null){obj.disabled=true;}else{obj.disabled=false;}}
function countCables(niv1,niv2,niv3,niv4){display='inline';if(niv1.value==999&&niv2.value==999&&niv3.value==999&&niv4.value==999){display='none';}
swap('utp_zoek',display);new Ajax.Updater('countCable','/apps/js_php_call.php?function=countCables&value='+niv1+';'+niv2+';'+niv3+';'+niv4,{method:'get'});}
function var_dump(data){var string='';for(var i in data){string+=i+' => '+data[i]+"\r\n";}
alert(string);}
function postformcontainer(id,url,containerid,submit,noCrumbs){try{actionelement=el('submit_action');actionelement.value=submit;}catch(err){}
element=el(id);if(element.getAttribute("action").indexOf('/?callajax=true')==-1){element.setAttribute('action',element.getAttribute("action")+'/?callajax=true');}
if(noCrumbs==1&&element.getAttribute("action").indexOf('/?nocrumbs=true')==-1&&element.getAttribute("action").indexOf('&nocrumbs=true')==-1){element.setAttribute('action',element.getAttribute("action")+'&nocrumbs=true');}
Element.extend(element);element.request({onComplete:function(transport){el(containerid).innerHTML=transport.responseText;}});}
function swapPicture(target,target2){if(target){document.getElementById(target).style.display='none';}
if(target2){document.getElementById(target2).style.display='block';}}
function swap(target,newdisplay){if(typeof target!="object"){target=el(target);}
if(target!=null){if(newdisplay==null){newdisplay='block';if(target.style.display!='none'){newdisplay='none';}}
target.style.display=newdisplay;}}
function swapClass(id,class1,class2){id=el(id);use_this_class=class1;if(id.className==class1){use_this_class=class2;}
id.className=use_this_class;}
function updatedeliveryinfo(element,infoelement){name=element.attributes['name'].value;var array=document.getElementsByName(name);newdisplay='none';checkdisplay='inline';if(element.checked){newdisplay='block';checkdisplay='none';}
for(i=0;i<array.length;i++){if(array[i].value!=element.value){swap(array[i].parentNode,checkdisplay);array[i].checked=false;}}
el('dtav').value='';el('dzipcode').value='';el('dhousenumber').value='';el('dbedrijf').value='';swap(infoelement,newdisplay);}
function showElement(obj){target=document.getElementById(obj);target.style.display="block";}
function hideElement(obj){target=document.getElementById(obj);target.style.display="none";}
function checkAllOrderStates(field){for(i=0;i<field.length;i++){if(field[i].parentNode.parentNode.style.display!='none'){field[i].checked=true;}}}
function unCheckHiddenOrderStates(field){for(i=0;i<field.length;i++){if(field[i].parentNode.parentNode.style.display=='none'){field[i].checked=false;}}}
function checkAll(field){for(i=0;i<field.length;i++){field[i].checked=true;}}
function uncheckAll(field){for(i=0;i<field.length;i++)
field[i].checked=false;}
function extendCloseAllOrders(type){var divType='orderExtended';listOrder=el('FOUND_ORDERS');var divs=listOrder.getElementsByTagName("DIV");for(i=0;i<divs.length;i++){var name=divs[i].id;var length=divType.length;if(divType==name.substring(0,length)){divElement=el(divs[i].id);if(type=='extend'){divElement.style.display='block';}else if(type=='close'){divElement.style.display='none';}}}}
function isPostBoxNotByDeliver(){billingstreet=el('bstreet').value;delliverystreet=el('dstreet').value;bool=el('billingaddressisdeliveryaddressyes').checked;returnbool=true;billingpos=billingstreet.toLowerCase().indexOf('postbus');deliverypos=delliverystreet.toLowerCase().indexOf('postbus');if((billingpos!=-1&&bool)||deliverypos!=-1){alert('Het afleveradres mag geen postbus adres zijn!');returnbool=false;}
return returnbool;}
function checkaddress(type,zipcode,housenumber,address,city,warning){setTimeout("doCheckAddress('"+type+"', '"+zipcode+"', '"+housenumber+"', '"+address+"', '"+city+"', '"+warning+"')",500);}
function checkkvk(kvk,name,kindofcomp,workplaces,tel,coc_bic){var myRequest=new Ajax.Request('js_php_call.php?function=getCustomer&value='+kvk,{onSuccess:function(transport){var customer=eval('('+transport.responseText+')');el(name).value=customer.bedrijfnaam;el(kindofcomp).value=customer.soortbedrijf;el(workplaces).value=customer.werkplekken;el(tel).value=customer.tel1;el(coc_bic).value=customer.coc_bik;}});}
function trim(str){return str.replace(/^\s*|\s*$/g,"");}
function getAddress(zipcode,housenumber,type){zipvalue=trim(el(zipcode).value);housenumbervalue=trim(el(housenumber).value);if(type=='I'){filled='billingaddressisfilled';}else{filled='deliveryaddressisfilled';}
element=el(filled);element.value='';setTimeout('doUpdateAddress("'+zipvalue+'","'+housenumbervalue+'","'+type+'")',500);}
function checkZipcode(zipvalue){var stripped=zipvalue.replace(/[\ ]/g,'');var part1=stripped.substr(0,4);var part2=stripped.substr(4);var valid=false;if(stripped.length!=6){valid=false;}else if(!(part1.length==4)||isNaN(part1)){valid=false;}
else if(!(part2.length==2)||!isNaN(part2.substr(0,1))||!isNaN(part2.substr(1))){valid=false;}else{valid=true;}
return valid;}
function doUpdateAddress(zipvalue,housenumbervalue,type){if((zipvalue!=''&&checkZipcode(zipvalue))&&housenumbervalue!=''){var myRequest=new Ajax.Request('/apps/js_php_call.php?function=checkAddress&value='+zipvalue+';'+housenumbervalue+';'+type,{onSuccess:function(transport){var adresinfo=eval('('+transport.responseText+')');updateAddress(adresinfo,type);}})}}
function updateAddress(adres,type){if(type=='I'){explanation='BILLINGADDRESS_EXPLANATION';waiting='BILLINGADDRESS_WAITING';notfound='BILLINGADDRESS_NOT_FOUND';streetdisplay='bstreetdisplay';street='bstreet';place='bplace';showadres='BILLINGADDRESS_SHOW_ADDRESS';filled='billingaddressisfilled';}else{explanation='DELIVERYADDRESS_EXPLANATION';waiting='DELIVERYADDRESS_WAITING';notfound='DELIVERYADDRESS_NOT_FOUND';streetdisplay='dstreetdisplay';street='dstreet';place='dplace';showadres='DELIVERYADDRESS_SHOW_ADDRESS';filled='deliveryaddressisfilled';}
swap(explanation,'none');if(adres.errormessage.length>0){swap(notfound,'block');el(filled).value='1';swap(showadres,'none');swap(waiting,'none');}else{el(streetdisplay).innerHTML=adres.straatnaam_nen+' '+adres.huisnummer+', '+adres.plaatsnaam;el(street).value=adres.straatnaam_nen;el(place).value=adres.plaatsnaam;el(filled).value='2';swap(notfound,'none');swap(showadres,'block');swap(waiting,'none');}}
function checkkvk(kvk){var myRequest=new Ajax.Request
('/apps/js_php_call.php?function=getCustomer&value='+kvk,{onSuccess:function(transport){var customer=eval('('+transport.responseText+')');updatekvk(customer);}});}
function updatekvk(customer){el('bedrijfsnaam').value=customer.bedrijfnaam;el('werkplekken').value=customer.werkplekken;el('rechtsvorm').value=customer.soortbedrijf;el('telefoon').value=customer.tel1;el('bzipcode').value=customer.saadres.postcode;el('bhousenumber').value=customer.saadres.huisnummer;explanation='BILLINGADDRESS_EXPLANATION';streetdisplay='bstreetdisplay';street='bstreet';place='bplace';showadres='BILLINGADDRESS_SHOW_ADDRESS';filled='billingaddressisfilled';swap(explanation,'none');el(streetdisplay).innerHTML=customer.saadres.adres+' '+customer.saadres.huisnummer+', '+customer.saadres.plaats;el(street).value=customer.saadres.adres;el(place).value=customer.saadres.plaats;el(filled).value='2';swap(showadres,'block');}
function updateshopaddress(key,arraystring,type){array=eval('('+arraystring+')');adres=array[key];if(typeof(adres)=='undefined'){adres=new Object();adres.id='';adres.bedrijf='';adres.tav='';adres.adres='';adres.huisnummer='';adres.postcode='';adres.plaats='';adres.kenmerk='';showdisplay='none';explanationdisplay='block';}else{showdisplay='block';explanationdisplay='none';el(type+'streetdisplay').innerHTML=adres.adres+' '+adres.huisnummer+' '+adres.plaats;}
if(type=='d'){swap('DELIVERYADDRESS_EXPLANATION',explanationdisplay);swap('DELIVERYADDRESS_SHOW_ADDRESS',showdisplay);}
el(type+'id').value=adres.id;el(type+'street').value=adres.adres;if(el(type+'kenmerk')){el(type+'kenmerk').value=adres.kenmerk;}
el(type+'housenumber').value=adres.huisnummer;el(type+'zipcode').value=adres.postcode;el(type+'place').value=adres.plaats;tav=el(type+'tav');if(tav){tav.value=adres.tav}
bedrijf=el(type+'bedrijf');if(bedrijf){bedrijf.value=adres.bedrijf}}
function delproductalert(id){var url='/apps/js_php_call.php?function=delproductalert&value='+id;doAjax(url,1);}
function delAllFilters(){var url='/apps/js_php_call.php?function=delAllFilterVariables';doAjax(url,1);}
function setFilterArray(arrayFilter,brand,newurl){delAllFilters();var i;var qstring='';for(i in arrayFilter){qstring+=i+';'+arrayFilter[i]+'||';}
if(typeof newurl!="undefined"&&typeof brand!="undefined"){newurl=newurl+'/'+brand;}else if(typeof newurl!="undefined"&&typeof brand=="undefined"){}
var url='/apps/js_php_call.php?function=setFilterVariableFromArray&value='+newurl+'^'+qstring;doAjax(url,'browserGoTo(\''+newurl+'\')');}
function browserGoTo(url){document.location=url;}
function limitLength(obj){var mlength=obj.getAttribute?parseInt(obj.getAttribute("limitlength")):""
if(obj.getAttribute&&obj.value.length>mlength)
obj.value=obj.value.substring(0,mlength)}
function enableAllFields(){var f=document.getElementsByTagName('input');for(var i=0;i<f.length;i++){if(f[i].getAttribute('type')=='text'){f[i].removeAttribute('disabled')}}}
function removeProductGroupFromShoppingcart(type){new Ajax.Updater('page','/apps/js_php_call.php?function=removeProductGroupFromShoppingcart&value='+type,{method:'get'});new Ajax.Updater('shoppingBasket','/apps/js_php_call.php?function=getShoppingcart',{method:'get'});new Ajax.Updater('HEADER_CONTAINER_RIGHT','/apps/js_php_call.php?function=getShoppcartsmall',{method:'get'});}
function searchBox(ID,input){var ZOEK='zoek uw product...';var TYP='typ hier de naam van het product...';var PROBEER='probeer het opnieuw...';if(input==ZOEK||input==TYP||input==PROBEER||input==''){el(ID).style.background='#d00222';el(ID).style.color='#ffffff';if(input==ZOEK){el(ID).value=TYP;}
if(input==TYP){el(ID).value=ZOEK;}
if(input==PROBEER){el(ID).value=TYP;}
if(input==''){el(ID).value=TYP;}
return false;}}
function searchBox_Clear(ID,status){if(status==0||(status!=0&&status!=el(ID).value)){el(ID).value='';}}
function startChatSession(){var url='/apps/js_php_call.php?function=chat&value=active';doAjax(url,0);showChat();return true;}
function hide_unhideChat(status){var url='/apps/js_php_call.php?function=hidechat&value='+status;doAjax(url,0);hide_chat=status;return true;}
function showChat(){el('CHAT_BOX_BAR_TEXT').innerHTML='<img src="https://content.takeitnow.nl/tin_site_images/chat_animation.gif" alt="" title="">Chatbox geopend. <a href="javascript:hideChat();">Klik hier om te verbergen</a>.';el('SHOW_HIDE_CHAT').style.display='block';el('HIDE_CHAT').style.display='block';el('SHOW_CHAT').style.display='none';el('CHAT_BREAK').style.display='block';if(el('CHAT_FORM')!=null){el('CHAT_FORM').id='CHAT_FORM_COMPLETE';var div=el('CHAT_BOX_BAR_INPUT');var x=div.getElementsByTagName('textarea');var textarea=x[0];textarea.className='chat_box_bar_input_complete';if(textarea.value=='VRAAG? Stel \'m hier...'){textarea.value='';}
div.id='CHAT_BOX_BAR_INPUT1';}
el('CHAT_BOX_INFO').style.display='block';el('HEADER').style.height=396+"px";el('CHAT_BOX').style.height=230+"px";if(hide_chat){hideChat();}}
function swapChatButtons(){el('CHAT_BOX_BAR_SEND_BTN').style.display='block';el('CHAT_BOX_BAR_SEND_BTN1').style.display='none';}
function startFaultyChat(){showChat();swapChatButtons();}
function checkChatInput(element){if(element.value=='VRAAG? Stel \'m hier...'){element.value='';}
swapChatButtons();}
function chatSessionActive(){return chatting;}
function checkEnter(e){var keynum;if(window.event)
{keynum=e.keyCode;}
else if(e.which)
{keynum=e.which;}
if(keynum==13){startChatSession();}}
function hideChat(){el('HIDE_CHAT').style.display='none';el('SHOW_CHAT').style.display='block';el('CHAT_FORM_COMPLETE').style.display='none';el('CHAT_BOX_INFO').style.display='none';el('HEADER').style.height=186+"px";el('CHAT_BOX').style.height=20+"px";el('CHAT_BOX_BAR_TEXT').innerHTML='<img src="https://content.takeitnow.nl/tin_site_images/chat_animation.gif" alt="" title="">Chatbox verborgen. <a href="javascript:reactivateChat();">Klik hier om te openen</a>.';hide_unhideChat(true);}
function reactivateChat(){hide_unhideChat(false);showChat();el('CHAT_FORM_COMPLETE').style.display='block';}
function showHide(element){display=element.style.display;if(display==''||display=='none'){newdisplay='block';}else{newdisplay='none';}
element.style.display=newdisplay;}
function showIdHideId(showId,hideId){show=el(showId);hide=el(hideId);showHide(show);showHide(hide);}
var divHeightChanger=Class.create();divHeightChanger.prototype={div:null,divFullHeight:0,divMaxHeight:0,divToShowIfFullHeightExceedsMaxHeight:null,initialize:function(divName,divMaxHeight,divToShowIfFullHeightExceedsMaxHeight){this.div=el(divName);this.divFullHeight=this.div.offsetHeight;this.divMaxHeight=divMaxHeight;this.divToShowIfFullHeightExceedsMaxHeight=divToShowIfFullHeightExceedsMaxHeight;},showDivFullHeight:function(){this.div.style.height=this.divFullHeight+'px';},showDivMaxHeight:function(){this.div.style.height=this.divMaxHeight+'px';},setMaxDivHeight:function(){if(this.divFullHeight>this.divMaxHeight){this.div.style.height=this.divMaxHeight+'px';if(this.divToShowIfFullHeightExceedsMaxHeight){el(this.divToShowIfFullHeightExceedsMaxHeight).style.display='block';}}}}
function elclass(classname){return document.getElementsByClassName(classname);}
var enter_pressed=false;function disableEnterSubmit(){var code;var e=window.event;if(e.keyCode){code=e.keyCode;}else if(e.which){code=e.which;}
if(code==13){enter_pressed=true
setTimeout('enableEnterSubmit()',500);}}
function enableEnterSubmit(){enter_pressed=false}
function disableEnterFormSubmit(){if(enter_pressed===true){return false;}else{return true;}}
function checkPlaceOrderForm(){if(el('couponcodeinput').value!=''){el('ORDER_PLACE_ORDER').action='';}else{el('ORDER_PLACE_ORDER').action='orderbevestiging';}
return disableEnterFormSubmit();}