jQuery.fn.popup=function(opt){
	if(opt==null)opt={};
	var popup = $(this).clone();
	var children = new Array();
	
	popup.addClass('ui-widget ui-widget-content ui-corner-all');
	popup.html('');
	$(this).children().addClass('ui-widget-content').css('border','none');
	$(this).children().each(function(){
		
		var i =children.length;
		var clone = $(this).clone().removeAttr('onclick');
		var icon =clone.attr('icon');
		
		if(icon!=null){
			var middle=$(this).height()/2;
			clone.prepend($('<span class="ui-icon '+icon+'"></span>').css({
				position : 'relative',
				top: (middle -3)+'px' ,
				float:'left'
			}));
		}
		
		clone.data('i',i);
		children[i] = $(this);
		popup.append(clone);
		clone.click(function(){
			children[$(this).data('i')].click();
		});
	})
	
	popup.children().hover(
			function(){
				$(this).addClass('ui-state-hover');$(this).css('border','none');
			},
			function(){
				$(this).removeClass('ui-state-hover');
			})
		.css('cursor','pointer');

	popup.css({
		position : "absolute",
		top  : mouse.y,
		left : mouse.x,
		'z-index' : 5000
	});
	$('html').append(popup);
	setTimeout(function(){
		$('html').click(function(){popup.remove()});
	},200);
	popup.show();
	
}