function SocialVote(a, url, title, text, pic) {
	
				$('#vote-options').remove();

				 $("body").append('<div id="vote-options" style="display:none;">\
<div class="vote-options"><div class="centers options">Выберите социальную сеть</div>\
<div class="centers links clr">\
<a href="#" class="fb" onclick="return SocialSend(\'fb\', \'' + url + '\', \'' + title + '\', \'' + text + '\', \'' + pic + '\')" title="Facebook">Facebook</a>\
<a href="#" class="tw" onclick="return SocialSend(\'tw\', \'' + url + '\', \'' + title + '\', \'' + text + '\', \'' + pic + '\')" title="Twitter">Twitter</a>\
<a href="#" class="vk" onclick="return SocialSend(\'vk\', \'' + url + '\', \'' + title + '\', \'' + text + '\', \'' + pic + '\')" title="vKontakte">vKontakte</a>\
<a href="#" class="ok" onclick="return SocialSend(\'ok\', \'' + url + '\', \'' + title + '\', \'' + text + '\', \'' + pic + '\')" title="Odnoklassniki">Odnoklassniki</a>\
<a href="#" class="ml" onclick="return SocialSend(\'ml\', \'' + url + '\', \'' + title + '\', \'' + text + '\', \'' + pic + '\')" title="Mail.Ru">Mail.Ru</a>\
</div></div></div>');
				
				$('#vote-options').dialog({
					autoOpen: true,
					width: 350,
					height: 150,
					dialogClass: "modalfixed",
				});
}

function SocialSend(objVT, link, title, share, pic) {
	
	  var url = '';
      var commentst = share;
	  
		if(objVT == 'fb') {
			url  = 'http://www.facebook.com/sharer.php?s=100';
			url += '&p[title]='     + encodeURIComponent(title);
			url += '&p[summary]='   + encodeURIComponent(commentst);
			url += '&p[url]='       + encodeURIComponent(link);
			url += '&p[images][0]=' + encodeURIComponent(pic);
		} else if(objVT == 'tw') {
			url  = 'http://twitter.com/share?';
			url += 'text='      + encodeURIComponent(title);
			url += '&url='      + encodeURIComponent(link);
			url += '&counturl=' + encodeURIComponent(link);
		} else if(objVT == 'vk') {
			url  = 'http://vkontakte.ru/share.php?';
			url += 'url='          + encodeURIComponent(link);
			url += '&title='       + encodeURIComponent(title);
			url += '&description=' + encodeURIComponent(commentst);
			url += '&image='       + encodeURIComponent(pic);
			url += '&noparse=true';
		} else if(objVT == 'ok') {
			url  = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1';
			url += '&st.comments=' + encodeURIComponent(commentst);
			url += '&st._surl='    + encodeURIComponent(link);
		} else if(objVT == 'ml') {
			url  = 'http://connect.mail.ru/share?';
			url += 'url='          + encodeURIComponent(link);
			url += '&title='       + encodeURIComponent(title);
			url += '&description=' + encodeURIComponent(commentst);
			url += '&imageurl='    + encodeURIComponent(pic);
		}

		window.open(url,'','toolbar=0,status=0,width=626,height=436');	
	 
	 $('#vote-options').dialog('close');
	 
	 return false;
}
