;(function($){
jQuery.fn.extend({
	xOffset:'0px',
	yOffset:'0px',
	setxOffset:function(x){
		$(this).xOffset=x;
	},
	setxyOffset:function(y){
		$(this).yOffset=y;
	},	
//	init:function(){
//		$(document).bind("mouseover",function(e){
//			if(e.target == this){
//				var postip = $("<div id='postip'></div>").attr("style","position:absolute;left:0px;top:0px");
//				$("body").append(postip);
//				$(postip).html("[x:"+e.pageX+",y:"+e.pageY+"]<br/>");
//				$(this).xOffset=e.pageX;
//				$(this).yOffset=e.pageY;
//			}
//		});
//	},
	popdiv:function(settings){
		//初始化配置信息
		var options = jQuery.extend({
				flagId:"tipId",
				flagCss:"tip",
				flagWidth:$(this).outerWidth(),
				flagInfo:$(this).attr("title"),
				isAnimate:true},
				settings
			);
			if(!options.flagInfo)
			{
				return;
			}
//			xOffset='0px';
//			yOffset='0px';
//			$(document).bind("mousemove",function(e){
//				alert(e.target);
//					if(e.target == this){
//						
//						var postip = $("#preview");
//						if(postip.length <=0){
//							postip =$("<div id='postip'></div>").attr("style","position:absolute;left:0px;top:0px");
//							$("body").append(postip);
//						}
//						$(postip).html("[x:"+e.pageX+",y:"+e.pageY+"]<br/>");
//						xOffset=e.pageX;
//						yOffset=e.pageY;
//					}
//			});
			
			var oToolTip = $("<div id='preview' name='"+options.flagId+"'>"+options.flagInfo+"</div>").attr("style",options.flagCss);
			$("body").append(oToolTip);
			var x = $("#mapDiv").attr('xOffset')-10;
			var y = $("#mapDiv").attr('yOffset')-10;
			$('#content').html("x:"+x+",y:"+y);
			//$(oToolTip).css("left",$(this).xOffset+"px").css("top",$(this).yOffset +"px");
			oToolTip.css("left",x+"px").css("top",y+"px").fadeIn("slow");
			$(oToolTip).hover(
				function () {
					if(!isFireFox){
						document.getElementById("debug").value = document.getElementById("debug").value + " --> hover_1";
						state = true;
					}
				},
				function () {
					if(!isFireFox){
						document.getElementById("debug").value = document.getElementById("debug").value + " --> hover_2";
						state = false;
						//div_hide();
					}
				}
			);
			$(this).mouseover(function(){
				//$(oToolTip).remove();
			});
	}
})
})(jQuery);

function init(divid){
	$("#flash_div").bind("mousemove",function(e){
//			var postip = $("#postip");
//			if(postip.length <=0){
				//postip =$("<div id='postip'></div>").attr("style","position:absolute;left:0px;top:0px");
				//$("body").append(postip);
//			}
			
			//$(postip).html("[x:"+e.pageX+",y:"+e.pageY+"]<br/>");
			//$(postip).css("left",e.pageX+ "px").css("top",e.pageY+ "px");
//			$("#"+divid).setxOffset(e.pageX);
//			$("#"+divid).setYOffset(e.pageY);
			$("#"+divid).attr( {xOffset:e.pageX,yOffset:e.pageY} )
	});	
}