var CountVisits = Class.create({
	init: function() {
		current = this;
		$('.ajaxlink').click(function(e) {
			e.preventDefault();
			current.addVisit(this.name, this.href);
		});
	},
	
	addVisit: function (idpage, url) {
		$.ajax({
	        type: "GET",
	        url: "/ajax/newvisits.php",
	        data: "idpage="+idpage,
			async:true,
	        beforeSend: function(datos){
				location.href=url;
			}
			});
		
	}
});