function fnRandomString(){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var string_length=8;var randomstring='';for(var i=0;i<string_length;i++){var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1);}
return randomstring;};$(window).load(function(){try{$('a[rel*="external"]').click(function()
{window.open(this);return false;});$('a[class*="external"]').click(function()
{window.open(this);return false;});}catch(e){}
try{jQuery.tools.validator.fn("[data-equals]","Valor não é igual ao campo $1",function(input){var name=input.attr("data-equals"),field=this.getInputs().filter("[name="+name+"]");return input.val()==field.val()?true:[name];});jQuery.tools.validator.fn("[type=cpf]","Preencha o campo CPF corretamente",function(element,value){value=jQuery.trim(value);value=value.replace('.','');value=value.replace('.','');cpf=value.replace('-','');while(cpf.length<11)cpf="0"+cpf;var expReg=/^0+$|^1+$|^2+$|^3+$|^4+$|^5+$|^6+$|^7+$|^8+$|^9+$/;var a=[];var b=new Number;var c=11;for(i=0;i<11;i++){a[i]=cpf.charAt(i);if(i<9)b+=(a[i]*--c);}
if((x=b%11)<2){a[9]=0}else{a[9]=11-x}
b=0;c=11;for(y=0;y<10;y++)b+=(a[y]*c--);if((x=b%11)<2){a[10]=0;}else{a[10]=11-x;}
if((cpf.charAt(9)!=a[9])||(cpf.charAt(10)!=a[10])||cpf.match(expReg))return"Preencha o campo CPF corretamente";return true;});$.tools.validator.localize("br",{'*':'corrija o valor',':email':'informe um e-mail válido',':number':'informe um número',':url':'informe uma url válida','[data-equals]':'Valor não é igual ao campo $1','[max]':'informe um valor menor que $1','[min]':'informe um valor maior que $1','[required]':'informe um valor','[cpf]':'informe o CPF'});$.tools.validator.addEffect("wall",function(errors,event){var wall=$(this.getConf().container).fadeIn();wall.find("p").remove();$.each(errors,function(index,error){wall.append("<p><strong>"+error.input.attr("title")+"</strong> : "+error.messages[0]+"</p>");});$("#msgCodeValidation").show();$('html, body').animate({scrollTop:($("#msgCodeValidation").offset().top)-50},500);},function(inputs){});$(".validateForm").validator({lang:'br',effect:'wall',container:'#msgCodeValidation',errorInputEvent:null}).submit(function(e){if(!e.isDefaultPrevented()){return true;e.preventDefault();}});}catch(e){}
try{$('.videos a').hover(function(){var $this=$(this).find('img');$this.stop().animate({'height':'155px','top':'0px','left':'-5px'});},function(){var $this=$(this).find('img');$this.stop().animate({'height':'150px','top':'0px','left':'0px'});});}catch(e){}});(function(f,h,i){function k(a,c){var b=(a[0]||0)-(c[0]||0);return b>0||!b&&a.length>0&&k(a.slice(1),c.slice(1))}function l(a){if(typeof a!=g)return a;var c=[],b="";for(var d in a){b=typeof a[d]==g?l(a[d]):[d,m?encodeURI(a[d]):a[d]].join("=");c.push(b)}return c.join("&")}function n(a){var c=[];for(var b in a)a[b]&&c.push([b,'="',a[b],'"'].join(""));return c.join(" ")}function o(a){var c=[];for(var b in a)c.push(['<param name="',b,'" value="',l(a[b]),'" />'].join(""));return c.join("")}var g="object",m=true;try{var j=i.description||function(){return(new i("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}()}catch(p){j="Unavailable"}var e=j.match(/\d+/g)||[0];f[h]={available:e[0]>0,activeX:i&&!i.name,version:{original:j,array:e,string:e.join("."),major:parseInt(e[0],10)||0,minor:parseInt(e[1],10)||0,release:parseInt(e[2],10)||0},hasVersion:function(a){a=/string|number/.test(typeof a)?a.toString().split("."):/object/.test(typeof a)?[a.major,a.minor]:a||[0,0];return k(e,a)},encodeParams:true,expressInstall:"expressInstall.swf",expressInstallIsActive:false,create:function(a){if(!a.swf||this.expressInstallIsActive||!this.available&&!a.hasVersionFail)return false;if(!this.hasVersion(a.hasVersion||1)){this.expressInstallIsActive=true;if(typeof a.hasVersionFail=="function")if(!a.hasVersionFail.apply(a))return false;a={swf:a.expressInstall||this.expressInstall,height:137,width:214,flashvars:{MMredirectURL:location.href,MMplayerType:this.activeX?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}}attrs={data:a.swf,type:"application/x-shockwave-flash",id:a.id||"flash_"+Math.floor(Math.random()*999999999),width:a.width||320,height:a.height||180,style:a.style||""};m=typeof a.useEncode!=="undefined"?a.useEncode:this.encodeParams;a.movie=a.swf;a.wmode=a.wmode||"opaque";delete a.fallback;delete a.hasVersion;delete a.hasVersionFail;delete a.height;delete a.id;delete a.swf;delete a.useEncode;delete a.width;var c=document.createElement("div");c.innerHTML=["<object ",n(attrs),">",o(a),"</object>"].join("");return c.firstChild}};f.fn[h]=function(a){var c=this.find(g).andSelf().filter(g);/string|object/.test(typeof a)&&this.each(function(){var b=f(this),d;a=typeof a==g?a:{swf:a};a.fallback=this;if(d=f[h].create(a)){b.children().remove();b.html(d)}});typeof a=="function"&&c.each(function(){var b=this;b.jsInteractionTimeoutMs=b.jsInteractionTimeoutMs||0;if(b.jsInteractionTimeoutMs<660)b.clientWidth||b.clientHeight?a.call(b):setTimeout(function(){f(b)[h](a)},b.jsInteractionTimeoutMs+66)});return c}})(jQuery,"flash",navigator.plugins["Shockwave Flash"]||window.ActiveXObject);jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});
/* Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
 * Licensed under the MIT License (LICENSE.txt).
 *
 * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
 * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
 * Thanks to: Seamus Leahy for adding deltaX and deltaY
 *
 * Version: 3.0.4
 * 
 * Requires: 1.2.2+
 */
(function($){var types=['DOMMouseScroll','mousewheel'];$.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var i=types.length;i;){this.addEventListener(types[--i],handler,false);}}else{this.onmousewheel=handler;}},teardown:function(){if(this.removeEventListener){for(var i=types.length;i;){this.removeEventListener(types[--i],handler,false);}}else{this.onmousewheel=null;}}};$.fn.extend({mousewheel:function(fn){return fn?this.bind("mousewheel",fn):this.trigger("mousewheel");},unmousewheel:function(fn){return this.unbind("mousewheel",fn);}});function handler(event){var orgEvent=event||window.event,args=[].slice.call(arguments,1),delta=0,returnValue=true,deltaX=0,deltaY=0;event=$.event.fix(orgEvent);event.type="mousewheel";if(event.wheelDelta){delta=event.wheelDelta/120;}
if(event.detail){delta=-event.detail/3;}
deltaY=delta;if(orgEvent.axis!==undefined&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){deltaY=0;deltaX=-1*delta;}
if(orgEvent.wheelDeltaY!==undefined){deltaY=orgEvent.wheelDeltaY/120;}
if(orgEvent.wheelDeltaX!==undefined){deltaX=-1*orgEvent.wheelDeltaX/120;}
args.unshift(event,delta,deltaX,deltaY);return $.event.handle.apply(this,args);}})(jQuery);(function($){$.fn.jsquares=$.fn.jSquares=function(options){var main=this,image_counter=0,dropin_int=0,defaults={image:'.js-image',caption:'.js-small-caption',caption_overlay_spacing:12,caption_width:400,caption_height:130,fade_to:.3,fade_start:1,fade_speed:'fast',shuffle_in:true,shuffle_in_speed:130,fade_on_hover:true,caption_slide_down:true,caption_slidedown_speed:'fast',_fade_selectors_on_hover:'img, .js-small-caption span',_overlay_selector_class:'js-caption-overlay'},options=$.extend(defaults,options),$image=$(options.image,main),$image_children=$image.find(options._fade_selectors_on_hover),window_width=$(window).width();$(window).resize(function(){window_width=$(window).width();});function _revealBinds(e,i,evt){_caption(i);_fadeInOutImage('in',options.fade_to,i);}
function _fadeInOutImage(in_out,opacity_val,i){var chain=(in_out=='in')?$image.not(':eq('+i+')').find(options._fade_selectors_on_hover):$image_children;(options.fade_on_hover)?$(chain).stop(true,false).fadeTo(options.fade_speed,opacity_val):$(chain).css('opacity',opacity_val);}
function _caption(index){$('.'+options._overlay_selector_class).remove();var $current_image=$(options.image+':eq('+index+')',main),overlay_sett=_getCaptionSettings($current_image),contents=$current_image.find('.js-overlay-caption-content').html()||'',caption_options=(options.caption_slide_down)?{display:'none'}:{};if(contents){var conts=contents,img=$current_image.find('img'),a=img.parent().attr('href')||'',wrap_a_start=(a!='')?'<a href="'+a+'">':'',wrap_a_end=(a!='')?'</a>':'';contents=wrap_a_start+'<img src="'+img.attr('src')+'" class="js-overlay-image" />'+wrap_a_end;contents+='<div class="js-overlay-html">'+conts+'</div><div style="clear:both"></div>';}
var caption_options=$.extend({top:overlay_sett.y,left:overlay_sett.x,width:overlay_sett.width,height:overlay_sett.height},caption_options);$('<div id="js-overlay-id-'+index+'">'+contents+'</div>').css(caption_options).addClass(options._overlay_selector_class).appendTo('body').bind('mouseleave',function(){_fadeInOutImage('out',options.fade_start)
$('#js-overlay-id-'+index).remove();});if(options.caption_slide_down){$('#js-overlay-id-'+index).slideDown(options.caption_slidedown_speed)}}
function _getCaptionSettings(image){var loc=_elementLocation($(image));var loc_x=loc.x-options.caption_overlay_spacing;var loc_y=loc.y-options.caption_overlay_spacing;var img_height=options.caption_height+(options.caption_overlay_spacing*2);var img_width=options.caption_width+(options.caption_overlay_spacing*2);var check_window_width=loc_x+img_width+(options.caption_overlay_spacing*2);if(check_window_width>=window_width){var hard_img_width=$(image).outerWidth();loc_x=loc_x-(options.caption_width+(options.caption_overlay_spacing*2))+hard_img_width;}
return{x:loc_x,y:loc_y,width:img_width,height:img_height};}
function _setImageTimeoutSlideDown(images){var images=_shuffle(images);dropin_int=setInterval(function(){if(image_counter==images.length){clearInterval(dropin_int);return false;}
var $img=$(options.image+':eq('+images[image_counter]+')',main)
var img_height=$img.height();$img.fadeIn(options.fade_speed);image_counter++},options.shuffle_in_speed);}
function _elementLocation(obj){var curleft=0;var curtop=0;do{var offset=obj.position();curleft+=offset.left;curtop+=offset.top;obj=obj.offsetParent();}while(obj[0].tagName.toLowerCase()!=='body');return{x:curleft,y:curtop};}
function _shuffle(v){for(var j,x,i=v.length;i;j=parseInt(Math.random()*i),x=v[--i],v[i]=v[j],v[j]=x);return v;};return this.each(function(){var images=[];$image.each(function(i){$(this).hide();images.push(i);});(options.shuffle_in)?_setImageTimeoutSlideDown(images):$image.show();$image.each(function(i){$(this).hoverIntent(function(evt){_revealBinds(this,i,evt);},function(evt){});});});};})(jQuery);if(typeof $.fn.hoverIntent!='function'){(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);}
$(window).load(function(){$('#js-container').jsquares({caption_width:332,caption_height:290,});});
