function popUp_avisale(id) {
         window.open('a_avisale.ngmf?id=1','Avisale','width=460,height=200,resizable=no,scrollbars=no');
 }
    
function popup(url)
{
	newwindow=window.open(url,'PASSWORD','height=300,width=450');
	if (window.focus) {newwindow.focus()}
	return false;
}
function recuperar_mail(){        
    if (document.RecupPass.diremail.value.indexOf("@") != -1){
          recuxajax();
    }else {
    		var errormsj= document.getElementById('traduerror').value;
            document.getElementById('ERRORMAIL').innerHTML=errormsj;
      }		
} 
    var xml;
    
function recuxajax()
    {
        
        if (window.XMLHttpRequest){
            xml= new XMLHttpRequest();
        }
        else if(window.ActiveXObject){
                xml = new ActiveXObject("Microsoft.XMLHTTP");
        }                
            xml.open("GET","a_recuperarpwd.ngmf?MAIL="+ document.RecupPass.diremail.value,true);
            xml.onreadystatechange = callbackmail;
            xml.send(null);
    }

function callbackmail(){
        if (xml.readyState==1){
            document.getElementById('MSJ').innerHTML='<img src="/aplicantes/images/spin_32.gif" />';
        }        
        	if (xml.readyState==4 && xml.status==200){
            	document.getElementById('MSJ').innerHTML='';
	            var rta=xml.responseText;

    	        if (rta.indexOf("@") != -1){                                        
                        document.getElementById('caja_olvido').innerHTML='';
                        document.getElementById('rmail').innerHTML= rta;
                        myPanel.show(); return false;                       						                 

            	}else {
            			document.getElementById('ERRORMAIL').innerHTML=rta;
            	}                        
        	}        
}
function desaparece(){

var informacion = '<form name="RecupPass"  action="javascript:recuperar_mail()"; method="post">Si olvidó su contraseña ingrese su e-mail para recuperarla';
		informacion += '<input size="8" name="diremail" class="input2" /> ';
		informacion += '<input type="image" name="PERDI" src="images/botones/btn_green.gif" alt="enviar" />';
		informacion +=' <div id="ERRORMAIL" align="center" class="Error"></div></form>';

			document.getElementById('caja_olvido').innerHTML=informacion;

}
function startajax()
    {
        
        if (window.XMLHttpRequest){
            xml= new XMLHttpRequest();
        }
        else if(window.ActiveXObject){
                xml = new ActiveXObject("Microsoft.XMLHTTP");
        }
                
            xml.open("GET","validar_usr.ngmf?USR="+ document.HOME.UUSERNAME.value+"&PWD="+document.HOME.PPASSWORD.value,true);
            xml.onreadystatechange = callback;
            xml.send(null);
    }
function callback(){

        if (xml.readyState==1){
            document.getElementById('MSJ').innerHTML='<img src="/aplicantes/images/spin_32.gif" />';
        }
        if (xml.readyState==4 && xml.status==200){
            document.getElementById('MSJ').innerHTML='';
            var rta=xml.responseText;

            if (rta==1){                
                        document.location="a_panel.ngmf";                    
                        document.getElementById('MSJ').innerHTML='';                        
            }else{
            	   document.getElementById('MSJ').innerHTML=rta;
            }
        }
        
    }