
window.redi=true;window.his_rotas=0;$(window).resize(function(){if(window.redi)$("#rotasCnt").height($("#fundo2").height()-188);})
function movFundo(){var img=$("#fundo2 img");img.css('marginLeft',img.outerWidth()*-2).show();img.animate({marginLeft:(img.outerWidth()*2)},5000,'linear',function(){img.hide();setTimeout(movFundo,6000);});}
function movFlexa(){var e=$("#flexaSuper");e.animate({"marginLeft":"-=15px"},'fast',function(){e.animate({"marginLeft":"+=15px"},'fast',function(){e.animate({"marginLeft":"-=15px"},'fast',function(){e.animate({"marginLeft":"+=15px"},'fast',function(){setTimeout(movFlexa,3000);})})})})}
jQuery.fn.extend({slideRight:function(speed,callback){return this.each(function(){jQuery(this).animate({width:'show'},speed,null,callback);});},slideLeft:function(speed,callback){return this.each(function(){jQuery(this).animate({width:'hide'},speed,null,callback);});},slideToggleWidth:function(){return this.each(function(){var el=jQuery(this);if(el.css('display')=='none'){el.slideRight();}else{el.slideLeft();}});}});var myNav=new function(){this.oldRef=0;this.idGal="#slideshow";this.idNav="#nav";this.idPrefix="mascara";this.idPrefixTitle="mascara_title";this.idPrefixText="mascara_text";this.idPrefixAbout="mascara_about";this.animeSpeed="fast";this.create=function(){var i=0;$(myNav.idGal+" img").each(function(){$(this).attr("ref",i);i++;$(this).click(function(){var e=$($(this).attr('video'));var top=e.offset().top-188;top+=$("#rotasCnt").scrollTop();$(".slider div").slider({value:top})
$("#rotasCnt").animate({scrollTop:top},1000,function(){if($("#rotasCnt").scrollTop()>20){$(".menuTopo").fadeIn('slow');}else{$(".menuTopo").fadeOut('slow');}
e.click();});});});i=0;$(myNav.idNav+" img").each(function(){var img=$(this);img.attr("ref",i).parent().append($('<div>').addClass("mascara").attr("id",myNav.idPrefix+i).css({"width":"173px","height":"45px"})).append($('<a>').addClass("mascara_title").attr("id",myNav.idPrefixTitle+i).css({"width":img.width()}).html(this.alt));i++;$(this).mouseover(function(){$(this).find(".mascara").slideDown(myNav.animeSpeed);$(this).find(".mascara_title").slideDown(myNav.animeSpeed);}).mouseout(function(){$(this).find(".mascara").slideUp(myNav.animeSpeed);$(this).find(".mascara_title").slideUp(myNav.animeSpeed);});});myNav.resize();setTimeout(function(){$(myNav.idNav+" .mascara:visible").hide();$(myNav.idNav+" .mascara_title:visible").hide();$("#content_super_aboutSlide").hide();$("#content_super_titleSlide").hide();},10)
$("#nav li").hover(function(){$(this).find(".mascara").slideDown(myNav.animeSpeed);$(this).find(".mascara_title").slideDown(myNav.animeSpeed).css("display","block");},function(){$(this).find(".mascara").slideUp(myNav.animeSpeed);$(this).find(".mascara_title").slideUp(myNav.animeSpeed);});$("#flexaSuper").toggle(function(){$("#content_super_aboutSlide").fadeIn(myNav.animeSpeed);$("#content_super_titleSlide").fadeIn(myNav.animeSpeed);},function(){$("#content_super_aboutSlide").fadeOut(myNav.animeSpeed);$("#content_super_titleSlide").fadeOut(myNav.animeSpeed);})}
this.show=function(el){if(el!=null){var old_ref=myNav.oldRef;myNav.oldRef=$(el).attr("ref");var jImg=$("#"+myNav.idPrefix+old_ref);$("#content_text").fadeOut(myNav.animeSpeed,function(){$(this).html(jImg.parent().find("."+myNav.idPrefixText).html()).fadeIn(myNav.animeSpeed);});$("#content_super_aboutSlide").hide();$("#content_super_titleSlide").hide();$("#tAbout").slideLeft(myNav.animeSpeed,function(){$("#content_aboutSlide").html(jImg.parent().find("."+myNav.idPrefixAbout).html());$("#content_titleSlide").html(jImg.parent().find("."+myNav.idPrefixTitle).html());}).slideRight(myNav.animeSpeed);}}
this.resize=function(){$(myNav.idNav+" a").each(function(){var off=$(this).offset();$("#"+myNav.idPrefix+$(this).attr("ref")).offset(off);$("#"+myNav.idPrefixTitle+$(this).attr("ref")).offset(off);})}}
var myRotas=new function(){this.animeSpeed="fast";this.els=new Array();this.prev=-1;this.show=function(next){voltaPlayerPortfolio();var e=$(myRotas.els[next]);var top=e.offset().top-188;top+=$("#rotasCnt").scrollTop();$(".slider div").slider({value:rotasCnt-top})
$("#rotasCnt").animate({scrollTop:top},1000,function(){if($("#rotasCnt").scrollTop()>20){$(".menuTopo").fadeIn('slow');}else{$(".menuTopo").fadeOut('slow');}});}
this.create=function(){var array=new Array();$("div.rota").each(function(){array.push('#'+$(this).attr("id"));});myRotas.els=array;}}
var myOver=new function(){this.animeSpeed="";this.create=function(){$(".content-portfolio").hover(function(){$(this).children(".over").fadeIn(myOver.animeSpeed);},function(){$(this).children(".over").fadeOut(myOver.animeSpeed);});$(".content-portfolio").click(function(){if(window.his_rotas==0)window.his_rotas=$("#rotasCnt").scrollTop();playerPortfolio($(this).children('.video').html(),$(this).children('.text').html());setTimeout(function(){var e=$("#portfolio_player");var top=e.offset().top-188;top+=$("#rotasCnt").scrollTop();$(".slider div").slider({value:rotasCnt-top})
$("#rotasCnt").animate({scrollTop:top},1000,function(){if($("#rotasCnt").scrollTop()>20){$(".menuTopo").fadeIn('slow');}else{$(".menuTopo").fadeOut('slow');}});},1000);})}}
function fnContato(){$("#formContato input[name=telefone]").mask("99-9999-9999");$("#formContato input[name=celular]").mask("99-9999-9999");$("#formContato").validar({end:function(){$.post('contato/enviar',$("#formContato").serialize(),function(data){if(data.result){alert('Contato enviado com sucesso!');document.getElementById('formContato').reset();}else{alert('Não foi possivel enviar o contato,\n por favor tente mais tarde.');}},"json");return false;}});}
function voltaPlayerPortfolio(){if(window.his_rotas>0)$("#rotasCnt").animate({scrollTop:window.his_rotas},1000);$("#portfolios").slideRight();$("#portfolio_video").slideLeft();window.his_rotas=0;}
function playerPortfolio(video,text){$("#portfolio_video").html('<span id="portfolio_player"></span>');var flashvars=false;var params={flashvars:"url_video="+video+"&text_video="+encodeURI(text)};var attributes={wmode:"transparent"};swfobject.embedSWF("content/flash/player.swf","portfolio_player","600","480","9.0.0",null,flashvars,params,attributes);$("#portfolios").slideLeft();$("#portfolio_video").slideRight();}
var rotasCnt=0;$(window).resize(function(){$("#rotasCnt").height($("#fundo2").height()-188);})
jQuery(window).load(function(){$("#fundo1").show();$("#fundo2").show();$("#fundo3").show();$("#rootCnt").fadeIn();$("#slideshow img").each(function(){var jImg=$(this);var newHeight=(jImg.height()/2)-91;jImg.css('margin-top','-'+newHeight+'px');jImg.mouseover(function(){$("#fundo_tela_case_home").fadeIn();})});$("#fundo_tela_case_home").mouseout(function(){$(this).fadeOut();}).click(function(){window.his_rotas=$("#rotasCnt").scrollTop();$("img[ref="+myNav.oldRef+"]").click();});$("#nav img").each(function(){var jImg=$(this);var newHeight=(jImg.height()/2)-22.5;jImg.css('margin-top','-'+newHeight+'px');});myOver.create();try{fnContato();}catch(er){}
$(document).bind("contextmenu",function(e){return false});var animeSpeed="";myRotas.create();myRotas.animeSpeed=animeSpeed;myNav.animeSpeed=animeSpeed;myNav.create();$('#slideshow').cycle({fx:'fade',speed:animeSpeed,pager:'#nav',pagerAnchorBuilder:function(idx,slide){return'#nav li:eq('+idx+') a';},prev:'#prev',next:'#next',cleartype:1,before:function(curr,next,opts){myNav.show(next);}});setTimeout(function(){$("#nav img:first").click();},50);rotasCnt=$("#rotasCnt div").height();$(".slider div").slider({orientation:"vertical",range:"min",min:1,max:rotasCnt,value:0,step:1,slide:function(event,ui){$("#rotasCnt").scrollTop(rotasCnt-ui.value);}})
setTimeout(movFundo,1500);setTimeout(movFlexa,1500);setTimeout(function(){$("#next").click();setInterval(function(){$("#next").click();},6500)},1750);myRotas.show(0);});$(window).load(function(){$("a.blog-item").hover(function(){$(this).find('img')[0].src=URLBASE+'content/image/seta_marrom_dir.png';},function(){$(this).find('img')[0].src=URLBASE+'content/image/seta_cinza_dir.png';});});$(window).load(function(){if(window.redi){$("#rotasCnt").height($("#fundo2").height()-188).css('overflow','hidden');}})
