var page;
var fcx;
var posfoco;
var oldlink;

function direciona(){
    var f=formulario1.opcao.value;
       if (f==1){ location="faleconoscowebmaster.php";}
       else if (f==2){ location="esqueci_func_auto.php";}
       else {location="faleconoscowebmaster.php";}
}
function showDivFalecon(raiz,page,metodo) {
  if (metodo == "abrir") {
    oldlink = raiz + "faleconosco/faleconoscoengine.php";    
    document.getElementById("ifdiv").src= oldlink + "?idcliente="+page;
    document.getElementById("div_falecon").style.visibility = "visible";
    document.getElementById("div_falecon").style.display = "block";
    //faleconx("../faleconosco/faleconteste.php","ifdiv")
    parent.focus();
  }
  else {
    document.getElementById("div_falecon").style.visibility = "hidden";
    document.getElementById("div_falecon").style.display = "none";
    //document.getElementById("ifdiv").src = oldlink;
  }  
}

function faleconx(link,foco) {
  var ie;
  fcx = null;
  posfoco = foco;
  if (window.XMLHttpRequest) {
    fcx = new XMLHttpRequest();      
    ie = false;
  }
  else if (window.ActiveXObject) {
    ie = true;
    try {
      fcx = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch(e)  {
      fcx = new ActiveXObject("MSXML2.XMLHTTP");
    }
  }
  fcx.open("GET",link,true);
  fcx.onreadystatechange = faleconxChange;  
  if (ie) {
    fcx.send();
  }
  else {
    fcx.send(null);
  }
}

function faleconxChange(foco) {
  if (fcx.readyState == 4) {
    if (fcx.status == 200) {
      document.getElementById(posfoco).innerHTML = fcx.responseText;      
    }
    else {
      document.getElementById(posfoco).innerHTML = "Ocorreu algum erro no processamento, por favor, retorne mais tarde.";
    }
  }  
}
