function creaAjax(){
	var objetoAjax=false;
	try {
		objetoAjax = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
		objetoAjax = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
			objetoAjax = false;
		}
	}
	if (!objetoAjax && typeof XMLHttpRequest!='undefined') {
		objetoAjax = new XMLHttpRequest();
	}
	return objetoAjax;
}

function FAjax_saveStats(contentID,webuserID)
{
	var ajax=creaAjax();
	
	/*Creamos y ejecutamos la instancia si el metodo elegido es POST*/
	ajax.open ('POST', 'includes/save_stats.jsp?contentID='+contentID+'&webuserID='+webuserID, true);
	ajax.onreadystatechange = function() {
		if (ajax.readyState==1) {
			//alert("Cargando.......");
		}
		else if (ajax.readyState==4){
			if(ajax.status==200){
/*				//alert(ajax.responseText);
				settings="toolbar=yes,location=yes,directories=yes,"+
						"status=yes,menubar=yes,scrollbars=yes,"+
						"resizable=yes,width=573, left=350,top=150";
				popupWindow = window.open(url,'',settings);

//				popupWindow.document.write(ajax.responseText);
				
*/			}else if(ajax.status==404){
/*				settings="toolbar=yes,location=no,directories=no,"+
						"status=yes,menubar=yes,scrollbars=yes,"+
						"resizable=no,width=573, left=350,top=150";
				popupWindow = window.open('about:blank','Visualizar',settings);

				popupWindow.document.write("La direccion no existe");
*/			}else{
/*				settings="toolbar=yes,location=no,directories=no,"+
						"status=yes,menubar=yes,scrollbars=yes,"+
						"resizable=no,width=573, left=350,top=150";
				popupWindow = window.open('about:blank','Visualizar',settings);

				popupWindow.document.write("Error: "+ajax.status);
*/			}
		}
	}
	ajax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	ajax.send(null);
	return;
} 
