
function entraFormRegistro(url,vista) 
{  //alert('hola');
  ShowInfoReg = crearXMLHttpRequest();
  ShowInfoReg.onreadystatechange = procesarRegistro;
  ShowInfoReg.open('GET',url+'?vista='+vista, true);
  //alert(url);
  ShowInfoReg.send(null);
  //window.location.reload();
}
//etRegistraNuevousuario('txtEmail','txtClave','txtRut','txtNombre','txtApellido','selPais','txtFono2','checTip');"

function GetRegistraNuevousuario(gettxtEmail,gettxtClave,gettxtRutCompleto,gettxtnombre,gettxtapellido,gettxtpais,gettxttelefono,gettxttip)
{ //alert("entra primera funcion");
  var valuetxtEmail=document.getElementById(gettxtEmail);
  //alert(valuetxtEmail.value);
  var valuetxtClave=document.getElementById(gettxtClave);
  //alert(valuetxtClave.value);
  var valuetxtRutCompleto=document.getElementById(gettxtRutCompleto);
  //alert(valuetxtRutCompleto.value);
  var valuetxtnombre=document.getElementById(gettxtnombre);
  //alert(valuetxtnombre.value);
  var valuetxtapellido=document.getElementById(gettxtapellido);
  //alert(valuetxtapellido.value);
  var valuetxtpais=document.getElementById(gettxtpais);
  //alert(valuetxtpais.value);
  var valuetxttelefono=document.getElementById(gettxttelefono);
 // alert(valuetxttelefono.value);
  var valuetxttip=document.getElementById(gettxttip);
  //alert(valuetxttip.value);
  
   RegistraNuevo(valuetxtEmail.value,valuetxtClave.value,valuetxtRutCompleto.value,valuetxtnombre.value,valuetxtapellido.value,valuetxtpais.value,valuetxttelefono.value,valuetxttip.value);
  //alert( + ':::' + valuetxtClave.value + ':::' + valuetxtRutCompleto.value + ':::' + valuetxtnombre.value + ':::' + valuetxtapellido.value + ':::' + valuetxtpais.value + ':::' + valuetxttelefono.value + ':::' + valuetxttip.value);
}


var ShowInfoReg;
function RegistraNuevo(txtEmail,txtClave,txtRutCompleto,txtNombre,txtApellido,selPais,txttelefono,checTip) 
{  //alert("entra segunda funcion");
  ShowInfoReg=crearXMLHttpRequest();
  ShowInfoReg.onreadystatechange = procesarRegistro;
  urlAction= '../shbral/stwGrabaDatosWebII.asp?sistema=2'
  urlAction= urlAction + '&txtEmail=' + txtEmail
  urlAction= urlAction + '&txtClave=' + txtClave
  urlAction= urlAction + '&txtRut=' + txtRutCompleto
  urlAction= urlAction + '&txtNombre=' + txtNombre
  urlAction= urlAction + '&txtApellido=' + txtApellido
  urlAction= urlAction + '&selPais='+ selPais
  urlAction= urlAction + '&txttelefono=' + txttelefono
  //alert(urlAction)
  urlAction= urlAction + '&checTip='+ checTip;
  ShowInfoReg.open('GET',urlAction, true);
 
  ShowInfoReg.send(null);

}




function GetRecuperaMail(txtEmail) 
{ //alert("entra primera funcion");
  var valuetxtEmail=document.getElementById(txtEmail);
   RecuperaDatos(valuetxtEmail.value);
  //alert( + ':::' + valuetxtClave.value + ':::' + valuetxtRutCompleto.value + ':::' + valuetxtnombre.value + ':::' + valuetxtapellido.value + ':::' + valuetxtpais.value + ':::' + valuetxttelefono.value + ':::' + valuetxttip.value);
}



var ShowInfoReg;
function RecuperaDatos(enviatxtEmail) 
{  //alert("entra segunda funcion");
  ShowInfoReg=crearXMLHttpRequest();
  ShowInfoReg.onreadystatechange = procesarRegistro;
  urlAction= '../shbral/stwRecuperaDatosWeb.asp?sistema=2'
  urlAction= urlAction + '&txtEmail=' + enviatxtEmail
 // alert(urlAction)
  ShowInfoReg.open('GET',urlAction, true);
 
  ShowInfoReg.send(null);

}







function procesarRegistro()
{ //alert("hola2")
  var formregistro = document.getElementById("formregistro");
  
   
  if(ShowInfoReg.readyState == 4)
  {
	formregistro.innerHTML = ShowInfoReg.responseText;
  } 
  else 
  {
	formregistro.innerHTML = '<br><br><br><div align="center"><img src="images/cargando.gif"/><span class="items_autor">...Procesando</span></div>';
	}
}