function checkLogin()
{
	//alert("entró");

	<!-- // Required to be compliant with XHTML-->
 	var xmlHttp=null; // Defines that xmlHttp is a new variable.
 	// Try to get the right object for different browser
 	try {
    	// Firefox, Opera 8.0+, Safari, IE7+
    	xmlHttp = new XMLHttpRequest(); // xmlHttp is now a XMLHttpRequest.
 	} catch (e) {
    	// Internet Explorer
    	try {
    	   	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
 	   	} catch (e) {
	       xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	 }
	 
	 

 xmlHttp.onreadystatechange = function() {
    if (xmlHttp.readyState == 4)
       try { // In some instances, status cannot be retrieved and will produce 
             // an error (e.g. Port is not responsive)
             document.getElementById('verifyUser').style.display="none";
             //document.getElementById('forgotPassword').style.display="none";
          
          if (xmlHttp.status == 500) {
          	alert('Hubo un error al verificar usuario');
          }   
          if (xmlHttp.status == 200) {
             // Set the main HTML of the body to the info provided by the 
             // Ajax Request
             if (xmlHttp.responseText!='Success')
             {
             	alert(xmlHttp.responseText);
             }
             else
             {
             	//document.Login.action = 'index.jsp';
             	//document.Login.action = '/masternet/portal/Funcionalidades_Softphone.jsp';
             	document.Login.action = 'home.jsp';
             	document.Login.submit();
             }
          }
       		} catch (e) {
	          //document.getElementById("ajax_output").innerHTML 
	            // = "Error on Ajax return call : " + e.description;
	            alert(e.description);
	       }
	 }

	var open = "/portal/ProcessLogin";
 	xmlHttp.open("post",open); // .open(RequestType, Source);
 	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send("user="+document.getElementById('user').value+"&password="+document.getElementById('password').value); // Since there is no supplied form, null takes its place 
	                     // as a new form.
	document.getElementById('verifyUser').style.display="block";
	document.getElementById('forgotPassword').style.display="none";



}

function entrar()
{

	if ( (document.getElementById('user').value!='') && (document.getElementById('password').value!='') )
		checkLogin();
	else
		alert("Por favor capture usuario y password");
}

function retrievePassword()
{
	if ( (document.getElementById('user').value!='') )
	{
		document.Login.submit();
	}
	else
		alert("Por favor capture un usuario");
}

function verifyLogin()
{

	<!-- // Required to be compliant with XHTML-->
 	var xmlHttp=null; // Defines that xmlHttp is a new variable.
 	// Try to get the right object for different browser
 	try {
    	// Firefox, Opera 8.0+, Safari, IE7+
    	xmlHttp = new XMLHttpRequest(); // xmlHttp is now a XMLHttpRequest.
 	} catch (e) {
    	// Internet Explorer
    	try {
    	   	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
 	   	} catch (e) {
	       xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	 }
	 
	 

 xmlHttp.onreadystatechange = function() {
    if (xmlHttp.readyState == 4)
       try { // In some instances, status cannot be retrieved and will produce 
             // an error (e.g. Port is not responsive)
             //document.getElementById('verifyUser').style.display="none";
             //document.getElementById('forgotPassword').style.display="none";
          
          if (xmlHttp.status == 500) {
          	alert('Hubo un error al verificar usuario');
          }   
          if (xmlHttp.status == 200) {
             // Set the main HTML of the body to the info provided by the 
             // Ajax Request

             if (xmlHttp.responseText!='')
             {
             	var aResponse = xmlHttp.responseText.split('|');
             	
             	document.getElementById('logged').style.display="block";
             	document.getElementById('menuLogged').style.display="block";
             	document.getElementById('menuMiCuentaLogged').style.display="block";
             	document.getElementById('labelName').innerHTML = "Bienvenido, " + aResponse[0];
             	if (aResponse[1]=='1')
             		document.getElementById('option1').innerHTML = '<a href="home.jsp"><div align="center" class="menu-funcionalA">Inicio</div></a>';
             	else
             		document.getElementById('option1').innerHTML = '<div align="center" class="menu-funcionalB">Inicio</div>';
             	if (aResponse[2]=='1')
             		document.getElementById('option2').innerHTML = '<a href="home-MiCuenta.jsp"><div align="center" class="menu-funcionalA">Mi cuenta</div></a>';
             	else
             		document.getElementById('option2').innerHTML = '<div align="center" class="menu-funcionalB">Mi cuenta</div>';
             	if (aResponse[3]=='1')
             		document.getElementById('option3').innerHTML = '<a href="home-funcionalidades.jsp"><div align="center" class="menu-funcionalA">Funcionalidades</div></a>';
             	else
             		document.getElementById('option3').innerHTML = '<div align="center" class="menu-funcionalB">Funcionalidades</div>';
             	if (aResponse[4]=='1')
             		document.getElementById('option4').innerHTML = '<a href="ayuda_linea.html"><div align="center" class="menu-funcionalA">Preguntas frecuentes</div></a>';
             	else
             		document.getElementById('option4').innerHTML = '<div align="center" class="menu-funcionalB">Preguntas frecuentes</div>';
             	if (aResponse[5]=='1')
             		document.getElementById('option5').innerHTML = '<a href="/portal/ModifyCustomerInfo"><div align="center" class="menu-funcionalA">Actualiza tus datos</div></a>';
             	else
             		document.getElementById('option5').innerHTML = '<div align="center" class="menu-funcionalB">Actualiza tus datos</div>';
             }
             else
             {
             	document.getElementById('notLogged').style.display="block";
             	document.getElementById('menuNotLogged').style.display="block";
             	document.getElementById('menuMiCuentaNotLogged').style.display="block";
             }
          }
       		} catch (e) {
	          //document.getElementById("ajax_output").innerHTML 
	            // = "Error on Ajax return call : " + e.description;
	            alert(e.description);
	       }
	 }

	var open = "/portal/VerifyLogin";
 	xmlHttp.open("post",open); // .open(RequestType, Source);
 	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send("action=verify"); // Since there is no supplied form, null takes its place 
	                     // as a new form.
	//document.getElementById('verifyUser').style.display="block";
	//document.getElementById('forgotPassword').style.display="none";
}

function verifyLoginWithoutDB()
{

	<!-- // Required to be compliant with XHTML-->
 	var xmlHttp=null; // Defines that xmlHttp is a new variable.
 	// Try to get the right object for different browser
 	try {
    	// Firefox, Opera 8.0+, Safari, IE7+
    	xmlHttp = new XMLHttpRequest(); // xmlHttp is now a XMLHttpRequest.
 	} catch (e) {
    	// Internet Explorer
    	try {
    	   	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
 	   	} catch (e) {
	       xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    }
	 }
	 
	 

 xmlHttp.onreadystatechange = function() {
    if (xmlHttp.readyState == 4)
       try { // In some instances, status cannot be retrieved and will produce 
             // an error (e.g. Port is not responsive)
             //document.getElementById('verifyUser').style.display="none";
             //document.getElementById('forgotPassword').style.display="none";
          
          if (xmlHttp.status == 500) {
          	alert('Hubo un error al verificar usuario');
          }   
          if (xmlHttp.status == 200) {
             // Set the main HTML of the body to the info provided by the 
             // Ajax Request

             if (xmlHttp.responseText!='')
             {
             	var aResponse = xmlHttp.responseText.split('|');
             	document.getElementById('logged').style.display="block";
             	document.getElementById('menuLogged').style.display="block";
             	document.getElementById('menuMiCuentaLogged').style.display="block";
             	document.getElementById('labelName').innerHTML = "Bienvenido, " + aResponse[0];
             	if (aResponse[1]=='1')
             		document.getElementById('option1').innerHTML = '<a href="home.jsp"><div align="center" class="menu-funcionalA">Inicio</div></a>';
             	else
             		document.getElementById('option1').innerHTML = '<div align="center" class="menu-funcionalB">Inicio</div>';
             	if (aResponse[2]=='1')
             		document.getElementById('option2').innerHTML = '<a href="home-MiCuenta.jsp"><div align="center" class="menu-funcionalA">Mi cuenta</div></a>';
             	else
             		document.getElementById('option2').innerHTML = '<div align="center" class="menu-funcionalB">Mi cuenta</div>';
             	if (aResponse[3]=='1')
             		document.getElementById('option3').innerHTML = '<a href="home-funcionalidades.jsp"><div align="center" class="menu-funcionalA">Funcionalidades</div></a>';
             	else
             		document.getElementById('option3').innerHTML = '<div align="center" class="menu-funcionalB">Funcionalidades</div>';
             	if (aResponse[4]=='1')
             		document.getElementById('option4').innerHTML = '<a href="ayuda_linea.html"><div align="center" class="menu-funcionalA">Preguntas frecuentes</div></a>';
             	else
             		document.getElementById('option4').innerHTML = '<div align="center" class="menu-funcionalB">Preguntas frecuentes</div>';
             	if (aResponse[5]=='1')
             		document.getElementById('option5').innerHTML = '<a href="/portal/ModifyCustomerInfo"><div align="center" class="menu-funcionalA">Actualiza tus datos</div></a>';
             	else
             		document.getElementById('option5').innerHTML = '<div align="center" class="menu-funcionalB">Actualiza tus datos</div>';

             }
             else
             {
             	document.getElementById('notLogged').style.display="block";
             	document.getElementById('menuNotLogged').style.display="block";
             	document.getElementById('menuMiCuentaNotLogged').style.display="block";
             }
          }
       		} catch (e) {
	          //document.getElementById("ajax_output").innerHTML 
	            // = "Error on Ajax return call : " + e.description;
	            alert(e.description);
	       }
	 }

	var open = "/portal/VerifyLogin";
 	xmlHttp.open("post",open); // .open(RequestType, Source);
 	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send("action=ayuda"); // Since there is no supplied form, null takes its place 
	                     // as a new form.
	//document.getElementById('verifyUser').style.display="block";
	//document.getElementById('forgotPassword').style.display="none";
}


document.write('<FORM NAME="Login" ACTION="/portal/portal/ProcessRetrievePassword" METHOD="post">');
document.write('        <div id="notLogged" style="display:none">');
//document.write('        <table width="261" height="101" border="0" cellpadding="0" cellspacing="0" background="images/img_fondoTit-A.gif">');
//document.write('          <tr>');
//document.write('            <td height="24" colspan="4"><div align="center"></div></td>');
//document.write('          </tr>');
//document.write('          <tr>');
//document.write('            <td width="73" height="23"><div align="right"><span class="acceso-text">Usuario:</span></div></td>');
//document.write('            <td width="4" height="23">&nbsp;</td>');
//document.write('            <td colspan="2"><input name="user" type="text" class="format" id="user" value="" size="20" maxlength="10"/></td>');
//document.write('          </tr>');
//document.write('          <tr>');
//document.write('            <td height="26"><div align="right"><span class="acceso-text">Contrase&ntilde;a:</span></div></td>');
//document.write('            <td height="26">&nbsp;</td>');
//document.write('            <td width="121"><input name="password" type="password" class="format" id="password" value="" size="20" maxlength="8"/>');
//document.write('              <a href="#"></a></td>');
//document.write('            <td width="63" valign="bottom"><a href="javascript:entrar();"><img src="images/btn_entrar.gif" border="0" width="58" height="22" /></a></td>');
//document.write('          </tr>');
//document.write('          <tr>');
//document.write('            <td height="28" colspan="4">');
//document.write('            	<div align="center" id="forgotPassword" style="display: none"><a href="javascript:retrievePassword();"><img src="images/img_btn-olvide.gif" border="0" alt="" width="158" height="22" /></a></div>');
//document.write('            	<div align="center" id="verifyUser" style="display: none">Verificando usuario...</div>');
//document.write('            </td>');
//document.write('          </tr>');
//document.write('        </table>');
document.write('        </div>');
document.write('');
document.write('		<div id="logged" style="display:none">');
document.write('			<table width="263" height="29" border="0" cellpadding="0" cellspacing="0">');
document.write('	          <tr>');
document.write('	            <td width="200" height="29"><div align="right"><span class="body-Msg_Activo" id="labelName"></span></div></td>');
document.write('	            <td width="63" valign="bottom"><div align="right"><a href="/portal/ProcessLogout"><img src="images/btn_Salir.gif" border="0" alt="" width="58" height="22" /></a></div></td>');
document.write('	          </tr>');
document.write('			</table>');
document.write('		</div>');
document.write('</FORM>');
