try{
    xmlhttp = new XMLHttpRequest();
}catch(ee){
    try{
        xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
    }catch(e){
        try{
            xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
        }catch(E){
            xmlhttp = false;
        }
    }
}

function criarXMLHttpRequest()
{
   try{ return new ActiveXObject("Msxml2.XMLHTTP"); }catch(e){}
   try{ return new ActiveXObject("Microsoft.XMLHTTP"); }catch(e){}
   try{ return new XMLHttpRequest(); }catch(e){}
   //alert("XMLHttpRequest not supported");
   return null;
}
var XHR_criado = criarXMLHttpRequest();


function limpaRepres(){
   document.getElementById('nome').value="";	
   document.getElementById('empresa').value="";	
   document.getElementById('cidade').value="";	
   document.getElementById('estado').value="";	
   document.getElementById('telefone').value="";	
   document.getElementById('email').value="";	
}

function limpaContato(){
   document.getElementById('msg').value="";	
   document.getElementById('nome').value="";	
   document.getElementById('telefone').value="";	
   document.getElementById('email').value="";	
}

function limpaContatoAss(){
   document.getElementById('msg').value="";	
   document.getElementById('nome').value="";	
   document.getElementById('telefone').value="";	
   document.getElementById('email').value="";	
}

function limpaRepresA(){
   document.getElementById('msg').value      ="";	
   document.getElementById('nome').value     ="";	
   document.getElementById('telefone').value ="";	
   document.getElementById('email').value    ="";	
   document.getElementById('cnpj').value     ="";	
   document.getElementById('cidade').value   ="";	
}

function mOverLink(src){
  src.style.cursor = "pointer";
  src.style.textDecoration = "underline";
}
function mOutLink(src){
  src.style.cursor = "default";
  src.style.textDecoration = "none";
}

function mOverLinkX(src,img){
  document.getElementById(src).src = "img/"+img;
}
function mOutLinkX(src,img){
  document.getElementById(src).src = "img/"+img;
}

function muda_foto(img,tit,descricao){
  document.getElementById('foto_amb').src = img;
  document.getElementById('txt_tit').innerHTML = tit;
  document.getElementById('txt_desc').innerHTML = descricao;
}

function mOverLinks(src){
  src.style.textDecoration = "underline";
  src.style.color = "#E72028";
}
function mOutLinks(src){
  src.style.textDecoration = "none";
  src.style.color= "#FFF";
}

function abreBusca(id) {
 if (document.getElementById(id).style.display=="block") {
   document.getElementById(id).style.display="none";
 } else {
   document.getElementById(id).style.display="block";
 }
}

function EnviarEmailTrabalheConosco()  {
	
	var erro = 0;
	var cor_erro = "#FEEEEE";

    var conhece       = document.getElementById('conhece');
    var nome          = document.getElementById('nome');
    var data_nasc     = document.getElementById('data_nasc');
	var email         = document.getElementById('email');
	var telefone_res  = document.getElementById('telefone_res');
	var telefone_cel  = document.getElementById('telefone_cel');
	var endereco      = document.getElementById('endereco');
	var cidade        = document.getElementById('cidade');
    var estado        = document.getElementById('estado');
    var cep           = document.getElementById('cep');
    var pais          = document.getElementById('pais');
    var estado_civil  = document.getElementById('estado_civil');
    var sexo          = document.getElementById('sexo');
    var deficiente    = document.getElementById('deficiente');
    var area          = document.getElementById('area');
    var tipo_contrato = document.getElementById('tipo_contrato');
    var nivel         = document.getElementById('nivel');
    var salario       = document.getElementById('salario');
    var viajens       = document.getElementById('viajens');
    var curriculo     = document.getElementById('arquivo');
    var formacao      = document.getElementById('formacao');
    var ingles        = document.getElementById('ingles');
    var espanhol      = document.getElementById('espanhol');
    var idiomas       = document.getElementById('idiomas');
    var outro         = document.getElementById('outro');

    if(conhece.value == "") {
       document.getElementById('conhece_div').innerHTML = '<font color="red">"Como conheceu a TECNOGRES?" deve ser preenchido!</font>';
	   conhece.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('conhece_div').innerHTML = ' ';
	   conhece.style.backgroundColor = "#FFFFFF";
    }

    if(nome.value == "") {
       document.getElementById('nome_div').innerHTML = '<font color="red">Nome deve ser preenchido!</font>';
	   nome.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('nome_div').innerHTML = ' ';
	   nome.style.backgroundColor = "#FFFFFF";
    }

    if(data_nasc.value == "") {
       document.getElementById('data_nasc_div').innerHTML = '<font color="red">Data de Nascimento deve ser preenchido!</font>';
	   data_nasc.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('data_nasc_div').innerHTML = ' ';
	   data_nasc.style.backgroundColor = "#FFFFFF";
    }
	
	if (email.value != "") {
		if (email.value.length > 0) {
		   if (email.value.indexOf('@')==-1 || email.value.indexOf('.')==-1 ) {
			   document.getElementById('email_div').innerHTML = '<font color="red">E-mail Incorreto, deve conter os seguintes caracteres: "@" e "."!</font>';
			   email.style.backgroundColor = cor_erro;
			   erro++;
		   } else  {
			   document.getElementById('email_div').innerHTML = ' ';
			   email.style.backgroundColor = "#FFFFFF";
		   }
		}
	} else {
       document.getElementById('email_div').innerHTML = '<font color="red">E-mail deve ser preenchido!</font>';
	   email.style.backgroundColor = cor_erro;
	   erro++;
	}

    if(telefone_res.value == "") {
       document.getElementById('telefone_res_div').innerHTML = '<font color="red">Telefone Residencial deve ser preenchido!</font>';
	   telefone_res.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('telefone_res_div').innerHTML = ' ';
	   telefone_res.style.backgroundColor = "#FFFFFF";
    }

    if(telefone_cel.value == "") {
       document.getElementById('telefone_cel_div').innerHTML = '<font color="red">Telefone Celular deve ser preenchido!</font>';
	   telefone_cel.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('telefone_cel_div').innerHTML = ' ';
	   telefone_cel.style.backgroundColor = "#FFFFFF";
    }

    if(endereco.value == "") {
       document.getElementById('endereco_div').innerHTML = '<font color="red">Endere&ccedil;o deve ser preenchido!</font>';
	   endereco.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('endereco_div').innerHTML = ' ';
	   endereco.style.backgroundColor = "#FFFFFF";
    }
	
    if(cidade.value == "") {
       document.getElementById('cidade_div').innerHTML = '<font color="red">Cidade deve ser preenchido!</font>';
	   cidade.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('cidade_div').innerHTML = ' ';
	   cidade.style.backgroundColor = "#FFFFFF";
    }

    if(estado.value == "XX") {
       document.getElementById('estado_div').innerHTML = '<font color="red">Estado deve ser preenchido!</font>';
	   estado.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('estado_div').innerHTML = ' ';
	   estado.style.backgroundColor = "#FFFFFF";
    }

    if(cep.value == "") {
       document.getElementById('cep_div').innerHTML = '<font color="red">CEP deve ser preenchido!</font>';
	   cep.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('cep_div').innerHTML = ' ';
	   cep.style.backgroundColor = "#FFFFFF";
    }

    if(pais.value == "") {
       document.getElementById('pais_div').innerHTML = '<font color="red">Pa&iacute;s deve ser preenchido!</font>';
	   pais.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('pais_div').innerHTML = ' ';
	   pais.style.backgroundColor = "#FFFFFF";
    }

    if(estado_civil.value == "") {
       document.getElementById('estado_civil_div').innerHTML = '<font color="red">Estado Civil deve ser preenchido!</font>';
	   estado_civil.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('estado_civil_div').innerHTML = ' ';
	   estado_civil.style.backgroundColor = "#FFFFFF";
    }

    if(sexo.value == "XX") {
       document.getElementById('sexo_div').innerHTML = '<font color="red">Sexo deve ser preenchido!</font>';
	   sexo.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('sexo_div').innerHTML = ' ';
	   sexo.style.backgroundColor = "#FFFFFF";
    }

    if(deficiente.value == "XX") {
       document.getElementById('deficiente_div').innerHTML = '<font color="red">Deficiente deve ser preenchido!</font>';
	   deficiente.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('deficiente_div').innerHTML = ' ';
	   deficiente.style.backgroundColor = "#FFFFFF";
    }

    if(area.value == "") {
       document.getElementById('area_div').innerHTML = '<font color="red">Objetivo Profissional/&Aacute;rea deve ser preenchido!</font>';
	   area.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('area_div').innerHTML = ' ';
	   area.style.backgroundColor = "#FFFFFF";
    }

    if(tipo_contrato.value == "") {
       document.getElementById('tipo_contrato_div').innerHTML = '<font color="red">Tipo de Contrato deve ser preenchido!</font>';
	   tipo_contrato.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('tipo_contrato_div').innerHTML = ' ';
	   tipo_contrato.style.backgroundColor = "#FFFFFF";
    }

    if(nivel.value == "") {
       document.getElementById('nivel_div').innerHTML = '<font color="red">N&iacute;vel de Atua&ccedil;&atilde;o Profissional deve ser preenchido!</font>';
	   nivel.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('nivel_div').innerHTML = ' ';
	   nivel.style.backgroundColor = "#FFFFFF";
    }

    if(salario.value == "") {
       document.getElementById('salario_div').innerHTML = '<font color="red">Pretens&atilde;o Salarial deve ser preenchido!</font>';
	   salario.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('salario_div').innerHTML = ' ';
	   salario.style.backgroundColor = "#FFFFFF";
    }

    if(viajens.value == "XX") {
       document.getElementById('viajens_div').innerHTML = '<font color="red">"Tem disponibilidade para viajens?" deve ser preenchido!</font>';
	   viajens.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('viajens_div').innerHTML = ' ';
	   viajens.style.backgroundColor = "#FFFFFF";
    }
	
    if(curriculo.value == "") {
       document.getElementById('curriculo_div').innerHTML = '<font color="red">"Seu Curriculo" deve ser preenchido!</font>';
	   curriculo.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('curriculo_div').innerHTML = ' ';
	   curriculo.style.backgroundColor = "#FFFFFF";
    }

    if(formacao.value == "") {
       document.getElementById('formacao_div').innerHTML = '<font color="red">Forma&ccedil;&atilde;o Acad&ecirc;mica deve ser preenchido!</font>';
	   formacao.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('formacao_div').innerHTML = ' ';
	   formacao.style.backgroundColor = "#FFFFFF";
    }

    if(ingles.value == "") {
       document.getElementById('ingles_div').innerHTML = '<font color="red">Ingl&ecirc;s deve ser preenchido!</font>';
	   ingles.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('ingles_div').innerHTML = ' ';
	   ingles.style.backgroundColor = "#FFFFFF";
    }

    if(espanhol.value == "") {
       document.getElementById('espanhol_div').innerHTML = '<font color="red">Espanhol deve ser preenchido!</font>';
	   espanhol.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('espanhol_div').innerHTML = ' ';
	   espanhol.style.backgroundColor = "#FFFFFF";
    }

    if(idiomas.value == "") {
       document.getElementById('idiomas_div').innerHTML = '<font color="red">Idiomas deve ser preenchido!</font>';
	   idiomas.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('idiomas_div').innerHTML = ' ';
	   idiomas.style.backgroundColor = "#FFFFFF";
    }

    if(outro.value == "") {
       document.getElementById('outro_div').innerHTML = '<font color="red">"Outros (especifique)" deve ser preenchido!</font>';
	   outro.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('outro_div').innerHTML = ' ';
	   outro.style.backgroundColor = "#FFFFFF";
    }

	if(erro==0) {
	  document.getElementById('formmail').submit();
	}
}

function mOutMenu(src){
  src.style.cursor = "default";
  //src.style.background = "#666666";
}
function mOverMenu(src){
  src.style.cursor = "pointer";
  //src.style.background = "#7A8688";
}

function mOverMenul(img){
  document.getElementById("menu_imgl").src = "img/"+img;
}
function mOutMenul(img){
  document.getElementById("menu_imgl").src = "img/"+img;
}

function TrocaImagem(nome, id){
  document.getElementById("telha_g").src = "img/"+nome;
  document.getElementById("a_telha_g").href = "img/"+nome;
  document.getElementById("nome_telha").innerHTML = id;
}

function EnviarEmailContato()  {
	
	var erro = 0;
	var cor_erro = "#FEEEEE";

    var estado   = document.getElementById('estado');
    var nome     = document.getElementById('nome');
	var mensagem = document.getElementById('mensagem');
	var telefone = document.getElementById('telefone');
	var email    = document.getElementById('email');
	var endereco = document.getElementById('endereco');
	var falarcom = document.getElementById('falarcom');
	var cidade   = document.getElementById('cidade');

    if(estado.value == "XX") {
       document.getElementById('estado_div').innerHTML = '<font color="red">Estado deve ser preenchido!</font>';
	   estado.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('estado_div').innerHTML = ' ';
	   estado.style.backgroundColor = "#FFFFFF";
    }

    if(falarcom.value == "XX") {
       document.getElementById('falarcom_div').innerHTML = '<font color="red">O setor a ser enviado deve ser preenchido!</font>';
	   falarcom.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('falarcom_div').innerHTML = ' ';
	   falarcom.style.backgroundColor = "#FFFFFF";
    }

    if(nome.value == "") {
       document.getElementById('nome_div').innerHTML = '<font color="red">Nome deve ser preenchido!</font>';
	   nome.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('nome_div').innerHTML = ' ';
	   nome.style.backgroundColor = "#FFFFFF";
    }

    if(cidade.value == "") {
       document.getElementById('cidade_div').innerHTML = '<font color="red">Cidade deve ser preenchido!</font>';
	   cidade.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('cidade_div').innerHTML = ' ';
	   cidade.style.backgroundColor = "#FFFFFF";
    }

    if(endereco.value == "") {
       document.getElementById('endereco_div').innerHTML = '<font color="red">Endere&ccedil;o deve ser preenchido!</font>';
	   endereco.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('endereco_div').innerHTML = ' ';
	   endereco.style.backgroundColor = "#FFFFFF";
    }

    //Validar E-mail
	if (email.value != "") {
		if (email.value.length > 0) {
		   if (email.value.indexOf('@')==-1 || email.value.indexOf('.')==-1 ) {
			   document.getElementById('email_div').innerHTML = '<font color="red">E-mail Incorreto, deve conter os seguintes caracteres: "@" e "."!</font>';
			   email.style.backgroundColor = cor_erro;
			   erro++;
		   } else  {
			   document.getElementById('email_div').innerHTML = ' ';
			   email.style.backgroundColor = "#FFFFFF";
		   }
		}
	} else {
       document.getElementById('email_div').innerHTML = '<font color="red">E-mail deve ser preenchido!</font>';
	   email.style.backgroundColor = cor_erro;
	   erro++;
	}

    if(mensagem.value == "") {
       document.getElementById('mensagem_div').innerHTML = '<font color="red">Mensagem deve ser preenchido!</font>';
	   mensagem.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('mensagem_div').innerHTML = ' ';
	   mensagem.style.backgroundColor = "#FFFFFF";
    }

    if(telefone.value == "") {
       document.getElementById('telefone_div').innerHTML = '<font color="red">Telefone deve ser preenchido!</font>';
	   telefone.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('telefone_div').innerHTML = ' ';
	   telefone.style.backgroundColor = "#FFFFFF";
    }

	if(erro==0) {
	  document.getElementById('formmail').submit();
	}
}


function EnviarEmailContatoAss()  {
	
	var erro = 0;
	var cor_erro = "#FCC";

    var msg       = document.getElementById('msg_ass');
    var nome      = document.getElementById('nome_ass');
	var estado    = document.getElementById('estado_ass');
	var email     = document.getElementById('email_ass');
    var nome_loja = document.getElementById('nome_loja_ass');
    var produto   = document.getElementById('produto_ass');
    var telefone  = document.getElementById('telefone_ass');
	
    if(telefone.value == "") {
       document.getElementById('telefone_ass_div').innerHTML = '<font color="red">Telefone deve ser preenchido!</font>';
	   telefone.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('telefone_ass_div').innerHTML = ' ';
	   telefone.style.backgroundColor = "#FFFFFF";
    }
	
    if(msg.value == "") {
       document.getElementById('msg_ass_div').innerHTML = '<font color="red">Mensagem deve ser preenchida!</font>';
	   msg.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('msg_ass_div').innerHTML = ' ';
	   msg.style.backgroundColor = "#FFFFFF";
    }

    if(nome.value == "") {
       document.getElementById('nome_ass_div').innerHTML = '<font color="red">Nome deve ser preenchido!</font>';
	   nome.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('nome_ass_div').innerHTML = ' ';
	   nome.style.backgroundColor = "#FFFFFF";
    }

    //Validar E-mail
	if (email.value != "") {
		if (email.value.length > 0) {
		   if (email.value.indexOf('@')==-1 || email.value.indexOf('.')==-1 ) {
			   document.getElementById('email_ass_div').innerHTML = '<font color="red">E-mail Incorreto, deve conter os seguintes caracteres: "@" e "."!</font>';
			   email.style.backgroundColor = cor_erro;
			   erro++;
		   } else  {
			   document.getElementById('email_ass_div').innerHTML = ' ';
			   email.style.backgroundColor = "#FFFFFF";
		   }
		}
	} else {
       document.getElementById('email_ass_div').innerHTML = '<font color="red">E-mail deve ser preenchido!</font>';
	   email.style.backgroundColor = cor_erro;
	   erro++;
	}

    if(estado.value == "XX") {
       document.getElementById('estado_ass_div').innerHTML = '<font color="red">Estado deve ser preenchido!</font>';
	   estado.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('estado_ass_div').innerHTML = ' ';
	   estado.style.backgroundColor = "#FFFFFF";
    }

    if(nome_loja.value == "") {
       document.getElementById('nome_loja_ass_div').innerHTML = '<font color="red">Nome da loja deve ser preenchido!</font>';
	   nome_loja.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('nome_loja_ass_div').innerHTML = ' ';
	   nome_loja.style.backgroundColor = "#FFFFFF";
    }

    if(produto.value == "") {
       document.getElementById('produto_ass_div').innerHTML = '<font color="red">Produto com defeito deve ser preenchido!</font>';
	   produto.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('produto_ass_div').innerHTML = ' ';
	   produto.style.backgroundColor = "#FFFFFF";
    }
	
	if(erro==0) {
	  document.getElementById('ass_form').submit();
	}
}

function EnviarEmailRepresA()  {
	
	var erro = 0;
	var cor_erro = "#FCC";

    var estado   = document.getElementById('estado');
    var nome     = document.getElementById('nome');
	var cidade   = document.getElementById('cidade');
	var telefone = document.getElementById('telefone');
	var email    = document.getElementById('email');
	var cnpj     = document.getElementById('cnpj');

    if(estado.value == "XX") {
       document.getElementById('estado_div').innerHTML = '<font color="red">Estado deve ser preenchido!</font>';
	   estado.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('estado_div').innerHTML = ' ';
	   estado.style.backgroundColor = "#FFFFFF";
    }

    if(nome.value == "") {
       document.getElementById('nome_div').innerHTML = '<font color="red">Nome deve ser preenchido!</font>';
	   nome.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('nome_div').innerHTML = ' ';
	   nome.style.backgroundColor = "#FFFFFF";
    }

    if(cnpj.value == "") {
       document.getElementById('cnpj_div').innerHTML = '<font color="red">CNPJ deve ser preenchido!</font>';
	   cnpj.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('cnpj_div').innerHTML = ' ';
	   cnpj.style.backgroundColor = "#FFFFFF";
    }

    //Validar E-mail
	if (email.value != "") {
		if (email.value.length > 0) {
		   if (email.value.indexOf('@')==-1 || email.value.indexOf('.')==-1 ) {
			   document.getElementById('email_div').innerHTML = '<font color="red">E-mail Incorreto, deve conter os seguintes caracteres: "@" e "."!</font>';
			   email.style.backgroundColor = cor_erro;
			   erro++;
		   } else  {
			   document.getElementById('email_div').innerHTML = ' ';
			   email.style.backgroundColor = "#FFFFFF";
		   }
		}
	} else {
       document.getElementById('email_div').innerHTML = '<font color="red">E-mail deve ser preenchido!</font>';
	   email.style.backgroundColor = cor_erro;
	   erro++;
	}

    if(cidade.value == "") {
       document.getElementById('cidade_div').innerHTML = '<font color="red">Cidade deve ser preenchido!</font>';
	   cidade.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('cidade_div').innerHTML = ' ';
	   cidade.style.backgroundColor = "#FFFFFF";
    }

    if(telefone.value == "") {
       document.getElementById('telefone_div').innerHTML = '<font color="red">Telefone deve ser preenchido!</font>';
	   telefone.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('telefone_div').innerHTML = ' ';
	   telefone.style.backgroundColor = "#FFFFFF";
    }

	if(erro==0) {
	  document.getElementById('repres_a_form').submit();
	}
}


function EnviarEmailRepresB()  {
	
	var erro = 0;
	var cor_erro = "#FCC";

    var msg       = document.getElementById('msg_ass');
    var nome      = document.getElementById('nome_ass');
	var estado    = document.getElementById('estado_ass');
	var email     = document.getElementById('email_ass');
    var telefone  = document.getElementById('telefone_ass');
    var curriculo = document.getElementById('curriculo_ass');
	
    if(telefone.value == "") {
       document.getElementById('telefone_ass_div').innerHTML = '<font color="red">Telefone deve ser preenchido!</font>';
	   telefone.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('telefone_ass_div').innerHTML = ' ';
	   telefone.style.backgroundColor = "#FFFFFF";
    }
	
    if(msg.value == "") {
       document.getElementById('msg_ass_div').innerHTML = '<font color="red">Mensagem deve ser preenchida!</font>';
	   msg.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('msg_ass_div').innerHTML = ' ';
	   msg.style.backgroundColor = "#FFFFFF";
    }

    if(nome.value == "") {
       document.getElementById('nome_ass_div').innerHTML = '<font color="red">Nome deve ser preenchido!</font>';
	   nome.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('nome_ass_div').innerHTML = ' ';
	   nome.style.backgroundColor = "#FFFFFF";
    }

    //Validar E-mail
	if (email.value != "") {
		if (email.value.length > 0) {
		   if (email.value.indexOf('@')==-1 || email.value.indexOf('.')==-1 ) {
			   document.getElementById('email_ass_div').innerHTML = '<font color="red">E-mail Incorreto, deve conter os seguintes caracteres: "@" e "."!</font>';
			   email.style.backgroundColor = cor_erro;
			   erro++;
		   } else  {
			   document.getElementById('email_ass_div').innerHTML = ' ';
			   email.style.backgroundColor = "#FFFFFF";
		   }
		}
	} else {
       document.getElementById('email_ass_div').innerHTML = '<font color="red">E-mail deve ser preenchido!</font>';
	   email.style.backgroundColor = cor_erro;
	   erro++;
	}

    if(estado.value == "XX") {
       document.getElementById('estado_ass_div').innerHTML = '<font color="red">Estado deve ser preenchido!</font>';
	   estado.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('estado_ass_div').innerHTML = ' ';
	   estado.style.backgroundColor = "#FFFFFF";
    }

    if(curriculo.value == "") {
       document.getElementById('curriculo_ass_div').innerHTML = '<font color="red"Currículo com defeito deve ser preenchido!</font>';
	   curriculo.style.backgroundColor = cor_erro;
	   erro++;
    } else {
       document.getElementById('curriculo_ass_div').innerHTML = ' ';
	   curriculo.style.backgroundColor = "#FFFFFF";
    }
	
	if(erro==0) {
	  document.getElementById('repres_b_form').submit();
	}
}

function EnviarEmailProd()  {
	
	var erro = 0;
	
    var nome         = document.getElementById('nome');
    var produto      = document.getElementById('produto');
    var telefone     = document.getElementById('telefone');
	var email        = document.getElementById('email');
	var comentarios  = document.getElementById('comentarios');

    // Validar Nome
    if(nome.value == "") {
       document.getElementById('nome_div').innerHTML = 'Nome deve ser preenchido!';
	   erro++;
    } else {
       document.getElementById('nome_div').innerHTML = ' ';
    }

    // Validar Produto
    if(produto.value == "") {
       document.getElementById('produto_div').innerHTML = 'Produto deve ser preenchido!';
	   erro++;
    } else {
       document.getElementById('produto_div').innerHTML = ' ';
    }

    // Validar Telefone
    if(telefone.value == "") {
       document.getElementById('telefone_div').innerHTML = 'Telefone deve ser preenchido!';
	   erro++;
    } else {
       document.getElementById('telefone_div').innerHTML = ' ';
    }

    //Validar E-mail
	if (email.value != "") {
		if (email.value.length > 0) {
		   if (email.value.indexOf('@')==-1 || email.value.indexOf('.')==-1 ) {
			   document.getElementById('email_div').innerHTML = 'E-mail Incorreto, deve conter os seguintes caracteres: "@" e "."!';
			   erro++;
		   } else  {
			   document.getElementById('email_div').innerHTML = ' ';
		   }
		}
	} else {
       document.getElementById('email_div').innerHTML = 'E-mail deve ser preenchido!';
	   erro++;
	}

    // Validar Comentario
    if(comentarios.value == "") {
       document.getElementById('comentarios_div').innerHTML = 'Coment&aacute;rio deve ser preenchido!';
	   erro++;
    } else {
       document.getElementById('comentarios_div').innerHTML = ' ';
    }

	if(erro==0) {
	  document.getElementById('contato_form').submit();
	}
}

function mask_telefone(e) {
    e.value=e.value.replace(/\D/g,'').replace(/^(\d{4})(\d)/,'$1-$2')
}
function mask_ddd_telefone(e) {
    e.value=e.value.replace(/\D/g,'').replace(/^(\d\d)(\d)/g,'($1) $2').replace(/(\d{4})(\d)/,'$1-$2')
}

function comboTamanho(url,senda,send,tag) {
    variavel = send;
    variavela = senda;
    var send = document.getElementById(send).value;
    var senda = document.getElementById(senda).value;
    XHR_criado.open("post",url,true);
    XHR_criado.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    XHR_criado.setRequestHeader('Cache-Control', 'no-store, no-cache, must-revalidate');
    XHR_criado.onreadystatechange = SaidaHttpPOSTx;
    XHR_criado.send(variavel+"="+send+"&"+variavela+"="+senda);
    function SaidaHttpPOSTx() {
      if(XHR_criado.readyState!=4) {
	    document.getElementById(tag).innerHTML= "carregando...";
	  }
	  if(XHR_criado.readyState==4) {
	    document.getElementById(tag).innerHTML= XHR_criado.responseText;
      }
    }
}

function favMuda(url,send,div_p)
  {
    XHR_criado.open("get",url+send,true);
    XHR_criado.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    XHR_criado.setRequestHeader('Cache-Control', 'no-store, no-cache, must-revalidate');
    XHR_criado.onreadystatechange = SaidaHttpPOST;
    XHR_criado.send(null);
    function SaidaHttpPOST()
    {
      if(XHR_criado.readyState!=4)
	  {
	    document.getElementById(div_p).innerHTML= "...";
	  }
	  if(XHR_criado.readyState==4)
	  {
	    document.getElementById(div_p).innerHTML= XHR_criado.responseText;
	  }
    }
}

function MudaIdioma(send, prog)
  {
    XHR_criado.open("get","muda_idioma.php?"+send,true);
    XHR_criado.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
    XHR_criado.setRequestHeader('Cache-Control', 'no-store, no-cache, must-revalidate');
    XHR_criado.onreadystatechange = SaidaHttpPOST;
    XHR_criado.send(null);
    function SaidaHttpPOST()
    {
      if(XHR_criado.readyState!=4)
	  {
	    document.getElementById(id_idioma).innerHTML= "carregando...";
	  }
	  if(XHR_criado.readyState==4)
	  {
	    document.location = prog;
	  }
    }
}

function abreCaracTec(id) {
 if (document.getElementById(id).style.display=="block") {
   document.getElementById(id).style.display="none";
 } else {
   document.getElementById(id).style.display="block";
 }
}
function carrega_a(prog,id,tp_repres){
if(id==null)
     {
      var conteudo=document.getElementById("conteudo");
     }
    else
     {
      var conteudo=document.getElementById(id);
     } 
    conteudo.innerHTML="<div><table border='0' width='100%' height='100%'><tr><td align='center' valign='middle' class='incefra_linha_produto_det'>carregando...<br><img src='img/loading4.gif'></td></tr></table></div>"
	
	prog = prog + "?cidade="+document.getElementById("sac_cidade").value+"&tipo_repres="+tp_repres;
	
    if(prog.indexOf('?')==-1)
	{
	  random_ = '?'+Math.ceil(Math.random()*100000);
	}
	else
	{
	  random_ = '&'+Math.ceil(Math.random()*100000);
	}
    xmlhttp.open("GET", prog+random_,true);
    xmlhttp.setRequestHeader('Cache-Control', 'no-store, no-cache, must-revalidate');
    xmlhttp.setRequestHeader('Pragma', 'no-cache');
    xmlhttp.onreadystatechange=function() {
    if (xmlhttp.readyState==4){
       var texto=xmlhttp.responseText
       texto=texto.replace(/\+/g," ")
       texto=unescape(texto)
    if(id==null)
     {
      var conteudo=document.getElementById("conteudo");
     }
    else
     {
      var conteudo=document.getElementById(id);
     } 
    conteudo.innerHTML=texto
        }
    }
    xmlhttp.send(null)
}

function BuscarProduto()  {
	
	var erro = 0;
	
	if(erro==0) {
	  document.getElementById('frm_not').submit();
	}
	
}

