/*
 * JSMin
 * Javascript Compressor
 * http://www.crockford.com/
 * http://www.smallsharptools.com/
*/

new function(){var Public={'browser':function(){return Private.browser},'version':{'number':function(){return Private.version.number},'string':function(){return Private.version.string}},'OS':function(){return Private.OS},'aol':function(){return Private.aol},'camino':function(){return Private.camino},'firefox':function(){return Private.firefox},'flock':function(){return Private.flock},'icab':function(){return Private.icab},'konqueror':function(){return Private.konqueror},'mozilla':function(){return Private.mozilla},'msie':function(){return Private.msie},'netscape':function(){return Private.netscape},'opera':function(){return Private.opera},'safari':function(){return Private.safari},'linux':function(){return Private.linux},'mac':function(){return Private.mac},'win':function(){return Private.win}};$.browserEx=Public;var Private={'browser':'Unknown','version':{'number':undefined,'string':'Unknown'},'OS':'Unknown','aol':false,'camino':false,'firefox':false,'flock':false,'icab':false,'konqueror':false,'mozilla':false,'msie':false,'netscape':false,'opera':false,'safari':false,'linux':false,'mac':false,'win':false};for(var i=0,ua=navigator.userAgent,ve=navigator.vendor,data=[{'name':'Safari','browser':function(){return/Apple/.test(ve)}},{'name':'Opera','browser':function(){return window.opera!=undefined}},{'name':'iCab','browser':function(){return/iCab/.test(ve)}},{'name':'Konqueror','browser':function(){return/KDE/.test(ve)}},{'identifier':'aol','name':'AOL Explorer','browser':function(){return/America Online Browser/.test(ua)},'version':function(){return ua.match(/rev(\d+(?:\.\d+)+)/)}},{'name':'Flock','browser':function(){return/Flock/.test(ua)}},{'name':'Camino','browser':function(){return/Camino/.test(ve)}},{'name':'Firefox','browser':function(){return/Firefox/.test(ua)}},{'name':'Netscape','browser':function(){return/Netscape/.test(ua)}},{'identifier':'msie','name':'Internet Explorer','browser':function(){return/MSIE/.test(ua)},'version':function(){return ua.match(/MSIE (\d+(?:\.\d+)+(?:b\d*)?)/)}},{'name':'Mozilla','browser':function(){return/Gecko|Mozilla/.test(ua)},'version':function(){return ua.match(/rv:(\d+(?:\.\d+)+)/)}}];i<data.length;i++){if(data[i].browser()){var identifier=data[i].identifier?data[i].identifier:data[i].name.toLowerCase();Private[identifier]=true;Private.browser=data[i].name;var result;if(data[i].version!=undefined&&(result=data[i].version())){Private.version.string=result[1];Private.version.number=parseFloat(result[1])}else{var re=new RegExp(data[i].name+'(?:\\s|\\/)(\\d+(?:\\.\\d+)+(?:(?:a|b)\\d*)?)');result=ua.match(re);if(result!=undefined){Private.version.string=result[1];Private.version.number=parseFloat(result[1])}}break}};for(var i=0,pl=navigator.platform,data=[{'identifier':'win','name':'Windows','OS':function(){return/Win/.test(pl)}},{'name':'Mac','OS':function(){return/Mac/.test(pl)}},{'name':'Linux','OS':function(){return/Linux/.test(pl)}}];i<data.length;i++){if(data[i].OS()){var identifier=data[i].identifier?data[i].identifier:data[i].name.toLowerCase();Private[identifier]=true;Private.OS=data[i].name;break}}}();function goodBrowser(){if($.browser.msie&&$.browserEx.version.number()<6)return false;if($.browserEx.camino()==true)return false;if($.browserEx.firefox()==true&&$.browserEx.version.number()<3)return false;if(!cookiesEnabled())return false;return true}
function everythingExists(stringArray,inString){for(var i=0;i<stringArray.length;i++){var pos=inString.toLowerCase().indexOf(stringArray[i].toLowerCase());if(pos<=1)return false;}
return true;}
function someExist(stringArray,inString){var ret=false;for(var i=0;i<stringArray.length;i++){var pos=inString.toLowerCase().indexOf($.trim(stringArray[i].toLowerCase()));if((!ret)&&(pos>=0))ret=true;}
return ret;}
function ajaxOn(elem){$(elem).after("<img class=\"ajaxindicator\" src=\"/images/sitev4/ajax.gif\" />");setTimeout(function(){ajaxOff(elem);},10000);}
function ajaxOff(elem){$(elem).parent().children(".ajaxindicator").remove();}
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else var expires="";document.cookie=name+"="+value+expires+"; path=/";}
function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}
return null;}
function eraseCookie(name){createCookie(name,"",-1);}
function saveJSInfo(){if(readCookie("xdt")==null||readCookie("xdt")==""){var ssx=window.screen.width.toString();var ssy=window.screen.height.toString();var cd=window.screen.colorDepth.toString();var pd="";if(!$.browserEx.msie())pd=window.screen.pixelDepth.toString();var os=$.browserEx.OS();var b=$.browserEx.browser();var bv=$.browserEx.version.string();var combine=ssx+":"+ssy+":"+cd+":"+pd+":"+os+":"+b+":"+bv;createCookie("xdt",combine);}}
function cookiesEnabled(){if(navigator.cookieEnabled==true){if(readCookie("cookietest")!=''){eraseCookie("cookietest");}
if(readCookie("ct")==''||readCookie("ct")==null){createCookie("ct","ct");}
var result=(readCookie("ct")=="ct");return result;}
return false}
(function($){$.fn.multipleOf=function(options){var defaults={multiplesOf:1,lowerLimit:0,upperLimit:9999,changedCallback:function(elem,newValue){},notMultipleOfCallback:function(multipleOf){},exceededLowerLimitCallback:function(lowerLimit){},exceededUpperLimitCallback:function(upperLimit){}};var options=$.extend(defaults,options);return this.each(function(){if(options.multiplesOf==0)options.multiplesOf=1;var f=function(){var that=$(this);var val=that.val();var ans;if(isNaN(parseInt(val))){ans=options.multiplesOf;}else{ans=parseInt(val);}
if(parseInt(val)%options.multiplesOf!=0){var floormult=Math.floor(parseFloat(val/options.multiplesOf));ans=options.multiplesOf*floormult;if(ans==0)ans=options.multiplesOf;options.notMultipleOfCallback(options.multiplesOf);fnTrigger=true;}
if(ans<options.lowerLimit){ans=options.lowerLimit;options.exceededLowerLimitCallback(options.lowerLimit);}
if(ans>options.upperLimit){ans=options.upperLimit;options.exceededUpperLimitCallback(options.upperLimit);}
that.val(ans);options.changedCallback(that,ans);};$(this).change(f);});};})(jQuery);(function($){var defaults={reNumbers:/(-|-\$)?(\d+(,\d{3})*(\.\d{1,})?|\.\d{1,})/g,useFieldPlugin:(!!$.fn.getValue),onParseError:null,onParseClear:null};$.Calculation={version:"0.4",setDefaults:function(options){$.extend(defaults,options)}};$.fn.parseNumber=function(options){var aValues=[];options=$.extend(options,defaults);this.each(function(){var $el=$(this),sMethod=($el.is(":input")?(defaults.useFieldPlugin?"getValue":"val"):"text"),v=$el[sMethod]().match(defaults.reNumbers,"");if(v==null){v=0;if(jQuery.isFunction(options.onParseError))options.onParseError.apply($el,[sMethod]);$.data($el[0],"calcParseError",true)}else{v=v[0].replace(/[^0-9.\-]/g,"");if($.data($el[0],"calcParseError")&&jQuery.isFunction(options.onParseClear)){options.onParseClear.apply($el,[sMethod]);$.data($el[0],"calcParseError",false)}}aValues.push(parseFloat(v,10))});return aValues};$.fn.calc=function(expr,vars,cbFormat,cbDone){var $this=this,exprValue="",$el,parsedVars={},tmp,sMethod,hVars,bIsError=false;for(var k in vars){if(!!vars[k]&&!!vars[k].jquery){parsedVars[k]=vars[k].parseNumber()}else{parsedVars[k]=vars[k]}}this.each(function(i,el){$el=$(this);sMethod=($el.is(":input")?(defaults.useFieldPlugin?"setValue":"val"):"text");hVars={};for(var k in parsedVars){if(typeof parsedVars[k]=="number"){hVars[k]=parsedVars[k]}else if(typeof parsedVars[k]=="string"){hVars[k]=parseFloat(parsedVars[k],10)}else if(!!parsedVars[k]&&(parsedVars[k]instanceof Array)){tmp=(parsedVars[k].length==$this.length)?i:0;hVars[k]=parsedVars[k][tmp]}if(isNaN(hVars[k]))hVars[k]=0}try{exprValue=eval(expr.replace(/([A-Za-z]+)/g,"hVars.$1"));if(!!cbFormat)exprValue=cbFormat(exprValue)}catch(e){exprValue=e;bIsError=true}$el[sMethod](exprValue.toString())});if(!!cbDone)cbDone(this);return this};$.each(["sum","avg","min","max"],function(i,method){$.fn[method]=function(bind,selector){if(arguments.length==0)return math[method](this.parseNumber());var bSelOpt=selector&&selector.constructor==Object&&!(selector instanceof jQuery);var opt=bind&&bind.constructor==Object?bind:{bind:"keyup",selector:(!bSelOpt)?selector:null,oncalc:null};if(bSelOpt)opt=jQuery.extend(opt,selector);if(!!opt.selector)opt.selector=$(opt.selector);var self=this,sMethod,doCalc=function(){var value=math[method](self.parseNumber(opt));if(!!opt.selector){sMethod=(opt.selector.is(":input")?(defaults.useFieldPlugin?"setValue":"val"):"text");opt.selector[sMethod](value)}if(jQuery.isFunction(opt.oncalc))opt.oncalc.apply(self,[value,opt])};doCalc();return self.bind(opt.bind,doCalc)}});var math={sum:function(a){var total=0;$.each(a,function(i,v){total+=v});return total},avg:function(a){return math.sum(a)/a.length},min:function(a){return Math.min.apply(Math,a)},max:function(a){return Math.max.apply(Math,a)}}})(jQuery);function swbrands(){$("#swcategories").removeClass("active");$("#swbrands").addClass("active");$("ul#categories").hide();$("ul#brands").show();return false;}
function swcategories(){$("#swcategories").addClass("active");$("#swbrands").removeClass("active");$("ul#categories").show();$("ul#brands").hide();return false;}
function highlightProducts(){var sq=$("#highlightTerm").attr("value").toLowerCase();if(sq!=""){clearHighlightedProducts();$("table.productlist tr").not(":eq(0)").each(function(){var text=$(this).text();if(everythingExists(sq.split(/\s+/g),text)){$(this).removeClass("hide");}else if(someExist(sq.split(/\s+/g),text)){$(this).removeClass("hide");}else{$(this).addClass("hide");}});}else if(sq==""&&$("table.productlist tr.highlightexact,table.productlist tr.highlightpartial").length>0){clearHighlightedProducts();}}
function clearHighlightedProducts(){$("table.productlist tr").removeClass("highlightexact").removeClass("highlightpartial");}
function updateBasket(){var subtotal=$(".total").sum();if(subtotal>0){$("#subtotal").text("$"+subtotal.toFixed(2))}else{subtotal=parseFloat($("#subtotal").text().replace("$",""));}
var srps=0;var subt=0;var count=0;$("#basket td.quantity").each(function(){count+=1;srps+=(parseFloat($(this).find("input[name^=srp]").val())*parseInt($(this).find("input[name^=quantity]").val()));subt+=(parseFloat($(this).parent().find("td.price").html().replace(/\$/g,""))*parseInt($(this).find("input[name^=quantity]").val()));});$("#basket input[name^=srp]").sum();if(!isNaN(srps)&&srps>0&&srps-subt>=1){if($(".yousaved").length==0)$("#basket").after("<p class=\"yousave\"></p>");$(".yousaved").html("You are saving <strong>$"+(srps-subt).toFixed(2)+"</strong> off list price by purchasing from us! ");}else{$(".yousaved").remove();}
var discount=parseFloat($("#discount").text().replace("$",""));if(isNaN(discount))discount=0;var tax=parseFloat($("#tax").text().replace("$",""));if(isNaN(tax))tax=0;var shipping=parseFloat($("#shipping").text().replace("$",""));if(isNaN(shipping))shipping=0;var gtotal=subtotal-discount+shipping+tax;$("#grandtotal,span.grandtotal").text("$"+gtotal.toFixed(2));$("#yourbasket span").html("Your Basket <em>("+count.toString()+")</em>");}
function updateShipPrices(){ajaxOn($("#shipZip"));var options="";$.get("/global/cpeAjax.html?a=sp&z="+$("#shipZip").val()+"&sm="+$("#shipmethod").val(),function(data){if(data.length>5){var jo=eval("({ "+data+" })");if(jo.result!="false"){if(jo.tax>0){$("#taxtext").html(jo.taxState+" Sales Tax:&nbsp;");$("p.disclaimer span.p1").hide("fast");}else{$("#taxtext").html("Sales Tax<sup>1</sup>:&nbsp;");$("p.disclaimer span.p1").show("fast");}
$("#tax").html("$"+parseFloat(jo.tax,2).toFixed(2));$("#shipping").html("$"+parseFloat(jo.shipping).toFixed(2));if(jo.upsground)options+="<option value=\"upsground\">UPS&reg; Ground ($"+parseFloat(jo.upsground,2).toFixed(2)+")</option>";if(jo.upsblue)options+="<option value=\"upsblue\">UPS&reg; 2nd-Day Air ($"+parseFloat(jo.upsblue,2).toFixed(2)+")</option>";if(jo.upsred)options+="<option value=\"upsred\">UPS&reg; Next-Day Air ($"+parseFloat(jo.upsred,2).toFixed(2)+")</option>";$("#gtotaltext").html("Grand Total:&nbsp;");}else{$("#taxtext").html("Sales Tax<sup>1</sup>: ");$("#shipping,#tax").html("$-.--");$("p.disclaimer span.p1").show("fast");$("#gtotaltext").html("Estimated Grand Total<sup>2</sup>:&nbsp;");}}else{$("#taxtext").html("Sales Tax<sup>1</sup>:&nbsp;");$("#shipping,#tax").html("$-.--");$("p.disclaimer span.p1").show("fast");$("#gtotaltext").html("Estimated Grand Total<sup>2</sup>:&nbsp;");}
$("#taxExemptHolder").css("display",$("#tax").html()=="$0.00"?"none":"block");if(options.length==0){options+="<option value=\"\">(Enter your 5-digit US ZIP code above.)</option>";}
var selected=$("#shipmethod").val();options=options.replace("<option value=\""+selected+"\"","<option selected=\"selected\" value=\""+selected+"\"");$("#shipmethod").empty().html(options).change();ajaxOff($("#shipZip"));updateBasket();});}
function setupBasket(){$("#shipmethod").change(function(){if($(":selected",this).text().match(/\$\d*\.\d+/)!=null){$.get("/global/cpeAjax.html?a=usm&sm="+$("#shipmethod").val(),function(){});var price=$(":selected",this).text().match(/\$\d*\.\d+/).toString().replace("$","");var totalPrice=parseFloat(price);$("#shipping").text("$"+parseFloat(totalPrice).toFixed(2));updateBasket();}else{}
return true});$("#basket #shipZip").change(updateShipPrices);$("#basket a[href^=?remove=]").click(function(){var that=this;var pid=$(this).attr("href").replace("?remove=","");$.get("/global/cpeAjax.html?a=rfb&pid="+pid,function(data){if(data=='ok'){$(that).parents("tr").remove();if($("#basket tbody tr").length==0){window.location.href="/your-basket.html";}else{$("#basketmessage").html("Part "+pid+" has been removed from your basket.");}
updateShipPrices();}else{return true}});return false;});$("#printbasket").click(function(){window.print();return false});$("#sendBasketForm").submit(function(){var bad="";if(!/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i.test($("#youremail").val()))bad+="- Your email address is invalid.<br />";if(!/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i.test($("#theiremail").val()))bad+="- Their email address is invalid.<br />";if($.trim($("#message").val()).length==0)bad+="- Please type a message.<br />";if(bad!=""){$("#sendBasketForm>p:first-child").css("color","#f00").html("<strong>Please correct these and try again:</strong><br />"+bad);return false}else{return true}});if($("#basket tbody tr").length>1&&goodBrowser()){$("p.jshide").after('<p class=\"align-right\">To purchase the items in your basket, click <input id="checkout2" type="submit" title="Check Out" value="Check Out" onclick="$(\'#checkout\').click();return false" /></p>');}}
function basketMessage(text){if($("#basketmessage").length==0){$("#center h1:first-child").after("<p id=\"basketmessage\" class=\"info\"></p>");}
$("#basketmessage").empty().html(text);setTimeout(function(){$("#basketmessage").slideUp(1000).remove();},3000);}
function qtyNotMultipleOf(multiple){basketMessage("This product can only be ordered in multiples of "+multiple.toString()+".");}
function qtyExceededLowerLimit(lowerLimit){basketMessage("You have to have at least "+lowerLimit.toString()+" of this product to order.");}
function qtyExceededUpperLimit(upperLimit){basketMessage("You can only order "+upperLimit.toString()+" of this product at this time.");}
function qtyChanged(elem,newValue){var num=$(elem).attr("name").replace("quantity","");var part=$("input[name=partid"+num+"]").val();ajaxOn(elem);$.get("/global/cpeAjax.html?a=ub&p="+part+"&q="+newValue,function(data){if(data!=""){var newp=parseFloat(data)
if(newp!=NaN){$(elem).parent().parent().find(".total").html("$"+newp.toFixed(2));basketMessage("The quantity for that part has been changed to "+newValue.toString()+".");updateShipPrices();}}
ajaxOff(elem);});updateBasket();}
(function($){$.fn.wresize=function(f){version='1.1';wresize={fired:false,width:0};function resizeOnce(){if($.browser.msie){if(!wresize.fired){wresize.fired=true;}
else{var version=parseInt($.browser.version,10);wresize.fired=false;if(version<7){return false;}
else if(version==7){var width=$(window).width();if(width!=wresize.width){wresize.width=width;return false;}}}}
return true;}
function handleWResize(e){if(resizeOnce()){return f.apply(this,[e]);}}
this.each(function(){if(this==window){$(this).resize(handleWResize);}
else{$(this).resize(f);}});return this;};})(jQuery);function minwidth(){var cssprop=jQuery("body").css("min-width");if(cssprop==null){cssprop=1000;}else{cssprop=parseInt(cssprop);};var margin=parseInt(jQuery("body").css("margin-left"))+parseInt(jQuery("body").css("margin-right"));if(clientwidth()<(cssprop+margin+21)){jQuery(document.body).width(cssprop);}else{jQuery(document.body).width("auto");};};function clientwidth(){var dimensions={width:0,height:0};if(window.innerWidth&&window.innerHeight){dimensions.width=window.innerWidth;dimensions.height=window.innerHeight;}else if(document.documentElement){dimensions.width=document.documentElement.offsetWidth;dimensions.height=document.documentElement.offsetHeight;};return dimensions.width;};function findLongestColumn(){var that=$("#container");function rz(){var longest=0;var cols=$(".column",that);for(var i=0;i<cols.length;i++){var hgt=$(cols[i]).height();if(hgt>longest){longest=hgt;}}
if(longest>0)$(that).height(longest);}
rz();setTimeout(rz,5000);setTimeout(rz,15000);}
function init(){if((jQuery.browser.msie)&&(jQuery.browser.version==6)){minwidth();$(window).wresize(minwidth);}
saveJSInfo();$("body").pngFix();$("a[innertext^=skip to]").hide();if(window.screen.width<1100){$("h1,legend").css("font-size","24pt");$("#afeatures").css("width","90px").find("span").html("Features");$("#asystemreq").css("width","90px").find("span").html("Sys. Req.");}
if(!goodBrowser()){$("#nojs").removeClass("jshide");}else{$(".jshide").css("display","none").hide();}
$(".nav li:even").addClass("alt");var bcstate=readCookie("bcdefault");if(bcstate==""){$("body").hasClass("sf")||$("body").hasClass("home")?swbrands():swcategories();}else{if(bcstate=="b"){swbrands()}else{swcategories()}}
$("#swbrands").click(function(){swbrands();createCookie("bcdefault","b",364);});$("#swcategories").click(function(){swcategories();createCookie("bcdefault","c",364);});$(window).resize(function(){findLongestColumn();var w=$(window).width();if(w<1187&&$("#myaccount").length==1){$("#groups ul").css("width","1090px").find("#myaccount").parent().remove();}else if(w>=1187&&$("#myaccount").length==0){$("#groups ul").css("width","1200px").append("<li><a title=\"My Account\" href=\"/my-account/index.html\" id=\"myaccount\"><span>My Account</span></a></li>");}
return true});$(window).resize();$("#groups ul").each(function(){var lis=$(this).find("li");var tw=0;for(var i=0;i<lis.length;i++){var w=$(lis[i]).width();var ml=parseInt($(lis[i]).css("margin-left"));var mr=parseInt($(lis[i]).css("margin-right"));var pl=parseInt($(lis[i]).css("padding-left"));var pr=parseInt($(lis[i]).css("padding-right"));tw+=w+ml+mr+pl+pr;}
$(this).width(tw);});$("ul.nav>li").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");}).click(function(){if($(this).children("a").attr("href").length>0)window.location.href=$(this).children("a").attr("href");}).filter(".selected").click(function(){}).end();var colors=["darkblue","blue","aqua","bluegreen","green","yellow","orange","red","lightpurple","purple"];var directions=["left","right"]
var img=new Array((colors.length-1)*(directions.length-1));var count=0;for(var didx=0;didx<directions.length;didx++){for(var cidx=0;cidx<colors.length;cidx++){img[count]=new Image();img[count].src="/images/sitev4/tabs/tab-"+colors[cidx]+"-"+directions[didx]+".gif";var img2=new Image();img2.src="/images/sitev4/tabs/bar-"+colors[cidx]+".gif";count+=1;}}
$("table.featuredlist").each(function(){var items=$("td",this).length;if(items==1)$("td",this).css("width","100%");if(items==2)$("td",this).css("width","50%");if(items>=3)$("td",this).css("width","33%");});if($("body#http").length==1){$("#groups ul li a").click(function(){var tc=$("body").attr("class").indexOf("twocol")>-1?"twocol ":"";$("body").attr("class",tc+$(this).attr("id"));return true});}
$("#newsletter form").submit(function(){var bad="";if(!/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i.test($("#email").val()))bad+="Your email address is invalid.";if(bad.length>0){alert(bad);return false}else{return true}});$("#search").focus(function(){$("#searchtips").show("fast");}).blur(function(){$("#searchtips").hide("fast");});if($("#highlight").length>0){$("#highlight").submit(function(){return false});$("#highlightTerm").blur(highlightProducts);$("#highlightTerm").keyup(function(){setTimeout("highlightProducts();",250);});$("#hw").click(function(){$("#highlightTerm").val("windows").keyup();return false});$("#hms").click(function(){$("#highlightTerm").val("mac os").keyup();return false});}
if($("table.productlist").length>0){$("table.productlist").tablesorter({cssAsc:"asc",cssDesc:"desc"});}
if(!($.browser.msie&&$.browser.version<7)){$("#parttabs a").click(function(){var a=this;var tabname=$(a).attr("href");var as=$("#parttabs a").removeClass("active");$("#parttabs a[href="+tabname+"]").addClass("active");var namelist="";for(var i=0;i<as.length;i++){namelist+=$(as[i]).attr("href")+",";}
$(namelist).hide();$(tabname).show();$(window).resize();return false});}else{$("#parttabs").remove();}
if($("#parttabs").length==1){var totalWidth=0;$("#parttabs li a").each(function(){totalWidth+=$(this).width();});$("#parttabs ul").css("width",totalWidth.toString()+"px");$("#systemrequirements,#details").hide();$("#parttabs li:first-child a").click();}
$("#multipleans").hide();$("#q>span").css("border-bottom","dotted 1px #000").css("cursor","pointer").mouseover(function(){$("#multipleans").show("fast");}).mouseout(function(){$("#multipleans").hide("fast");})
if($("#buynow").length==1&&goodBrowser()){$("#buynow").attr("disabled",$("#addtobasket").attr("disabled"));}
setupBasket();$("#changePassword").submit(function(){var bad="";if($("#oldpassword").val()=="")bad+="- You must enter your old password.<br />";if($.trim($("#newpassword").val()).length<6)bad+="- You must enter a new password that is 6 characters or longer.<br />";if($.trim($("#newpassword").val())!=$.trim($("#cfmpassword").val()))bad+="- The two new passwords must match.<br />";if($.trim($("#oldpassword").val())==$.trim($("#newpassword").val()))bad+="- Your old password cannot be your new password.<br />";if(bad!=""){$("#changePassword>p:first-child").css("color","#f00").html("<strong>Please correct these and try again:</strong><br />"+bad);return false}else{return true}});$("#rmadetail td[colspan=5] input[id^=return-check]").click(function(){var index=$(this).attr("id").replace("return-check","");$(this).attr("checked")?$("#return-options"+index).show("fast"):$("#return-options"+index).hide("fast");});$("#rmaRequestForm").submit(function(){var bad="";var ci=$("#rmadetail td[colspan=5] input[id^=return-check]:checked");if(ci.length==0){bad+="You must select at least one item to return.<br />";}else{for(var i=0;i<ci.length;i++){var index=$(ci[i]).attr("id").replace("return-check","");var indexn=parseInt(index);var itemno=(indexn+1).toString();var qty=$("#quantity"+index).val();var cond=$("#condition"+index).val();var reason=$("#reason"+index).val();var qtyn=parseInt(qty);if(isNaN(qtyn)||qtyn==0)bad+="For item "+itemno+", the quantity you want returned must be specified.<br />";if($.trim(cond)=="")bad+="For item "+itemno+", the condition of the product must be specified.<br />";if($.trim(reason)=="")bad+="For item "+itemno+", the reason for return must be specified.<br />";}}
if(bad!=""){if($("#center h1+div.info").length==0)$("<div class=\"info\">").insertAfter("#center h1");$("#center h1+div.info").html(bad);return false;}else{return true;}});}
$(init);(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'.',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,cells[i]);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i];}}return parsers[0];}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));}cols.push(i);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){if(!node)return"";var t="";if(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){t=node.childNodes[0].innerHTML;}else{t=node.innerHTML;}}else{if(typeof(config.textExtraction)=="function"){t=config.textExtraction(node);}else{t=$(node).text();}}return t;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0;};$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(!this.sortDisabled){$(this).addClass(table.config.cssHeader);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0;}else{i=(v==(0||1))?v:0;}return i;}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function sortText(a,b){return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){var DECIMAL='\\'+config.decimal;var exp='/(^[+]?0('+DECIMAL+'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)'+DECIMAL+'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*'+DECIMAL+'0+$)/';return RegExp(exp).test($.trim(s));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}$("tr:visible",table.tBodies[0]).filter(':even').removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(':odd').removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery);(function($){jQuery.fn.pngFix=function(settings){settings=jQuery.extend({blankgif:'blank.gif'},settings);var ie55=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 5.5")!=-1);var ie6=(navigator.appName=="Microsoft Internet Explorer"&&parseInt(navigator.appVersion)==4&&navigator.appVersion.indexOf("MSIE 6.0")!=-1);if(jQuery.browser.msie&&(ie55||ie6)){jQuery(this).find("img[@src$=.png]").each(function(){jQuery(this).attr('width',jQuery(this).width());jQuery(this).attr('height',jQuery(this).height());var prevStyle='';var strNewHTML='';var imgId=(jQuery(this).attr('id'))?'id="'+jQuery(this).attr('id')+'" ':'';var imgClass=(jQuery(this).attr('class'))?'class="'+jQuery(this).attr('class')+'" ':'';var imgTitle=(jQuery(this).attr('title'))?'title="'+jQuery(this).attr('title')+'" ':'';var imgAlt=(jQuery(this).attr('alt'))?'alt="'+jQuery(this).attr('alt')+'" ':'';var imgAlign=(jQuery(this).attr('align'))?'float:'+jQuery(this).attr('align')+';':'';var imgHand=(jQuery(this).parent().attr('href'))?'cursor:hand;':'';if(this.style.border){prevStyle+='border:'+this.style.border+';';this.style.border='';}
if(this.style.padding){prevStyle+='padding:'+this.style.padding+';';this.style.padding='';}
if(this.style.margin){prevStyle+='margin:'+this.style.margin+';';this.style.margin='';}
var imgStyle=(this.style.cssText);strNewHTML+='<span '+imgId+imgClass+imgTitle+imgAlt;strNewHTML+='style="position:relative;white-space:pre-line;display:inline-block;background:transparent;'+imgAlign+imgHand;strNewHTML+='width:'+jQuery(this).width()+'px;'+'height:'+jQuery(this).height()+'px;';strNewHTML+='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader'+'(src=\''+jQuery(this).attr('src')+'\', sizingMethod=\'scale\');';strNewHTML+=imgStyle+'"></span>';if(prevStyle!=''){strNewHTML='<span style="position:relative;display:inline-block;'+prevStyle+imgHand+'width:'+jQuery(this).width()+'px;'+'height:'+jQuery(this).height()+'px;'+'">'+strNewHTML+'</span>';}
jQuery(this).hide();jQuery(this).after(strNewHTML);});jQuery(this).find("*").each(function(){var bgIMG=jQuery(this).css('background-image');if(bgIMG.indexOf(".png")!=-1){var iebg=bgIMG.split('url("')[1].split('")')[0];jQuery(this).css('background-image','none');jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+iebg+"',sizingMethod='scale')";}});jQuery(this).find("input[@src$=.png]").each(function(){var bgIMG=jQuery(this).attr('src');jQuery(this).get(0).runtimeStyle.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader'+'(src=\''+bgIMG+'\', sizingMethod=\'scale\');';jQuery(this).attr('src',settings.blankgif)});}
return jQuery;};})(jQuery);
