function goBackButton(){var e=$("<div>").attr("id","go_back");var c=$('<span class="button type_f go_back_button"><em class="pre"> </em><span>Go Back</span><em class="post"> </em></span>');var b=$("<a>");var a="fcp_last_category";if(window.location.href.indexOf("redirect=true")==-1&&$.cookie(a)!=null&&!(window.location.href==$.cookie(a))){b.attr("href",$.cookie(a))}else{if($("ul#crumbs li.last").length>0){var d=$("ul#crumbs li.last").find("a:first");if(d.length==0){d=$("ul#crumbs li.last").prev().find("a:first")}b.attr("href",d.attr("href"))}}if(b.attr("href")!=null){e.append(b.append(c));$("div#guide").append(e)}}(function(a){a.fn.frescaFilter=function(l){var h=a(this);var b=a("li.product");function k(){h.find("li.filter_group li").mouseover(function(m){if(a(this).hasClass("filter_selected")){a(this).addClass("filter_selected_hover")}a(this).addClass("filter_hover")}).mousedown(function(m){if(!a(this).find("a:first").hasClass("filter_disabled")){d(a(this).find("a:first"));i();g();a("#products .product .product_sizes").each(function(){a(this).css("height","auto")});setHeight();a(this).find("a:first").addClass("get_counters")}}).mouseup(function(m){if(!a(this).hasClass("filter_selected")){a(this).removeClass("filter_selected_hover")}if(!a(this).find("a:first").hasClass("filter_disabled")){c()}a(this).find("a:first").removeClass("get_counters")}).mouseout(function(m){a(this).removeClass("filter_hover").removeClass("filter_selected_hover");if(a(this).find("a:first").hasClass("get_counters")){c()}}).click(function(m){m.preventDefault()}).keypress(function(m){if(m.keyCode==13){d(a(this).find("a:first"));i();g();a("#products .product .product_sizes").each(function(){a(this).css("height","auto")});setHeight();c()}});a("p.counter").prepend('<span id="js_product_count"></span>&nbsp;of&nbsp;');e()}function f(n){var m=n.parents("ul.hidden_filter:first");var p=a("<ul class='extracted_filter'>");var o=a("<ul class='hidden_filter open open_listing'>");var q=false;m.find("li").each(function(){if(q){o.append(a(this))}else{if(a(this).hasClass("filter_selected")){q=true}}});p.prepend(n);if(o.find("li").length>0){m.after(o)}m.after(p)}function j(p){var n=p.parents("ul.extracted_filter:first");var o=n.prev();var m=n.next();if(o.hasClass("hidden_filter")){o.append(p);n.remove()}else{n.removeClass("extracted_filter").addClass("hidden_filter");if(n.parent().find("ul.open").length>0){n.addClass("open_listing")}o=n}if(m.hasClass("hidden_filter")){m.find("li").each(function(){o.append(a(this))});if(m.hasClass("hidden_filter")){m.remove()}}}function d(m){m.toggleClass("filter_selected");m.parent("li").toggleClass("filter_selected");if(m.hasClass("filter_selected")&&m.parents("ul.colour").length>0){var n=m.find("img:first");n.attr("src",n.attr("src").replace(".gif","_1.gif"))}else{if(m.parents("ul.colour").length>0){var n=m.find("img:first");n.attr("src",n.attr("src").replace("_1.gif",".gif"))}else{if(m.parents("ul:first").hasClass("hidden_filter")||m.parents("ul:first").hasClass("extracted_filter")){if(m.hasClass("filter_selected")){f(m.parent("li"))}else{j(m.parent("li"))}}}}if(m.parents("li.filter_group").find("a.filter_selected").length>0){m.parents("li.filter_group").addClass("filter_group_active")}else{m.parents("li.filter_group").removeClass("filter_group_active")}}function i(){a(b).removeClass("partial_exclude").css("display","block");h.find(".filter_group_active").each(function(){a("li.product").addClass("partial_exclude");a(this).find("a.filter_selected").each(function(){a("li."+a(this).attr("id")).removeClass("partial_exclude")});a("li.partial_exclude").css("display","none")})}function g(){a("ul#products li.divider").remove();a("ul#products li.first").removeClass("first");a("ul#products li.last").removeClass("last");var m=0;a("li.product:visible").each(function(n){m++;if(m%4===0){a(this).addClass("last");a(this).after('<li class="divider">&nbsp;</div>')}else{if(m%4===1){a(this).addClass("first")}}})}function c(){var p=a("p.counter");var o;var m;var n=0;h.find("a").not(".more_filters").each(function(q){o=a(b).filter("."+a(this).attr("id"));m=a(this).parents("li.filter_group");a(m).siblings(".filter_group_active").each(function(){a(this).find("a.filter_selected").each(function(){a(o).filter("."+a(this).attr("id")).addClass("partialInclude")});o=a(o).filter(".partialInclude").removeClass("partialInclude")});count=o.length;if(count>0){a(this).removeClass("filter_disabled")}else{a(this).removeClass("filter_selected").addClass("filter_disabled")}});e()}function e(){var m=a("li.product:visible").length;a("span#js_product_count").empty().append(m)}k()}})(jQuery);function setHeight(){var b=1;var a=4;var d=0;var c=new Array();$("#products .product:visible .product_sizes").each(function(){height=$(this).outerHeight();if(height>d){d=height}if(b==a){c.push(d);d=0;b=0}b++});if(b<=a){c.push(d)}setQuickBuyHeight(c)}function setQuickBuyHeight(c){var b=1;var a=4;var d=0;$("#products .product:visible .product_sizes").each(function(){$(this).css("height",c[d]+"px");if(b%a==0){d++}b++})}function initCustomFilters(){if($("li.fPRICE0").length==0){$("#fPRICE0").css("display","none")}if($("li.fPRICE30").length==0){$("#fPRICE30").css("display","none")}if($("li.fPRICE40").length==0){$("#fPRICE40").css("display","none")}if($("li.fPRICE50").length==0){$("#fPRICE50").css("display","none")}if($("li.fPRICE75").length==0){$("#fPRICE75").css("display","none")}$("p.filter_title").click(function(){var b=$(this);var a=b.parent().find("div.filter_content");if(!a.hasClass("closed")){a.addClass("closed");a.stop().slideUp("slow");b.find("span").addClass("tab_closed").removeClass("tab_open")}else{a.removeClass("closed");a.stop().slideDown("slow");b.find("span").addClass("tab_open").removeClass("tab_closed")}});$("p.filter_show_hide a").click(function(){var b=$(this);var a=b.parents(".filter_group").find("ul.hidden_filter");if(!a.hasClass("open")){a.slideDown("fast").addClass("open");$(this).html($(this).html().replace("more","fewer"));b.parents(".filter_group").find("ul.hidden_filter").each(function(){$(this).addClass("open_listing")})}else{a.slideUp("fast",function(){$(this).css("display","none")}).removeClass("open");$(this).html($(this).html().replace("fewer","more"));b.parents(".filter_group").find("ul.hidden_filter").each(function(){$(this).removeClass("open_listing")})}return false})}window.onload=function(){if($("ul#products").length>0){$("ul#apply_filter").frescaFilter()}initCustomFilters()};$(document).ready(function(){goBackButton();$("select#sortby").change(function(){$(this).parent().parent().submit()});if($("li.product").length<400){setHeight()}});
