function comprobar()
{

	if (document.frmValidar.txtEmail.value=="" || document.frmValidar.txtClave.value=="")
	{
		alert("Debe rellenar los dos campos");
		return false; 
	}			
	loadXMLDoc();			
}

function comprobarMail()
{
	if (document.frmClave.txtEmailClave.value=="")
	{
		alert("Debe escribir su dirección de correo");
	}else{		
		document.frmClave.submit();
	}
}
		
		
		
function loadXMLDoc() {

document.frmValidar.anchoVentana.value = screen.width-20;
document.frmValidar.altoVentana.value = screen.height-20;
document.getElementById("imagenFrameBloqueo").width = screen.width-20;
document.getElementById("imagenFrameBloqueo").height = screen.height-20;

    if (window.XMLHttpRequest) {        
		req = new XMLHttpRequest();
		req.onreadystatechange = processReqChange;
		
		req.open("POST", "validar.asp");
		
		req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		//req.setRequestHeader('Accept-Charset','ISO-8859');
		//req.setRequestHeader('Accept-Language','es-ES');


		req.send("email="+document.frmValidar.txtEmail.value+"&clave="+document.frmValidar.txtClave.value+"&anchoVentana="+document.frmValidar.anchoVentana.value+"&altoVentana="+document.frmValidar.altoVentana.value);   
    	} else if (window.ActiveXObject) {
		
			req = new ActiveXObject("Microsoft.XMLHTTP");
			if (req) {
				req.onreadystatechange = processReqChange;				
				req.open("POST", "validar.asp", false);
				req.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
				req.setRequestHeader('Accept-Charset','utf-8');
				req.setRequestHeader('Accept-Language','es-ES');
				req.send("email="+document.frmValidar.txtEmail.value+"&clave="+document.frmValidar.txtClave.value+"&anchoVentana="+document.frmValidar.anchoVentana.value+"&altoVentana="+document.frmValidar.altoVentana.value);
			}
    }		
    
}



function processReqChange() {
   
    if (req.readyState == 4) {
	
        if (req.status == 200) {
			
			document.getElementById("frameBloqueo").style.visibility="visible";
			document.getElementById("frameAccion").style.visibility="visible";			
			document.getElementById("frameAccion").innerHTML= req.responseText;            
        } else {
            alert("Ha ocurrido un error vuelva a intentarlo:\n" +
                req.statusText);
        }
    }
}

function refrescar(){
document.getElementById("frameAccion").style.visibility="hidden";
var forzarRefresco = true;
window.location.reload(forzarRefresco);
}