/*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)}};function expand(){jQuery(this).addClass("ddmenu1")}function collapse(){jQuery(this).removeClass("ddmenu1")};
/* 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});try{_gaq.push(["_trackPageview","/ajax/"+b+"/view"])}catch(e){}},onGreyBoxExit:function(){jQuery(a).css({background:"#FFF",position:"static",border:"#fff 2px solid"})},onGreyBoxError:function(){jQuery(a).unbind("click");jQuery(a+" a").unbind("click");jQuery(a).unbind("over");jQuery(a).css({background:"#FFF",position:"static",border:"#fff 2px solid"})}},{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 startAjaxGreyBoxQuickLook(g,f,c,d,e,a,h,b){if(f!=""){greyBoxOptions={attachGreyBoxElementsTo:f,height:a,width:e,onGreyBoxShow:h,onGreyBoxExit:b,localElementSelector:g,onGreyBoxError:function(){alert('The application encountered an error while performing this action.  Please use the "Report Problem with Page" link in the footer to let technical support know about it.')}}}else{greyBoxOptions={height:a,width:e,localElementSelector:g,onGreyBoxShow:h,onGreyBoxExit:b,onGreyBoxError:function(){alert('The application encountered an error while performing this action.  Please use the "Report Problem with Page" link in the footer to let technical support know about it.')}}}jQuery.ShowGreyBox(c,greyBoxOptions,{data:d})}function miniProductPageAjax(d,b,a,f){try{jQuery("#"+b).click(function(){startGreyBox(d,"#"+b,a,f);return false});jQuery("#"+b).bind("mouseenter",function(){if(!greyBoxShowing){jQuery(this).css({position:"relative","z-index":105,"background-color":"#EEE",border:"2px solid "+f})}});jQuery("#"+b).bind("mouseleave",function(){if(!greyBoxShowing){jQuery(this).css({position:"relative","z-index":0,"background-color":"#fff",border:"2px solid #fff"})}})}catch(c){}}function miniProductPageMainAjax(i,g,d,f,b,c,a){try{if(g==""){divOrClassName="."+d}else{divOrClassName="#"+g}if(a==null){a="/browse/miniProductDetail.ajax"}jQuery(divOrClassName).click(function(){startGreyBoxQuickLook(i,divOrClassName,f,c,a);return false});if(b){greyBoxHoverIntentConfig.over=function(){startGreyBoxQuickLook(i,divOrClassName,f,c,a)};jQuery(divOrClassName).hoverIntent(greyBoxHoverIntentConfig)}}catch(h){}}function miniProductPageMainAjaxSubmit(i,g,d,f,b,c,a){try{if(g==""){divOrClassName="."+d}else{divOrClassName="#"+g}if(a==null){a="/browse/miniProductDetail.ajax"}jQuery(divOrClassName).click(function(){startGreyBoxQuickLook(i,divOrClassName,f,c,a);setTimeout("checkMiniProdForm(0)",1000);return false});if(b){greyBoxHoverIntentConfig.over=function(){startGreyBoxQuickLook(i,divOrClassName,f,c,a)};jQuery(divOrClassName).hoverIntent(greyBoxHoverIntentConfig)}}catch(h){}}function checkMiniProdForm(a){a++;if(typeof submitMiniProdForm=="function"){submitMiniProdForm()}else{if(a<5){setTimeout("checkMiniProdForm("+a+")",1000)}else{}}}function loadLocalDivInPopup(a,d,b,c,h){try{var g=c;if(c!="auto"){g=g+=1}jQuery.ShowGreyBox("",{localElementSelector:a,attachGreyBoxElementsTo:d,width:b,height:g,onGreyBoxShow:h},{})}catch(f){}}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())}if(c.indexOf("price in cart")>-1){jQuery("#replaceableSkuDescription").html(jQuery.trim(c).replace("(price in cart) *",")"));jQuery("#replaceableSkuPrice").html('(See price in Cart) <a class="btReasonForCartPrice" href="#" onclick="jQuery(\'#reasonForCartPrice\').trigger(\'click\');return false;">Why?</a>')}else{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}};
