$(function(){$("#cartItems table tr:nth-child(2n+2)").css("display","block");$("#cartItems table tr:nth-child(4n+3)").css("background","#eeeeee");var b=1;$("#rotatingImage .rotate:nth-child(1)").css("display","block");setTimeout(a,6000);function a(){$("#rotatingImage .rotate:nth-child("+b+")").fadeOut(1500);if(b+1>5){b=1;}else{b=b+1;}$("#rotatingImage .rotate:nth-child("+b+")").fadeIn(500);setTimeout(a,6000);}$("#scroller").jCarouselLite({btnNext:".next",btnPrev:".prev",visible:7,circular:true});$("#vertScroller").jCarouselLite({btnNext:".down",btnPrev:".up",visible:14,circular:false,vertical:true});$("a[rel^='lightbox']").prettyPhoto({animationSpeed:"normal",padding:40,opacity:0.35,showTitle:true,allowresize:false});});function equalizeheight(){var d=0;var a=0;var c=0;var g=0;$("#eqTwo .productName").each(function(){if($(this).outerHeight()>a){a=$(this).height();}});$("#eqTwo .productDesc").each(function(){if($(this).outerHeight()>c){c=$(this).height();}});$("#eqTwo div[id*='pnlDisplayPrice']").each(function(){if($(this).outerHeight()>g){g=$(this).height();}});$("#eqTwo .productName").each(function(){$(this).css("height",a);});$("#eqTwo .productDesc").each(function(){$(this).css("height",c);});$("#eqTwo div[id*='pnlDisplayPrice']").each(function(){$(this).css("height",g);});var f=$("#body #mainCol").outerHeight();var b=$("#body #subCol").outerHeight();if(fb){$("#body #subCol").css("height",f);}var e=$("#content").outerHeight();$("#shadowLeft").css("height",e);$("#shadowRight").css("height",e);if($("#products").length>0){if(f<680){$("#products").css("height", 1340);}}if($("#brandLanding").length>0){if(f<680){$("#brandLanding").css("height",660);}}}$(document).ready(function(){$("#accessoryitem").live("click",function(){var b=$("#UpsellProducts").val();var a=b.split(",");var c=$(this).val();if($(this).is(":checked")){if(b.length>0){b=$("#UpsellProducts").val()+","+$(this).val();}else{b=$(this).val();}$("#UpsellProducts").val(b);}else{$("#UpsellProducts").val($.grep(a,function(d){return d!=c;}));}});});$(document).ready(function(){$("#topsearchform").submit(function(){if($("#searchBox").val().length<3){alert("Please enter at least 3 characters in the Search For field");return false;}else{return true;}});});$(document).ready(function(){if($("#breadcrumbs > #breadcrumbtrailparams").length>0){$("#breadcrumbline").hide();$.ajax({type:"POST",url:"StoreFrontService.asmx/GetXMLPackageHTML",data:"{'strXMLPackage':'custom.breadcrumbgetinfo.xml.config', 'strRuntimeParams':'"+$("#breadcrumbs > #breadcrumbtrailparams").val()+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(a){$("#breadcrumbline").html(a);$("#breadcrumbline").fadeIn("slow");}});}});$(document).ready(function(){if($("#mycarousel").length>0){$("#pnlRelatedAccessories").hide();$("#mycarousel").jcarousel({scroll:4,itemLoadCallback:relatedaccessories_itemLoadCallback});}if($("#mycarousel2").length>0){$("#pnlRelatedAccessories").hide();$("#mycarousel2").jcarousel({scroll:4,itemLoadCallback:otheraccessories_itemLoadCallback});}if($("#mycarousel3").length>0){$("#pnlRecommendedProducts").hide();$("#mycarousel3").jcarousel({scroll:4,itemLoadCallback:recommendedProducts_itemLoadCallback});}if(($("#mycarousel").length>0)||($("#mycarousel2").length>0)||($("#mycarousel3").length>0)){setTimeout(equalizemainColHeight,1000);}});function otheraccessories_itemLoadCallback(b,a){if((a!="init")&&(a!="next")){return;}if((b.last!=b.size())&&b.size()!=null){return;}$.ajax({type:"POST",url:"StoreFrontService.asmx/GetXMLPackageHTML",data:"{'strXMLPackage':'custom.accessoriesscroller.xml.config', 'strRuntimeParams':'"+$("#mycarousel2 > #otheraccessoriesparams").val()+"&OtherAccessories=true'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){if(e.length>0){var c=e.split("|x|");$("#pnlOtherAccessories").show("slow");var d=0;if(b.size()!=null){d=b.size();}$.each(c,function(g,f){b.add(g+d,f);});b.size(d+c.length);equalizeHeightOnSelectElements($("#pnlOtherAccessories"));}else{$("#pnlOtherAccessories").hide();}}});}function relatedaccessories_itemLoadCallback(b,a){if(a!="init"){return;}$.ajax({type:"POST",url:"StoreFrontService.asmx/GetXMLPackageHTML",data:"{'strXMLPackage':'custom.accessoriesscroller.xml.config', 'strRuntimeParams':'"+$("#mycarousel > #relatedaccessoriesparams").val()+"&RelatedAccessories=true'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(d){if(d.length>0){var c=d.split("|x|");$("#pnlRelatedAccessories").show("slow");$.each(c,function(f,e){b.add(f,e);});b.size(c.length);equalizeHeightOnSelectElements($("#pnlRelatedAccessories"));}else{$("#pnlRelatedAccessories").hide();}}});}function recommendedProducts_itemLoadCallback(b,a){if(a!="init"){return;}$.ajax({type:"POST",url:"StoreFrontService.asmx/GetXMLPackageHTML",data:"{'strXMLPackage':'custom.accessoriesscroller.xml.config', 'strRuntimeParams':'RecommendedProducts=true'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(d){if(d.length>0){var c=d.split("|x|");$("#pnlRecommendedProducts").show("slow");$.each(c,function(f,e){b.add(f,e);});b.size(c.length);equalizeHeightOnSelectElements($("#pnlRecommendedProducts"));}else{$("#pnlRecommendedProducts").hide();}}});}function equalizeHeightOnSelectElements(d){var c=0;var a=0;var b=0;var e=0;$("#eqTwo .productName",d).each(function(){if($(this).outerHeight()>a){a=$(this).height();}});$("#eqTwo .productDesc",d).each(function(){if($(this).outerHeight()>b){b=$(this).height();}});$("#eqTwo div[id*='pnlDisplayPrice']",d).each(function(){if($(this).outerHeight()>e){e=$(this).height();}});$("#eqTwo .productName",d).each(function(){$(this).css("height",a);});$("#eqTwo .productDesc",d).each(function(){$(this).css("height",b);});$("#eqTwo div[id*='pnlDisplayPrice']",d).each(function(){$(this).css("height",e);});}function equalizemainColHeight(){var c=$("#body #mainCol").outerHeight();var a=$("#body #subCol").outerHeight();if(ca){$("#body #subCol").css("height",c);}var b=$("#content").outerHeight();$("#shadowLeft").css("height",b);$("#shadowRight").css("height",b);if($("#catLanding").length>0){if(c<680){$("#catLanding").css("height",660);}}}$(document).ready(function(){if($("#SunglassesMeasurements").length>0){$("#SunglassesMeasurements").hide();$.ajax({type:"POST",url:"StoreFrontService.asmx/GetXMLPackageHTML",data:"{'strXMLPackage':'custom.sunglassesmeasurements.xml.config', 'strRuntimeParams':'"+$("#SunglassesMeasurements > #measurementsparams").val()+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(a){$("#SunglassesMeasurements").html(a);$("#SunglassesMeasurements").fadeIn("slow");}});}});$(document).ready(function(){if($("#homepageproducts").length>0){$("#homepageproducts").hide();$.ajax({type:"POST",url:"StoreFrontService.asmx/GetXMLPackageHTML",data:"{'strXMLPackage':'custom.homepageproducts.xml.config', 'strRuntimeParams':''}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(a){$("#homepageproducts > #eqTwo").html(a);$("#homepageproducts").fadeIn("slow");equalizeHeightOnSelectElements($("#homepageproducts"));equalizemainColHeight();}});}});$(document).ready(function(){if($("#catLanding").length>0){$("#eqTwo").hide();$.ajax({type:"POST",url:"StoreFrontService.asmx/GetXMLPackageHTML",data:"{'strXMLPackage':'custom.categorylandingproducts.xml.config', 'strRuntimeParams':'"+$("#catLanding > #catLandingparams").val()+"'}",contentType:"application/json; charset=utf-8",dataType:"json",success:function(a){$("#catLanding > #eqTwo").html(a);$("#eqTwo").fadeIn("slow");equalizeHeightOnSelectElements($("#catLanding"));equalizemainColHeight();}});}});$(document).ready(function(){if($("#homepageproducts").length>0){return;}if($("#homepageproducts").length>0){return;}if($("#mycarousel").length>0){return;}if($("#mycarousel2").length>0){return;}$(document).load(setTimeout(equalizeheight,100));});