
function ModalAuto() {
showPopWin("aviso.asp", 571, 223, null, false);

}
function timedMsg()
{
var td=setTimeout("ModalAuto()",1000);
var ta=setTimeout("hidePopWin()",5000);
}


function handleDivTag(divtag) 
{ 
   var divtag; 
   return divtag; 
   } 
var divhandler = new handleDivTag(null);

function doLogin(){  			
xmlHttp=GetXmlHttpObject()

var url="AXlogin.asp";
url=url+"?ident="+window.document.getElementById('usuario').value;
url=url+"&pss="+window.document.getElementById('password').value;
url=url+"&cedula="+window.document.getElementById('cedula').value;
url=url+"&rid="+Math.random();
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
//divhandler.divtag = divtag;
xmlHttp.send(null)
	}

function stateChanged() 
	{ 	
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
			{ 
			document.getElementById('AXloginDiv').innerHTML=xmlHttp.responseText
					if (window.document.getElementById('LoginSuccess').value == "0"){
						//alert('En estos momentos estamos en mantenimiento \nPor favor intentar mas tarde');
						alert('Cedula, usuario o password incorrectos');
						window.document.getElementById('password').value = "";
						window.document.getElementById('password').focus();
					} else {
						location.href="system.asp";		
					}	
			} 
	} 
	
function GetXmlHttpObject()
	{ 
		var objXMLHttp=null
			if (window.XMLHttpRequest)
				{
				objXMLHttp=new XMLHttpRequest()
				}
			else if (window.ActiveXObject)
				{
				objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
				}
		return objXMLHttp
	}	
// *************************************







function validar(e) {
	tecla=(document.all) ? e.keyCode : e.which;
	if(tecla<48 || tecla>57)
	return false;
}

function ValidarCedula() {
var Cedula = document.form1.cedula.value;
	if (Cedula.length == 3) {
		document.form1.cedula.value = Cedula+"-";
	}
		if (Cedula.length == 11) {
		document.form1.cedula.value = Cedula+"-";
	}
}
