(function(A){A.fn.extend({reflect:function(B){B=A.extend({height:1/3,opacity:0.5},B);return this.unreflect().each(function(){var D=this;if(/^img$/i.test(D.tagName)){function C(){var K=D.width,L=D.height,F,I,E,J,G;I=Math.floor((B.height>1)?Math.min(L,B.height):L*B.height);if(A.browser.msie){F=A("<img />").attr("src",D.src).css({width:K,height:L,marginBottom:I-L,filter:"flipv progid:DXImageTransform.Microsoft.Alpha(opacity="+(B.opacity*100)+", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy="+(I/L*100)+")"})[0]}else{F=A("<canvas />")[0];if(!F.getContext){return }J=F.getContext("2d");try{A(F).attr({width:K,height:I});J.save();J.translate(0,L-1);J.scale(1,-1);J.drawImage(D,0,0,K,L);J.restore();J.globalCompositeOperation="destination-out";G=J.createLinearGradient(0,0,0,I);G.addColorStop(0,"rgba(255, 255, 255, "+(1-B.opacity)+")");G.addColorStop(1,"rgba(255, 255, 255, 1.0)");J.fillStyle=G;J.rect(0,0,K,I);J.fill()}catch(H){return }}A(F).css({display:"block",border:0});E=A(/^a$/i.test(D.parentNode.tagName)?"<span />":"<div />").insertAfter(D).append([D,F])[0];E.className=D.className;A.data(D,"reflected",E.style.cssText=D.style.cssText);A(E).css({width:K,height:L+I,overflow:"hidden"});D.style.cssText="display: block; border: 0px";D.className="reflected"}if(D.complete){C()}else{A(D).load(C)}}})},unreflect:function(){return this.unbind("load").each(function(){var D=this,B=A.data(this,"reflected"),C;if(B!==undefined){C=D.parentNode;D.className=C.className;D.style.cssText=B;A.removeData(D,"reflected");C.parentNode.replaceChild(D,C)}})}})})(jQuery);jQuery(function(A){A.fn.customFileInput=function(){return A(this).each(function(){var D=A(this).addClass("customfile-input").mouseover(function(){C.addClass("customfile-hover")}).mouseout(function(){C.removeClass("customfile-hover")}).focus(function(){C.addClass("customfile-focus");D.data("val",D.val())}).blur(function(){C.removeClass("customfile-focus");A(this).trigger("checkChange")}).bind("disable",function(){D.attr("disabled",true);C.addClass("customfile-disabled")}).bind("enable",function(){D.removeAttr("disabled");C.removeClass("customfile-disabled")}).bind("checkChange",function(){if(D.val()&&D.val()!=D.data("val")){D.trigger("change")}}).bind("change",function(){var G=A(this).val().split(/\\/).pop();var F="customfile-ext-"+G.split(".").pop().toLowerCase();E.text(G).removeClass(E.data("fileExt")||"").addClass(F).data("fileExt",F).addClass("customfile-feedback-populated");A("span",B).text("Change")}).click(function(){D.data("val",D.val());setTimeout(function(){D.trigger("checkChange")},100)});var C=A('<div class="customfile"></div>');var B=A('<span class="customfile-button button" aria-hidden="true"><span>Select file</span></span>').appendTo(C);var E=A('<span class="customfile-feedback" aria-hidden="true">No file selected</span>').appendTo(C);if(D.is("[disabled]")){D.trigger("disable")}C.mousemove(function(F){D.css({left:F.pageX-C.offset().left-D.outerWidth()+20,top:F.pageY-C.offset().top-A(window).scrollTop()-3})}).insertAfter(D);D.appendTo(C)})};A(".gallery").each(function(){if((jQuery.browser.msie)&&(jQuery.browser.version<7)){return }var B;var C=A(".figure",this);if(C.length<2){return }var D=A("<ul>").addClass("thumbnail-list");C.each(function(){A(this).hide();var E=A(this).attr("id");var G=A("<li>");var F=A("<a>",{href:"#"+E});F.click(function(){var H=A(this).attr("href");A(".gallery .target").fadeOut("fast");A(".gallery .target").removeClass("target");A(H).fadeIn();A(H).addClass("target");A(".gallery .active").removeClass("active");A(this).parent().addClass("active");return false});A("p",this).clone().appendTo(F);A("img",this).clone().attr("alt","").appendTo(F);F.appendTo(G);G.appendTo(D)});A("<h2>Click on an image to enlarge</h2>").appendTo(".gallery");D.appendTo(".gallery");A(".thumbnail-list li a",this).eq(Math.floor(Math.random()*C.length)).click();B=true});if((!jQuery.browser.msie)||(jQuery.browser.version>7)){A("img.reflect").reflect({height:0.5,opacity:0.25})}A("#footer").each(function(){var B=A("<a>",{href:"#","class":"print-link",html:"Print"});B.click(function(){window.print();return false});A(this).append(B)});A(".gift-boxes:not(.empty)").each(function(){var B=A("<a>",{href:"#","class":"print-link",html:"Print details"});var C=A("<span>",{"class":"button"});B.click(function(){window.print();return false});C.append(B);A(".gift-boxes > div > h3 + .button").after(C)});A(".tabs").tabs();A("#file").customFileInput();A(".customizer-choices li").each(function(){var B=A("input",this).click(function(C){C.stopPropagation()});A(this).click(function(){B.click()})});A(window).load(function(){A(".home .hero").each(function(){var B=A("img",this);if(B.length<2){B.css("visibility","visible");return }var C=0;var E=B.length-1;A.fx.off=true;B.fadeOut().css("visibility","visible");A.fx.off=false;B.eq(C).fadeIn();function D(){B.eq(C).fadeOut(1000);C++;if(C==B.length){C=0}B.eq(C).fadeIn(1000,function(){setTimeout(D,5000)})}setTimeout(D,5000)})})});
