/**
 * Unobtrusive scripting adapter for jQuery
 *
 * Requires jQuery 1.6.0 or later.
 * https://github.com/rails/jquery-ujs

 * Uploading file using rails.js
 * =============================
 *
 * By default, browsers do not allow files to be uploaded via AJAX. As a result, if there are any non-blank file fields
 * in the remote form, this adapter aborts the AJAX submission and allows the form to submit through standard means.
 *
 * The `ajax:aborted:file` event allows you to bind your own handler to process the form submission however you wish.
 *
 * Ex:
 *     $('form').live('ajax:aborted:file', function(event, elements){
 *       // Implement own remote file-transfer handler here for non-blank file inputs passed in `elements`.
 *       // Returning false in this handler tells rails.js to disallow standard form submission
 *       return false;
 *     });
 *
 * The `ajax:aborted:file` event is fired when a file-type input is detected with a non-blank value.
 *
 * Third-party tools can use this hook to detect when an AJAX file upload is attempted, and then use
 * techniques like the iframe method to upload the file instead.
 *
 * Required fields in rails.js
 * ===========================
 *
 * If any blank required inputs (required="required") are detected in the remote form, the whole form submission
 * is canceled. Note that this is unlike file inputs, which still allow standard (non-AJAX) form submission.
 *
 * The `ajax:aborted:required` event allows you to bind your own handler to inform the user of blank required inputs.
 *
 * !! Note that Opera does not fire the form's submit event if there are blank required inputs, so this event may never
 *    get fired in Opera. This event is what causes other browsers to exhibit the same submit-aborting behavior.
 *
 * Ex:
 *     $('form').live('ajax:aborted:required', function(event, elements){
 *       // Returning false in this handler tells rails.js to submit the form anyway.
 *       // The blank required inputs are passed to this function in `elements`.
 *       return ! confirm("Would you like to submit the form with missing info?");
 *     });
 */
function do_error_for(a,b){a.siblings("span.field_is_valid").remove(),a.siblings("button").after('<span class="postcode_error_message">'+b+"</span>")}function postcode_finder_for(a){$(".address3, .address4").hide();var b=$("#order_"+a+"_attributes_postcode"),c=$("<div class='loading'>Loading</div>");if(b.length){var d=$('<button class="find_postcode">Click to find address</button>'),e=$('<select name="postcode_addresses" multiple="multiple" class="postcode_addresses"></select>'),f=$("."+a+" .address");b.after(d),d.click(function(){return b.addClass("input_loading"),postcode=b.attr("value"),list_json_url="/postcodes/?postcode="+postcode+"&"+csrf_param+"="+csrf_token,$.getJSON(list_json_url,function(c){html="",c.length>0?(b.removeClass("input_loading"),$.each(c,function(a,b){html+="<option value="+b.id+">"+b.description+"</option>"}),e.remove().empty().append(html),$("."+a+" .find_postcode").parent("p").before(e),e.change(function(){var a=e.attr("value");single_json_url="/postcodes/"+a+"?"+csrf_param+"="+csrf_token,$.getJSON(single_json_url,function(a){a.postcode.length>0?(b.removeClass("input_loading"),$(".company",f).attr("value",a.organisation_name),$(".address1",f).attr("value",a.line1),$(".address2",f).attr("value",a.line2),a.line2?$(".address2",f).attr("value",a.line2).show():$(".address2",f).attr("value",""),a.line3?$(".address3",f).attr("value",a.line3).show():$(".address3",f).attr("value","").hide(),a.line4?$(".address4",f).attr("value",a.line4).show():$(".address4",f).attr("value","").hide(),$(".town",f).attr("value",a.post_town),$(".county",f).attr("value",a.county),$(".residential",f).attr("value",a.is_residential),$(".small_organisation",f).attr("value",a.small_organisation),$(".large_organisation",f).attr("value",a.large_organisation),b.attr("value",a.postcode),$("input[type=text]",f).blur(),e.remove()):(b.removeClass("input_loading"),b.siblings(".postcode_error_message").remove(),do_error_for(b,"We can't find an address for this postcode. Please manually enter your address below"))})})):(b.removeClass("input_loading"),b.siblings(".postcode_error_message").remove(),do_error_for(b,"We can't find an address for this postcode. Please manually enter your address below"))}),!1})}}function delivery_same(){$(".delivery-different, .delivery_address .no_postcode").hide(),$(".delivery-same").show()}function delivery_different(){$(".delivery-different, .delivery_address .no_postcode").show(),$(".delivery-same").hide()}function setFamily(){(family_id=$(".dropdowns").attr("data-family-id"))&&$family_select.val(family_id).change()}function make_side_cart(){cart_json_url="/cart.json";var a=$("<div class='loading'>Loading</div>"),b="";$cart_container=$(".cart_items"),$($cart_container).css("opacity",.3),a.remove(),$cart_container.prepend(a),$.getJSON(cart_json_url,function(a){$.each(a,function(a,c){c.quantity>0?(c.quantity==1?item_label="item":item_label="items",b+="<p>Contains <strong>"+c.quantity+"</strong> "+item_label+"</p>",b+='<p class="mini_cart_total">&pound;'+c.total_inc_vat+" <sup>inc VAT</sup></p>"):b="<p>Your shopping cart is empty.</p>",$cart_container.css("opacity",1).empty().html(b)})})}function update_cart_product(a,b){update_cart_product_by_dom_id($("#add_to_cart_for_"+a),b)}function update_cart_product_by_dom_id(a,b){$(".in-basket",a).remove(),$("nav",a).html("<p class='in-basket'><strong><a href='/cart/'>"+b+" in basket</a></strong></p>")}function cart_product_loading(a,b){$(".in-basket",a).remove(),$("nav",a).html("<p class='in-basket loading'><a href='/cart/'>"+b+"</a></p>")}function update_cart_summary(a,b){make_side_cart(),$(".summary").html(a+" Items: &pound;"+b)}function cart_summary_loading(){$(".summary").html("updating totals...")}function remote_update_cart(){$.getJSON("/cart.json",function(a){update_cart_summary(a.cart.quantity,a.cart.total_inc_vat),$.each(a.cart.cart_products,function(a,b){update_cart_product(b.product_id,b.quantity)})})}function flash(a,b,c){window.scroll(0,0),c==!1&&$("#flash_"+a).remove(),$("#content").prepend('<div id="flash_'+a+'">'+b+"</div>"),$("#flash_"+a).hide().fadeIn("slow")}function flash_ajax(a,b){$(".flash").remove(),$("#cboxLoadedContent").prepend('<div class="flash" id="flash_'+a+'">'+b+"</div>"),$("#flash_"+a).hide().fadeIn("slow")}function getCardType(a){a=a.replace(/\s/g,""),b=new RegExp("^(4026|417500|4508|4844|4913|4917)");if(a.match(b)!=null)return"electron";var b=new RegExp("^4");return a.match(b)!=null?"visa":(b=new RegExp("^(34|37)"),a.match(b)!=null?"amex":(b=new RegExp("^(5018|5020|5038|6304|6759|6761|6762|6763)"),a.match(b)!=null?"maestro":(b=new RegExp("^5[1-5]"),a.match(b)!=null?"mastercard":(b=new RegExp("^6011"),a.match(b)!=null?"discover":""))))}(function(a,b){var c;a.rails=c={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input:file",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(b){var c=a('meta[name="csrf-token"]').attr("content");c&&b.setRequestHeader("X-CSRF-Token",c)},fire:function(b,c,d){var e=a.Event(c);return b.trigger(e,d),e.result!==!1},confirm:function(a){return confirm(a)},ajax:function(b){return a.ajax(b)},handleRemote:function(d){var e,f,g,h=d.data("cross-domain")||null,i=d.data("type")||a.ajaxSettings&&a.ajaxSettings.dataType,j;if(c.fire(d,"ajax:before")){if(d.is("form")){e=d.attr("method"),f=d.attr("action"),g=d.serializeArray();var k=d.data("ujs:submit-button");k&&(g.push(k),d.data("ujs:submit-button",null))}else d.is(c.inputChangeSelector)?(e=d.data("method"),f=d.data("url"),g=d.serialize(),d.data("params")&&(g=g+"&"+d.data("params"))):(e=d.data("method"),f=d.attr("href"),g=d.data("params")||null);j={type:e||"GET",data:g,dataType:i,crossDomain:h,beforeSend:function(a,e){return e.dataType===b&&a.setRequestHeader("accept","*/*;q=0.5, "+e.accepts.script),c.fire(d,"ajax:beforeSend",[a,e])},success:function(a,b,c){d.trigger("ajax:success",[a,b,c])},complete:function(a,b){d.trigger("ajax:complete",[a,b])},error:function(a,b,c){d.trigger("ajax:error",[a,b,c])}},f&&(j.url=f),c.ajax(j)}},handleMethod:function(c){var d=c.attr("href"),e=c.data("method"),f=a("meta[name=csrf-token]").attr("content"),g=a("meta[name=csrf-param]").attr("content"),h=a('<form method="post" action="'+d+'"></form>'),i='<input name="_method" value="'+e+'" type="hidden" />';g!==b&&f!==b&&(i+='<input name="'+g+'" value="'+f+'" type="hidden" />'),h.hide().append(i).appendTo("body"),h.submit()},disableFormElements:function(b){b.find(c.disableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with",b[c]()),b[c](b.data("disable-with")),b.attr("disabled","disabled")})},enableFormElements:function(b){b.find(c.enableSelector).each(function(){var b=a(this),c=b.is("button")?"html":"val";b.data("ujs:enable-with")&&b[c](b.data("ujs:enable-with")),b.removeAttr("disabled")})},allowAction:function(a){var b=a.data("confirm"),d=!1,e;return b?(c.fire(a,"confirm")&&(d=c.confirm(b),e=c.fire(a,"confirm:complete",[d])),d&&e):!0},blankInputs:function(b,c,d){var e=a(),f,g=c||"input,textarea";return b.find(g).each(function(){f=a(this);if(d?f.val():!f.val())e=e.add(f)}),e.length?e:!1},nonBlankInputs:function(a,b){return c.blankInputs(a,b,!0)},stopEverything:function(b){return a(b.target).trigger("ujs:everythingStopped"),b.stopImmediatePropagation(),!1},callFormSubmitBindings:function(c){var d=c.data("events"),e=!0;return d!==b&&d.submit!==b&&a.each(d.submit,function(a,b){if(typeof b.handler=="function")return e=b.handler(b.data)}),e},disableElement:function(a){a.data("ujs:enable-with",a.html()),a.html(a.data("disable-with")),a.bind("click.railsDisable",function(a){return c.stopEverything(a)})},enableElement:function(a){a.data("ujs:enable-with")!==b&&(a.html(a.data("ujs:enable-with")),a.data("ujs:enable-with",!1)),a.unbind("click.railsDisable")}},a.ajaxPrefilter(function(a,b,d){a.crossDomain||c.CSRFProtection(d)}),a(c.linkDisableSelector).live("ajax:complete",function(){c.enableElement(a(this))}),a(c.linkClickSelector).live("click.rails",function(d){var e=a(this);if(!c.allowAction(e))return c.stopEverything(d);e.is(c.linkDisableSelector)&&c.disableElement(e);if(e.data("remote")!==b)return c.handleRemote(e),!1;if(e.data("method"))return c.handleMethod(e),!1}),a(c.inputChangeSelector).live("change.rails",function(b){var d=a(this);return c.allowAction(d)?(c.handleRemote(d),!1):c.stopEverything(b)}),a(c.formSubmitSelector).live("submit.rails",function(d){var e=a(this),f=e.data("remote")!==b,g=c.blankInputs(e,c.requiredInputSelector),h=c.nonBlankInputs(e,c.fileInputSelector);if(!c.allowAction(e))return c.stopEverything(d);if(g&&e.attr("novalidate")==b&&c.fire(e,"ajax:aborted:required",[g]))return c.stopEverything(d);if(f)return h?c.fire(e,"ajax:aborted:file",[h]):!a.support.submitBubbles&&c.callFormSubmitBindings(e)===!1?c.stopEverything(d):(c.handleRemote(e),!1);setTimeout(function(){c.disableFormElements(e)},13)}),a(c.formInputClickSelector).live("click.rails",function(b){var d=a(this);if(!c.allowAction(d))return c.stopEverything(b);var e=d.attr("name"),f=e?{name:e,value:d.val()}:null;d.closest("form").data("ujs:submit-button",f)}),a(c.formSubmitSelector).live("ajax:beforeSend.rails",function(b){this==b.target&&c.disableFormElements(a(this))}),a(c.formSubmitSelector).live("ajax:complete.rails",function(b){this==b.target&&c.enableFormElements(a(this))})})(jQuery),function(a,b,c){function d(b){if(!_){W=b,g(),F=a(W),X=0,R.rel!=="nofollow"&&(F=a("."+n).filter(function(){var b=a.data(this,l).rel||this.rel;return b===R.rel}),X=F.index(W),X===-1&&(F=F.add(W),X=F.length-1));if(!Z){Z=$=!0,y.show();if(R.returnFocus)try{W.blur(),a(W).one(s,function(){try{this.focus()}catch(a){}})}catch(c){}x.css({opacity:+R.opacity,cursor:R.overlayClose?"pointer":"auto"}).show(),R.w=i(R.initialWidth,"x"),R.h=i(R.initialHeight,"y"),bc.position(),v&&G.bind("resize."+w+" scroll."+w,function(){x.css({width:G.width(),height:G.height(),top:G.scrollTop(),left:G.scrollLeft()})}).trigger("resize."+w),f(o,R.onOpen),Q.add(K).hide(),P.html(R.close).show()}bc.load(!0)}}function e(){var a,b=m+"Slideshow_",c="click."+m,d,e,f;R.slideshow&&F[1]?(d=function(){M.text(R.slideshowStop).unbind(c).bind(q,function(){if(X<F.length-1||R.loop)a=setTimeout(bc.next,R.slideshowSpeed)}).bind(p,function(){clearTimeout(a)}).one(c+" "+r,e),y.removeClass(b+"off").addClass(b+"on"),a=setTimeout(bc.next,R.slideshowSpeed)},e=function(){clearTimeout(a),M.text(R.slideshowStart).unbind([q,p,r,c].join(" ")).one(c,d),y.removeClass(b+"on").addClass(b+"off")},R.slideshowAuto?d():e()):y.removeClass(b+"off "+b+"on")}function f(b,c){c&&c.call(W),a.event.trigger(b)}function g(b){R=a.extend({},a.data(W,l));for(b in R)a.isFunction(R[b])&&b.substring(0,2)!=="on"&&(R[b]=R[b].call(W));R.rel=R.rel||W.rel||"nofollow",R.href=R.href||a(W).attr("href"),R.title=R.title||W.title,typeof R.href=="string"&&(R.href=a.trim(R.href))}function h(a){return R.photo||/\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(a)}function i(a,b){return Math.round((/%/.test(a)?(b==="x"?G.width():G.height())/100:1)*parseInt(a,10))}function j(c,d,e){return e=b.createElement("div"),c&&(e.id=m+c),e.style.cssText=d||"",a(e)}var k={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",open:!1,returnFocus:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:!1},l="colorbox",m="cbox",n=m+"Element",o=m+"_open",p=m+"_load",q=m+"_complete",r=m+"_cleanup",s=m+"_closed",t=m+"_purge",u=a.browser.msie&&!a.support.opacity,v=u&&a.browser.version<7,w=m+"_IE6",x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,ba,bb,bc;bc=a.fn[l]=a[l]=function(b,c){var e=this;b=b||{};if(!e[0]){if(e.selector)return e;e=a("<a/>"),b.open=!0}return c&&(b.onComplete=c),e.each(function(){a.data(this,l,a.extend({},a.data(this,l)||k,b)),a(this).addClass(n)}),(a.isFunction(b.open)&&b.open.call(e)||b.open)&&d(e[0]),e},bc.init=function(){G=a(c),y=j().attr({id:l,"class":u?m+(v?"IE6":"IE"):""}),x=j("Overlay",v?"position:absolute":"").hide(),z=j("Wrapper"),A=j("Content").append(H=j("LoadedContent","width:0; height:0; overflow:hidden"),J=j("LoadingOverlay").add(j("LoadingGraphic")),K=j("Title"),L=j("Current"),N=j("Next"),O=j("Previous"),M=j("Slideshow").bind(o,e),P=j("Close")),z.append(j().append(j("TopLeft"),B=j("TopCenter"),j("TopRight")),j(!1,"clear:left").append(C=j("MiddleLeft"),A,D=j("MiddleRight")),j(!1,"clear:left").append(j("BottomLeft"),E=j("BottomCenter"),j("BottomRight"))).children().children().css({"float":"left"}),I=j(!1,"position:absolute; width:9999px; visibility:hidden; display:none"),a("body").prepend(x,y.append(z,I)),A.children().hover(function(){a(this).addClass("hover")},function(){a(this).removeClass("hover")}).addClass("hover"),S=B.height()+E.height()+A.outerHeight(!0)-A.height(),T=C.width()+D.width()+A.outerWidth(!0)-A.width(),U=H.outerHeight(!0),V=H.outerWidth(!0),y.css({"padding-bottom":S,"padding-right":T}).hide(),N.click(function(){bc.next()}),O.click(function(){bc.prev()}),P.click(function(){bc.close()}),Q=N.add(O).add(L).add(M),A.children().removeClass("hover"),x.click(function(){R.overlayClose&&bc.close()}),a(b).bind("keydown."+m,function(a){var b=a.keyCode;Z&&R.escKey&&b===27&&(a.preventDefault(),bc.close()),Z&&R.arrowKey&&F[1]&&(b===37?(a.preventDefault(),O.click()):b===39&&(a.preventDefault(),N.click()))})},bc.remove=function(){y.add(x).remove(),a("."+n).removeData(l).removeClass(n)},bc.position=function(a,c){function d(a){B[0].style.width=E[0].style.width=A[0].style.width=a.style.width,J[0].style.height=J[1].style.height=A[0].style.height=C[0].style.height=D[0].style.height=a.style.height}var e=0,f=0;G.unbind("resize."+m),y.hide(),R.fixed&&!v?y.css({position:"fixed"}):(e=G.scrollTop(),f=G.scrollLeft(),y.css({position:"absolute"})),R.right!==!1?f+=Math.max(G.width()-R.w-V-T-i(R.right,"x"),0):R.left!==!1?f+=i(R.left,"x"):f+=Math.round(Math.max(G.width()-R.w-V-T,0)/2),R.bottom!==!1?e+=Math.max(b.documentElement.clientHeight-R.h-U-S-i(R.bottom,"y"),0):R.top!==!1?e+=i(R.top,"y"):e+=Math.round(Math.max(b.documentElement.clientHeight-R.h-U-S,0)/2),y.show(),a=y.width()===R.w+V&&y.height()===R.h+U?0:a||0,z[0].style.width=z[0].style.height="9999px",y.dequeue().animate({width:R.w+V,height:R.h+U,top:e,left:f},{duration:a,complete:function(){d(this),$=!1,z[0].style.width=R.w+V+T+"px",z[0].style.height=R.h+U+S+"px",c&&c(),setTimeout(function(){G.bind("resize."+m,bc.position)},1)},step:function(){d(this)}})},bc.resize=function(a){if(Z){a=a||{},a.width&&(R.w=i(a.width,"x")-V-T),a.innerWidth&&(R.w=i(a.innerWidth,"x")),H.css({width:R.w}),a.height&&(R.h=i(a.height,"y")-U-S),a.innerHeight&&(R.h=i(a.innerHeight,"y"));if(!a.innerHeight&&!a.height){var b=H.wrapInner("<div style='overflow:auto'></div>").children();R.h=b.height(),b.replaceWith(b.children())}H.css({height:R.h}),bc.position(R.transition==="none"?0:R.speed)}},bc.prep=function(b){function c(){return R.h=R.h||H.height(),R.h=R.mh&&R.mh<R.h?R.mh:R.h,R.h}function d(){return R.w=R.w||H.width(),R.w=R.mw&&R.mw<R.w?R.mw:R.w,R.w}if(!!Z){var e,g=R.transition==="none"?0:R.speed;H.remove(),H=j("LoadedContent").append(b),H.hide().appendTo(I.show()).css({width:d(),overflow:R.scrolling?"auto":"hidden"}).css({height:c()}).prependTo(A),I.hide(),a(Y).css({"float":"none"}),v&&a("select").not(y.find("select")).filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one(r,function(){this.style.visibility="inherit"}),e=function(){function b(){u&&y[0].style.removeAttribute("filter")}var c,d,e,i,j=F.length,k,n;!Z||(n=function(){clearTimeout(bb),J.hide(),f(q,R.onComplete)},u&&Y&&H.fadeIn(100),K.html(R.title).add(H).show(),j>1?(typeof R.current=="string"&&L.html(R.current.replace("{current}",X+1).replace("{total}",j)).show(),N[R.loop||X<j-1?"show":"hide"]().html(R.next),O[R.loop||X?"show":"hide"]().html(R.previous),c=X?F[X-1]:F[j-1],e=X<j-1?F[X+1]:F[0],R.slideshow&&M.show(),R.preloading&&(i=a.data(e,l).href||e.href,d=a.data(c,l).href||c.href,i=a.isFunction(i)?i.call(e):i,d=a.isFunction(d)?d.call(c):d,h(i)&&(a("<img/>")[0].src=i),h(d)&&(a("<img/>")[0].src=d))):Q.hide(),R.iframe?(k=a("<iframe/>").addClass(m+"Iframe")[0],R.fastIframe?n():a(k).one("load",n),k.name=m+ +(new Date),k.src=R.href,R.scrolling||(k.scrolling="no"),u&&(k.frameBorder=0,k.allowTransparency="true"),a(k).appendTo(H).one(t,function(){k.src="//about:blank"})):n(),R.transition==="fade"?y.fadeTo(g,1,b):b())},R.transition==="fade"?y.fadeTo(g,0,function(){bc.position(0,e)}):bc.position(g,e)}},bc.load=function(b){var c,d,e=bc.prep;$=!0,Y=!1,W=F[X],b||g(),f(t),f(p,R.onLoad),R.h=R.height?i(R.height,"y")-U-S:R.innerHeight&&i(R.innerHeight,"y"),R.w=R.width?i(R.width,"x")-V-T:R.innerWidth&&i(R.innerWidth,"x"),R.mw=R.w,R.mh=R.h,R.maxWidth&&(R.mw=i(R.maxWidth,"x")-V-T,R.mw=R.w&&R.w<R.mw?R.w:R.mw),R.maxHeight&&(R.mh=i(R.maxHeight,"y")-U-S,R.mh=R.h&&R.h<R.mh?R.h:R.mh),c=R.href,bb=setTimeout(function(){J.show()},100),R.inline?(j().hide().insertBefore(a(c)[0]).one(t,function(){a(this).replaceWith(H.children())}),e(a(c))):R.iframe?e(" "):R.html?e(R.html):h(c)?(a(Y=new Image).addClass(m+"Photo").error(function(){R.title=!1,e(j("Error").text("This image could not be loaded"))}).load(function(){var a;Y.onload=null,R.scalePhotos&&(d=function(){Y.height-=Y.height*a,Y.width-=Y.width*a},R.mw&&Y.width>R.mw&&(a=(Y.width-R.mw)/Y.width,d()),R.mh&&Y.height>R.mh&&(a=(Y.height-R.mh)/Y.height,d())),R.h&&(Y.style.marginTop=Math.max(R.h-Y.height,0)/2+"px"),F[1]&&(X<F.length-1||R.loop)&&(Y.style.cursor="pointer",Y.onclick=function(){bc.next()}),u&&(Y.style.msInterpolationMode="bicubic"),setTimeout(function(){e(Y)},1)}),setTimeout(function(){Y.src=c},1)):c&&I.load(c,R.data,function(b,c,d){e(c==="error"?j("Error").text("Request unsuccessful: "+d.statusText):a(this).contents())})},bc.next=function(){!$&&F[1]&&(X<F.length-1||R.loop)&&(X=X<F.length-1?X+1:0,bc.load())},bc.prev=function(){!$&&F[1]&&(X||R.loop)&&(X=X?X-1:F.length-1,bc.load())},bc.close=function(){Z&&!_&&(_=!0,Z=!1,f(r,R.onCleanup),G.unbind("."+m+" ."+w),x.fadeTo(200,0),y.stop().fadeTo(300,0,function(){y.add(x).css({opacity:1,cursor:"auto"}).hide(),f(t),H.remove(),setTimeout(function(){_=!1,f(s,R.onClosed)},1)}))},bc.element=function(){return a(W)},bc.settings=k,ba=function(a){a.button!==0&&typeof a.button!="undefined"||a.ctrlKey||a.shiftKey||a.altKey||(a.preventDefault(),d(this))},a.fn.delegate?a(b).delegate("."+n,"click",ba):a("."+n).live("click",ba),a(bc.init)}(jQuery,document,this),!function(a){function d(a,b,c){return typeof a=="function"?a.apply(b,c):a}"use strict";var b;a(document).ready(function(){a.support.transition=function(){var a=document.body||document.documentElement,b=a.style,c=b.transition!==undefined||b.WebkitTransition!==undefined||b.MozTransition!==undefined||b.MsTransition!==undefined||b.OTransition!==undefined;return c}(),a.support.transition&&(b="TransitionEnd",a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"))});var c=function(b,c){this.$element=a(b),this.options=c,this.enabled=!0,this.fixTitle()};c.prototype={show:function(){var b,c,e,f,g,h;if(this.hasContent()&&this.enabled){g=this.tip(),this.setContent(),this.options.animate&&g.addClass("fade"),g.remove().css({top:0,left:0,display:"block"}).prependTo(document.body),b=a.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),c=g[0].offsetWidth,e=g[0].offsetHeight,f=d(this.options.placement,this,[g[0],this.$element[0]]);switch(f){case"below":h={top:b.top+b.height+this.options.offset,left:b.left+b.width/2-c/2};break;case"above":h={top:b.top-e-this.options.offset,left:b.left+b.width/2-c/2};break;case"left":h={top:b.top+b.height/2-e/2,left:b.left-c-this.options.offset};break;case"right":h={top:b.top+b.height/2-e/2,left:b.left+b.width+this.options.offset}}g.css(h).addClass(f).addClass("in")}},setContent:function(){var a=this.tip();a.find(".twipsy-inner")[this.options.html?"html":"text"](this.getTitle()),a[0].className="twipsy"},hide:function(){function e(){d.remove()}var c=this,d=this.tip();d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.bind(b,e):e()},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getTitle:function(){var a,b=this.$element,c=this.options;return this.fixTitle(),typeof c.title=="string"?a=b.attr(c.title=="title"?"data-original-title":c.title):typeof c.title=="function"&&(a=c.title.call(b[0])),a=(""+a).replace(/(^\s*|\s*$)/,""),a||c.fallback},tip:function(){return this.$tip=this.$tip||a('<div class="twipsy" />').html(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},a.fn.twipsy=function(b){return a.fn.twipsy.initWith.call(this,b,c,"twipsy"),this},a.fn.twipsy.initWith=function(b,c,d){function i(e){var f=a.data(e,d);return f||(f=new c(e,a.fn.twipsy.elementOptions(e,b)),a.data(e,d,f)),f}function j(){var a=i(this);a.hoverState="in",b.delayIn==0?a.show():(a.fixTitle(),setTimeout(function(){a.hoverState=="in"&&a.show()},b.delayIn))}function k(){var a=i(this);a.hoverState="out",b.delayOut==0?a.hide():setTimeout(function(){a.hoverState=="out"&&a.hide()},b.delayOut)}var e,f,g,h;return b===!0?this.data(d):typeof b=="string"?(e=this.data(d),e&&e[b](),this):(b=a.extend({},a.fn[d].defaults,b),b.live||this.each(function(){i(this)}),b.trigger!="manual"&&(f=b.live?"live":"bind",g=b.trigger=="hover"?"mouseenter":"focus",h=b.trigger=="hover"?"mouseleave":"blur",this[f](g,j)[f](h,k)),this)},a.fn.twipsy.Twipsy=c,a.fn.twipsy.defaults={animate:!0,delayIn:0,delayOut:0,fallback:"",placement:"above",html:!1,live:!1,offset:0,title:"title",trigger:"hover",template:'<div class="twipsy-arrow"></div><div class="twipsy-inner"></div>'},a.fn.twipsy.rejectAttrOptions=["title"],a.fn.twipsy.elementOptions=function(b,c){var d=a(b).data(),e=a.fn.twipsy.rejectAttrOptions,f=e.length;while(f--)delete d[e[f]];return a.extend({},c,d)}}(window.jQuery||window.ender),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=c,this.enabled=!0,this.fixTitle()};b.prototype=a.extend({},a.fn.twipsy.Twipsy.prototype,{setContent:function(){var a=this.tip();a.find(".title")[this.options.html?"html":"text"](this.getTitle()),a.find(".content > *")[this.options.html?"html":"text"](this.getContent()),a[0].className="popover"},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return typeof this.options.content=="string"?a=b.attr(this.options.content):typeof this.options.content=="function"&&(a=this.options.content.call(this.$element[0])),a},tip:function(){return this.$tip||(this.$tip=a('<div class="popover" />').html(this.options.template)),this.$tip}}),a.fn.popover=function(c){return typeof c=="object"&&(c=a.extend({},a.fn.popover.defaults,c)),a.fn.twipsy.initWith.call(this,c,b,"popover"),this},a.fn.popover.defaults=a.extend({},a.fn.twipsy.defaults,{placement:"right",content:"data-content",template:'<div class="arrow"></div><div class="inner"><h3 class="title"></h3><div class="content"><p></p></div></div>'}),a.fn.twipsy.rejectAttrOptions.push("content")}(window.jQuery||window.ender),$(function(){$delivery_address_checkbox=$("#order_invoice_is_delivery"),$delivery_address_checkbox.length&&($(".delivery-change").click(function(a){return delivery_different(),$delivery_address_checkbox[0].checked=!1,!1}),$delivery_address_checkbox[0].checked?delivery_same():delivery_different(),$("#order_invoice_is_delivery").click(function(){this.checked?delivery_same():delivery_different()}),$(".delivery-same").append('<span class="delivery-change">(choose different)</span>'),$(".delivery-change").click(function(){return $("#order_invoice_is_delivery").click(),delivery_different(),!1})),invoice_select="#order_invoice_address_attributes_country_id",delivery_select="#order_delivery_address_attributes_country_id",$(invoice_select+","+delivery_select).change(function(){$(delivery_select+":visible").length?country_id=$(delivery_select).attr("value"):country_id=$(invoice_select).attr("value"),json_path="/countries/"+country_id+"/delivery_methods.json",$.getJSON(json_path,function(a){html="",$.each(a,function(a,b){html+="<option value="+b.delivery_method.id+">"+b.delivery_method.name_with_price+"</option>"}),$("#order_delivery_method_id").empty().append(html)})}),postcode_finder_for("invoice_address"),postcode_finder_for("delivery_address")}),$(function(){$(".order_form button[type=submit]").click(function(){$(".field_to_validate").remove(),postcode_length=$("#order_invoice_address_attributes_postcode").attr("value").length,address1_length=$("#order_invoice_address_attributes_address1").attr("value").length,town_length=$("#order_invoice_address_attributes_town").attr("value").length,postcode_length>0&&(address1_length<1||town_length<1)&&$(".invoice_address fieldset.address").show()}),$order_form=$("form.order_form"),$("input[type=text]",$order_form).blur(function(){var a=$(this).attr("value").length;a>0?($(this).siblings("span.error_message, span.postcode_error_message").remove(),$(this).parents("p").removeClass().addClass("validating"),$order_form.append('<input type="hidden" name="field_to_validate" class="field_to_validate" value="#'+$(this).attr("id")+'" />').submit()):($(this).parents("p").removeClass(),$(this).siblings("span.error_message, span.postcode_error_message").remove())})}),$(function(){$(".payment_form .error_msg").each(function(){$field=$(this),$field.parents("p").removeClass().addClass("has_error")}),$("#order_payment_number").keyup(function(){card_number=$(this).prop("value"),card_type=getCardType(card_number),card_type.length>0?$(this).removeClass().addClass(card_type):$(this).removeClass().addClass("unknown")})}),$(function(){if(($dropdowns=$(".dropdowns")).length){manufacturer_choose_text="<option>Choose your Manufacturer</option>",family_choose_text="<option>Choose your Series</option>",printer_choose_text='<option class="p_choose">Choose your Printer</option>',$manufacturer_select=$("<select name='manufacturers'>"+manufacturer_choose_text+"</select>"),$family_select=$("<select name='families' disabled='disabled'>"+family_choose_text+"</select>"),$printer_select=$("<select name='printers' disabled='disabled'>"+printer_choose_text+"</select>"),$go_button=$("<input type='submit' class='dd_go' value=\"Find Your Printer's Cartridges\" disabled='disabled' />"),$loading_spinner=$("<div class='loading'>Loading</div>"),$dropdowns.append('<form method="post" class="dd" action=""></form>'),$dropdowns.children("form").append($manufacturer_select),$dropdowns.children("form").append($family_select),$dropdowns.children("form").append($printer_select),$dropdowns.children("form").append($go_button),$dropdowns.append($loading_spinner),$dropdowns.show(),$loading_spinner.fadeOut("fast"),manufacturer_dropdown_data=manufacturers,html=manufacturer_choose_text,$.each(manufacturer_dropdown_data,function(a,b){html+="<option value="+b.manufacturer.id+">"+b.manufacturer.name+"</option>"}),$manufacturer_select.html(html),$manufacturer_select.change(),$manufacturer_select.change(function(){html=family_choose_text,manufacturer_id=$("option:selected",this).attr("value"),$.each(manufacturer_dropdown_data,function(a,b){b.manufacturer.id==manufacturer_id&&$.each(b.manufacturer.families,function(a,b){html+="<option value="+b.stub+">"+b.name+"</option>"})}),$family_select.removeAttr("disabled").html(html).focus()});if(manufacturer_id=$(".dropdowns").attr("data-manufacturer-id"))$manufacturer_select.val(manufacturer_id).change(),setTimeout("setFamily()",1e3);$family_select.change(function(){html=printer_choose_text,family_id=$("option:selected",this).attr("value"),$loading_spinner.fadeIn("fast"),$.getJSON("/families/"+family_id+".json",function(a){$loading_spinner.fadeOut("fast"),$.each(a.family.visible_printers,function(a,b){html+="<option value="+b.path+">"+b.full_name+"</option>"}),$printer_select.html(html).focus();var b=function(){$(".p_choose").attr("selected","selected")};b(),$.browser.msie?setTimeout(b,1):b(),$printer_select.removeAttr("disabled").focus(),$go_button.removeAttr("disabled")})}),$("form.dd",$dropdowns).submit(function(){return path=$("option:selected",$printer_select).attr("value"),path=="Choose your Printer"&&(family=$("option:selected",$family_select).attr("value"),path="/families/"+family),window.location=path+"?ref=dropdowns",!1})}}),$(function(){csrf_token=$("meta[name=csrf-token]").attr("content"),csrf_param=$("meta[name=csrf-param]").attr("content"),$("a[rel='lightbox']").colorbox({width:"80%",height:"60%",rel:"nofollow",scrolling:!0}),$("a[rel='lightbox nofollow']").colorbox({width:"80%",height:"60%",rel:"nofollow",scrolling:!0}),$("a[rel='zoom']").colorbox({rel:"nofollow",scrolling:!0}),$("a[rel='external']").colorbox({width:"720px",height:"90%",iframe:!0,rel:"nofollow",scrolling:!0}),$("a.verisign").colorbox({width:"610px",height:"600px",iframe:!0,rel:"nofollow",scrolling:!0}),$("a[rel='popup']").colorbox({width:"720px",height:"80%",scrolling:!0}),$("a[rel='profile']").colorbox({data:!0,width:"720px",height:"80%",scrolling:!0}),$("a[rel='inline']").colorbox({inline:!0,width:"650px",rel:"nofollow"}),$("span[rel='popover']")
.popover({html:!0,content:function(){return $(".quantity_breaks_popup",this).html()}})}),$(function(){$("body.orders #minicart strong").text("Amend order?"),$(".add_to_cart button").click(function(){var a=$("select",$(this).parent());a.length>0&&(quantity_to_add=a[0].selectedIndex+1,cart_product_loading($(this).parent(),"adding "+quantity_to_add+" to basket")),cart_summary_loading()}),remote_update_cart()}),$(function(){json_path="/customer.json",$.getJSON(json_path,function(a){$.each(a,function(a,b){$(".header #my_account").empty().html("Welcome back "+b.name+', <a href="/customer">View Account</a> | <a href="/customer/logout">Logout</a>')})})}),$(function(){$(".bundle_items li").hover(function(){$(this).children("div").fadeIn("1000")},function(){$(this).children("div").hide()})}),$(function(){$tabby=$("#tabby"),$tablinks=$("#tabs li a",$tabby),$(".tab_content:not(.active)",$tabby).hide(),$("#tabs a",$tabby).click(function(){return $tablinks.parents("li").removeClass("current"),$(this).parent("li").addClass("current"),$tab_id=$(this).prop("rel"),$(".tab_content.active",$tabby).removeClass("active").hide(),$("#"+$tab_id,$tabby).addClass("active").show(),!1})}),$().ready(function(){$("#q").bind("change keyup",function(){var a=String(jQuery(this).val().toLowerCase());a.indexOf("do a barrel")==0&&($("body").addClass("barrel_roll"),setTimeout(function(){$("body").removeClass("barrel_roll")},4e3),$(this).unbind("change keyup"))}),$("#q").bind("change keyup",function(){var a=String(jQuery(this).val().toLowerCase());a.indexOf("tilt")==0&&($("body").addClass("tilt"),setTimeout(function(){},4e3),$(this).unbind("change keyup"))})}),document.createElement("article"),document.createElement("aside"),document.createElement("header"),document.createElement("footer"),document.createElement("nav"),document.createElement("section"),document.createElement("figure"),$(function(){var a=$("input#q"),b=$(".search_button"),c="enter a search term...",d=$('<p class="show_more_printers"><strong>Show more printers...</strong></p>'),e=$("#printer-results");$("li",e).length>4&&($("li.result:gt(4)",e).hide(),e.after(d),d.click(function(){$(this).hide(),$("li.result:gt(4)",e).show()})),$("#product-results div.quantity").hide()}),function(a){function c(a){return typeof a=="object"?a:{top:a,left:a}}var b=a.scrollTo=function(b,c,e){a(window).scrollTo(b,c,e)};b.defaults={axis:"xy",duration:parseFloat(a.fn.jquery)>=1.3?0:1},b.window=function(b){return a(window)._scrollable()},a.fn._scrollable=function(){return this.map(function(){var b=this,c=!b.nodeName||a.inArray(b.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!c)return b;var e=(b.contentWindow||b).document||b.ownerDocument||b;return a.browser.safari||e.compatMode=="BackCompat"?e.body:e.documentElement})},a.fn.scrollTo=function(e,f,g){return typeof f=="object"&&(g=f,f=0),typeof g=="function"&&(g={onAfter:g}),e=="max"&&(e=9e9),g=a.extend({},b.defaults,g),f=f||g.speed||g.duration,g.queue=g.queue&&g.axis.length>1,g.queue&&(f/=2),g.offset=c(g.offset),g.over=c(g.over),this._scrollable().each(function(){function r(a){i.animate(o,f,g.easing,a&&function(){a.call(this,e,g)})}var h=this,i=a(h),l=e,m,o={},q=i.is("html,body");switch(typeof l){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(l)){l=c(l);break}l=a(l,this);case"object":if(l.is||l.style)m=(l=a(l)).offset()}a.each(g.axis.split(""),function(a,c){var d=c=="x"?"Left":"Top",e=d.toLowerCase(),f="scroll"+d,j=h[f],n=b.max(h,c);if(m)o[f]=m[e]+(q?0:j-i.offset()[e]),g.margin&&(o[f]-=parseInt(l.css("margin"+d))||0,o[f]-=parseInt(l.css("border"+d+"Width"))||0),o[f]+=g.offset[e]||0,g.over[e]&&(o[f]+=l[c=="x"?"width":"height"]()*g.over[e]);else{var p=l[e];o[f]=p.slice&&p.slice(-1)=="%"?parseFloat(p)/100*n:p}/^\d+$/.test(o[f])&&(o[f]=o[f]<=0?0:Math.min(o[f],n)),!a&&g.queue&&(j!=o[f]&&r(g.onAfterFirst),delete o[f])}),r(g.onAfter)}).end()},b.max=function(b,c){var e=c=="x"?"Width":"Height",f="scroll"+e;if(!a(b).is("html,body"))return b[f]-a(b)[e.toLowerCase()]();var g="client"+e,h=b.ownerDocument.documentElement,i=b.ownerDocument.body;return Math.max(h[f],i[f])-Math.min(h[g],i[g])}}(jQuery),$().ready(function(){function a(a){}$timeline=$("#timeline"),$nav_wrapper=$('<ul id="years"><li class="label">Jump to a year:</li></ul>'),$timeline.after($nav_wrapper),$("h2",$timeline).each(function(){$label=$(this).text(),$nav_wrapper.append('<li><a href="#year_'+$label+'">'+$label+"</a></li>")}),$("a",$nav_wrapper).click(function(b){$the_year=$(this).attr("href"),$timeline.scrollTo($the_year,800,{axis:"x",offset:-10,onAfter:a($the_year+" h2")}),b.preventDefault()})}),$(function(){$("#compare-table tbody tr:odd").hide(),$("#compare-table tbody tr:even").toggle(function(){$(this).next().show()},function(){$(this).next().hide()})}),window.jQuery&&function(a){if(a.browser.msie)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(b){}a.fn.rating=function(b){if(this.length==0)return this;if(typeof arguments[0]=="string"){if(this.length>1){var c=arguments;return this.each(function(){a.fn.rating.apply(a(this),c)})}return a.fn.rating[arguments[0]].apply(this,a.makeArray(arguments).slice(1)||[]),this}var b=a.extend({},a.fn.rating.options,b||{});return a.fn.rating.calls++,this.not(".star-rating-applied").addClass("star-rating-applied").each(function(){var c,d=a(this),e=(this.name||"unnamed-rating").replace(/\[|\]/g,"_").replace(/^\_+|\_+$/g,""),f=a(this.form||document.body),g=f.data("rating");if(!g||g.call!=a.fn.rating.calls)g={count:0,call:a.fn.rating.calls};var h=g[e];h&&(c=h.data("rating")),h&&c?c.count++:(c=a.extend({},b||{},(a.metadata?d.metadata():a.meta?d.data():null)||{},{count:0,stars:[],inputs:[]}),c.serial=g.count++,h=a('<span class="star-rating-control"/>'),d.before(h),h.addClass("rating-to-be-drawn"),d.attr("disabled")&&(c.readOnly=!0),h.append(c.cancel=a('<div class="rating-cancel"><a title="'+c.cancel+'">'+c.cancelValue+"</a></div>").mouseover(function(){a(this).rating("drain"),a(this).addClass("star-rating-hover")}).mouseout(function(){a(this).rating("draw"),a(this).removeClass("star-rating-hover")}).click(function(){a(this).rating("select")}).data("rating",c)));var i=a('<div class="star-rating rater-'+c.serial+'"><a title="'+(this.title||this.value)+'">'+this.value+"</a></div>");h.append(i),this.id&&i.attr("id",this.id),this.className&&i.addClass(this.className),c.half&&(c.split=2);if(typeof c.split=="number"&&c.split>0){var j=(a.fn.width?i.width():0)||c.starWidth,k=c.count%c.split,l=Math.floor(j/c.split);i.width(l).find("a").css({"margin-left":"-"+k*l+"px"})}c.readOnly?i.addClass("star-rating-readonly"):i.addClass("star-rating-live").mouseover(function(){a(this).rating("fill"),a(this).rating("focus")}).mouseout(function(){a(this).rating("draw"),a(this).rating("blur")}).click(function(){a(this).rating("select")}),this.checked&&(c.current=i),d.hide(),d.change(function(){a(this).rating("select")}),i.data("rating.input",d.data("rating.star",i)),c.stars[c.stars.length]=i[0],c.inputs[c.inputs.length]=d[0],c.rater=g[e]=h,c.context=f,d.data("rating",c),h.data("rating",c),i.data("rating",c),f.data("rating",g)}),a(".rating-to-be-drawn").rating("draw").removeClass("rating-to-be-drawn"),this},a.extend(a.fn.rating,{calls:0,focus:function(){var b=this.data("rating");if(!b)return this;if(!b.focus)return this;var c=a(this).data("rating.input")||a(this.tagName=="INPUT"?this:null);b.focus&&b.focus.apply(c[0],[c.val(),a("a",c.data("rating.star"))[0]])},blur:function(){var b=this.data("rating");if(!b)return this;if(!b.blur)return this;var c=a(this).data("rating.input")||a(this.tagName=="INPUT"?this:null);b.blur&&b.blur.apply(c[0],[c.val(),a("a",c.data("rating.star"))[0]])},fill:function(){var a=this.data("rating");if(!a)return this;if(a.readOnly)return;this.rating("drain"),this.prevAll().andSelf().filter(".rater-"+a.serial).addClass("star-rating-hover")},drain:function(){var a=this.data("rating");if(!a)return this;if(a.readOnly)return;a.rater.children().filter(".rater-"+a.serial).removeClass("star-rating-on").removeClass("star-rating-hover")},draw:function(){var b=this.data("rating");if(!b)return this;this.rating("drain"),b.current?(b.current.data("rating.input").attr("checked","checked"),b.current.prevAll().andSelf().filter(".rater-"+b.serial).addClass("star-rating-on")):a(b.inputs).removeAttr("checked"),b.cancel[b.readOnly||b.required?"hide":"show"](),this.siblings()[b.readOnly?"addClass":"removeClass"]("star-rating-readonly")},select:function(b,c){var d=this.data("rating");if(!d)return this;if(d.readOnly)return;d.current=null;if(typeof b!="undefined"){if(typeof b=="number")return a(d.stars[b]).rating("select",undefined,c);typeof b=="string"&&a.each(d.stars,function(){a(this).data("rating.input").val()==b&&a(this).rating("select",undefined,c)})}else d.current=this[0].tagName=="INPUT"?this.data("rating.star"):this.is(".rater-"+d.serial)?this:null;this.data("rating",d),this.rating("draw");var e=a(d.current?d.current.data("rating.input"):null);(c||c==undefined)&&d.callback&&d.callback.apply(e[0],[e.val(),a("a",d.current)[0]])},readOnly:function(b,c){var d=this.data("rating");if(!d)return this;d.readOnly=b||b==undefined?!0:!1,c?a(d.inputs).attr("disabled","disabled"):a(d.inputs).removeAttr("disabled"),this.data("rating",d),this.rating("draw")},disable:function(){this.rating("readOnly",!0,!0)},enable:function(){this.rating("readOnly",!1,!1)}}),a.fn.rating.options={cancel:"Cancel Rating",cancelValue:"",split:0,starWidth:16},a(function(){a("input[type=radio].star").rating()})}(jQuery),jQuery(document).ready(function(a){a("#reviews .rating .stars label").hide(),a("#reviews .rating .stars input").rating()}),$(function(){$(".livechat").click(function(){return window.open(encodeURI("https://oggchat2.icoa.com/cp?font=Verdana&fontsize=10pt&bgcolor=FFFFFF&cid=c08f011a34c270f60134c706677d0310&website=http://www.stinkyinkshop.co.uk&text=_oc-c&height=450&width=380&r="+document.referrer),"Stinkyink Live Chat","toolbar=0,scrollbars=1,location=0,status=0,menubar=0,resizable=1,width=380,height=450"),!1})})
