var animation={currentZ:0,stageWidth:0,stageHeight:0,loading:null,loadingPy:0,loadingEnabled:false,mouseX:0,mouseY:0,updateCount:0,isMenuUp:false,selectMenu:function(b){$(".stage .menu .itens a").eq(b).addClass("selected").animate({"background-position":"0px -80px"},{queue:false,duration:200})},unselectMenu:function(b){$(".stage .menu .itens a").eq(b).removeClass("selected").animate({"background-position":"0px 0px"},{queue:false,duration:200})},init:function(){this.loading=$("#loading");setInterval(this.onUpdate,
isSimple?55:45);setInterval(this.onResize,isSimple?500:300);this.onResize();this.onUpdate();document.onmousemove=function(b){b=b||window.event;if(b.pageX||b.pageY){animation.mouseX=b.pageX;animation.mouseY=b.pageY}else{animation.mouseX=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;animation.mouseY=b.clientY+document.body.scrollTop+document.documentElement.scrollTop}}},showLoading:function(){animation.loadingEnabled=true;isSimple?animation.loading.show():animation.loading.animate({opacity:1},
{duration:200,queue:true})},hideLoading:function(){if(isSimple){animation.loading.hide();animation.loadingEnabled=false}else animation.loading.animate({opacity:0},{duration:200,queue:true,complete:function(){animation.loadingEnabled=false}})},onResize:function(){var b=$(window).height(),c=$(window).width();animation.stageWidth=c;animation.stageHeight=b;$(".defaultPage").add($(".blackModal")).each(function(){var a=$(this);a.css("height",b);a.css("margin-top",(1-a.attr("_size"))*b)});$(".fullSize").css("width",
c).css("height",b);$(".alignCenter").each(function(){var a=$(this).width(),g=$(this).height();$(this).css("margin-left",(c-a)/2);$(this).css("margin-top",(b-g)/2)});$(".boxBranco").css("opacity",0.9);$(".imageResize").add(".videoMode").each(function(){var a=$(this),g=a.hasClass("videoMode");if(a.attr("_aspect")==null&&a.width()>0){a.attr("_width",a.width());a.attr("_height",a.height());a.attr("_aspect",a.width()/a.height())}if(a.attr("_aspect")!=null){var e=a.attr("_maxHeight"),h=a.attr("_maxWidth");
if(g&&e==null)e=b;if(g&&h==null)h=c;if(e!=null)if(h!=null){var f=a.width(),d=a.height(),i=toInt(a.attr("_aspect"));f=h;d=f/i;if(g){if(d<e){d=e;f=d*i}a.css("margin-left",-(f-h)/2);a.css("margin-top",-(d-e)/2)}else if(d>e){d=e;f=d*i}a.css("width",f+"px");a.css("height",d+"px")}}});$(".autoWidth").each(function(){var a=0;$(this).find("div").each(function(){a+=$(this).width()});$(this).width(a)})},menuUp:function(){if(!animation.isMenuUp){animation.isMenuUp=true;$(".stage .content .menu").animate({top:animation.stageHeight-
40}).animate({top:0},{duration:1E3,queue:false})}},menuDown:function(){if(animation.isMenuUp){animation.isMenuUp=false;$(".stage .content .menu").animate({top:animation.stageHeight-40},{duration:1E3,queue:false,complete:function(){$(this).animate({bottom:0})}})}},onUpdate:function(){var b=animation.stageHeight;$(".defaultPage").add($(".blackModal")).each(function(){var c=$(this);c.css("height",b);c.css("margin-top",(1-c.attr("_size"))*b)});animation.updateCount++;if(animation.updateCount%2==0){animation.loadingPy-=
89;animation.loading.css("background-position","0px "+animation.loadingPy+"px")}},animate:function(b,c,a){b.animate(c,{duration:a})}};$(document).ready(function(){$(".stage .menu .itens a").hover(function(){$(this).hasClass("selected")||$(this).animate({"background-position":"0px -80px"},{queue:false,duration:200})},function(){$(this).hasClass("selected")||$(this).animate({"background-position":"0px 0px"},{queue:false,duration:200})})});

