$(document).ready(function(){	
	$("a[target='_blank']").attr('onclick','');	
	$("a[target='_blank']").click(function(){
		salva_click(this.href);
	});	
});

function salva_click(target){
	var link=location.href;
	$.ajax({
		   type: "POST",
		   url: "/click_conta/new/conta_click.php",
		   data: {target: target, link: link},
		   success: function(data, textStatus){	   		    		   		
		   		//alert(data);
		   },
		   cache: false,
	   	   async: true
	 });	
}
/*
function get_statistiche(url,inizio,fine){
	alert(url);
	alert(inizio);
	alert(fine);
	$("#dialog").html('Caricamento in corso...');	
	$("#dialog").dialog({
		title: 'Statistiche sito',
		height: 640,
		width: 800,
		open: function(event, ui) {
			stampa_statistiche(url,inizio,fine);
		}
	});
	
	return false;
}

function stampa_statistiche(url,inizio,fine){
	alert(url);
	alert(inizio);
	alert(fine);
	$.ajax({
		   type: "POST",
		   url: "/amministrazione/statistiche_aziende/get_statistiche",
		   dataType: "html",
		   data: {url:url,url_corrente:location.href,inizio:inizio,fine:fine},
		   cache: false,
		   success: function(data, textStatus){	   		    		   		
			   $("#dialog").html(data);;
		   },
		   beforeSend: function(){
			   $("#dialog").html('Caricamento in corso...');
		   },
	   	   async: false
	 });
	return false;
}
*/
function get_statistiche(url,inizio,fine){

	$("#dialog").dialog({
		position: 'center'	
	});
	$.ajax({
		   type: "POST",
		   url: "/amministrazione/statistiche_aziende/get_statistiche",
		   dataType: "html",
		   data: {url:url,url_corrente:location.href,inizio:inizio,fine:fine},
		   cache: false,
		   success: function(data, textStatus){	   		    		   		
			   $("#dialog").html(data);;
		   },
		   beforeSend: function(){
			   $("#dialog").html('Caricamento in corso...');
		   },
	   	   async: false
	 });
	return false;
}



