// JavaScript Document
;(function($){
	$.fn.jTips=function(options){
		var settings={actionType:"mouseover"};
		var op=$.extend(settings,options);
		var $this=$(this);
		var $tipsframe=$("<div class=\"tips\"><img src=\"../images/tips_arrow.gif\" class=\"arrow\"><div class=\"content\">$content</div></div>");
		var checkExternalClick=function(event){
			var $target = $(event.target);
			//alert($target.html()==$this.html());你好
			//if ($target===$this){alert("ssss")}
			//if (!$target.html()==$this.html()){
			if (!$target.hasClass($this.attr("class"))){
				//$("#cellphone").val($target.html()==$this.html())
				$tipsframe.remove();
			}
		}
		var initTips=function(){
			$(document).mousemove(function(event){checkExternalClick(event)});
		}
		initTips();	
		return $(this).bind(op.actionType,function(){
			var offsetleft=$(this).offset().left;
			var offsettop=$(this).offset().top+$(this).innerHeight();
			var tipscontent=$(this).attr("tips");
			if (tipscontent){
				$tipsframe.find(".content").html(tipscontent);
				$('body').append($tipsframe);
				$tipsframe.css("top", offsettop-$tipsframe.innerHeight()-28+"px").css("left", offsetleft-12+"px").show()
			}

		});

	};
	
	$.fn.jTips1=function(options){
		var settings={actionType:"mouseover"};
		var op=$.extend(settings,options);
		var $this=$(this);
		var $tipsframe=$("<div class=\"tips1\"><img src=\"../images/tips_arrow.gif\" class=\"arrow\"><div class=\"content\"><b>退改签规定：</b><span>$content</span></div></div>");
		var checkExternalClick=function(event){
			var $target = $(event.target);
			if (!$target.hasClass($this.attr("class"))){
				$tipsframe.remove();
			}
		}
		var initTips=function(){
			$(document).mousemove(function(event){checkExternalClick(event)});
		}
		initTips();	
		return $(this).bind(op.actionType,function(){
			var offsetleft=$(this).offset().left;
			var offsettop=$(this).offset().top+$(this).innerHeight();
			var tipscontent=$(this).attr("tips");
			if (tipscontent){
				$tipsframe.find(".content span").html(tipscontent);
				$('body').append($tipsframe);
				$tipsframe.css("top", offsettop-$tipsframe.innerHeight()-50+"px").css("left", offsetleft-0+"px").show()
			}

		});

	};
	
})
( jQuery );
