function socializ(u,t) {


window.fbAsyncInit = function() {
    FB.init({appId: '174009262663215', status: true, cookie: true,
             xfbml: true});
  };
  (function() {
    var e = document.createElement('script'); 
	e.async = true;
    e.src = document.location.protocol + '//connect.facebook.net/it_IT/all.js';
    document.getElementById('fb-root').appendChild(e);
  }());

	var m1 = 250; /* расстояние от начала страницы до плавающей панели */
	var m2 = 20; /* расстояние от верха видимой области страницы до плавающей панели */
	var f = 'images/socializ/'; /* путь к папке с изображениями кнопок */

	document.write('<div id="socializ"></div>');

	(function($) {
	$(function() {

		var s = $('#socializ');
		s.css({top: m1});
		function margin() {
			var top = $(window).scrollTop();
			if (top+m2 < m1) {
				s.css({top: m1-top});
			} else {
				s.css({top: m2});
			}
		}
		$(window).scroll(function() { margin(); })

		s.append(
			'<a href="http://www.facebook.com/sharer.php?u=' + u + '&t=' + t +'" title="Condividi su Facebook"><img src="' + f + 'facebook.png" alt="" /></a>' +
			
			'<a href="http://twitter.com/share?text=' + t + '&url=' + u + '" title="Condividi su Twitter"><img src="' + f + 'twitter.png" alt="" /></a>' +
			'<a href="http://www.google.com/buzz/post?message=' + t + '&url=' + u + '" title="Condividi su Google Buzz"><img src="' + f + 'google-buzz.png" alt="" /></a>' +
			
			'<a href="http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=' + u + '&title=' + t + '" title="Aggiungere a segnalibri Google"><img src="' + f + 'google.png" alt="" /></a>' + 
			
			'<a href="http://www.friendfeed.com/share?title=' + t + ' - ' + u + '" title="Condividi su FriendFeed"><img src="' + f + 'friendfeed.png" alt="" /></a>' + '');

		s.find('a').attr({target:'_blank'}).css({opacity: 0.5}).hover(
			function() { $(this).css({opacity: 1}); },
			function() { $(this).css({opacity: 0.7}); }
		).addClass('popup');
		s.hover(
			function() { $(this).find('a').css({opacity: 0.7}); },
			function() { $(this).find('a').css({opacity: 0.5}); }
		);

	})
	})(jQuery)

}



function popWin(theURL,winName,features) {
	var w;
	var h;
	var str;
	var inizio;
	var str;
	inizio = features.indexOf("width=") + 6;
	fine = features.indexOf(",",inizio);
	if (fine != -1) {
		str = features.substring(inizio,fine);
	} else {
		str = features.substring(inizio);
	}
	w = parseFloat(str)
	inizio = features.indexOf("height=") + 7;
	fine = features.indexOf(",",inizio);
	if (fine != -1) {
		str = features.substring(inizio,fine);
	} else {
		str = features.substring(inizio);
	}
	h = parseFloat(str)

	PosX = (screen.width - w) / 2;
	PosY = (screen.height - h) / 2;

	window.open(theURL,winName,features + ",left=" + PosX + ",top=" +
	PosY+",screenX=" + PosX +",screenY=" + PosY);
}

document.onclick = function(e) {
  e = e || event;
  var t = e.target || e.srcElement;
  while (t && t.nodeType == 1 && t.tagName.toLowerCase() != 'a')
     t = t.parentNode;

  if (t && t.nodeType == 1 && /\bpopup\b/.test(t.className)) {
	popWin(t.href,'','width=600,height=400,scrollbars=yes,status=yes,resizable=no');
    return false;
  }
  return true;
}
