function Popup(browser, height)
{
	var popupWin = null;

	var init = function()
	{
		popupWin = document.createElement("div");
		popupWin.id = "PopupWin";

		var s = popupWin.style;
		s.opacity = "0.9";
		if (browser == 'ie6')
			s.position = "absolute";
		else
			s.position = "fixed";
		s.overflow = "hidden";
		s.textAlign = "left";
		s.lineHeight = "20px";
		s.zIndex = "10000000";
		s.zIndex = "10";
		s.bottom = "0px";
		s.right = "0px";
		s.width = "256px";
		s.padding = "5px";
		s.margin = "0";
		s.height = "0";
	};
	init();

	var changeT = function(){
		popupWin.style.top = document.documentElement.scrollTop + document.documentElement.clientHeight - popupWin.clientHeight + "px";
		setTimeout(function(){changeT();}, 50);
	};

	this.showMsg = function(title, contentHtml, cookie_key, curr_time)
	{
		popupWin.innerHTML = '<div class="Main"><div class="Content"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><th class="title">'+title+'</th><th class="close"><a onclick="Popup.hide()" href="javascript:void(0)"><img border="0" src="http://www.anybi.com/images/tools/close.png"/></a></th></tr><tr><td colspan="2">'+contentHtml+'</td></tr><tr><td colspan="2" align="right"><a onclick="Popup.neverShow(\''+cookie_key+'\', \''+curr_time+'\')" href="javascript:void(0)">知道了，以后不再提示该信息</a></td></tr></tbody></table></div></div>';
		document.body.appendChild(popupWin);

		if (parseInt(popupWin.style.height) == 0)
		{
			handle = setInterval("Popup.changeH('up',"+height+")",2);
		}

		if (browser == 'ie6')
			changeT();
	};
}

Popup.hide = function()
{
	var popupWin = document.getElementById('PopupWin');
	if (parseInt(popupWin.style.height) != 0)
	{
		handle = setInterval("Popup.changeH('down',8)",2);
	}
};

Popup.neverShow = function(cookie_key, curr_time)
{
	Popup.setCookie(cookie_key, curr_time, 365*5);
	Popup.hide();
};

Popup.setCookie = function(c_name, value, expiredays)
{
	var exdate = new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie = c_name+ "=" + escape(value) + ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}


Popup.changeH = function(str, height)
{
	var popupWin = document.getElementById('PopupWin');
	if (str == "up")
	{
		if (parseInt(popupWin.style.height) > height)
			clearInterval(handle);
		else
			popupWin.style.height = (parseInt(popupWin.style.height)+8).toString() + "px";
	}
	if (str == "down")
	{
		if (parseInt(popupWin.style.height) < 8)
		{
			clearInterval(handle);
			popupWin.style.display = "none";
		}
		else  
			popupWin.style.height = (parseInt(popupWin.style.height)-8).toString() + "px"; 
	}
};
