function resetUI(){$(".tabs").tabs();$(".accordion").accordion({header:"h4",autoHeight:!1,active:!1});$(".topMenu").buildMenu({menuWidth:200,menuSelector:".menuContainer",hasImages:!1,fadeInTime:200,fadeOutTime:200,menuTop:0,menuLeft:0,opacity:100,openOnRight:!1,openOnClick:!1,closeAfter:1E3,hoverIntent:100,submenuHoverIntent:100,closeOnMouseOut:!0});$(".leftMenu").buildMenu({menuWidth:200,menuSelector:".menuContainer",hasImages:!1,fadeInTime:200,fadeOutTime:200,menuTop:0,menuLeft:0,opacity:100,openOnRight:!0,
openOnClick:!1,closeAfter:2E3,hoverIntent:100,submenuHoverIntent:100,closeOnMouseOut:!1});window.addthis&&(window.addthis=null);$.getScript("http://s7.addthis.com/js/250/addthis_widget.js#&pubid=ra-4e1da7ad1a6486e4&domready=");$(".scroll-pane").jScrollPane({showArrows:!0,hideFocus:!0,enableKeyboardNavigation:!0,horizontalGutter:0,arrowScrollOnHover:!1,arrowButtonSpeed:504,clickOnTrack:!1,horizontalDragMinWidth:100,animateScroll:!0,autoReinitialise:!0,autoReinitialiseDelay:1E3});$(".scroll-pane p").each(function(){imgwidth=
parseInt($("img",this).css("width"));imgcount=$("img",this).length;pwidth=parseInt(imgcount*(imgwidth+3));$(this).width(pwidth)});$("a[rel][href][ajxlay!=1]").fancybox({padding:5,topRatio:0.5,playSpeed:2E3,loop:!0,openEffect:"elastic",closeEffect:"elastic",closeBtn:!1,scrolling:!1,fixed:!0,fitToView:!0,mouseWheel:!0,helpers:{buttons:{},thumbs:{width:100,height:76,position:"bottom"},title:{type:"inside"},overlay:{speedIn:1500,opacity:0.8}},afterLoad:function(){child_img_alt=$("a[href='"+this.href+
"']").find("img").attr("alt");child_img_fancy=$("a[href='"+this.href+"']").find("img").attr("data-ajax");"undefined"!=child_img_fancy&&""!=child_img_fancy?this.title=child_img_fancy:"undefined"!=child_img_alt&&""!=child_img_alt&&(this.title=child_img_alt)}});$("a[ajxlay=1]").fancybox({type:"ajax",autoSize:!0,width:800,height:500,padding:0,loop:!1,fitToView:!1,openEffect:"elastic",closeEffect:"elastic",scrolling:"no",fixed:!0,closeBtn:!0,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,helpers:{overlay:{css:{cursor:"auto"},
closeClick:!1,speedIn:1500,opacity:0.8}}});$("a[title], div[title], label[title]").tooltip({track:!0,fade:0,delay:0,showURL:!1,extraClass:"",showBody:" - "});$("img[title]").tooltip({track:!0,top:0,left:0,fade:250,delay:0,showURL:!1,extraClass:"",showBody:" - ",bodyHandler:function(){str='<img src="'+this.src+'"/>';str=str+"<h3>"+$(this).attr("alt")+"</h3>";$(this).attr("src:back")&&(str=str+'<img src="'+$(this).attr("src:back")+'"/>');return str}});$(".pager_product_category").hoverIntent({over:function(){elementMaximizer("open",
".pager_product_category",$(".pager_product_category").css("min-height"))},out:function(){elementMaximizer("close",".pager_product_category",$(".pager_product_category").css("min-height"))},timeout:1E3,interval:200});$(".rating").stars({inputType:"select",oneVoteOnly:!1,cancelShow:!1,showTitles:!1,split:2,callback:function(a,b,c){query_arr=$.deparam.fragment(c);b=-1<query_arr.mode.indexOf("cast")?"cast_":"";ajxtrg="#"+b+query_arr.content_id+"_rating";$(ajxtrg).load("?mode="+query_arr.mode+" "+ajxtrg,
{content_id:query_arr.content_id,user_rating:query_arr.user_rating},function(a,c){"success"==c?(str='<img src="'+$("a[rel="+b+query_arr.content_id+"] img").attr("src")+'" /><br>'+$("a[rel="+b+query_arr.content_id+"] img").attr("alt")+"<br>"+transl8.t_rating+": "+(1*query_arr.user_rating).toFixed(1),$.jGrowl(str,{header:transl8.t_my_rating}),resetUI(1)):$.jGrowl("",{header:transl8.t_error,sticky:!0})})}})}var maxheight=0;
function elementMaximizer(a,b,c){if("open"==a){if(!maxheight||"undefned"==maxheight)$(b).height("100%"),maxheight=parseInt($(b).height()),minheight=parseInt(c),$(b).height(minheight);$(b).height()==minheight&&$(b).animate({height:maxheight},{duration:500,specialEasing:{height:"easeOutBounce"}})}else"close"==a&&$(b).animate({height:$(b).css("min-height")})}
$(".button-favorite a").live("click",function(a){button=$(this);title=$(button).attr("name");url=$(button).attr("href");ajxtrg=$(button).attr("ajxtrg");query_arr=$.deparam.fragment($.param.querystring(url));type=-1<query_arr.mode.indexOf("cast")?"cast_":"";$(ajxtrg).load(url+" "+ajxtrg,function(b,a){"success"==a?($(button).toggleClass("selected"),str='<img src="'+$("a[rel="+type+query_arr.content_id+"] img").attr("src")+'" /><br>'+$("a[rel="+type+query_arr.content_id+"] img").attr("alt"),$(button).hasClass("selected")?
$.jGrowl(str,{header:transl8.t_add_favorite_success}):$.jGrowl(str,{header:transl8.t_remove_favorite_success}),resetUI(1)):$.jGrowl(transl8.t_add_favorite_error_max,{header:transl8.t_error,sticky:!0})});a.preventDefault()});
$("a[ajxsrc][href]").live("click",function(a){title=$(this).attr("title");ajxurl=$.param.querystring($(this).attr("href"));ajxsrc=$(this).attr("ajxsrc");ajxtrg=$(this).attr("ajxtrg");query_arr=$.deparam.fragment(ajxurl);vseek=query_arr.vseek;"undefined"!==typeof vseek&&0<vseek?(jwplayer().onPlay()&&jwplayer().seek(vseek),a.preventDefault()):(""==location.hash&&$("body").attr("last_url",location.href),location.hash="#?"+ajxurl+"&:"+ajxsrc+":"+ajxtrg);a.preventDefault()});
$(window).bind("hashchange",function(){tmp=unescape(location.hash);tmp=tmp.replace(/^\#/,"");tmp=tmp.split(":");if(!tmp[2]||"undefined"==tmp[2])tmp[2]=tmp[1];"undefined"!==typeof tmp&&""!=location.hash?(url=tmp[0]+" "+tmp[1]+" > *",$(tmp[2]).load(url,function(a,b){if("success"==b){if(ajxtitle=$("div[ajxtitle]",a).attr("ajxtitle"))document.title=ajxtitle;resetUI(1)}})):""==location.hash&&$("body").attr("last_url")&&(location=$("body").attr("last_url"))});
$.widget("custom.catcomplete",$.ui.autocomplete,{_renderMenu:function(a,b){var c=this,e="",d=0;$.each(b,function(b,f){if(f.category!=e){if(1>d)var g="rounded";a.append("<li class='ui-autocomplete-category clearfix "+g+"'>"+f.category+"</li>");e=f.category;d+=1}c._renderItem(a,f)})}});
$(function(){var a={},b;$("#search").catcomplete({minLength:3,delay:1E3,position:{my:"left top",at:"right top",collision:"none"},source:function(c,e){$(".loading").show();var d=c.term;d in a?(e(a[d]),$(".loading").hide()):b=$.getJSON("?mode=helper_searchajx",c,function(c,f,g){a[d]=c;g===b&&(e(c),$(".loading").hide())})},select:function(b,a){location.hash=a.item.url+"&:#col3_main:";$("#search").val("");$("#search").removeClass("selected");return!1},open:function(){$("#search").addClass("selected");
$(".loading").hide()},focus:function(){},blur:function(){$("#search").removeClass("selected")},close:function(){$("#search").removeClass("selected");$(".submenu_favorites").hide()}})});
