(function($){  
	$.fn.share = function(postInfo) {
		var postInfo = $.extend(postInfo);  
	    return this.each(function() {
	
			var shareUrl = '<li id="share">Share\n\t<ul id="social">\n';

			for(var i = 0; i < postInfo.sites.length; i++) {
				var site = (postInfo.sites[i]);

				switch (site) {
				case 'delicious':
					shareUrl += '\t\t<li><a id="delicious" class="shareWindow" href="http://del.icio.us/post?v=4&noui&jump=close&url='
					+ postInfo.base
					+ postInfo.url
					+ '&title='
					+ postInfo.description
					+ '">Delicious</a></li>\n';
					break;
				case 'reddit':
					shareUrl += '\t\t<li><a id="reddit" class="shareWindow" href="http://reddit.com/submit?url='
					+ postInfo.base
 					+ postInfo.url
					+ '&title='
					+ postInfo.title
					+ '">Reddit</a></li>\n';
					break;
				case 'newsvine':
					shareUrl += '\t\t<li><a id="newsvine" class="shareWindow" href="http://www.newsvine.com/_wine/save?&h='
					+ postInfo.title
					+ '&e='
					+ postInfo.description
					+ '&u='
					+ postInfo.base
 					+ postInfo.url
					+ '&t='
					+ '">Newsvine</a></li>\n';
					break;
				case 'facebook':
					shareUrl += '\t\t<li><a id="facebook" class="shareWindow" href="http://www.facebook.com/sharer.php?u='
					+ postInfo.base
					+ postInfo.url
					+ '">Facebook</a></li>\n';
					break;
				case 'digg':
					shareUrl += '\t\t<li><a id="digg" class="shareWindow" href="http://digg.com/submit?phase=2&url='
					+ postInfo.base
					+ postInfo.url
					+ '&title='
					+ postInfo.title
					+ '">Digg</a></li>\n';
					break;
				}
			}
	
			shareUrl += '\t</ul>\n</li>\n';

			$(this).children('ul').append(shareUrl);
			$("#social").hide();

			$("#share").hover(
				function() {
					$("#social").toggle();
				},
				function() {
					$("#social").toggle();
				}
			);

	    });	
	};  
})(jQuery);
