function share_twitter(desc,u) {
	var conf = 'toolbar=0,status=0,width=626,height=436',
		 t_desc = desc.replace("_","'");
	var a;
	if (u === "#"){
		 a = document.location.href;
	}else{
		 a = 'http://guidatv.sky.it/'+u;
	}
	return window.open('http://twitter.com/share?count=none&original_referer='+encodeURIComponent(a.replace('^','%5E'))+'&text='+encodeURIComponent(t_desc).substring(0,119)+'&url='+encodeURIComponent(a.replace('^','%5E')),'Twitter',conf) || false;
}

function fb_share(desc,img,u,title){
	var url, f_img,f_title;
	if (u==="#"){
		url = document.location.href;
	}else{
		url = 'http://guidatv.sky.it'+ u;
	}
	if (title === "#") f_title = document.title.substring(0, document.title.indexOf("-"));
	else f_title = title.replace("_","'");
	if (img==="#") f_img = $('meta:eq(3)').attr('content') || $("#focus .foto img").attr("src");
	else f_img = img;
	desc ==="#"? desc =  $('meta:eq(1)').attr('content') : '';
	$('body').append($('<div>').attr({'id':'fb-root'}));
	
	FB.init({appId  : '198694496823084',status : true,cookie : true,xfbml  : true});
	FB.ui({method: 'feed',name: f_title,
		link: url,
		picture: f_img,
		caption: '',
		description: desc.replace("_","'"),
		actions : [{
			name :'sky.it', link:'http://www.sky.it'
		}]
	})
}



