
;(function($) {
	// Write noscript style
	document.write("<style type='text/css'>.noscript{display:none}</style>");
	var limitX=0;
	var limitY=0;
	var adPointCls={
		pos:{left:0,top:0},
		child:null,
		showChild:false,
		init:function(){
			var s=this;
			s.pos.left=s.style.left.replace("px","");
			s.pos.top=s.style.top.replace("px","");
			s.child=$(s).find("table");
			if(s.pos.left>limitX) s.child.css("left",(-1)*300+"px");
			if(s.pos.top>limitY) s.child.css("top",(-1)*100+"px");
			$(s).hover(
					function(){
						$(s).css("z-index",4);
						s.child.css("z-index",20);
						s.showChild=true;
						s.child.fadeIn();
					},
					function(){
						s.child.css("z-index",10);
						s.showChild=false;
						setTimeout(function(){
							if(s.showChild==false){
								s.child.fadeOut(100,function(){$(s).css("z-index",1);});
							}
							else s.child.css("z-index",20);
						},500);
					});
			$(s).show();
		}
	};

	jQuery.fn.mapInit = function(){
		var s=this;
		limitX=s.width()/2;
		limitY=s.height()/2;
		s.find("div").each(function(){
			$.extend(this,{},adPointCls);
			this.init();
		});
		//$.extend(this,{},unitCls);
	};
	
})(jQuery);

