jQuery(document).ready(function(){slideShow = new rockSlide("#slideshow","left",500,5000,"");jQuery("#leftArrow").click(function(){slideShow.next();}
);jQuery("#rightArrow").click(function(){slideShow.previous();}
);jQuery(".valForm").val("true");if(jQuery("#slider-range").length > 0){jQuery("#slider-range").slider({range:true,min:parseInt(jQuery("#filterMin").val()),max:parseInt(jQuery("#filterMax").val()),values:[ parseInt(jQuery("#filterMinSlider").val().replace("\u20ac ","")),parseInt(jQuery("#filterMaxSlider").val().replace("\u20ac ","")) ],slide:function( event,ui ){jQuery("#filterMinSlider").val("\u20ac "+ui.values[0]);jQuery("#filterMaxSlider").val("\u20ac "+ui.values[1]);}
}
);}

  //COOKIES
  jQuery("div.cookieWide div.cookieButton").click(function(){
    var d = new Date();
    d.setTime(d.getTime() + (365*24*60*60*1000));
    var expires = "expires="+ d.toUTCString();
    if(jQuery("#cookieStats").prop("checked")){
      document.cookie = "CookieStats=" + jQuery("#cookieStats").prop("checked") + ";" + expires + ";path=/";
    } else {
      document.cookie = "CookieStats=0;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/";
    }
    if(jQuery("#cookieAds").prop("checked")){
      document.cookie = "CookieAds=" + jQuery("#cookieAds").prop("checked") + ";" + expires + ";path=/";
    } else {
      document.cookie = "CookieAds=0;expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/";
    }
    document.cookie = "CookieAVG=true;" + expires + ";path=/";
    window.location.reload();
  });
  jQuery("div.cookieWide div.cookieSettings").click(function(){
    jQuery(this).hide();
    jQuery("div.cookieWide div.checkBoxHolder").css("display","inline-block");
  });
  
  jQuery("#cookieSettings, #cookieSettingsMobile").click(function(){
    jQuery(".cookieWideHolder").show();
  });
  
  //CHECKBOX
  jQuery(".checkBox:not(.forced)").click(function(){
    jQuery(this).children("div.box").children("span").toggleClass("active");
    if(jQuery(this).children("div.box").children("span").hasClass("active")){
      jQuery(this).children("input").prop('checked', true);
    } else {
      jQuery(this).children("input").prop('checked', false);
    }
  });   
  
  jQuery(".showAllProducts").click(function(){
    jQuery(".productHolder").show();
    jQuery(this).hide();
    //jQuery("article.hero").hide();
    //jQuery("div.heroContent").hide();
  });    

jQuery('.productHolder').infinitescroll({loading:{msgText:" <div class='loadingDiv'>    <img src='/images/loading.gif' /></div>",}
,pixelsFromNavToBottom:jQuery(".blogHolder").height() + jQuery("article.hero").height() + jQuery("footer").height() + 400,navSelector:".paginationHolder",nextSelector:"a#next",itemSelector:".productHolder a",path:function(index){if(window.location.search.substr(0,4) == "?utm"){url = window.location.pathname;    }
else{url = window.location.pathname + window.location.search;    }
//url = window.location.pathname + window.location.search;    urlParts = url.split("/");    if(urlParts[urlParts.length-1].substr(0,5) == "limit" || urlParts[urlParts.length-1] == ""){urlParts.pop();      url = urlParts.join("/");    }
return url + "/limit" + index;  }
}
);jQuery(".colorBlock").mouseenter(function(){jQuery(this).children("span").css("display","block");}
).mouseleave(function(){code = jQuery(this).attr("id").substring(10);if(jQuery("#colorCheck"+code).is(":checked")){jQuery("#colorBlock"+code).children("span").css("display","block");}
else{jQuery("#colorBlock"+code).children("span").css("display","none");}
}
);}
);function swapColorCheck(code){if(jQuery("#colorCheck"+code).is(":checked")){jQuery("#colorCheck"+code).prop('checked',false);jQuery("#colorBlock"+code).children("span").css("display","none");}
else{jQuery("#colorCheck"+code).prop('checked',true);jQuery("#colorBlock"+code).children("span").css("display","block");}
}
var menuExpanded = false;function toggleMenu(){if (menuExpanded){jQuery(".menuItem").fadeOut();menuExpanded = false;}
else{jQuery(".menuItem").fadeIn();menuExpanded = true;}
}