(function($){
	
	$.fn.extend({
		showneedthing:function(){
	
			var self = this;
	
	
			var init = function() {		
				$(self).click(function(event) {
						$('#akst_social').remove();
						array =($(self).attr("needth")).split(','); 
			
						ask_id = "akst_link_"+array[0];
						
						$.post("http://blog.51yip.com/ajax/connect.php",{url:array[1],title:array[2],action:'connectaction'},function(data){
						$(data).prependTo($(self).parent());		
										
						var left = getLeft(document.getElementById(ask_id));
					    if(navigator.userAgent.indexOf("Firefox")>0){
    						left = left-385;
						}else{
							left = left+215;
						}
						var top = getTop(document.getElementById(ask_id))-$('#akst_social').height()-125;	
						$('#akst_social').css({left:left,top:top}).show();
						$('#akst_social').find('a').css("color","blue");
					});
				});
			}
		
			var getLeft = function(e) {
				 var   l=e.offsetLeft;  
				 while(e=e.offsetParent)     l   +=   e.offsetLeft;  
				 return   l;  
			}
			
			var getTop = function(e) {			
				 var   t=e.offsetTop;  
				 while(e=e.offsetParent)     t   +=   e.offsetTop;  
				 return   t;  
			}
			init();
		}
	});

})(jQuery);
