<!--

function proprietariobt1(){
   window.location = 'areaproprietarioprincipal.php?acao=areaproprietariorelatorio';
}
function proprietariobt2(){
   window.location = 'areaproprietarioprincipal.php?acao=areaproprietariocontas';
}
function proprietariobt3(){
   window.location = 'areaproprietarioprincipal.php?acao=informativo';
}
function proprietariobt4(){
   window.location = 'areaproprietarioprincipal.php?acao=pesquisa_satisfacao';
}
function proprietariobt5(){
   window.location = 'areaproprietarioprincipal.php?acao=email3';
}
function proprietariobt6(){
   window.location = 'areaproprietarioprincipal.php?acao=areaproprietariosenha';
}
function proprietariobt7(){
   window.location = 'logoutcookies2.php';
}

function carregarcurriculo(td){
    var ajax = getAjax();
    if(ajax){
	var url="contato"+td+".php";
        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("divcurriculo").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("divcurriculo").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}


function carregarproprietario(){
    var ajax = getAjax();
    if(ajax){
	var url="areaproprietariologin.php";
        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("txt").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("txt").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}

function linkshome(td,tema){
    var ajax = getAjax();
    if(ajax){
var url="noticias.php?td="+td;
url=url+"&tema="+tema;
        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("txt").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("txt").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}
function carregarhome(){
    var ajax = getAjax();
    if(ajax){
	var url="home.php";
        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("txt").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("txt").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}
function pesquisasatisfacaopagar(){
document.getElementById('txtnome').value="";
document.getElementById('txtemail').value="";
document.getElementById('txttel1').value="";
document.getElementById('txttel2').value="";
document.getElementById('txtcodimovel').value="";
document.getElementById('txtcomentario').value="";
}
function pesquisasatisfacao(){
	var ajax = getAjax();
    if(ajax){
	var url="contatopesquisasatisfacao2.php?txtnome="+document.getElementById("txtnome").value+"&txtcodimovel="+document.getElementById("txtcodimovel").value+"&txttel1="+document.getElementById("txttel1").value+"&txttel2="+document.getElementById("txttel2").value+"&txtemail="+document.getElementById("txtemail").value+"&txtcomentario="+document.getElementById("txtcomentario").value+"&P1="+document.getElementById("P1").value+"&P2="+document.getElementById("P2").value+"&P3="+document.getElementById("P3").value+"&P4="+document.getElementById("P4").value+"&P5="+document.getElementById("P5").value+"&P6="+document.getElementById("P6").value+"&P7="+document.getElementById("P7").value;
        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("divpesquisasatisfacao").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("divpesquisasatisfacao").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}

function fornecedorapagar(){
	document.getElementById('txtempresa').value="";
	document.getElementById('txtnomefantasia').value="";
	document.getElementById('cboramo').value="";
	document.getElementById('txttelefone').value="";
	document.getElementById('txtcontato').value="";
	document.getElementById('txtfax').value="";
	document.getElementById('txtdadosempresa').value="";
	document.getElementById('txtsite').value="";
	document.getElementById('txtemail').value="";
}
function fornecedor(){
	var ajax = getAjax();
    if(ajax){
	var url="contatofornecedorsalvar.php?txtempresa="+document.getElementById("txtempresa").value+"&txtnomefantasia="+document.getElementById("txtnomefantasia").value+"&cboramo="+document.getElementById("cboramo").value+"&txtdadosempresa="+document.getElementById("txtdadosempresa").value+"&txttelefone="+document.getElementById("txttelefone").value+"&txtcontato="+document.getElementById("txtcontato").value+"&txtfax="+document.getElementById("txtfax").value+"&txtemail="+document.getElementById("txtemail").value+"&txtsite="+document.getElementById("txtsite").value;
        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("divfornecedor").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("divfornecedor").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}

function descricaocargo(td){
    var ajax = getAjax();
    if(ajax){
	var url="descricaocargo.php?vid="+td;
    ajax.open("GET",url, true);
    ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("divvagas").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("divvagas").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}


function curriculoapagar(){
	document.getElementById('txtnome').value="";
	document.getElementById('txtdatanascd').value="";
	document.getElementById('txtdatanascm').value="";
	document.getElementById('txtdatanascy').value="";
	document.getElementById('txtlocalnascimento').value="";
	document.getElementById('txtidade').value="";
	document.getElementById('txtestado').value="";
	document.getElementById('txttelefone').value="";
	document.getElementById('txtcelular').value="";
	document.getElementById('txtrecado').value="";
	document.getElementById('txtendereco').value="";
	document.getElementById('txtnumero').value="";
	document.getElementById('txtbairro').value="";
	document.getElementById('txtcidade').value="";
	document.getElementById('txtcep').value="";
	document.getElementById('txtfundano').value="";
	document.getElementById('txtsuperiorcurso').value="";
	document.getElementById('txtmedioano').value="";
	document.getElementById('txtsuperiorano').value="";
	document.getElementById('txtcursos').value="";
	document.getElementById('txtempresa1').value="";
	document.getElementById('txtdataen1d').value="";
	document.getElementById('txtdataen1m').value="";
	document.getElementById('txtdataen1y').value="";
	document.getElementById('txtdatasaida1d').value="";
	document.getElementById('txtdatasaida1m').value="";
	document.getElementById('txtdatasaida1y').value="";
	document.getElementById('txtfone1').value="";
	document.getElementById('txtcargo1').value="";
	document.getElementById('txtsalario1').value="";
	document.getElementById('txtmotivo1').value="";
	document.getElementById('txtempresa2').value="";
	document.getElementById('txtdataen2d').value="";
	document.getElementById('txtdataen2m').value="";
	document.getElementById('txtdataen2y').value="";
	document.getElementById('txtdatasaida2d').value="";
	document.getElementById('txtdatasaida2m').value="";
	document.getElementById('txtdatasaida2y').value="";
	document.getElementById('txtfone2').value="";
	document.getElementById('txtcargo2').value="";
	document.getElementById('txtsalario2').value="";
	document.getElementById('txtmotivo2').value="";
	document.getElementById('txtempresa3').value="";
	document.getElementById('txtdataen3d').value="";
	document.getElementById('txtdataen3m').value="";
	document.getElementById('txtdataen3y').value="";
	document.getElementById('txtdatasaida3d').value="";
	document.getElementById('txtdatasaida3m').value="";
	document.getElementById('txtdatasaida3y').value="";
	document.getElementById('txtfone3').value="";
	document.getElementById('txtcargo3').value="";
	document.getElementById('txtsalario3').value="";
	document.getElementById('txtmotivo3').value="";
	document.getElementById('txtemail').value="";
	document.getElementById('txtpretencao').value="";
}
function curriculo(){
	var ajax = getAjax();
    if(ajax){
	var url="contatocurriculosalvar.php?txtnome="+document.getElementById("txtnome").value+"&txtdatanascd="+document.getElementById("txtdatanascd").value+"&txtdatanascm="+document.getElementById("txtdatanascm").value+"&txtdatanascy="+document.getElementById("txtdatanascy").value+"&txtlocalnascimento="+document.getElementById("txtlocalnascimento").value+"&txtidade="+document.getElementById("txtidade").value+"&txtestado="+document.getElementById("txtestado").value+"&txttelefone="+document.getElementById("txttelefone").value+"&txtcelular="+document.getElementById("txtcelular").value+"&txtrecado="+document.getElementById("txtrecado").value+"&txtendereco="+document.getElementById("txtendereco").value+"&txtnumero="+document.getElementById("txtnumero").value+"&txtbairro="+document.getElementById("txtbairro").value+"&txtcidade="+document.getElementById("txtcidade").value+"&txtcep="+document.getElementById("txtcep").value+"&rdestadocivil="+document.getElementById("rdestadocivil").value+"&rdcnh="+document.getElementById("rdcnh").value+"&chcnh="+document.getElementById("chcnh").value+"&rdveiculoproprio="+document.getElementById("rdveiculoproprio").value+"&rdensfundamental="+document.getElementById("rdensfundamental").value+"&txtfundano="+document.getElementById("txtfundano").value+"&rdensmedio="+document.getElementById("rdensmedio").value+"&txtmedioano="+document.getElementById("txtmedioano").value+"&rdenssuperior="+document.getElementById("rdenssuperior").value+"&txtsuperiorcurso="+document.getElementById("txtsuperiorcurso").value+"&txtsuperiorano="+document.getElementById("txtsuperiorano").value+"&txtcursos="+document.getElementById("txtcursos").value+"&txtempresa1="+document.getElementById("txtempresa1").value+"&txtdataen1d="+document.getElementById("txtdataen1d").value+"&txtdataen1m="+document.getElementById("txtdataen1m").value+"&txtdataen1y="+document.getElementById("txtdataen1y").value+"&txtdatasaida1d="+document.getElementById("txtdatasaida1d").value+"&txtdatasaida1m="+document.getElementById("txtdatasaida1m").value+"&txtdatasaida1y="+document.getElementById("txtdatasaida1y").value+"&txtfone1="+document.getElementById("txtfone1").value+"&txtcargo1="+document.getElementById("txtcargo1").value+"&txtsalario1="+document.getElementById("txtsalario1").value+"&txtmotivo1="+document.getElementById("txtmotivo1").value+"&txtempresa2="+document.getElementById("txtempresa2").value+"&txtdataen2d="+document.getElementById("txtdataen2d").value+"&txtdataen2m="+document.getElementById("txtdataen2m").value+"&txtdataen2y="+document.getElementById("txtdataen2y").value+"&txtdatasaida2d="+document.getElementById("txtdatasaida2d").value+"&txtdatasaida2m="+document.getElementById("txtdatasaida2m").value+"&txtdatasaida2y="+document.getElementById("txtdatasaida2y").value+"&txtfone2="+document.getElementById("txtfone2").value+"&txtcargo2="+document.getElementById("txtcargo2").value+"&txtsalario2="+document.getElementById("txtsalario2").value+"&txtmotivo2="+document.getElementById("txtmotivo2").value+"&txtempresa3="+document.getElementById("txtempresa3").value+"&txtdataen3d="+document.getElementById("txtdataen3d").value+"&txtdataen3m="+document.getElementById("txtdataen3m").value+"&txtdataen3y="+document.getElementById("txtdataen3y").value+"&txtdatasaida3d="+document.getElementById("txtdatasaida3d").value+"&txtdatasaida3m="+document.getElementById("txtdatasaida3m").value+"&txtdatasaida3y="+document.getElementById("txtdatasaida3y").value+"&txtfone3="+document.getElementById("txtfone3").value+"&txtcargo3="+document.getElementById("txtcargo3").value+"&txtsalario3="+document.getElementById("txtsalario3").value+"&txtmotivo3="+document.getElementById("txtmotivo3").value+"&cbocargo="+document.getElementById("cbocargo").value+"&txtemail="+document.getElementById("txtemail").value+"&txtpretencao="+document.getElementById("txtpretencao").value;
        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("divcurriculo").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("divcurriculo").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}


function faleconoscoapagar(){
	document.getElementById('txtnome').value="";
	document.getElementById('txtemail').value="";
	document.getElementById('txtassunto').value="";
	document.getElementById('txtduvida').value="";
	
	}

function faleconosco(){
	var ajax = getAjax();
    if(ajax){
	var url="contatofaleconosco2.php?nome="+document.getElementById("txtnome").value+"&email="+document.getElementById("txtemail").value+"&assunto="+document.getElementById("txtassunto").value+"&duvida="+document.getElementById("txtduvida").value;
        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("divfaleconosco").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("divfaleconosco").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}
function linkmail(){
   window.location = 'mail';
}
function linkadmin(){
   window.location = 'gerenciar/index.php';
}

function carregarcontatos2(td){
    var ajax = getAjax();
    if(ajax){
	var url="contato"+td+".php";
        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("divpagina").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("divpagina").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}


function carregarcontatos(td){
    var ajax = getAjax();
    if(ajax){
	var url="contato"+td+".html";
        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("divpagina").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("divpagina").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}

function carregarDiv3(td){
    var ajax = getAjax();
    if(ajax){
if (td=="home"){
var url="home.php";}
else if (td=="CONTATO"){
var url="contato.html";}
else{ 
var url="noticias.php?td="+td;
}

        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("txt").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("txt").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}

function carregarContato(td){
    var ajax = getAjax();
    if(ajax){
    if (td=="CONTATO"){
	   var url="contato.php";}
	if (td=="CONTAT"){
	   var url="contato.php?var=pesquisa";}
    

        ajax.open("GET",url, true);
        ajax.onreadystatechange = function(){
		    if (ajax.readyState == 1) {
				document.getElementById("txt").innerHTML = "<img src='loading.gif'>";
}
			if(ajax.readyState >= 4) {
				if(ajax.status == 200){
                    document.getElementById("txt").innerHTML = ajax.responseText;
                    doScript(ajax.responseText);
                }
			}
		}
    	ajax.send(null);
	}
}

function doScript(texto){
    var ini, pos_src, fim, codigo;
    var objScript = null;
    ini = texto.indexOf('<script', 0);
    while (ini!=-1){
        var objScript = document.createElement("script");
        //Busca se tem algum src a partir do inicio do script
        pos_src = texto.indexOf(' src', ini)
        ini = texto.indexOf('>', ini) + 1;

        //Verifica se este e um bloco de script ou include para um arquivo de scripts
        if (pos_src < ini && pos_src >=0){//Se encontrou um "src" dentro da tag script, esta e um include de um arquivo script
            //Marca como sendo o inicio do nome do arquivo para depois do src
            ini = pos_src + 4;
            //Procura pelo ponto do nome da extencao do arquivo e marca para depois dele
            fim = texto.indexOf('.', ini)+4;
            //Pega o nome do arquivo
            codigo = texto.substring(ini,fim);
            //Elimina do nome do arquivo os caracteres que possam ter sido pegos por engano
            codigo = codigo.replace("=","").replace(" ","").replace("\"","").replace("\"","").replace("\'","").replace("\'","").replace(">","");
            // Adiciona o arquivo de script ao objeto que sera adicionado ao documento
            objScript.src = codigo;
        }else{//Se nao encontrou um "src" dentro da tag script, esta e um bloco de codigo script
            // Procura o final do script
            fim = texto.indexOf('</script>', ini);
            // Extrai apenas o script
            codigo = texto.substring(ini,fim);
            // Adiciona o bloco de script ao objeto que sera adicionado ao documento
            objScript.text = codigo;
        }

        //Adiciona o script ao documento
        document.body.appendChild(objScript);
        // Procura a proxima tag de <script
        ini = texto.indexOf('<script', fim);

        //Limpa o objeto de script
        objScript = null;
    }
}
function getAjax(){
  try {
    ajax = new ActiveXObject("Microsoft.XMLHTTP");
  }
  catch(e) {
    try {
      ajax = new ActiveXObject("Msxml2.XMLHTTP");
    }
	catch(ex) {
      try {
        ajax = new XMLHttpRequest();
      }
	  catch(exc) {
        alert("Esse browser não tem recursos para uso do Ajax");
        ajax = null;
      }
    }
  }
  return ajax;
}
//-->

