//Title personalizado//

//filtro title//
function filtroTolltip(){
	$('#tab1 ul.list2 li a, section.services.criacao ul.list1 li a, section.services.sistemas ul.list1 li a, section.services.usabilidade ul.list1 li a, section.services.planejamento ul.list1 li a, a.button.back').attr({
		rel: 'ignorar'		
	});	
}
//
var obj;
var tagname;
var tooltip;
function tit(){
/* <![CDATA[ */
tagname = new Array('a', 'img', 'address', 'input', 'strong');

tooltip = {
    
    init: function(){
                
        obj = document.createElement('div');
        obj.setAttribute('id', 'tooltip');
        
        document.body.appendChild(obj);
        
        window.document.onmousemove = this.move;
        
        for(var i = 0; i < tagname.length; i++){
            
            var ancora = document.getElementsByTagName(tagname[i]);
			
            for(var j = 0; j < ancora.length; j++){
                
                var a = ancora[j];
                texttitle = a.getAttribute('title');
                textrel = a.getAttribute('rel');
				
                if(texttitle && textrel != 'ignorar'){
					a.setAttribute('sTitle', texttitle);
					a.removeAttribute('title');

                    a.onmouseover = function(){
                        
                        t = this.getAttribute('sTitle');
                        
                        obj.innerHTML = t;
                        obj.style.display = 'block';
                        
                    };// end function
                    
                    a.onmouseout = function(){
                        
                        obj.innerHTML = '';
                        obj.style.display = 'none';
                        
                    };// end function
                    
                }//end if
                
            }//end for
            
        }//end for
        
    },
    
    move: function(e){
        
        e = e || window.event;
        
        if(e.pageX || e.pageY){
            
            x = e.pageX;
            y = e.pageY;
            
        }else{
            
            x = e.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft) - document.documentElement.clientLeft;
            y = e.clientY + (document.documentElement.scrollTop ||  document.body.scrollTop) -  document.documentElement.clientTop;
            
        }//end if
        obj.style.left = (x+7)+'px';
        obj.style.top = (y+20)+'px';
        obj.style.position = 'absolute';
		obj.style.zIndex = '9999';
        
        return true; 
    }
}
/* ]]> */
}
function cores(){
	if($('.container').hasClass('yellow')){
		$('#tooltip').addClass('criacao');
	}else if($('.container').hasClass('green')){
		$('#tooltip').addClass('planejamento');
	}else if($('.container').hasClass('blue')){
		$('#tooltip').addClass('sistemas');
	}else if($('.container').hasClass('purple')){
		$('#tooltip').addClass('usabilidade');
	}
	
	if($('.barra').hasClass('criacao')){
		$('#tooltip').addClass('criacao');
		$('.container').removeClass('yellow green blue purple');
		$('.container').addClass('yellow');
	}else if($('.barra').hasClass('planejamento')){
		$('#tooltip').addClass('planejamento');
		$('.container').removeClass('yellow green blue purple');
		$('.container').addClass('green');
	}else if($('.barra').hasClass('sistemas-web')){
		$('#tooltip').addClass('sistemas');
		$('.container').removeClass('yellow green blue purple');
		$('.container').addClass('blue');
	}else if($('.barra').hasClass('usabilidade')){
		$('#tooltip').addClass('usabilidade');
		$('.container').removeClass('yellow green blue purple');
		$('.container').addClass('purple');
	}else if($('.barra').hasClass('todos')){
		$('.container').removeClass('yellow green blue purple');
	}
}
function personal(){
	$('a.criacao, li.cri a, .template-area .services.criacao a, .veja-tambem a.criacao').mouseover(function(){
		$('#tooltip').removeClass('criacao sistemas usabilidade planejamento');	
		$('#tooltip').addClass('criacao');										   
    });
	$('a.planejamento, li.plan a, .template-area .services.planejamento a, .veja-tambem a.planejamento').mouseover(function(){
		$('#tooltip').removeClass('criacao sistemas usabilidade planejamento');	
		$('#tooltip').addClass('planejamento');										   
    });
	$('a.sistemas, li.web a, .template-area .services.sistemas a, .veja-tambem a.sistemas-web').mouseover(function(){
		$('#tooltip').removeClass('criacao sistemas usabilidade planejamento');	
		$('#tooltip').addClass('sistemas');										   
    });
	$('a.otimizacao, li.usab a, .template-area .services.usabilidade a, .veja-tambem a.usabilidade').mouseover(function(){
		$('#tooltip').removeClass('criacao sistemas usabilidade planejamento');	
		$('#tooltip').addClass('usabilidade');										   
    });
	$('#nav a, #brand-inside a, li.todos a, .pagin a, footer a, a.english').mouseover(function(){
		$('#tooltip').removeClass('criacao sistemas usabilidade planejamento');									   
    });
	$('#nav-front ul li a, #nav a, #brand-inside a, li.cri a, li.web a, li.plan a, li.usab a, li.todos a, .pagin a, footer a, .template-area .services a, a.english, .veja-tambem a.usabilidade, .veja-tambem a.planejamento, .veja-tambem a.criacao, .veja-tambem a.sistemas-web').mouseout(function(){
		$('#tooltip').removeClass('criacao sistemas usabilidade planejamento');
		cores();									
	});	
}

//DD_Round//
/**
* DD_roundies, this adds rounded-corner CSS in standard browsers and VML sublayers in IE that accomplish a similar appearance when comparing said browsers.
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_roundies/
* Version: 0.0.2a -  preview 2008.12.26
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_roundies/#license
*
* Usage:
* DD_roundies.addRule('#doc .container', '10px 5px'); // selector and multiple radii
* DD_roundies.addRule('.box', 5, true); // selector, radius, and optional addition of border-radius code for standard browsers.
* 
* Just want the PNG fixing effect for IE6, and don't want to also use the DD_belatedPNG library?  Don't give any additional arguments after the CSS selector.
* DD_roundies.addRule('.your .example img');
**/

eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('t K={16:\'K\',1L:G,1M:G,1d:G,2f:y(){u(D.2g!=8&&D.1N&&!D.1N[q.16]){q.1L=M;q.1M=M}17 u(D.2g==8){q.1d=M}},2h:D.2i,1O:[],1b:{},2j:y(){u(q.1L||q.1M){D.1N.2L(q.16,\'2M:2N-2O-2P:x\')}u(q.1d){D.2Q(\'<?2R 2S="\'+q.16+\'" 2T="#1P#2k" ?>\')}},2l:y(){t a=D.1k(\'z\');D.2m.1w.1Q(a,D.2m.1w.1w);u(a.12){2n{t b=a.12;b.1x(q.16+\'\\\\:*\',\'{1l:2U(#1P#2k)}\');q.12=b}2o(2p){}}17{q.12=a}},1x:y(a,b,c){u(1R b==\'1S\'||b===2V){b=0}u(b.2W.2q().1y(\'2X\')==-1){b=b.2q().2Y(/[^0-9 ]/g,\'\').1T(\' \')}H(t i=0;i<4;i++){b[i]=(!b[i]&&b[i]!==0)?b[C.1e((i-2),0)]:b[i]}u(q.12){u(q.12.1x){t d=a.1T(\',\');H(t i=0;i<d.1U;i++){q.12.1x(d[i],\'1l:2Z(K.1V.2r(q, [\'+b.1W(\',\')+\']))\')}}17 u(c){t e=b.1W(\'F \')+\'F\';q.12.1z(D.2s(a+\' {Q-1f:\'+e+\'; -30-Q-1f:\'+e+\';}\'));q.12.1z(D.2s(a+\' {-1A-Q-1m-1n-1f:\'+b[0]+\'F \'+b[0]+\'F; -1A-Q-1m-1X-1f:\'+b[1]+\'F \'+b[1]+\'F; -1A-Q-1Y-1X-1f:\'+b[2]+\'F \'+b[2]+\'F; -1A-Q-1Y-1n-1f:\'+b[3]+\'F \'+b[3]+\'F;}\'))}}17 u(q.1d){q.1O.31({\'2t\':a,\'2u\':b})}},2v:y(a){2w(32.33){I\'z.Q\':I\'z.34\':I\'z.1B\':q.1o(a);13;I\'z.2x\':q.1Z(a);13;I\'z.1p\':I\'z.2y\':I\'z.2z\':q.1o(a);13;I\'z.20\':a.18.z.20=(a.z.20==\'S\')?\'S\':\'35\';13;I\'z.21\':q.22(a);13;I\'z.1c\':a.18.z.1c=a.z.1c;13}},1o:y(a){a.14.23=\'\';q.2A(a);q.1Z(a);q.1C(a);q.1D(a);q.24(a);q.2B(a);q.22(a)},22:y(a){u(a.W.21.1y(\'36\')!=-1){t b=a.W.21;b=1g(b.37(b.25(\'=\')+1,b.25(\')\')),10)/2C;H(t v 1h a.x){a.x[v].1i.38=b}}},2A:y(a){u(!a.W){1q}17{t b=a.W}a.14.1p=\'\';a.14.1E=\'\';t c=(b.1p==\'2D\');t d=M;u(b.1E!=\'S\'||a.1F){u(!a.1F){a.J=b.1E;a.J=a.J.39(5,a.J.25(\'")\')-5)}17{a.J=a.26}t e=q;u(!e.1b[a.J]){t f=D.1k(\'3a\');f.1r(\'3b\',y(){q.1s=q.3c;q.1t=q.3d;e.1D(a)});f.3e=e.16+\'3f\';f.14.23=\'1l:S; 1j:27; 1m:-2E; 1n:-2E; Q:S;\';f.26=a.J;f.2F(\'1s\');f.2F(\'1t\');D.2G.1Q(f,D.2G.1w);e.1b[a.J]=f}a.x.Z.1i.26=a.J;d=G}a.x.Z.2H=!d;a.x.Z.1G=\'S\';a.x.1u.2H=!c;a.x.1u.1G=b.1p;a.14.1E=\'S\';a.14.1p=\'2D\'},1Z:y(a){a.x.1H.1G=a.W.2x},1C:y(a){t c=[\'N\',\'19\',\'1a\',\'O\'];a.P={};H(t b=0;b<4;b++){a.P[c[b]]=1g(a.W[\'Q\'+c[b]+\'U\'],10)||0}},1D:y(c){t e=[\'O\',\'N\',\'U\',\'V\'];H(t d=0;d<4;d++){c.E[e[d]]=c[\'3g\'+e[d]]}t f=y(a,b){a.z.1n=(b?0:c.E.O)+\'F\';a.z.1m=(b?0:c.E.N)+\'F\';a.z.1s=c.E.U+\'F\';a.z.1t=c.E.V+\'F\'};H(t v 1h c.x){t g=(v==\'Z\')?1:2;c.x[v].3h=(c.E.U*g)+\', \'+(c.E.V*g);f(c.x[v],M)}f(c.18,G);u(K.1d){c.x.1H.z.28=\'-3i\';u(1R c.P==\'1S\'){q.1C(c)}c.x.1u.z.28=(c.P.N-1)+\'F \'+(c.P.O-1)+\'F\'}},24:y(j){t k=y(a,w,h,r,b,c,d){t e=a?[\'m\',\'1I\',\'l\',\'1J\',\'l\',\'1I\',\'l\',\'1J\',\'l\']:[\'1J\',\'l\',\'1I\',\'l\',\'1J\',\'l\',\'1I\',\'l\',\'m\'];b*=d;c*=d;w*=d;h*=d;t R=r.2I();H(t i=0;i<4;i++){R[i]*=d;R[i]=C.3j(w/2,h/2,R[i])}t f=[e[0]+C.11(0+b)+\',\'+C.11(R[0]+c),e[1]+C.11(R[0]+b)+\',\'+C.11(0+c),e[2]+C.15(w-R[1]+b)+\',\'+C.11(0+c),e[3]+C.15(w+b)+\',\'+C.11(R[1]+c),e[4]+C.15(w+b)+\',\'+C.15(h-R[2]+c),e[5]+C.15(w-R[2]+b)+\',\'+C.15(h+c),e[6]+C.11(R[3]+b)+\',\'+C.15(h+c),e[7]+C.11(0+b)+\',\'+C.15(h-R[3]+c),e[8]+C.11(0+b)+\',\'+C.11(R[0]+c)];u(!a){f.3k()}t g=f.1W(\'\');1q g};u(1R j.P==\'1S\'){q.1C(j)}t l=j.P;t m=j.2J.2I();t n=k(M,j.E.U,j.E.V,m,0,0,2);m[0]-=C.1e(l.O,l.N);m[1]-=C.1e(l.N,l.19);m[2]-=C.1e(l.19,l.1a);m[3]-=C.1e(l.1a,l.O);H(t i=0;i<4;i++){m[i]=C.1e(m[i],0)}t o=k(G,j.E.U-l.O-l.19,j.E.V-l.N-l.1a,m,l.O,l.N,2);t p=k(M,j.E.U-l.O-l.19+1,j.E.V-l.N-l.1a+1,m,l.O,l.N,1);j.x.1u.29=o;j.x.Z.29=p;j.x.1H.29=n+o;q.2K(j)},2B:y(a){t s=a.W;t b=[\'N\',\'O\',\'19\',\'1a\'];H(t i=0;i<4;i++){a.14[\'1B\'+b[i]]=(1g(s[\'1B\'+b[i]],10)||0)+(1g(s[\'Q\'+b[i]+\'U\'],10)||0)+\'F\'}a.14.Q=\'S\'},2K:y(e){t f=K;u(!e.J||!f.1b[e.J]){1q}t g=e.W;t h={\'X\':0,\'Y\':0};t i=y(a,b){t c=M;2w(b){I\'1n\':I\'1m\':h[a]=0;13;I\'3l\':h[a]=0.5;13;I\'1X\':I\'1Y\':h[a]=1;13;1P:u(b.1y(\'%\')!=-1){h[a]=1g(b,10)*0.3m}17{c=G}}t d=(a==\'X\');h[a]=C.15(c?((e.E[d?\'U\':\'V\']-(e.P[d?\'O\':\'N\']+e.P[d?\'19\':\'1a\']))*h[a])-(f.1b[e.J][d?\'1s\':\'1t\']*h[a]):1g(b,10));h[a]+=1};H(t b 1h h){i(b,g[\'2y\'+b])}e.x.Z.1i.1j=(h.X/(e.E.U-e.P.O-e.P.19+1))+\',\'+(h.Y/(e.E.V-e.P.N-e.P.1a+1));t j=g.2z;t c={\'T\':1,\'R\':e.E.U+1,\'B\':e.E.V+1,\'L\':1};t k={\'X\':{\'2a\':\'L\',\'2b\':\'R\',\'d\':\'U\'},\'Y\':{\'2a\':\'T\',\'2b\':\'B\',\'d\':\'V\'}};u(j!=\'2c\'){c={\'T\':(h.Y),\'R\':(h.X+f.1b[e.J].1s),\'B\':(h.Y+f.1b[e.J].1t),\'L\':(h.X)};u(j.1y(\'2c-\')!=-1){t v=j.1T(\'2c-\')[1].3n();c[k[v].2a]=1;c[k[v].2b]=e.E[k[v].d]+1}u(c.B>e.E.V){c.B=e.E.V+1}}e.x.Z.z.3o=\'3p(\'+c.T+\'F \'+c.R+\'F \'+c.B+\'F \'+c.L+\'F)\'},1v:y(a){t b=q;2d(y(){b.1o(a)},1)},2e:y(a){q.1D(a);q.24(a)},1V:y(b){q.z.1l=\'S\';u(!q.W){1q}17{t c=q.W}t d={3q:G,3r:G,3s:G,3t:G,3u:G,3v:G,3w:G};u(d[q.1K]===G){1q}t e=q;t f=K;q.2J=b;q.E={};t g={3x:\'2e\',3y:\'2e\'};u(q.1K==\'A\'){t i={3z:\'1v\',3A:\'1v\',3B:\'1v\',3C:\'1v\'};H(t a 1h i){g[a]=i[a]}}H(t h 1h g){q.1r(\'3D\'+h,y(){f[g[h]](e)})}q.1r(\'3E\',y(){f.2v(e)});t j=y(a){a.z.3F=1;u(a.W.1j==\'3G\'){a.z.1j=\'3H\'}};j(q.3I);j(q);q.18=D.1k(\'3J\');q.18.14.23=\'1l:S; 1j:27; 28:0; 1B:0; Q:0; 3K:S;\';q.18.z.1c=c.1c;q.x={\'1u\':M,\'Z\':M,\'1H\':M};H(t v 1h q.x){q.x[v]=D.1k(f.16+\':3L\');q.x[v].1i=D.1k(f.16+\':3M\');q.x[v].1z(q.x[v].1i);q.x[v].3N=G;q.x[v].z.1j=\'27\';q.x[v].z.1c=c.1c;q.x[v].3O=\'1,1\';q.18.1z(q.x[v])}q.x.Z.1G=\'S\';q.x.Z.1i.3P=\'3Q\';q.3R.1Q(q.18,q);q.1F=G;u(q.1K==\'3S\'){q.1F=M;q.z.3T=\'3U\'}2d(y(){f.1o(e)},1)}};2n{D.3V("3W",G,M)}2o(2p){}K.2f();K.2j();K.2l();u(K.1d&&D.1r&&K.2h){D.1r(\'3X\',y(){u(D.3Y==\'3Z\'){t d=K.1O;t e=d.1U;t f=y(a,b,c){2d(y(){K.1V.2r(a,b)},c*2C)};H(t i=0;i<e;i++){t g=D.2i(d[i].2t);t h=g.1U;H(t r=0;r<h;r++){u(g[r].1K!=\'40\'){f(g[r],d[i].2u,r)}}}}})}',62,249,'||||||||||||||||||||||||||this|||var|if|||vml|function|style|||Math|document|dim|px|false|for|case|vmlBg|DD_roundies||true|Top|Left|bW|border||none||Width|Height|currentStyle|||image||floor|styleSheet|break|runtimeStyle|ceil|ns|else|vmlBox|Right|Bottom|imgSize|zIndex|IE8|max|radius|parseInt|in|filler|position|createElement|behavior|top|left|applyVML|backgroundColor|return|attachEvent|width|height|color|pseudoClass|firstChild|addRule|search|appendChild|webkit|padding|vmlStrokeWeight|vmlOffsets|backgroundImage|isImg|fillcolor|stroke|qy|qx|nodeName|IE6|IE7|namespaces|selectorsToProcess|default|insertBefore|typeof|undefined|split|length|roundify|join|right|bottom|vmlStrokeColor|display|filter|vmlOpacity|cssText|vmlPath|lastIndexOf|src|absolute|margin|path|b1|b2|repeat|setTimeout|reposition|IEversion|documentMode|querySelector|querySelectorAll|createVmlNameSpace|VML|createVmlStyleSheet|documentElement|try|catch|err|toString|call|createTextNode|selector|radii|readPropertyChanges|switch|borderColor|backgroundPosition|backgroundRepeat|vmlFill|nixBorder|100|transparent|10000px|removeAttribute|body|filled|slice|DD_radii|clipImage|add|urn|schemas|microsoft|com|writeln|import|namespace|implementation|url|null|constructor|Array|replace|expression|moz|push|event|propertyName|borderWidth|block|lpha|substring|opacity|substr|img|onload|offsetWidth|offsetHeight|className|_sizeFinder|offset|coordsize|1px|min|reverse|center|01|toUpperCase|clip|rect|BODY|TABLE|TR|TD|SELECT|OPTION|TEXTAREA|resize|move|mouseleave|mouseenter|focus|blur|on|onpropertychange|zoom|static|relative|offsetParent|ignore|background|shape|fill|stroked|coordorigin|type|tile|parentNode|IMG|visibility|hidden|execCommand|BackgroundImageCache|onreadystatechange|readyState|complete|INPUT'.split('|'),0,{}))
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

/*function mostra(texto) {
			var mudar = document.getElementById(texto) ;
			mudar.style.display = 'block';
			if(document.getElementById('institucionais') == mudar) {
				document.getElementById('clientes').style.display = 'none';
				document.getElementById('second').style.display = 'none';
			  document.getElementById('tit-institucionais').className = 'mn02 over';
				document.getElementById('tit-institucionais').style.zIndex = '6';
				document.getElementById('tit-second').style.zIndex = '5';
				document.getElementById('tit-clientes').style.zIndex = '5';
				document.getElementById('tit-clientes-link').className = 'mn01 selecionado';
				document.getElementById('tit-clientes').className = 'selecionado';
				document.getElementById('tit-second-link').className = 'mn01 selecionado';
				document.getElementById('tit-second').className = 'selecionado';

			}
			
			if(document.getElementById('clientes') == mudar) {
				document.getElementById('institucionais').style.display = 'none';
				document.getElementById('second').style.display = 'none';
				document.getElementById('tit-clientes').className = 'mn02 over';
				document.getElementById('tit-clientes').style.zIndex = '6';
				document.getElementById('tit-second').style.zIndex = '5';
				document.getElementById('tit-institucionais').style.zIndex = '5';
				document.getElementById('tit-institucionais-link').className = 'mn01 selecionado';
				document.getElementById('tit-institucionais').className = 'selecionado';
				document.getElementById('tit-second-link').className = 'mn01 selecionado';
				document.getElementById('tit-second').className = 'selecionado';
			}
			
			if(document.getElementById('second') == mudar) {
				document.getElementById('institucionais').style.display = 'none';
				document.getElementById('clientes').style.display = 'none';
				document.getElementById('tit-second').className = 'mn02 over';
				
				
			  document.getElementById('tit-second').className = 'mn03 over';
				document.getElementById('tit-second').style.zIndex = '6';
				document.getElementById('tit-institucionais').style.zIndex = '5';
				document.getElementById('tit-clientes').style.zIndex = '5';
				document.getElementById('tit-clientes-link').className = 'mn01 selecionado';
				document.getElementById('tit-clientes').className = 'selecionado';
				document.getElementById('tit-institucionais-link').className = 'mn01 selecionado';
				document.getElementById('tit-institucionais').className = 'selecionado';


			}

		}*/
/////////////////////////////////////////////////////////////////////////////////////////////////

//Scroll animado//
var scrollInt
var scrTime, scrSt, scrDist, scrDur, scrInt, scrSl, scrDistX

function easeInOut(t,b,c,d)
{
	return (c/2 * (1 - Math.cos(Math.PI*t/d)) + b);
}

scrollPage = function()
{
	scrTime += scrInt

	if (scrTime < scrDur) {
		window.scrollTo(easeInOut(scrTime,scrSl,scrDistX,scrDur), easeInOut(scrTime,scrSt,scrDist,scrDur))
	} else {
		window.scrollTo(scrSl+scrDistX, scrSt+scrDist)
		clearInterval(scrollInt)
	}
}

jQuery.fn.extend({
	smoothScroll : function(duration, velocity, marginLeft, marginTop)
	{
		if(typeof(duration) == 'undefined') duration = 500
		if(typeof(velocity) == 'undefined') velocity = 10
		if(typeof(marginLeft) == 'undefined') marginLeft = 0
		if(typeof(marginTop) == 'undefined') marginTop = 0

		this.click(function(){
			var element_id = $(this).attr("href")
			var source_positions = {
				top : $(this).get(0).offsetTop,
				left : $(this).get(0).offsetLeft
			}
			var dest_positions = {
				top : $(element_id).get(0).offsetTop-marginTop,
				left : $(element_id).get(0).offsetLeft-marginLeft
			}

			if (window.scrollY)
				scrSt = window.scrollY
			else if (document.documentElement.scrollTop)
				scrSt = document.documentElement.scrollTop
			else
				scrSt = document.body.scrollTop
				
			if (window.scrollX)
				scrSl = window.scrollX
			else if (document.documentElement.scrollLeft)
				scrSl = document.documentElement.scrollLeft
			else
				scrSl = document.body.scrollLeft

			scrDist = dest_positions.top - scrSt
			scrDistX = dest_positions.left - scrSl
			scrDur = 500
			scrTime = 0
			scrInt = 5

			// set interval
			clearInterval(scrollInt)
			scrollInt = setInterval(scrollPage, scrInt)

			return false
		})
	}
})
////////////////////////////////////////////////////

//Pesquisa Portfolio//
/*function filtro_portfolio(){
	$('.search-portfolio select').attr('disabled', 'disabled');
	$('.search-portfolio .active select').attr('disabled', '');
}*/
/*var servico = new Array();
servico = ['#a50000', '#efb90a', '#03728c', '#8246a3', '#5faf0b']
function filtro_portfolio(){
	$('.abas_port ul li').click(function(){
		if($(this).children('a').children('label').children('.sub_cat').css('display') == "none"){
			$('.abas_port ul li').removeClass('active');
			$(this).addClass('active');
			
			$('.content_port .barra').css('background-color',servico[$(this).prevAll().size()]);
			$('.abas_port ul li a label .sub_cat').hide('fast');
			$(this).children('a').children('label').children('.sub_cat').show('fast');
			$(this).css('width',$(this).width + 150 + "px");
		}else if($(this).hasClass('todos')){
			$('.abas_port ul li').removeClass('active');
			$(this).addClass('active');
			
			$('.content_port .barra').css('background-color',servico[$(this).prevAll().size()]);
			$('.abas_port ul li a label .sub_cat').hide('fast');
		}
	});
}*/
/*function sel_filtro_portifolio() {
	if($('.search-portfolio input[type="radio"]:checked').parent().next('.desc').css('display') == "none"){
		$('.desc').hide('fast');
		$('.search-portfolio input[type="radio"]:checked').parent().next('.desc').show('fast');
		$('.search-portfolio input[type="radio"]:checked').parent().next('.desc').css('display', 'table');
		
		$('.desc select').attr('disabled', true);
		$('.search-portfolio input[type="radio"]:checked').parent().next('.desc').children('select').removeAttr('disabled');
			
	}else{
		if($('.search-portfolio input[type="radio"]:checked').hasClass('radio-todos')){
			$('.desc').hide('fast');
		}
	}
}*/
///////////////////////////////////////////////////////
//Label//
function label(quem, valor){
	$(quem).focus(function(){
		if($(quem).val() == valor){
			$(quem).val("");
		}
	});
	$(quem).blur(function(){
		if($(quem).val() == ""){
			$(quem).val(valor);
		}
	});
}
////////////////////////////////////////////////////////
//Muda clientes//
function clientes(){
	$('.box-clientes .nav-tab li').click(function(){
		var boxClientes = $('.box-clientes');
		if(boxClientes.hasClass('.hide')){
			boxClientes.removeClass('hide');
			$(this).children('a').text('[-] Todos os clientes');
		}else{
			boxClientes.addClass('hide');
			$(this).children('a').text('[+] Todos os clientes');
		};
	});
}
////////////////////////////////////////////////////////
//abas postifolio
function abasPortifolio(){
	$('.abas-portifolio .nav-tab li').click(function(){
		var qual = $(this).prevAll().size();
		if($('.content_port.aba'+qual).css('display') == 'none'){
			$('.abas-portifolio .nav-tab li').removeClass('active');
			$(this).addClass('active');
			$('.content_port').hide();
			$('.content_port.aba'+qual).show();
			
			if($(this).children('a').text() == "Clientes"){
				$('.pagin').css('display', 'none');
			}else{
				$('.pagin').css('display', 'block');
			}
		};
	});
} 
////////////////////////////////////////////////////////
var videoUrlSecond = new Array('http://www.youtube.com/v/-roUmQwle60', 'http://www.youtube.com/v/Zk_E8hn-NBg', 'http://www.youtube.com/v/PMUBgBMjBcU', 'http://www.youtube.com/v/eQl5VWBCz5s', 'http://www.youtube.com/v/QLkWuYGSjNs', 'http://www.youtube.com/v/zuepN01uJI8', 'http://www.youtube.com/v/5L5BpD1m-bM', 'http://www.youtube.com/v/ZowOpSJI4vM');
	
var videoUrlClientes = new Array('http://www.youtube.com/v/oTk9UjMMRs8', 'http://www.youtube.com/v/uzaE_zsHQnU', 'http://www.youtube.com/v/bEz9CL2crs8', 'http://www.youtube.com/v/wqHJwgG5lys', 'http://www.youtube.com/v/tZJyljx5Akc', 'http://www.youtube.com/v/NpD1sXcPvio', 'http://www.youtube.com/v/iXjGnUwDwPk');

var videoUrlInstitucionais = new Array('http://www.youtube.com/v/_cNGv0aWKRI', 'http://www.youtube.com/v/x37IMM8cz-8', 'http://www.youtube.com/v/ygU_9SBkuEo', 'http://www.youtube.com/v/3Im4J8rFT6Q', 'http://www.youtube.com/v/DKEOUJ_30q4', 'http://www.youtube.com/v/V_b5nyqNX04', 'http://www.youtube.com/v/-zBiR9FWD0A', 'http://www.youtube.com/v/jovGsux8Ts4', 'http://www.youtube.com/v/1pOCWV7-RqE', 'http://www.youtube.com/v/2KLK8A3SkuI', 'http://www.youtube.com/v/lEOJu18mYPU', 'http://www.youtube.com/v/KVkw_Zln7iM', 'http://www.youtube.com/v/bqHu5kcL0H0');

var atual;
var url;
var video;
//Muda Videos//
function videos(){
	var content_aba_serv = new Array("Institucionais", "Para Clientes", "Second Life");
	var content = new Array("#institucionais", "#clientes", "#second");
	var abas_serv = content_aba_serv.length;
	
	$('.content .item.content-aba').css('display','none');
	$(content[0]).css('display','block');
	
	var item_aba_serv = "";
	for(var a = 0; a < abas_serv; a++){	
		if(a == 0){
			item_aba_serv += "<li class='active' id=" + a + " style='z-index:" + (abas_serv - a) + ";'><span></span><a title='Exibir vídeos " + content_aba_serv[a] + "'>" + content_aba_serv[a] + "</a></li>";
		}else{
			item_aba_serv += "<li id=" + a + " style='z-index:" + (abas_serv - a) + ";'><span></span><a title='Exibir vídeos " + content_aba_serv[a] + "'>" + content_aba_serv[a] + "</a></li>";	
		}
		$('.box-videos .nav-tab').html(item_aba_serv);
	}
	
	var aba_serv;
	$('.box-videos .nav-tab li').click(function(){
		aba_serv = this.id;
		$('.nav-tab li').removeClass('active');
		$(this).addClass('active');
		
		if($('.box-videos ' + content[aba_serv]).css('display') == 'none'){
			$('.content .item.content-aba').fadeOut('fast');
			$('.box-videos ' + content[aba_serv]).fadeIn('slow');
			
		}
	});
}


function mudaVideo(){
	$('.box-videos .menu li').click(function(){

		//$('.box-videos .menu li').removeClass('active');
		$(this).prevAll().removeClass('active');
		$(this).nextAll().removeClass('active');
		$(this).addClass('active');
		
		$('.box-videos .video').html();
		
		atual = $(this).prevAll().size();
		url = videoUrlSecond[atual];
		video = '<object width="350" height="290"><param name="movie" value="' + url + '?fs=1&hl=pt_BR"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque" /></param><embed src="' + url + '?fs=1&hl=pt_BR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="290" wmode="opaque"></embed></object>';
		
		if($('#second').css('display') == "block"){
			url = videoUrlSecond[atual];
			video = '<object width="350" height="290"><param name="movie" value="' + url + '?fs=1&hl=pt_BR"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque" /></param><embed src="' + url + '?fs=1&hl=pt_BR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="290" wmode="opaque"></embed></object>';
			$('#youtube3').html(video);
		}else if($('#clientes').css('display') == "block"){
			url = videoUrlClientes[atual];
			video = '<object width="350" height="290"><param name="movie" value="' + url + '?fs=1&hl=pt_BR"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque" /></param><embed src="' + url + '?fs=1&hl=pt_BR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="290" wmode="opaque"></embed></object>';
			$('#youtube2').html(video);
		}else if($('#institucionais').css('display') == "block"){
			url = videoUrlInstitucionais[atual];
			video = '<object width="350" height="290"><param name="movie" value="' + url + '?fs=1&hl=pt_BR"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque" /></param><embed src="' + url + '?fs=1&hl=pt_BR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="290" wmode="opaque"></embed></object>';
			$('#youtube1').html(video);
		}
		
	});	
}

function initVideo(){
	url = videoUrlSecond[0];
	video = '<object width="350" height="290"><param name="movie" value="' + url + '?fs=1&hl=pt_BR"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque" /></param><embed src="' + url + '?fs=1&hl=pt_BR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="290" wmode="opaque"></embed></object>';
	$('#youtube3').html(video);
	
	url = videoUrlClientes[0];
	video = '<object width="350" height="290"><param name="movie" value="' + url + '?fs=1&hl=pt_BR"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque" /></param><embed src="' + url + '?fs=1&hl=pt_BR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="290" wmode="opaque"></embed></object>';
	$('#youtube2').html(video);
	
	url = videoUrlInstitucionais[0];
	video = '<object width="350" height="290"><param name="movie" value="' + url + '?fs=1&hl=pt_BR"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><param name="wmode" value="opaque" /></param><embed src="' + url + '?fs=1&hl=pt_BR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="350" height="290" wmode="opaque"></embed></object>';
	$('#youtube1').html(video);
}
////////////////////////////////////////////////////////
//Clientes Home OVER//
function clientes_over(){
	$('.brands .client-home').mouseover(function(){
		$(this).children().css('margin-top', -60+'px');
	});
	$('.brands .client-home').mouseout(function(){
		$(this).children().css('margin-top', 0);
	});
}

//////////////////////////////////////////////////////////
//Clientes Janelas Over//
function detalheCliente(){
	$(this).children('.over-client').css('background','#222');
	$('#tab1 .list2 li').hover(function(){	
		
		var altura = $(this).children('.over-client').height() / 2 + 10;
		var comprimento = $(this).width();
		$(this).children('.over-client').css('top', -1 * altura + 'px');
		//alert(comprimento);
		if(comprimento < 80){
			$(this).children('.over-client').css('margin-left', comprimento + 'px');
		}
	});
}

function detalheClientePortfolio(){
	$('.list-brand-image li').hover(function(){	
		var altura = $(this).children('.over-client').height() / 2 - 20;
		$(this).children('.over-client').css('top', -1 * altura + 'px');
	});
}

/////////////////////////////////////////////////////////		

//Banner-Home//
function banner(){
	var flashvars = {
		xmlURL:"xml/main-banner.xml"
	};
	var params = {
		menu: "false",
		scale: "noScale",
		allowFullscreen: "true",
		allowScriptAccess: "always",
		bgcolor: "#FFFFFF",
		wmode: "transparent"
	};
	var attributes = {
		id:"AgenciaVM2"
	};
	swfobject.embedSWF("swf/main-banner.swf", "banner-home", "666", "304", "10.0.0", "swf/swfexpressInstall.swf", flashvars, params, attributes);	
}
//////////////////////////////////////////////////////////////////////
//Mapas///
/*Shadowbox.init({
			// let's skip the automatic setup because we don't have any
			// properly configured link elements on the page
			skipSetup: true,
			handleOversize: "drag",
    		modal: true
		});

function setupDemos() {
	Shadowbox.setup("a.mustang-gallery", {
		gallery: "mustang",
		continuous: true,
		counterType: "skip"
	});
} */

/*function map1() {
	// open a welcome message as soon as the window loads
	Shadowbox.open({
		content:    '<iframe width="600" height="470" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.google.com.br/maps?f=q&amp;hl=pt-BR&amp;geocode=&amp;q=vm2&amp;sll=-23.498552,-46.84799&amp;sspn=0.012909,0.019999&amp;ie=UTF8&amp;t=h&amp;cid=-23496315,-46849082,3050049198418555724&amp;s=AARTsJolWa2Wf0RD5nS81KDDkUjXhjfVAQ&amp;ll=-23.482535,-46.845188&amp;spn=0.036999,0.051498&amp;z=14&amp;iwloc=A&amp;output=embed"></iframe>',
		player:     "html",
		title:      "VM2 - Como Chegar em São Paulo",
		height:     475,
		width:      605
	});

};
function map2() {
	// open a welcome message as soon as the window loads
	Shadowbox.open({
		content:    '<iframe width="600" height="470" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=pt-BR&amp;geocode=&amp;q=Av.+Ant%C3%B4nio+Carlos+Comitre,+1350++Campolim+Sorocaba+-+SP+-+Brasil+-+CEP:+18047-620&amp;sll=-23.52326,-47.464976&amp;sspn=0.025616,0.04549&amp;ie=UTF8&amp;t=h&amp;z=14&amp;iwloc=A&amp;ll=-23.517011,-47.461023&amp;output=embed"></iframe>',
		player:     "html",
		title:      "VM2 - Como Chegar em Sorocaba",
		height:     475,
		width:      605
	});

};*/

//////////////////////////////////////////////////////////////////
$(document).ready(function(){				   
	$('article').attr('id', 'conteudo');
	$("a.top[href^=#nav]").smoothScroll(50,20,20,20);
	$("a.direct-content[href^=#conteudo]").smoothScroll(50,20,20,20);
	
	//filtro_portfolio();
	//sel_filtro_portifolio();
	clientes_over();
	clientes();
	abasPortifolio();
	detalheCliente();
	detalheClientePortfolio();
	videos();
	mudaVideo();
	initVideo();
	banner();
	
function checkAttribute(element, attribute) {
 var test = document.createElement(element);
 if (attribute in test) {
   
  } else {
	$('#email_news').val('informe seu e-mail aqui');
    label('#email_news', 'informe seu e-mail aqui');
	$('#n_email1').val('digite o seu e-mail');
	label('#n_email1', 'digite o seu e-mail');
  }
}
	
		
	checkAttribute('input', 'placeholder')
	
	
	$('.description-job .co-img a').colorbox();
	$(".button.see-map").colorbox({iframe:true, innerWidth:600, innerHeight:470});
	
	$(".clients-slide .brands a").mouseover(function(){
		$("#marcas").cycle("pause");
	});
	$(".clients-slide .brands a").mouseout(function(){
		$("#marcas").cycle("resume");
	});
	
	tit();
	filtroTolltip();
	tooltip.init();
	cores();
	personal();
});

/////////////////////////////////////////////////////////	
