$(document).ready(function() {
	var pagina = location.href.substring(location.href.lastIndexOf("/") + 1) || location.href;
	var url = location.href;
	var send = "WIDTH=" + screen.width + "&HEIGHT=" + screen.height + "&PAGE=" + pagina + "&URL=" + url;
	ajax("screen/screen.php", function(ret) {  }, "html", send, "POST");
});

function ajax(page, callback, dtType, data, method) {
	if(page == null)
		alert("Ajax requiere pagina de solicitud");
	else if(callback == null)
		alert("Ajax requiere funcion para el retorno de valores");
	else {
		dtType = dtType || "html";
		method = method || "GET";
		send = data;
		$.ajax({
			cache: false,
			async: true,
			dataType: dtType,
			global: true,
			ifModified: false,
			processData: true,
			contentType: "application/x-www-form-urlencoded",
			type: method,
			url: page,
			data: send,
			success: function(value) {
				if(typeof callback == "function")
					callback.call(this, value);
			}
		});
	}
}
