var $j=jQuery.noConflict();$j(document).ready(function(){$j('#block-best_verkocht').after($j('#block-montage'));$j('#block-best_verkocht').after($j('#block-kwantumkorting'));$j('.block-tags:first').before($j('#block-newsletter'));if($j('#slider').length>0)
{$j('#slider p').hide();}
$j('#narrow-by-list select').change(function(){var val=$j(this).val();location.href=val;});$j('input#newsletter').focus(function(){var value=$j(this).attr('value');if(value=='e-mail adres'){$j(this).attr('value','');}});$j('input#newsletter').blur(function(){var value=$j(this).attr('value');if(value==''){$j(this).attr('value','e-mail adres');}});$j('#nav li ul').hide();$j("#nav li.active").each(function(i){$j(this).children('ul').show();$j(this).children('a').addClass('active');});var height_left=$j(".left-column").height()+40;var height_center=$j('.center-column').height();var height_right=$j('.right-column').height()-85;if(height_left>height_center&&height_left>height_right)
{var contentheight=height_left;}
else if(height_center>height_right)
{var contentheight=($j("body").hasClass('cms-home'))?height_center+170:height_center;}
else
{var contentheight=height_right;}
$j('.left-column').height(contentheight);$j("span.price").each(function(i){var prijs=$j(this).text();prijs_new=prijs.replace("€","<span>€</span>");$j(this).replaceWith('<span class="price">'+prijs_new+'</span>');});if($j("#cart-sidebar").html()==null)
{$j('.block-cart').removeAttr('onclick');$j('.block-cart').css('cursor','default');}
if($j('span#compare_note').length&&$j('ol#compare-items li').length>1)
{$j('span#compare_note').html($j('.compare_link:first').clone());}
if($j('#checkout-step-billing:visible').length)
{}
if($j('table#shopping-cart-totals-table').length)
{var cart_verzending_1=$j('table#shopping-cart-totals-table tbody tr:first').next().children('th').text();var cart_verzending_2=$j('table#shopping-cart-totals-table tbody tr:first').next().next().children('th').text();cart_verzending_1=$j.trim(cart_verzending_1).toLowerCase();cart_verzending_2=$j.trim(cart_verzending_2).toLowerCase();if(cart_verzending_1.indexOf('verzending en afhandeling')==0||cart_verzending_2.indexOf('verzending en afhandeling')==0)
{$j('span#carttotals_verzending').hide();}}
$j('#billing\\:type1').click(function(){setFormField('disable',$j('#p_method_checkmo'));setFormField('enable',$j('#p_method_ig_cashondelivery'));$j('#billing\\:company').attr('disabled','disabled');$j('input#billing\\:is_subscribed').parent('li').removeClass('no-display');$j('input#billing\\:is_subscribed2').removeAttr('checked');});$j('#billing\\:type2').click(function(){setFormField('enable',$j('#p_method_checkmo'));setFormField('disable',$j('#p_method_ig_cashondelivery'));$j('#billing\\:company').removeAttr('disabled');$j('input#billing\\:is_subscribed').parent('li').addClass('no-display');$j('input#billing\\:is_subscribed2').attr('checked','checked');});if(Ajax.Responders){Ajax.Responders.register({onComplete:function(response){window.scrollTo(0,0);if(response.url.include("saveBilling")||response.url.include("set_methods_separate"))
{$j('#shipping\\:street1').removeAttr('value');$j('#shipping\\:street2').removeAttr('value');$j('#shipping\\:street3').removeAttr('value');$j('#shipping\\:postcode').removeAttr('value');$j('#shipping\\:city').removeAttr('value');$j('#shipping\\:same_as_billing').removeAttr('checked');}
if(response.url.include("saveBilling"))
{if($j('#s_method_rembour_rembour').is(':checked'))
{setFormField('disable',$j('#p_method_msp_ideal'));}}
if(response.url.include("saveShippingMethod"))
{$j('#label_ig_cashondelivery').append($j('#payment_form_ig_cashondelivery .price'));$j('#payment_form_ig_cashondelivery').remove();if(!$j('#s_method_freeshipping_freeshipping').attr('checked'))
{setFormField('disable',$j('#p_method_bankpayment'));}
if($j('#billing\\:type1').is(':checked'))
{setFormField('disable',$j('#p_method_checkmo'));setFormField('enable',$j('#p_method_ig_cashondelivery'));}
else
{setFormField('enable',$j('#p_method_checkmo'));setFormField('disable',$j('#p_method_ig_cashondelivery'));}}}});}
function setFormField(type,obj)
{if(type=='disable')
{obj.attr('disabled','disabled');obj.next('label').hide();obj.parent('dt').hide();}
else
{obj.removeAttr('disabled');obj.next('label').show();obj.parent('dt').show();}}
$j('#container_payment_method_bankpayment').remove();$j('#payment_form_bankpayment').remove();$j('#p_method_bankpayment').live('click',function(){$j('#container_payment_method_bankpayment').remove();$j('#payment_form_bankpayment').remove();});$j('#billing\\:type1').trigger('click');setPostcodeValidatie($j('#billing\\:country_id'),$j('#billing\\:postcode'));setPostcodeValidatie($j('#shipping\\:country_id'),$j('#shipping\\:postcode'));function setPostcodeValidatie(obj,selector)
{var sel_value=obj.val();if(sel_value=='NL')
{selector.removeClass('validate-postcode-be');selector.addClass('validate-postcode-nl');}
else if(sel_value=='BE')
{selector.removeClass('validate-postcode-nl');selector.addClass('validate-postcode-be');}
else if(sel_value=='DE')
{selector.addClass('validate-postcode-de');}}
$j('#billing\\:country_id').change(function(){setPostcodeValidatie($j(this),$j('#billing\\:postcode'));});$j('#shipping\\:country_id').change(function(){setPostcodeValidatie($j(this),$j('#shipping\\:postcode'));});$j('#checkout-payment-method-load label').live('click',function(){$j('#checkout-payment-method-load label').removeClass('active');$j(this).addClass('active');$j(this).prev('input.radio').attr('checked','checked');});if($j('#slider').length>0)
{var timeout=6000;$j('#slider p').each(function(i){var slide_id=i+1;$j(this).attr('id','slide_'+slide_id);$j(this).addClass('slide');if(slide_id==1)
{$j(this).show();}});slider_timer=setInterval("nextSlide()",timeout);}
$j('#slider_nav a').click(function(){var slide_id=$j(this).attr('id');slide_id=parseInt(slide_id.substr(11));showSlide(slide_id);clearInterval(slider_timer);slider_timer=setInterval("nextSlide()",timeout);});});function nextSlide()
{var next_slide=getActiveSlide()+1;if($j('#slide_'+next_slide).length==0)
{next_slide=1;}
showSlide(next_slide);}
function showSlide(slide_id)
{$j('#slider p').hide();$j('#slide_'+slide_id).fadeIn(1000);}
function getActiveSlide()
{var active_slide=$j('#slider').find('.slide:visible').attr('id');active_slide=parseInt(active_slide.substr(6));return active_slide;}
function setActiveStep(section)
{var step=section.replace('opc-','');$j('.checkout-stap').removeClass('active');switch(step)
{case'payment':$j('#checkout-stap3').addClass('active');break;case'review':$j('#checkout-stap4').addClass('active');break;default:case'billing':$j('#checkout-stap2').addClass('active');break;}}
$j.fn.setLayeredNav=function()
{var body_class=$j('body').attr('class');if(body_class.indexOf('categorypath-afvalemmers-en-afvalbakken')>-1||body_class.indexOf('categorypath-keukenkranen')>-1||body_class.indexOf('categorypath-spoelbakken')>-1||body_class.indexOf('cms-page-view')>-1)
{$j('#narrow-by-list .filter:nth-child(3n)').addClass('last');var height_1=$j('.block-layered-nav .block-content').height();var height_2=$j('.block-layered-nav_top').height();var height_3=$j('.block-layered-nav_bottom').height();var total_height=height_1+height_2+height_3;$j(this).height(total_height);}
else
{$j(this).hide();}};function distilledCheckAnalyticsCookie(){var cookiename="__utma";var cookiecheck=0;var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){while(cookies[i].charAt(0)==' ')cookies[i]=cookies[i].substring(1,cookies[i].length);if(cookies[i].indexOf(cookiename+'=')==0){cookiecheck=1;}}
return cookiecheck;}
function distilledTruncate(input){var byteLength=63;if(encodeURIComponent(input).substr(byteLength-2,1)=="%"){truncatedInput=decodeURIComponent(encodeURIComponent(input).substr(0,byteLength-2));}else if(encodeURIComponent(input).substr(byteLength-1,1)=="%"){truncatedInput=decodeURIComponent(encodeURIComponent(input).substr(0,byteLength-1));}else{truncatedInput=decodeURIComponent(encodeURIComponent(input).substr(0,byteLength));}
return truncatedInput;}
function distilledFirstTouch(pageTracker){try{if(distilledCheckAnalyticsCookie()===0){pageTracker._setCustomVar(1,"l",distilledTruncate(window.location.pathname),1);pageTracker._setCustomVar(2,"s",distilledTruncate(window.location.search),1);pageTracker._setCustomVar(3,"r",distilledTruncate(document.referrer.substr(7,document.referrer.length)),1);pageTracker._setCustomVar(4,"q",distilledTruncate(document.referrer.match(/(?:([#]|[?]|[&]))(?:(encquery|k|p|q|qs|qt|query|rdata|search_word|szukaj|terms|text|wd|words))=[^&]*/i)[0]),1);}}catch(err){}}
function asyncDistilledFirstTouch(asyncStack){try{if(distilledCheckAnalyticsCookie()===0){asyncStack.push(['_setCustomVar',1,"l",distilledTruncate(window.location.pathname),1]);asyncStack.push(['_setCustomVar',2,"s",distilledTruncate(window.location.search),1]);asyncStack.push(['_setCustomVar',3,"r",distilledTruncate(document.referrer.substr(7,document.referrer.length)),1]);asyncStack.push(['_setCustomVar',4,"q",distilledTruncate(document.referrer.match(/(?:([#]|[?]|[&]))(?:(encquery|k|p|q|qs|qt|query|rdata|search_word|szukaj|terms|text|wd|words))=[^&]*/i)[0]),1]);}}catch(err){}}
function asyncDistilledFirstTouchOverwrite(){if(distilledCheckAnalyticsCookie()!=0){var savedReferrer=readCookie('__utmv');console.log(savedReferrer);}}
function readCookie(cookiename){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){while(cookies[i].charAt(0)==' ')cookies[i]=cookies[i].substring(1,cookies[i].length);if(cookies[i].indexOf(cookiename+'=')==0){return unescape(cookies[i]);}}
return false;}
