function manageShareLinks()
{
  if (window.shareLinks)
  {
    $j('#contentWrapper .st_twitter,.st_facebook,.st_email').each(function(e){
      $j(this).click(function(e) {
        
        var updater = new $j.ajax({
          url:  'index.php',
          type: 'POST',
          data: ({
            task : 'share',
            shareMethod : shareMethod,
            contentTitle : $j(this).attr('st_title'),
            userId : window.userId
          }),
          dataType: 'html',
          astnc:  false
        });

      });
    });


	var shareThisDivs = $j('.shareThis');
	var shareThisDivsLength = shareThisDivs.length;
	
	for (var i = 0; i < shareThisDivsLength; i++) {
		var parentDiv = $j(shareThisDivs[i]);
		
		$j('.shareThisLink', parentDiv).click(function () {
			console.log(parentDiv);
			$j('.shareThisModal', parentDiv).dialog({
				modal: true,
				width: 500,
				title: 'ShareThis',
				buttons: {
					Close: function() {
						$j( this ).dialog( "close" );
						$j( this ).dialog( "destroy" );
					}
				}
			});
		});
	}

  }
}

$j(window).load(function() {
  manageShareLinks();
});
