function ajax(url,variaveis,divconteudo) {
    var http = false;
    if(navigator.appName == "Microsoft Internet Explorer") {
      http = new ActiveXObject("Microsoft.XMLHTTP");
    } else {
      http = new XMLHttpRequest();
    }
    http.onreadystatechange=function stateChanged() { 
    if (http.readyState==4 || http.readyState=="complete"){ 
           document.getElementById(divconteudo).innerHTML=http.responseText
        }else
           document.getElementById(divconteudo).innerHTML="<p class='style23'><center>Aguarde...</center></p>";
    };
    http.open("GET",url+'?'+variaveis,true);
    http.send(null);
}

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function mod_portal(){
	ajax("mod_portal.php","","expandir");
	document.getElementById("troca_botao").innerHTML = "<a href='javascript:lmp_portal();'><strong>[ Ocultar ]</strong></a>";
}
function lmp_portal(){
	document.getElementById("expandir").innerHTML = "";
	document.getElementById("troca_botao").innerHTML = "<a href='javascript:mod_portal();'><strong>[ Expandir ]</strong></a>";
}

function mod_gestao(){
	ajax("mod_gestao.php","","expandir");
	document.getElementById("troca_botao").innerHTML = "<a href='javascript:lmp_gestao();'><strong>[ Ocultar ]</strong></a>";
}
function lmp_gestao(){
	document.getElementById("expandir").innerHTML = "";
	document.getElementById("troca_botao").innerHTML = "<a href='javascript:mod_gestao();'><strong>[ Expandir ]</strong></a>";
}
function func_sixma(){
	ajax("func_sixma.php","","expandir");
	document.getElementById("troca_botao").innerHTML = "<a href='javascript:lmp_sixma();'><strong>[ Ocultar ]</strong></a>";
}
function lmp_sixma(){
	document.getElementById("expandir").innerHTML = "";
	document.getElementById("troca_botao").innerHTML = "<a href='javascript:func_sixma();'><strong>[ Expandir ]</strong></a>";
}

function func_eit(){
	ajax("func_eit.php","","expandir");
	document.getElementById("troca_botao").innerHTML = "<a href='javascript:lmp_eit();'><strong>[ Ocultar ]</strong></a>";
}
function lmp_eit(){
	document.getElementById("expandir").innerHTML = "";
	document.getElementById("troca_botao").innerHTML = "<a href='javascript:func_eit();'><strong>[ Expandir ]</strong></a>";
}
function func_eit2(){
	ajax("porque_usar_eit.php","","expandir2");
	document.getElementById("troca_botao2").innerHTML = "<a href='javascript:lmp_eit2();'><strong>[ Ocultar ]</strong></a>";
}
function lmp_eit2(){
	document.getElementById("expandir2").innerHTML = "";
	document.getElementById("troca_botao2").innerHTML = "<a href='javascript:func_eit2();'><strong>[ Expandir ]</strong></a>";
}

function envia_email_webcorp(){
	 var nome  = document.getElementById("nome").value;
	 var telefone = document.getElementById("telefone").value;
	 var email = document.getElementById("email").value;
	 var assunto = document.getElementById("assunto").value;
	 var mensagem = document.getElementById("mensagem").value;
	 var tipo_atendimento = document.getElementById("tipo_atendimento").value;
	
	if (nome =='' || telefone == '' || email == '' || assunto == '' || mensagem == '') {
		window.alert("Dados em branco! Por favor, preencha todos os campos!");
	}
	else {
	
		var poststr = "nome=" + encodeURI(nome) + "&telefone=" + encodeURI(telefone) + "&email=" + encodeURI(email) +
				      "&assunto=" + encodeURI(assunto) + "&mensagem=" + encodeURI(mensagem) + "&tipo_atendimento=" + encodeURI(tipo_atendimento);
	
		ajax('contato_webcorp.php',poststr,'conteudo');
	}
}

function limpa_email(){
     document.getElementById("nome").value = "";
     document.getElementById("telefone").value = "";
     document.getElementById("email").value = "";
     document.getElementById("assunto").value = "";
     document.getElementById("mensagem").value = "";
     document.getElementById("tipo_atendimento").value = "";
     document.getElementById("nome").focus();
}

function flash(file, width, height){
	document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0' width='" + width + "' height='" + height + "'> \n");
    document.write("<param name='movie' value='" + file + "'>\n");
    document.write("<param name='quality' value='high'> \n");
    document.write("<param name='wmode' value='transparent'> \n");
    document.write("<embed src='" + file + "' quality='high' wmode='transparent' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'></embed> ");
    document.write("</object>");
}

function abrejanela(){
   window.open("saida.htm","","width=775,height=475,status=no,scrollbars=YES,resizable=no");
}