(function($) {

	$.fn.socialShare = function(type, preText) {
		var url = window.location.href;
		
		$(this).click(function()
		{
			
			if(type == 'twitter')
			{
				var socialurl = 'http://twitter.com/home?status=';
				if(typeof preText != 'undefined')
				 	socialurl += preText+' ';
		 		socialurl += url;
			}
			if(type == 'facebook')
			{
				var socialurl = 'http://www.facebook.com/sharer.php?u='+url;
				if(typeof preText != 'undefined')
				 	socialurl += '&t='+preText;
			}
			if(type == 'linkedIn') {
				var title = window.document.title;
				var socialurl = 'http://www.linkedin.com/shareArticle?mini=true&url='+url+'&title='+preText+'&source='+title;
			}
			
			if(typeof socialurl != 'undefined')				
				window.location.href = socialurl;
				
			return false;
		});
	};

})(jQuery);
