$sd(document).ready(function(){$sd().HoverBox({items:".product .productImage",container:"body",hoverBoxId:"hoverBox",delay:200,xOffset:-40,yOffset:25});
var d=sdg.gallerySwatchImageSwapType||"none";var b=$sd(".gallerySwatches").find("li").find("img");
if(d==="click"){b.addClass("jsAction").click(function(){a(this);});}else{if(d==="hover"){b.addClass("jsAction").hover(function(){a(this);
});}}function a(g){var k=$sd(g),l=k.attr("rel"),j=k.closest(".gallerySwatches").find("#"+l).val(),h=k.closest(".product").find(".productImage").find("img"),f=h.attr("src"),e=f.replace(/\$prod_img=[^&]+/i,"$prod_img="+j);
if(j){h.attr("src",e);}}var c=$sd("#mainContent");$switchGrid=c.find(".switch_grid"),$switchList=c.find(".switch_list"),$products=$sd("#products");
$switchGrid.click(function(){if(!$sd(this).hasClass(".active")){$products.fadeOut("normal",function(){$products.addClass("gridview").removeClass("listview").fadeIn("normal");
$sd("html, body").stop(true,true).animate({scrollTop:c.offset().top},500);});$switchGrid.addClass("active");
$switchList.removeClass("active");$sd.getJSON("/json/changeGalleryView.jsp?listview=false");
}return false;});$switchList.click(function(){if(!$sd(this).hasClass(".active")){$products.fadeOut("normal",function(){$products.addClass("listview").removeClass("gridview").fadeIn("normal");
$sd("html, body").stop(true,true).animate({scrollTop:c.offset().top},500);});$switchList.addClass("active");
$switchGrid.removeClass("active");$sd.getJSON("/json/changeGalleryView.jsp?listview=true");
}return false;});$sd(".extratext").each(function(){var f=$sd(this),e=f.text(),h=f.html(),g="";
if(e.length>400){for(i=200;i<e.length;i++){if(e.charAt(i)=="."&&e.charAt(i+1)==" "){break;
}}if(i=e.length){for(i=300;i<e.length;i++){if(e.charAt(i)==" "){i=i-2;g="&hellip;";
break;}}}if(i<e.length){f.html(e.substr(0,i+2)).append(g+' <a href="" class="toggleDescription">More</a>').after('<div class="extratext fullDescription" style="display:none">'+h+' <a href="" class="toggleDescription">Less</a></div>');
}}});$sd(".proddescinfo").find("a").live("click",function(){$sd(this).parents(".proddescinfo").find(".fullDescription, .originalDescription").toggle();
return false;});});
