/*tandoori.js*/
var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};var Tandoori=Class.create();function WindowEdges(){var C=document.createElement("div");var A=jQuery(C).css({position:"absolute",width:"1px",height:"1px",bottom:"0",right:"0"}).appendTo(document.body);var B=A.offset();document.body.removeChild(C);return[B.left+1,B.top+1]}function ContractCategorySidebar(){jQuery("#category-sidebar li").each(function(A){if(this.hasClass(h1)){this.hide()}})}Tandoori.executeWhenAvailable=function(D,A){if(jQuery("#"+A)){D()}else{var C=D,B=A;setTimeout(Tandoori.executeWhenAvailable(C,B),100)}};
/* popupwindow.js */
isMac=(navigator.appVersion.indexOf("Mac")!=-1)?true:false;NS4=(document.layers)?true:false;IEmac=((document.all)&&(isMac))?true:false;IE4plus=(document.all)?true:false;IE4=((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1))?true:false;IE5=((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1))?true:false;IE6=((document.all)&&(navigator.appVersion.indexOf("MSIE 6.")!=-1))?true:false;ver4=(NS4||IE4plus)?true:false;NS6=(!document.layers)&&(navigator.userAgent.indexOf("Netscape")!=-1)?true:false;IE5plus=IE5||IE6;IEMajor=0;if(IE4plus){var start=navigator.appVersion.indexOf("MSIE");var end=navigator.appVersion.indexOf(".",start);IEMajor=parseInt(navigator.appVersion.substring(start+5,end));IE5plus=(IEMajor>=5)?true:false}var gSafeOnload=new Array();function SafeAddOnload(A){if(IEmac&&IE4){window.onload=SafeOnload;gSafeOnload[gSafeOnload.length]=A}else{if(window.onload){if(window.onload!=SafeOnload){gSafeOnload[0]=window.onload;window.onload=SafeOnload}gSafeOnload[gSafeOnload.length]=A}else{window.onload=A}}}function SafeOnload(){for(var A=0;A<gSafeOnload.length;A++){gSafeOnload[A]()}}function isInt(B){var A=parseInt(B);return !isNaN(A)}function PUW_Init(){if(gPopupWindow.CheckFrequency()){setTimeout("gPopupWindow.Show()",gPopupWindow.showDelay)}}function PUW_Show(){var B="width="+this.width+",height="+this.height+",top="+this.top+",left="+this.left+",";B+="scrollbars="+((this.scrollbars)?"yes,":"no,");B+="toolbar="+((this.toolbar)?"yes,":"no,");B+="location="+((this.locationbar)?"yes,":"no,");B+="menubar="+((this.menubar)?"yes,":"no,");B+="status="+((this.statusbar)?"yes,":"no,");B+="resizable="+((this.resizable)?"yes":"no");var A=window.open(this.url,this.name,B);if(!this.ontop){window.focus()}}function PUW_CheckFrequency(){var A=this.frequency!=0;if(this.frequency>0){var C=document.cookie;var F=C.indexOf("PUWCount=");if(F>=0){var B=C.indexOf(";",F);if(B<0){B=C.length}var D=C.substring(F+9,B);if(isInt(D)){this.frequency=parseInt(D)}}if(this.frequency>0){this.frequency--}else{A=false}var E=new Date();E.setTime(E.getTime()+this.renew*60*60000);document.cookie="PUWCount="+this.frequency+"; expires="+E.toGMTString()}return A}function PopupWindow(C,D,B,A){this.width=D;this.height=B;this.top=screen.availHeight/2-B/2;this.left=screen.availWidth/2-D/2;this.name="CWViewer";this.url=C;this.showDelay=2000;this.frequency=2;this.renew=1;this.scrollbars=A;this.toolbar=false;this.statusbar=false;this.resizable=false;this.locationbar=false;this.menubar=false;this.ontop=true;this.Init=PUW_Init;this.Show=PUW_Show;this.CheckFrequency=PUW_CheckFrequency}function PUWStart(){gPopupWindow.Init()}function loadWindow(B,C,A){loadWindow(B,C,A,false)}function loadWindow(C,D,B,A){gPopupWindow=new PopupWindow(C,D,B,A);SafeAddOnload(PUWStart);gPopupWindow.toolbar=false;gPopupWindow.statusbar=false;gPopupWindow.resizable=true;gPopupWindow.ontop=true;gPopupWindow.Show()};
/* misc.js */
function ToggleHiddenLinks(A,B){jQuery("#"+A).toggleClass("tandoori-links-visible");jQuery("#"+A+" "+B).each(function(C){if(jQuery(this).hasClass("hl")){jQuery(this).toggle()}})}function startGreyBox(C,A,B,D){jQuery.ShowGreyBox("/browse/miniProductDetail.ajax",{onGreyBoxShow:function(){jQuery(A).css({position:"relative","z-index":105,background:"#EEE",border:"2px solid "+D,height:"50px"});try{pageTracker._trackPageview("/ajax/"+B+"/view")}catch(E){}},onGreyBoxExit:function(){jQuery(A).css({background:"#FFF",position:"static",border:"none"})},onGreyBoxError:function(){jQuery(A).unbind("click");jQuery(A+" a").unbind("click");jQuery(A).unbind("over");jQuery(A).css({background:"#FFF",position:"static",border:"none"})}},{data:({pid:C,googleAnalyticsTracking:""+B})})}function startGreyBoxQuickLook(E,A,D,C,B){if(C!=""){greyBoxOptions={attachGreyBoxElementsTo:C,onGreyBoxError:function(){jQuery(A).unbind("click");jQuery(A).css({background:"#FFF"})}}}else{greyBoxOptions={onGreyBoxError:function(){jQuery(A).unbind("click");jQuery(A).css({background:"#FFF"})}}}jQuery.ShowGreyBox(B,greyBoxOptions,{data:({pid:E,googleAnalyticsTracking:""+D})})}function miniProductPageAjax(D,B,A,E){try{jQuery("#"+B).click(function(){startGreyBox(D,"#"+B,A,E);return false});jQuery("#"+B).bind("mouseenter",function(){jQuery(this).css({position:"relative","z-index":105,"background-color":"#EEE",border:"2px solid "+E,height:"50px"})});jQuery("#"+B).bind("mouseleave",function(){if(!greyBoxShowing){jQuery(this).css({position:"relative","z-index":0,"background-color":"#fff",border:"none",height:"50px"})}})}catch(C){}}function miniProductPageMainAjax(H,F,D,E,B,C,A){try{if(F==""){divOrClassName="."+D}else{divOrClassName="#"+F}if(A==null){A="/browse/miniProductDetail.ajax"}jQuery(divOrClassName).click(function(){startGreyBoxQuickLook(H,divOrClassName,E,C,A);return false});if(B){greyBoxHoverIntentConfig.over=function(){startGreyBoxQuickLook(H,divOrClassName,E,C,A)};jQuery(divOrClassName).hoverIntent(greyBoxHoverIntentConfig)}}catch(G){}}function loadLocalDivInPopup(A,D,B,C,G){try{var F=C;if(C!="auto"){F=F+=1}jQuery.ShowGreyBox("",{localElementSelector:A,attachGreyBoxElementsTo:D,width:B,height:F,onGreyBoxShow:G},{})}catch(E){}}function setupMouseEnterAndMouseLeave(D,C,B,A){jQuery(C).bind("mouseenter",function(){jQuery(D).css({backgroundColor:B}).corner("round 10px");jQuery(C).css("backgroundColor",A).corner("round 8px")});jQuery(C).bind("mouseleave",function(){jQuery(D).css({backgroundColor:A});jQuery(D+" .jquery-corner").remove()})}function BetterTogetherItem(){var E=0;var D="";var B="";var C="";var A="";var F=false;this.GetPrice=function(){return E};this.GetCurrencyPriceString=function(){var G="$"+E;if((G).indexOf(".")==(G.length-2)){G+="0"}return G};this.SetPrice=function(G){E=G};this.GetCheckBoxIdForJquery=function(){return("#"+D)};this.SetCheckBoxId=function(G){D=G};this.GetDivIdForJquery=function(){return"#"+B};this.SetDivId=function(G){B=G};this.SetHidden=function(G){F=G};this.IsHidden=function(){return F};this.SetInputId=function(G){C=G};this.GetInputId=function(){return C}}function InitializeBetterTogetheterDropDownChangeListener(){jQuery("select.skuIdSelectionDropDown").change(function(){try{currentFirstBTISkuId=jQuery("select.skuIdSelectionDropDown").attr("value");var C=jQuery.trim(jQuery("select.skuIdSelectionDropDown :selected").text());var B=C.indexOf("$");if(B>-1){firstBTI.SetPrice(parseFloat(C.substring(B+1,C.length)));if(((B-2)>-1)&&(C.charAt(B-2)=="-")){C="- "+C.substring(0,B-2)}else{skuSelectiontext="- "+C.substring(0,B)}jQuery("#replaceableSkuPrice").text(firstBTI.GetCurrencyPriceString());jQuery("#totalBetterTogetherPriceValue").html(getTotalCurrencyBTPrice())}jQuery("#replaceableSkuDescription").html(jQuery.trim(C))}catch(A){jQuery("#totalBetterTogetherPrice").hide()}})}var currentBetterTogether=2;function betterTogetherCheckBoxChange(E,C,D,A){var B;switch(E){case 1:B=firstBTI;break;case 2:B=secondBTI;break;case 3:B=thirdBTI;break;default:B=firstBTI}if(jQuery(B.GetCheckBoxIdForJquery()).attr("checked")){B.SetHidden(false);if(currentBetterTogether==0){jQuery("#betterTogetherPricingRow").show("slow")}currentBetterTogether++;jQuery("#totalBetterTogetherPriceValue").html(getTotalCurrencyBTPrice());jQuery(B.GetDivIdForJquery()).show("slow")}else{B.SetHidden(true);currentBetterTogether--;jQuery(B.GetDivIdForJquery()).hide("fast");if(currentBetterTogether==0){jQuery("#betterTogetherPricingRow").hide("slow")}jQuery("#totalBetterTogetherPriceValue").html(getTotalCurrencyBTPrice())}displayCorrectCartImageAndText(C,D,A)}function displayCorrectCartImageAndText(B,C,A){switch(currentBetterTogether){case 0:jQuery("#betterTogetherPricingRow").hide();break;case 1:jQuery("#btPriceText").text("Only: ");jQuery("#"+B).attr("src","/images/cart/add-to-cart-bt.png");jQuery("#"+C).hide();jQuery("#"+A).hide();break;case 2:jQuery("#btPriceText").text("Get Both for Only: ");jQuery("#"+B).attr("src","/images/cart/add-both-to-cart.png");if(firstBTI.IsHidden()){jQuery("#"+C).hide();jQuery("#"+A).show()}else{jQuery("#"+C).show();jQuery("#"+A).hide()}break;default:jQuery("#btPriceText").text("Get All 3 for Only: ");jQuery("#"+B).attr("src","/images/cart/add-all-to-cart.png");jQuery("#"+C).show();jQuery("#"+A).show();break}};