(function($) {
	snsshare();
	function snsshare() {
		var thelink = encodeURIComponent(document.location),
			thetitle = encodeURIComponent(document.title.substring(0,60)),
			windowName = '分享到',
			param = getParamsOfShareWindow(600, 560),

			ss_tqq = 'http://v.t.qq.com/share/share.php?title=' + thetitle + '&url=' + thelink + '&site=',
			ss_qzone = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + thelink + '&title=',
			ss_tsina = 'http://v.t.sina.com.cn/share/share.php?url=' + thelink + '&title=' + thetitle,
			ss_douban = 'http://www.douban.com/recommend/?url=' + thelink + '&title=' + thetitle,
			ss_renren = 'http://share.renren.com/share/buttonshare?link=' + thelink + '&title=' + thetitle,
			ss_kaixin = 'http://www.kaixin001.com/repaste/share.php?rurl=' + thelink + '&rcontent=' + thelink + '&rtitle=' + thetitle;

		$('.snsshare').each(function() {
			$(this).attr('title',windowName + $(this).text());
			$(this).unbind('hover').click(function() {
				var httpUrl = eval($(this).attr('class').substring($(this).attr('class').lastIndexOf('ss_')));
				window.open(httpUrl, windowName, param);
			});
		});

		function getParamsOfShareWindow(width, height) {
			return ['toolbar=0,status=0,resizable=1,width=' + width + ',height=' + height + ',left=',(screen.width-width)/2,',top=',(screen.height-height)/2].join('');
		}
	}

})(jQuery);