function acessaPortal(){if(document.login.empresa.value == 0){alert("É necessário informar o nome de sua empresa.");document.login.empresa.focus();} else {SITE = document.login.empresa.value;window.open("http://relacionamento.l5.com.br/" + SITE, "_blank");}}
function creditos(){window.open("http://www.mdmstudio.com.br/creditos/index.php?BOX_QUAL_SITE=Copyright 2006/2009 - L5 Networks&BOX_DIREITOS_SITE=Desenvolvimento do website.<br>O conteúdo cadastrado neste website é de uso exclusivo da empresa<br>A cópia total ou parcial são proibidas&BOX_COD_SITE=51","","toolbar=no,statusbar=no,resizable=no,location=no,menubar=no,scrollbars=no,width=500,height=250,left=50,top=50")}
function executarSwf_transparent(filme,alt,lar){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + lar + '" height="' + alt + '">\n');document.write('<param name="movie" value="' + filme + '.swf" />\n');document.write('<param name="quality" value="high" />\n');document.write('<param name="menu" value="false" />\n');document.write('<param name="wmode" value="transparent" />\n');document.write('<embed src="' + filme + '.swf" width="' + lar + '" height="' + alt + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent">\n');document.write('</embed>\n');document.write('</object>\n');}
function executarSwf_white(filme, alt, lar){document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="' + lar + '" height="' + alt + '">\n');document.write('<param name="movie" value="' + filme + '.swf" />\n');document.write('<param name="quality" value="high" />\n');document.write('<param name="menu" value="false" />\n');document.write('<embed src="' + filme + '.swf" width="' + lar + '" height="' + alt + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash">\n');document.write('</embed>\n');document.write('</object>\n');}
function mapa(){window.open("../html/mapaSite.php","","toolbar=no,statusbar=no,resizable=no,location=no,menubar=no,scrollbars=no,width=598,height=280,left=50,top=50")}
function meuIp(){window.open("../html/meuIp.php","","toolbar=no,statusbar=no,resizable=no,location=no,menubar=no,scrollbars=no,width=290,height=280,left=50,top=50")}
function pop_treinamento(){window.open("../html/pop_treinamento.php","form_treino","toolbar=no,statusbar=no,resizable=no,location=no,menubar=no,scrollbars=no,width=450,height=250,left=50,top=50")}
function MM_swapImgRestore() {var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;}
function MM_preloadImages() {var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}}
function MM_findObj(n, d) {var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);if(!x && d.getElementById) x=d.getElementById(n); return x;}
function MM_swapImage() {var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}}

function overCases(id){

for(i=1; i<=10; i++){
document.getElementById(i).style.backgroundColor='#E9E9E9';
document.getElementById(i).style.backgroundImage='url(../imagens/conteudo/fundosLinks.gif)';
document.getElementById(i).style.backgroundRepeat='no-repeat';
document.getElementById(i).style.color='#0066CC';
document.getElementById(i).style.fontWeight='normal';
}

document.getElementById(id).style.backgroundColor='transparent';
document.getElementById(id).style.backgroundImage='url(../imagens/conteudo/fundosLinksOver2.gif)';
document.getElementById(id).style.backgroundRepeat='no-repeat';
document.getElementById(id).style.backgroundPosition='left';
document.getElementById(id).style.color='#000';
document.getElementById(id).style.fontWeight='bold';
}

function cases(texto){document.getElementById('cases_direita').innerHTML = texto;}

function mostra_tel(){

valor = document.telefones_contato.meus_telefones.value;

if(valor=="..."){alert('Você deve selecionar uma cidade para obter o telefone de contato');}

if(valor=="SP"){document.getElementById('mostra_tel').innerHTML="(11) 4063-7500<br />(11) 2222-1000<br />(11) 2222-1010";}
if(valor=="RJ"){document.getElementById('mostra_tel').innerHTML="(21) 4062-7500";}
if(valor=="CWB"){document.getElementById('mostra_tel').innerHTML="(41) 4063-7500";}
if(valor=="BHZ"){document.getElementById('mostra_tel').innerHTML="(31) 4062-7500";}
if(valor=="POA"){document.getElementById('mostra_tel').innerHTML="(51) 4063-7500";}
if(valor=="BSB"){document.getElementById('mostra_tel').innerHTML="(61) 4063-7500";}

}

function menu(qual,local){
	
	if(navigator.appName=="Microsoft Internet Explorer"){
		
		//alert('Explorer');
		//alert(navigator.appVersion);
		
		var marginTop_1; var marginTop_4;
		var marginTop_2; var marginTop_5;
		var marginTop_3; var marginTop_6;
		
		if(navigator.appVersion.indexOf("MSIE 6.0")!=-1){
			//alert('Versão 6.0');
			marginTop_1 = '-124px'; marginTop_2 = '-144px'; marginTop_3 = '-220px';
			marginTop_4 = '-128px'; marginTop_5 = '-148px'; marginTop_6 = '-224px';
		}
		
		if(navigator.appVersion.indexOf("MSIE 7.0")!=-1){
			//alert('Versão 7.0');
			marginTop_1 = '0px'; marginTop_2 = '0px'; marginTop_3 = '0px';
			marginTop_4 = '-4px'; marginTop_5 = '-4px'; marginTop_6 = '-4px';
		}
		
		if(navigator.appVersion.indexOf("MSIE 8.0")!=-1){
			//alert('Versão 8.0');
			marginTop_1 = '0px'; marginTop_2 = '0px'; marginTop_3 = '0px';
			marginTop_4 = '-4px'; marginTop_5 = '-4px'; marginTop_6 = '-4px';
		}
		
	} else {
	
		//alert('Outros');
	
	}

		if(local=='1'){
		
		if(qual!='3'){
			if(qual=='1'){document.getElementById('ilustracao_Pcp').style.marginTop=marginTop_1;}
			if(qual=='2'){document.getElementById('ilustracao_Pcp').style.marginTop=marginTop_2;}
			
		} else {document.getElementById('ilustracao_Pcp').style.marginTop=marginTop_3;}}
		
		if(local=='2'){
		
		if(qual!='3'){
			if(qual=='1'){document.getElementById('ilustracoes_internas').style.marginTop=marginTop_4;}
			if(qual=='2'){document.getElementById('ilustracoes_internas').style.marginTop=marginTop_5;}
			
		} else {document.getElementById('ilustracoes_internas').style.marginTop=marginTop_6;}}


	for(i=1;i<=3;i++){
		
		if(document.getElementById('sub_Pcp_'+i).style.display=='block'){document.getElementById('sub_Pcp_'+i).style.display='none';}
		
		document.getElementById('sub_Pcp_'+qual).style.display='block';
		
	}}

function start(local){

	for(i=1;i<=3;i++){
		
		if(document.getElementById('sub_Pcp_'+i).style.display=='block'){document.getElementById('sub_Pcp_'+i).style.display='none'; var reduziu=true;}
		
	}
		
		if(reduziu){
			
			var versao = navigator.appVersion;
			
			if(navigator.appName=="Microsoft Internet Explorer" & navigator.appVersion.indexOf("MSIE 6.0")!=-1){
				
				if(local=='1'){document.getElementById('ilustracao_Pcp').style.marginTop='0px';}
				if(local=='2'){document.getElementById('ilustracoes_internas').style.marginTop='-4px';}}			
			
	}}
	
function check_valor_suporte(acao, campo){
	
	var formulario = document.suporte;
	
	if(acao=="over"){
	
	if(campo=="1"){		
		if(formulario.txtLogin.value=="usuario"){formulario.txtLogin.value="";}
	}
	
	if(campo=="2"){		
		if(formulario.txtSenha.value=="senha"){formulario.txtSenha.value="";}
	}}
	
		if(acao=="out"){
	
	if(campo=="1"){		
		if(formulario.txtLogin.value==""){formulario.txtLogin.value="usuario";}
	}
	
	if(campo=="2"){		
		if(formulario.txtSenha.value==""){formulario.txtSenha.value="senha";}
	}}
}

function check_valor_suaConta(acao, campo){
	
	var formulario = document.suaConta;
	
	if(acao=="over"){
	
	if(campo=="1"){		
		if(formulario.pb_auth_user.value=="usuario"){formulario.pb_auth_user.value="";}
	}
	
	if(campo=="2"){		
		if(formulario.pb_auth_password.value=="senha"){formulario.pb_auth_password.value="";}
	}}
	
		if(acao=="out"){
	
	if(campo=="1"){		
		if(formulario.pb_auth_user.value==""){formulario.pb_auth_user.value="usuario";}
	}
	
	if(campo=="2"){		
		if(formulario.pb_auth_password.value==""){formulario.pb_auth_password.value="senha";}
	}}
}

function check_suporte(){
	
	var formulario = document.suporte;
	
	if(formulario.txtLogin.value=="" | formulario.txtLogin.value=="usuario"){
		alert('Por favor informe seu nome de usuário');
		formulario.txtLogin.focus();
		return false;
	}
	
	if(formulario.txtSenha.value=="" | formulario.txtSenha.value=="senha"){
		alert('Por favor informe sua senha de acesso');
		formulario.txtSenha.focus();
		return false;
	} else {return true;}}
	
function check_suaConta(){
	
	var formulario = document.suaConta;
	
	if(formulario.pb_auth_user.value=="" | formulario.pb_auth_user.value=="usuario"){
		alert('Por favor informe seu nome de usuário');
		formulario.pb_auth_user.focus();
		return false;
	}
	
	if(formulario.pb_auth_password.value=="" | formulario.pb_auth_password.value=="senha"){
		alert('Por favor informe sua senha de acesso');
		formulario.pb_auth_password.focus();
		return false;
	} else {return true;}}

	
function criaXMLHttp() {

if (typeof XMLHttpRequest != "undefined")
return new XMLHttpRequest();

else if (window.ActiveXObject){
var versoes = ["MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0", "MSXML2.XMLHttp.3.0", "MSXML2.XMLHttp", "Microsoft.XMLHttp"];
}

for (var i = 0; i < versoes.length; i++){
try {return new ActiveXObject(versoes[i]); }catch (e) {}
}

throw new Error("Seu browser nao suporta AJAX");

}

function rec_textos(local,lk,tipo) {

	if(local=="ipbx"){
		
		if(tipo!=0){
		
		for(i=1;i<=6;i++){
			document.getElementById('lk_'+i).className='out_diferenciais';		
			if(i==tipo){document.getElementById('lk_'+i).className='clicado_diferenciais';}
		}}}
		
	if(local=="gateways"){
		
		if(tipo!=0){
		
		for(i=1;i<=2;i++){
			document.getElementById('lk_'+i).className='out_diferenciais';		
			if(i==tipo){document.getElementById('lk_'+i).className='clicado_diferenciais';}
		}}}
		
	if(local=="telefones"){
		
		if(tipo!=0){
		
		for(i=1;i<=7;i++){
			document.getElementById('lk_'+i).className='out_diferenciais';		
			if(i==tipo){document.getElementById('lk_'+i).className='clicado_diferenciais';}
		}}}
	
	if(local=="helpDesk"){
		
		if(tipo!=0){
		
		for(i=1;i<=2;i++){
			document.getElementById('lk_'+i).className='out_diferenciais';		
			if(i==tipo){document.getElementById('lk_'+i).className='clicado_diferenciais';}
		}}}
		
	if(local=="infraestrutura"){
		
		if(tipo!=0){
		
		for(i=1;i<=2;i++){
			document.getElementById('lk_'+i).className='out_diferenciais';		
			if(i==tipo){document.getElementById('lk_'+i).className='clicado_diferenciais';}
		}}}

	if(local=="outsourcing"){
		
		if(tipo!=0){
		
		for(i=1;i<=2;i++){
			document.getElementById('lk_'+i).className='out_diferenciais';		
			if(i==tipo){document.getElementById('lk_'+i).className='clicado_diferenciais';}
		}}}

	if(local=="voip"){
		
		if(tipo!=0){
		
		for(i=1;i<=2;i++){
			document.getElementById('lk_'+i).className='out_diferenciais';		
			if(i==tipo){document.getElementById('lk_'+i).className='clicado_diferenciais';}
		}}}
		
	if(local=="consultoria"){
		
		if(tipo!=0){
		
		for(i=1;i<=2;i++){
			document.getElementById('lk_'+i).className='out_diferenciais';		
			if(i==tipo){document.getElementById('lk_'+i).className='clicado_diferenciais';}
		}}}

	if(local=="diferencial"){
		
		if(tipo!=0){
		
		for(i=1;i<=5;i++){
			document.getElementById('lk_'+i).className='out_diferenciais';
			if(i==tipo){document.getElementById('lk_'+i).className='clicado_diferenciais';}
		}}}

	if(local=="desenvolvimento"){
		
		if(tipo!=0){
		
		for(i=1;i<=4;i++){
			document.getElementById('lk_'+i).className='out_diferenciais';
			if(i==tipo){document.getElementById('lk_'+i).className='clicado_diferenciais';}
	}}}

	var altura = document.getElementById('internas_direita').offsetHeight;
	
	// alert('Altura internas direita= ' + altura);
	
	
	var comparar = document.getElementById('internas_esquerda').offsetHeight;
	
	// alert('Altura internas esquerda= ' + comparar);
	
	var sobraAjustador = altura-comparar+20;
	
	// alert('Altura do ajustador deve ser= ' + sobraAjustador);
	
	if(comparar<altura){
	
	document.getElementById('box_internas').style.height=altura + 'px';
	document.getElementById('internas_esquerda').style.height=altura + 'px';
	
	document.getElementById('ajustador').style.height=sobraAjustador + 'px';	
	
	// alert('Comparação ' + comparar + 'é menor que ' + altura + '\nInternas geral e esquerda agora é= '+ altura);
	
	// document.getElementById('rodape_internas').style.marginTop='-20px';
	
	} else {document.getElementById('rodape_internas').style.marginTop='-20px';}

}

function cd (END, LAR, ALT, ROLAR){var LARGURA_TOTAL = (screen.availWidth - LAR) / 2;var ALTURA_TOTAL = (screen.availHeight - ALT) / 2; ABRIR = window.open(""+END+"","","toolbar=no,statusbar=no,resizable=no,location=no,menubar=no,scrollbars="+ROLAR+",width="+LAR+",height="+ALT+",left="+LARGURA_TOTAL+",top="+ALTURA_TOTAL+""); if (parseInt(navigator.appVersion) >= 4) {ABRIR.window.focus();}}

function carregaWebPhone(){	
	    
		if(navigator.appName!="Microsoft Internet Explorer"){
			alert('O sistema Web Call funciona somente no navegador Internet Explorer\nEm breve estaremos disponibilizando uma versão compatível com seu navegador \n\n('+navigator.userAgent+')\n\nEquipe L5 Networks');
			return false;
		
		} else {
		
		var departamento=document.clique_fale.departamento.value;	
		
		document.getElementById('iframe_web_call').innerHTML="<iframe src=\"http://ipbx.l5.com.br/webphone/softphone.php?departamento="+departamento+"\" width=\"345\" height=\"110\" frameBorder=\"no\" scrolling=\"no\"></iframe>";
		
		document.getElementById('web_call').style.display='block';		
		
		start_web_call();
		
		}}


function start_web_call(){
	
	var valor_topo = 150;
	var fracao = 90/100;

	var intervalo = window.setInterval(function () {valor_topo = (valor_topo + 87.5) * (80/100);
	document.getElementById('web_call').style.top = valor_topo + 'px';}, 25);
	window.setTimeout(function(){clearInterval(intervalo);}, 1000);

}

function googleTranslateElementInit() {
  new google.translate.TranslateElement({
    pageLanguage: 'pt',
    includedLanguages: 'de,zh-CN,es,fr,en'
  }, 'google_translate_element');
}