(function(a){a.fn.tabz=function(b){var c=a.extend({clActive:"active"},b);return this.each(function(){var e=a(this);var d=e.find("."+c.clActive+" a").attr("href");e.find("a").click(function(){(a(d).length)?a(d).hide():"";a(this).parents("li").addClass(c.clActive).siblings().removeClass(c.clActive);d=a(this).attr("href");(a(d).length)?a(d).show():"";return false})})}})(jQuery);(function(a){a.fn.clicky=function(b,c){return this.each(function(){var g=a(this);var f;if(b){f=g.find(b).eq(0)}else{f=g.find("a");if(f.length!=1){f=null}}var e=g;if(c){var d=g.find(c);e=(d.length)?d:g}if(f){e.each(function(){a(this).click(function(h){if(h.target.nodeName!="a"){window.location=f.attr("href")}h.preventDefault()}).css("cursor","pointer").attr("title",f.attr("title"))})}})}})(jQuery);(function(a){a.fn.hoverIntent=function(k,j){var l={sensitivity:7,interval:100,timeout:0};l=a.extend(l,j?{over:k,out:j}:k);var n,m,h,d;var e=function(f){n=f.pageX;m=f.pageY};var c=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);if((Math.abs(h-n)+Math.abs(d-m))<l.sensitivity){a(f).unbind("mousemove",e);f.hoverIntent_s=1;return l.over.apply(f,[g])}else{h=n;d=m;f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}};var i=function(g,f){f.hoverIntent_t=clearTimeout(f.hoverIntent_t);f.hoverIntent_s=0;return l.out.apply(f,[g])};var b=function(q){var o=(q.type=="mouseover"?q.fromElement:q.toElement)||q.relatedTarget;while(o&&o!=this){try{o=o.parentNode}catch(q){o=this}}if(o==this){return false}var g=jQuery.extend({},q);var f=this;if(f.hoverIntent_t){f.hoverIntent_t=clearTimeout(f.hoverIntent_t)}if(q.type=="mouseover"){h=g.pageX;d=g.pageY;a(f).bind("mousemove",e);if(f.hoverIntent_s!=1){f.hoverIntent_t=setTimeout(function(){c(g,f)},l.interval)}}else{a(f).unbind("mousemove",e);if(f.hoverIntent_s==1){f.hoverIntent_t=setTimeout(function(){i(g,f)},l.timeout)}}};return this.mouseover(b).mouseout(b)}})(jQuery);(function(a){a.fn.pictureViewer=function(){return this.each(function(){var d=a(this);d.find(".big").prettyPhoto({allowresize:false});var c=a(".pv-picture",d);var b=a(".pv-thumbs",d);c.find("a").click(function(){b.find("li.active > .big").click();return false});b.find("a.thumb").click(function(){var f=a(this);var e=a(this).parent("li");c.find("img").attr("src",f.siblings(".medium").attr("href")).end().find("a").attr("href",f.siblings(".big").attr("href")).end();e.addClass("active").siblings().removeClass();return false})})}})(jQuery);$(function(){$("li#nav-cats").hoverIntent({sensitivity:3,interval:100,timeout:250,over:function(){$(" div.contents",this).show()},out:function(){$(" div.contents",this).slideUp("fast")}});$("#palettes-toggler").find("a.toggle-list").click(function(){$("#wishlist_block_list").slideToggle(function(){$(this).toggleClass("collapsed")});ajaxCart.collapse();return false});var b=$("#teaser__");if(b.length){var a=[];b.find("a").each(function(){a.push({url:$(this).find("img").attr("src"),link:$(this).attr("href")})}).end().empty().showcase({animation:{interval:3200,speed:700,stopOnHover:false,easefunction:"swing",type:"scroll"},css:{},images:a,navigator:{position:"top-right",showNumber:true,orientation:"horizontal",css:{bottom:"0",padding:"10px"},item:{cssClass:"navitem",cssClassSelected:"navitem-selected",cssClassHover:"navitem-hover"}},titleBar:{enabled:false}})}if(typeof($.fn.cycle)!=="undefined"){$("#teaser-slides").cycle({fx:"scrollVert",timeout:8000,pager:"#teaser-nav",pauseOnPagerHover:1,pause:1})}$("ul.products li").add("#side-filter .set li").clicky();$("#home-categories li.cat").clicky("h2 a","img, h2");$(":input[title]").each(function(){var e=$(this);if(e.val()===""){e.val(e.attr("title"))}e.focus(function(){if(e.val()===e.attr("title")){e.val("")}});e.blur(function(){if(e.val()===""){e.val(e.attr("title"))}})});$("#product-pics").pictureViewer({allowresize:false});$(".tabs").tabz({clActive:"current"});$("#product-extras .review .r-read a").click(function(){$('a[href="#prod-reviews"]').click();document.location.href="#prod-reviews";return false});$("#product-extras .review .r-write a").click(function(){$('a[href="#prod-reviews"]').click();$("#addCommentButton").click();document.location.href="#sendComment";return false});$("#entrance").find("h2").each(function(){var e=$(this).parent().parent("form").hasClass("active");$(this).prepend('<input type="radio" class="trigger" '+(e?'checked="true"':"")+" />")}).end().find("form").click(function(f){$(this).siblings("form").removeClass("active").end().addClass("active");$("#entrance").find("input.trigger").each(function(){$(this).attr("checked",$(this).parent().parent().parent("form").hasClass("active"))})});$("#cart-table td.thumb").hoverIntent({sensitivity:1,interval:100,timeout:200,over:function(){$(this).find("img.magnified").fadeIn()},out:function(){$(this).find("img.magnified").fadeOut("fast")}}).find("img.magnified").click(function(){$(this).hide()});var c=$(".carrier-picker");c.find("> li").filter(":has(:radio:checked)").addClass("selected").siblings().removeClass("selected").end().end().bind("click",function(e){if($(this).hasClass("selected")){return false}$(this).toggleClass("selected").siblings().removeClass("selected");if(e.target.type!=="radio"){var f=$(":radio",this);f.attr("checked",!f.get(0).checked);if(e.target.nodeName!=="A"){return false}}});var d=$("#order-payment .channels");d.find("> li").filter(":has(:radio:checked)").addClass("selected").siblings().removeClass("selected").end().end().bind("click",function(e){if($(this).hasClass("selected")){return false}$(this).toggleClass("selected").siblings().removeClass("selected");if(e.target.type!=="radio"){var f=$(":radio",this);f.attr("checked",!f.get(0).checked);if(e.target.nodeName!=="A"){return false}}});$("#order-shipping .gift p.tick").bind("click",function(e){var f=$(":checkbox",this);if(e.target.type!=="checkbox"){f.attr("checked",!f.get(0).checked);if(e.target.nodeName!=="A"){e.preventDefault()}}if(f.get(0).checked){$("#order-shipping .gift .message").slideDown()}else{$("#order-shipping .gift .message").slideUp()}})});