function handleHttpResponse() { 
	if (http.readyState == 4) { 
		if (http.status == 200) { 
			if (http.responseText.indexOf('invalid') == -1) {
            	// Armamos un array, usando la coma para separar elementos
            	results = http.responseText.split(","); 
            	document.getElementById("campoMensaje").innerHTML = results[0];
            	enProceso = false;
          	}
       	}
    }
}
function anhade(valor) {
	if(document.all){
		eval(valor).style.display='none';
	}else{
		document.getElementById(valor).style.display='none';
	}
	if (!enProceso && http) {
       var url = "/anhadecookie.asp?meva="+ valor;
       http.open("GET", url, true);
       http.onreadystatechange = handleHttpResponse;
       enProceso = true;
       http.send(null);
    }
	setTimeout("window.location=location.href",1000)
	return false;
}

function quita(valor){
	if (!enProceso && http) {
       var url = "/quitacookie.asp?meva="+ valor;
       http.open("GET", url, true);
       http.onreadystatechange = handleHttpResponse;
       enProceso = true;
       http.send(null);
    }
	if(document.all){
		eval('fich'+valor).style.display='none';
		//if(eval(valor).style.display){
			//eval(valor).style.display='block';
		//}
	}else{
		qdiv = 'fich'+valor
		document.getElementById(qdiv).style.display='none';
		//if(document.getElementById(valor).style.display){
			//document.getElementById(valor).style.display='block';
		//}
	}
	setTimeout("window.location=location.href",1000)
	return false;
}

function getHTTPObject() {
    var xmlhttp;
    //if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
       	try{
			if (window.XMLHttpRequest){
				xmlhttp  = new XMLHttpRequest( );
			}else if(window.ActiveXObject){
				xmlhttp  = new ActiveXObject("Msxml2.XMLHTTP");
				if (!xmlhttp){
					xmlhttp  = new ActiveXObject("Microsoft.XMLHTTP");
				}
			}
        	//xmlhttp = new XMLHttpRequest();
       	}catch (e){ 
	   		xmlhttp = false;
		}
    //}
    return xmlhttp;
}

var enProceso = false; // lo usamos para ver si hay un proceso activo
var http = getHTTPObject(); // Creamos el objeto XMLHttpRequest

