
$(document).ready(function(){removeEmptyZones();setContentWidth();setTimeout('setContentWidth();',1000);$(window).resize(function(){setContentWidth();setTimeout('setContentWidth();',1000);});init();});function init()
{$("body").css("display","block");if($(".tree").length>0)
{$(".tree").treeview({collapsed:true,animated:"medium",persist:"location"});}
if($("body").hasClass("page-product"))
{if($(".product-page-blocks").hasClass("product-page-blocks-tabs"))
{var html='<ul>';var blockCounter=0;var checkRefresh=false;$(".product-page-blocks .product-page-block").each(function(){if($(this).find(".product-page-block-header").length>0)
{if($(".product-page-blocks ul li a[href='#product-page-block-"+blockCounter+"']").length>0)
{$(".product-page-blocks ul li a[href='#product-page-block-"+blockCounter+"']").html($(this).find(".product-page-block-header:first").html());checkRefresh=true;}
else
{var blockId=$(this).attr("id")!=''?$(this).attr("id"):'product-page-block-'+blockCounter;$(this).attr("id",blockId);var title=$(this).find(".product-page-block-header:first").html();html=html+'<li><a href="#'+blockId+'">'+title+'</a></li>';}}
blockCounter++;});html=html+'</ul>';$(".product-page-blocks .product-page-block .product-page-block-header").remove();if(html!='<ul></ul>')$(".product-page-blocks").prepend(html).tabs();if(checkRefresh)
{if(confirm("Some of changes you just made require page refresh.\nDo you want to do it now?"))
{document.location.reload();}}}}}