/*
INCLUDES E FUNCTIONS por Helio Osako
Site: http://www.wenfear.com
*/
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function Flash(nomeSWF, largura, altura) {
	var flash = '\
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="' + largura + '" height="' + altura + '" />\
	  <param name="movie" value="http://www.fsb.com.br/ing/wp-content/themes/fsb/swf/' + nomeSWF + '.swf"/>\
	  <param name="quality" value="high" />\
	  <param name="wmode" value="transparent" />\
	  <param name="menu" value="false" />\
	  <embed src="http://www.fsb.com.br/ing/wp-content/themes/fsb/swf/' + nomeSWF + '.swf" quality="high" wmode="transparent" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ largura + '" height="' + altura + '"></embed>\
    </object>\
	';
	document.write(flash);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function FlashOut(nomeSWF, largura, altura) {
	var flash = '\
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="' + largura + '" height="' + altura + '" />\
	  <param name="movie" value="http://www.fsb.com.br/ing/' + nomeSWF + '.swf"/>\
	  <param name="quality" value="high" />\
	  <param name="wmode" value="transparent" />\
	  <param name="menu" value="false" />\
	  <embed src="http://www.fsb.com.br/ing/' + nomeSWF + '.swf" quality="high" wmode="transparent" menu="false" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ largura + '" height="' + altura + '"></embed>\
    </object>\
	';
	document.write(flash);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function toUrl(url, target) {
	if(target != '_blank') {
		window.location = url;	
	} else {
		nwin = window.open(url, '');
		nwin.focus();
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function fechaSocios(idNum) {
	for (i=1;i<5;i++) {
		$("#socios"+i).css({'display':'none'});
	}
	$("#socios"+idNum).fadeOut(100);
}
function exibeSocios(idNum) {
	for (i=1;i<5;i++) {
		$("#socios"+i).css({'display':'none'});
	}
	$("#socios"+idNum).css({'display':'block'});
	$("#socios"+idNum).fadeOut(0);
	$("#socios"+idNum).fadeIn(1000);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function showHideAll(qtde) {
	caseDescHeights = new Array();
	caseDescStatus = new Array();
	for (i=1;i<(Number(qtde)+1);i++) {
		caseDescHeights[i] = $("#caseDesc"+i).height();
		caseDescStatus[i] = false;
		$("#caseDesc"+i).css( {'height':'28px'} );
		$("#caseDesc"+i).click( function() {
			idNum = this.id.split("Desc")[1];
			$(this).stop();
			if (caseDescStatus[idNum] == false) {
				$(this).animate( { height: caseDescHeights[idNum] }, 200);
				$("#caseDescBt"+idNum).fadeOut(200, function() {
					$(this).attr( { src:'http://www.fsb.com.br/wp-content/themes/fsb/img/btFechar.gif' });	
					$(this).fadeIn(500);
				} );
				caseDescStatus[idNum] = true;
			}
			else {
				$(this).animate( { height: '28px' }, 200);
				$("#caseDescBt"+idNum).fadeOut(200, function() {
					$(this).attr( { src:'http://www.fsb.com.br/wp-content/themes/fsb/img/setaDireita.gif' });	
					$(this).fadeIn(500);
				} );
				caseDescStatus[idNum] = false;
			}
		} );
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function showHideAllSlim(qtde) {
	caseDescHeights = new Array();
	caseDescStatus = new Array();
	for (i=1;i<(Number(qtde)+1);i++) {
		caseDescHeights[i] = $("#caseDesc"+i).height();
		caseDescStatus[i] = false;
		$("#caseDesc"+i).css( {'height':'23px'} );
		$("#caseDesc"+i).click( function() {
			idNum = this.id.split("Desc")[1];
			$(this).stop();
			if (caseDescStatus[idNum] == false) {
				$(this).animate( { height: caseDescHeights[idNum] }, 200);
				$("#caseDescBt"+idNum).fadeOut(200, function() {
					$(this).attr( { src:'http://www.fsb.com.br/wp-content/themes/fsb/img/btFechar.gif' });	
					$(this).fadeIn(500);
				} );
				caseDescStatus[idNum] = true;
			}
			else {
				$(this).animate( { height: '23px' }, 200);
				$("#caseDescBt"+idNum).fadeOut(200, function() {
					$(this).attr( { src:'http://www.fsb.com.br/wp-content/themes/fsb/img/setaDireita.gif' });	
					$(this).fadeIn(500);
				} );
				caseDescStatus[idNum] = false;
			}
		} );
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function depoimento(id) {
	$('.video_title').html("carregando...");
	$.getJSON('?v='+id, function(data) {
		$('.video_title').html(data.title);
		$('.fotoAmpliada').html(data.video);
	});
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function caseImagem () {
	var icaseimg = 0;
	var ncaseimg = $(".case-imgs ul li").length;

	$(".case-img").hide();
	$(".case-imgs").hide();
	
	$('.case-img-ver').html( $(".case-imgs ul li:eq("+icaseimg+")").html());
	$('.legenda').html($(".case-imgs ul li:eq("+icaseimg+")").find('img').attr('alt'));

	if(ncaseimg>0){
		$(".case-img").show();
	}

	$(".fotoNavega img").click(function() {
		if($(this).attr('action') == 'next') {
			if(ncaseimg>(icaseimg+1)) {
				icaseimg = icaseimg+1;
				$('.case-img-ver').html( $(".case-imgs ul li:eq("+icaseimg+")").html() );
				$('.legenda').html($(".case-imgs ul li:eq("+icaseimg+")").find('img').attr('alt'))
			}
		} else {
			if(icaseimg>0) {
				icaseimg = icaseimg-1;
				$('.case-img-ver').html( $(".case-imgs ul li:eq("+icaseimg+")").html());
				$('.legenda').html($(".case-imgs ul li:eq("+icaseimg+")").find('img').attr('alt'));
			}
		}
	});
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
var intElement = 0;
var goPlay = 0;

function pegarNoticias() {

	$(".noticia").html($(".noticias-lista li:eq("+intElement+")").html());

			intElement = intElement+1;

			if($(".noticias-lista li:eq("+intElement+")").html() == null) {
				intElement = 0;
			}

			goPlay = window.setTimeout(pegarNoticias, 8000);
			$(".noticia").fadeTo(500, 1);
			$(".noticia").fadeTo(6000, 1);
			$(".noticia").fadeTo(500, 0);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function iniciaPassosCurriculo() {
	numPasso = 1;
	passosHeights = new Array();
	for (i=1;i<5;i++) {
		passosHeights[i] = $("#passosCurriculo"+i).height();
		$("#passosBox"+i).addClass('passo');
		//$("#passosCurriculo"+i).animate( { height: '0px' }, 0);
		$("#avanca"+i).click( function() { numPasso += 1; resetaTodosPassos(); } );
		$("#volta"+i).click( function() { numPasso -= 1; resetaTodosPassos(); } );
		$("#passosCurriculo"+i).css("display","none");
	}
	$("#passosBox1").removeClass('passo');
	$("#passosBox1").addClass('passoAtual');
	
	$("#passosCurriculo1").css("display","block");
	
	//$("#passosCurriculo1").stop();
	//$("#passosCurriculo1").animate( { height: passosHeights[numPasso] }, 500);
}
function resetaTodosPassos() {
	for (s=1;s<5;s++) {
		$("#passosBox"+s).removeClass('passo');
		$("#passosBox"+s).removeClass('passoOk');
		$("#passosBox"+s).removeClass('passoAtual');
		if (s < numPasso) $("#passosBox"+s).addClass('passoOk');
		if (s == numPasso) $("#passosBox"+s).addClass('passoAtual');
		else $("#passosBox"+s).addClass('passo');
		
		$("#passosCurriculo"+s).css("display","none");
		$("#passosCurriculo"+numPasso).css("display","block");
		
		/*
		$("#passosCurriculo"+s).stop();
		$("#passosCurriculo"+s).animate( { height: '0px' }, 500, function() {
			$("#passosCurriculo"+numPasso).stop();
			$("#passosCurriculo"+numPasso).animate( { height: passosHeights[numPasso] }, 500);
		} );
		*/
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function palestraDescHideAll() {
	palestraDescHeights = new Array();
	palestraDescStatus = new Array();
	for (i=1;i<6;i++) {
		palestraDescHeights[i] = $("#desc"+i).height();
		palestraDescStatus[i] = false;
		$("#desc"+i).css( {'height':'82px'} );
		$("#desc"+i).click( function() {
			idNum = this.id.split("desc")[1];
			$(this).stop();
			if (palestraDescStatus[idNum] == false) {
				$(this).animate( { height: palestraDescHeights[idNum] }, 200);
				$("#palestraDescBt"+idNum).fadeOut(200, function() {
					$(this).attr( { src:'http://www.fsb.com.br/wp-content/themes/fsb/img/btFechar.gif' });	
					$(this).fadeIn(500);
				} );
				palestraDescStatus[idNum] = true;
			}
			else {
				$(this).animate( { height: '82px' }, 200);
				$("#palestraDescBt"+idNum).fadeOut(200, function() {
					$(this).attr( { src:'http://www.fsb.com.br/wp-content/themes/fsb/img/setaDireita.gif' });	
					$(this).fadeIn(500);
				} );
				palestraDescStatus[idNum] = false;
			}
		} );
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function estruturaFoto(linkImg) {
	$("#fotoAmpliada").fadeOut(500, function() {
		document.getElementById("fotoAmpliada").src = linkImg;										  
	} );
	$("#fotoAmpliada").fadeIn(500);
}
function estruturaThumbPag(valor) {
	var cssTop = $("#fotoThumbs").css('left');
	cssTop = Number(cssTop.split('px')[0]);
	if (valor == 1) {
		$("#fotoThumbs").animate( { top: "-344px"}, 1000);
	} else {
		$("#fotoThumbs").animate( { top: "8px"}, 1000);
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function setSidebar(tipo) {
	var header = '<a href="index.htm"><img src="img/latLogo.gif" class="logoFsb" width="104" height="104" alt="FSB Comunica&ccedil;&otilde;es" /></a>';
	header += '<div class="menu">';
	// - - - - - - - - - - - - - - -
	if (tipo == 'fsb') {
		header += '<a href="fsb.htm"><img src="img/latMenuFsb_sel.gif" width="120" height="19" alt="a FSB" /></a>';
		header += '\
		<ul class="submenu"> \
			<li><a href="equipe.htm">equipe</a></li> \
			<li><a href="abrangencia.htm">abrang&ecirc;ncia</a></li> \
			<li><a href="acaoSocial.htm">a&ccedil;&atilde;o social</a></li> \
			<li><a href="depoimentos.htm">depoimentos</a></li> \
			<li><a href="relatorioAnual.htm">relat&oacute;rio anual</a></li> \
			<li><a href="experiencia.htm">experi&ecirc;ncia</a></li> \
		</ul> \
		';
	} else {
		header += '<a href="fsb.htm"><img src="img/latMenuFsb.gif" width="120" height="19" alt="a FSB" /></a>';	
	}
	// - - - - - - - - - - - - - - -
	if (tipo == 'solucoes') {
		header += '<a href="solucoes.htm"><img src="img/latMenuSolucoes_sel.gif" width="120" height="19" alt="soluções" /></a>';
		header += '\
		<ul class="submenu"> \
			<li><a href="solucoesDescricao.htm?id=1">rela&ccedil;&otilde;es com a m&iacute;dia</a></li> \
			<li><a href="solucoesDescricao.htm?id=2">comunica&ccedil;&atilde;o com a comunidade</a></li> \
			<li><a href="solucoesDescricao.htm?id=3">comunica&ccedil;&atilde;o com investidores</a></li> \
			<li><a href="solucoesDescricao.htm?id=4">comunica&ccedil;&atilde;o de governo</a></li> \
			<li><a href="solucoesDescricao.htm?id=5">comunica&ccedil;&atilde;o interna</a></li> \
			<li><a href="solucoesDescricao.htm?id=6">eventos corporativos</a></li> \
			<li><a href="solucoesDescricao.htm?id=7">rela&ccedil;&otilde;es com o setor p&uacute;blico</a></li> \
			<li><a href="solucoesDescricao.htm?id=8">FSB Design</a></li> \
			<li><a href="solucoesDescricao.htm?id=9">FSB PR Digital</a></li> \
			<li><a href="solucoesDescricao.htm?id=10">Instituto FSB Pesquisa</a></li> \
		</ul> \
		';
	} else {
		header += '<a href="solucoes.htm"><img src="img/latMenuSolucoes.gif" width="120" height="19" alt="soluções" /></a>';
	}
	// - - - - - - - - - - - - - - -
	if (tipo == 'cases') {
		header += '<a href="cases.htm"><img src="img/latMenuCases_sel.gif" width="120" height="19" alt="cases" /></a>';
		header += '\
		<ul class="submenu"> \
			<li><a href="casesLista.htm?id=1">constru&ccedil;&atilde;o e reposicionamento de imagem</a></li> \
			<li><a href="casesLista.htm?id=2">gerenciamento de crise</a></li> \
			<li><a href="casesLista.htm?id=3">lan&ccedil;amento de produto</a></li> \
			<li><a href="casesLista.htm?id=4">comunica&ccedil;&atilde;o de feiras e eventos</a></li> \
			<li><a href="casesLista.htm?id=5">gera&ccedil;&atilde;o de fatos</a></li> \
			<li><a href="casesLista.htm?id=6">comunica&ccedil;&atilde;o interna</a></li> \
			<li><a href="casesLista.htm?id=7">comunica&ccedil;&atilde;o de governo</a></li> \
			<li><a href="casesLista.htm?id=8">rela&ccedil;&otilde;es com a comunidade</a></li> \
			<li><a href="casesLista.htm?id=9">rela&ccedil;&otilde;es com o setor p&uacute;blico</a></li> \
			<li><a href="casesLista.htm?id=10">comunica&ccedil;&atilde;o digital</a></li> \
			<li><a href="casesLista.htm?id=11">propaganda</a></li> \
			<li><a href="casesLista.htm?id=12">pesquisa</a></li> \
			<li><a href="casesLista.htm?id=13">design</a></li> \
		</ul> \
		';	
	} else {
		header += '<a href="cases.htm"><img src="img/latMenuCases.gif" width="120" height="19" alt="cases" /></a>';
	}
	// - - - - - - - - - - - - - - -
	if (tipo == 'imprensa') {
		header += '<a href="salaImprensa.htm"><img src="img/latMenuImprensa_sel.gif" width="120" height="19" alt="sala de imprensa" /></a>';
		header += '\
		<ul class="submenu"> \
			<li><a href="releases.htm">releases</a></li> \
			<li><a href="noticias.htm">not&iacute;cias FSB</a></li> \
			<li><a href="credenciamento.htm">credenciamento</a></li> \
			<li><a href="bancoPautas.htm">banco de pautas</a></li> \
		</ul> \
		';
	} else {
		header += '<a href="salaImprensa.htm"><img src="img/latMenuImprensa.gif" width="120" height="19" alt="sala de imprensa" /></a>';
	}
	// - - - - - - - - - - - - - - -
	if (tipo == 'estudante') {
		header += '<a href="salaEstudante.htm"><img src="img/latMenuEstudante_sel.gif" width="120" height="19" alt="sala do estudante" /></a>';
		header += '\
		<ul class="submenu"> \
			<li><a href="bancoCurriculo.htm">banco de curr&iacute;culo</a></li> \
			<li><a href="palestras.htm">palestras</a></li> \
		</ul> \
		';
	} else {
		header += '<a href="salaEstudante.htm"><img src="img/latMenuEstudante.gif" width="120" height="19" alt="sala do estudante" /></a>';
	}
	// - - - - - - - - - - - - - - -
	if (tipo == 'ideias') {
		header += '<a href="fsbIdeias.htm"><img src="img/latMenuIdeias_sel.gif" width="120" height="19" alt="cases" /></a>';
		header += '\
		<ul class="submenu"> \
			<li><a href="blogsFsb.htm">blogs FSB</a></li> \
			<li><a href="linksTwitter.htm">links do twitter</a></li> \
			<li><a href="youtube.htm">youtube</a></li> \
			<li><a href="artigos.htm">artigos</a></li> \
			<li><a href="colaboradores.htm">colaboradores</a></li> \
		</ul> \
		';
	} else {
		header += '<a href="fsbIdeias.htm"><img src="img/latMenuIdeias.gif" width="120" height="19" alt="cases" /></a>';
	}
	// - - - - - - - - - - - - - - -
	header += '</div>';
	
	document.write(header);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function setHeader() {
	var header = '\
	<div class="header"> \
        <div class="menuSec"> \
            <a href="areaRestrita.htm"><img src="img/headerAreaRestrita.gif" width="71" height="15" alt="área restrita" /></a> \
            <img src="img/headerDivisao.gif" width="1" height="15" /> \
            <a href="mapaDoSite.htm"><img src="img/headerMapaDoSite.gif" width="76" height="15" alt="mapa do site" /></a> \
            <img src="img/headerDivisao.gif" width="1" height="15" /> \
            <a href="contato.htm"><img src="img/headerContato.gif" width="51" height="15" alt="contato" /></a> \
        </div> \
        <form action="busca.htm"> \
        	<input type="text" id="busca" name="busca" class="busca" value="Buscar" /> \
			<input name="Submit" type="submit" class="busca-btn" value="OK" /> \
        </form> \
        <div class="langBt"> \
        	<a href=""><img src="img/flagIng.gif" width="16" height="11" /></a> \
            <a href=""><img src="img/flagEs.gif" width="16" height="11" /></a> \
			<a href=""><img src="img/flagCh.gif" width="16" height="11" /></a> \
        </div> \
    </div> \
	';
	document.write(header);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function setBottom() {
	var bottom = '\
	<div class="bottom"> \
		<div class="centro"> \
			<div class="menu"> \
				<a href="fsb.htm"><img src="img/bottomMenuFsb.gif" width="34" height="19" /></a> \
				<img src="img/bottomMenuDivisao.gif" width="6" height="19" /> \
				<a href="solucoes.htm"><img src="img/bottomMenuSolucoes.gif" width="52" height="19" /></a> \
				<img src="img/bottomMenuDivisao.gif" width="6" height="19" /> \
				<a href="cases.htm"><img src="img/bottomMenuCases.gif" width="34" height="19" /></a> \
				<img src="img/bottomMenuDivisao.gif" width="6" height="19" /> \
				<a href="salaImprensa.htm"><img src="img/bottomMenuImprensa.gif" width="104" height="19" /></a> \
				<img src="img/bottomMenuDivisao.gif" width="6" height="19" /> \
				<a href="salaEstudante.htm"><img src="img/bottomMenuEstudante.gif" width="109" height="19" /></a> \
				<img src="img/bottomMenuDivisao.gif" width="6" height="19" /> \
				<a href="fsbIdeias.htm"><img src="img/bottomMenuIdeias.gif" width="58" height="19" /></a> \
			</div> \
			<div class="associacoes"> \
				<img src="img/bottomAssociacoes.gif" class="chamada" width="68" height="15" /> \
				<a href=""><img src="img/bottomAbracom.gif" class="abracom" width="141" height="27" /></a> \
				<a href=""><img src="img/bottomAberje.gif" class="aberje" width="35" height="41" /></a> \
			</div> \
			<div class="copyright"> \
				&copy; Copyright 2009. Todos os direitos reservados. \
			</div> \
		</div> \
	</div> \
	';
	document.write(bottom);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function setCompartilhe() {
	for(s=1;s<6;s++) {
		$("#compartilheIco"+s).mouseover(function() { 
			$(this).stop();								  
			$(this).animate( { top: '-5px' }, 250 );
		} );
		$("#compartilheIco"+s).mouseout(function() { 
			$(this).stop();	
			$(this).animate( { top: '0px' }, 250 );
		} );
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function iniciaAbaBarras(qtdeAbas) {
	qtdeAbas += 1;
	for (w=1;w<qtdeAbas;w++) {
		$("#abaBarra"+w).mouseover( function() {
			$(this).stop();
			$(this).animate( { height: '110px' }, 200);
		} );
		$("#abaBarra"+w).mouseout( function() {
			$(this).stop();
			$(this).animate( { height: '40px' }, 200);
		} );
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
function iniciaAbaTripla() {
	for (w=1;w<4;w++) {
		$("#abaTripla"+w).mouseover( function() {
			for (i=1;i<4;i++) { 
				$("#abaTripla"+i).stop();
				$("#abaTripla"+i).animate( { width: '75px' }, 200);
			}
			$(this).stop();
			$(this).animate( { width: '300px' }, 200);
		} );
		$("#abaTripla"+w).mouseout( function() {
			for (i=1;i<4;i++) { 
				$("#abaTripla"+i).stop();
				$("#abaTripla"+i).animate( { width: '150px' }, 200);
			}
		} );
	}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 