var Popup = {
	isMove: false,
	isOpen: false,
	div: null,
	time: null,
	mouse: [0,0],
	p: {x:0,y:0},
	$:function(v) { return document.getElementById(v) },
	open: function(v) {
		if(this.isOpen) this.close();
		this.isOpen=true;
		this.div=this.$(v);
		this.div.style.display="block";
		var screen={w:document.body.offsetWidth,h:document.body.offsetHeight,y:document.body.scrollTop}
		var div={w:this.div.offsetWidth,h:this.div.offsetHeight}
		this.p.x=Math.round((screen.w-div.w)/2);
		this.p.y=Math.round((screen.h-div.h)/2)+screen.y;
		this.div.style.left=this.p.x+'px';
		this.div.style.top=this.p.y+'px';
		this.div.onmouseover=function() { clearTimeout(Popup.time);  }
		this.div.onmouseout=function() { clearTimeout(Popup.time);  Popup.timeout(); }
		this.timeout();
	},
	timeout: function() { this.time=setTimeout('Popup.close()', 5000) },
	close: function() { this.isOpen=false; clearTimeout(Popup.time); this.div.style.display="none" },
	moveStart: function(e) { this.mouse=this.getMouse(e);this.isMove=true },
	moveTo: function(e) {
		if(!this.isMove) return;
		var m=this.getMouse(e);
		this.p.x+=(m[0]-this.mouse[0]);
		this.p.y+=(m[1]-this.mouse[1]);
		this.mouse=m;
		this.div.style.left=this.p.x+'px';
		this.div.style.top=this.p.y+'px';
	},
	moveEnd: function() {this.isMove=false},
	getMouse: function(evt) {
		var x,y;
		if (evt.pageX) { x=evt.pageX;y=evt.pageY }
		else if (evt.clientX) {
			x=evt.clientX + (document.documentElement.scrollLeft||document.body.scrollLeft);
			y=evt.clientY + (document.documentElement.scrollTop||document.body.scrollTop);
		}
		return [x,y];
	}
};