var MsgPop = function(title, content, width, height){
	var $get = function(o)
	{
		return (typeof(o) == "string") ? document.getElementById(o) : o;
	};
	var Init = function(){
		var _html = '<div id="MsgPop_Panle" style="background-color:#FFF;width:'+ width +'px; height:'+ height +'px; border:solid 1px #666; overflow:hidden;position:absolute;right:0; bottom:0px;display:none;">';
		_html+= '<div style="font-weight:bold;padding:5px; background-color:#F5B065;font-size:14px;"><span style="float:left;">'+ title +'</span><span style="color:#F00; font-size:12px; font-weight:bold; float:right;"><a href="javascript:void(0);" onclick="document.getElementById(\'MsgPop_Panle\').style.display=\'none\';return false;" style="color:#F00;">关闭</a></span><br style="clear:both;"></div>';
		_html+= '<div style="line-height:150%;padding:5px;font-size:14px;">'+ content +'</div>';
		_html+= '</div>';
		document.write(_html);
	}
	
	var showed = null;
	var hided = null;
	var MsgPop = null;
	var doStart = function(mode){
		var _bottom = parseInt(MsgPop.style.bottom);
		if(mode=='up')
		{
			if (_bottom > 0){
				MsgPop.style.bottom = (_bottom--).toString()+"px";
			}else{
				clearInterval(showed);
			}
		}
	};
	var $size = function(){
		return {"width": document.body.clientWidth, "height": document.body.clientHeight };
	}
	var $offset = function(){
		return {"x": document.body.clientWidth, "y": document.body.clientHeight };
	}
	var $scrollTop = function(){
		var scrollTop = document.documentElement.scrollTop || window.pageYOffset;
		return scrollTop;
	}

	this.Show = function(p)
	{
		Init();
		MsgPop = $get("MsgPop_Panle");
		MsgPop.style.display = "block";
		MsgPop.style.bottom = '0px';
		var x = 0;
		var _height = parseInt(MsgPop.style.height);
		window.onresize = window.onscroll = function(){
			var $s = $size();
			MsgPop.style.top = (document.body.scrollTop + document.body.clientHeight - _height - 2).toString() + 'px'
		}
	}
	
};

