
jQuery.fn.showPrompt = function(targetId,text,direction,offset) {
	var _seft = this;
	
	var down_class = "ui-tooltip-pointer-down";
	var down_inner_class = "ui-tooltip-pointer-down-inner";
	if(direction && direction == 'down')
	{
		 down_class = "ui-tooltip-pointer-down-down";
		 down_inner_class = "ui-tooltip-pointer-down-inner-down";
	}
	
	var messageBox = "<span class=\"ui-slider-tooltip  ui-corner-all\" id=\""+targetId+"\">";
	messageBox+= "<span>"+text+"</span>";
	messageBox+= "<span class=\""+down_class+"\">";
	messageBox+= "<span class=\""+down_inner_class+"\" ></span>";
	messageBox+= "</span>";
	messageBox+= "</span>";
	
	$('body').append(messageBox);
	
	var targetId = $("#"+targetId);
	targetId.children("span:first").html(text);

	var A_top = $(this).offset().top + $(this).outerHeight(true); 
	var A_left =  $(this).offset().left;
	targetId.bgiframe();//ie6 div与下拉框的问题
	
	if(direction && direction == 'down')
	{
		A_top -= 70;
		if(offset)
		{
			A_left += offset;
		}
	}
	else if(direction && direction == 'top')
	{
		A_top -= 70;
		A_top -= offset;
		A_left += 300;
	}else
	{
		A_top -= 30;
		A_left += 300;
	}
	
	targetId.show().css({"position":"absolute","top":A_top+"px" ,"left":A_left+"px"});//设置Div的top和left
	
//	targetId.find("#selectItemClose").click(function(){
//		targetId.hide(100);//隐藏div
//	});
//
	if(_seft.attr("id") == 'message_warn' || _seft.hasClass('auto_dis'))
	{
		setTimeout(function(){targetId.hide();},3000);
	}
	this.click(function(){
		targetId.hide();
	});
	targetId.click(function(e){
		e.stopPropagation(); // 阻止冒泡，避免点击div也触发body上的事件
	});

    return this;
}

jQuery.fn.hidePrompt = function(targetId) {
	var _seft = this;
	var targetId = $("#"+targetId);
	targetId.hide();
    return this;
}
