/*
ÓÒÏÂµ¯´°¹ã¸æ
*/
var showtime=0;
var marginL=10; //ÓÒ±ß¾à
var it1;

function ShowPop(popParam,popCode){
	var popup=document.createElement("DIV");
	popup.id="popup";
	popup.className='t';
	popup.style.height=popParam.winHeight+"px";
	popup.style.width=popParam.winWidth+"px";
	popup.style.padding="0";
	popup.style.margin="0";
	popup.style.backgroundColor="#FFFFFF";
	popup.style.position="absolute";
	popup.style.top=ietruebody().clientHeight+getTop()-marginL-popParam.winHeight+"px";
	popup.style.right=marginL+"px";
	popup.style.zIndex = 9999;

	popup.innerHTML="<table cellspacing=0 cellpadding=0 width=100%><tr><td class='h'><a id='closeButton' title='close' class='fr' onclick='hidePop();'><img src='http://www.chinamgo.com/images/close.gif' /></a>"+popParam.title+"</td></tr><tr class='f_one'><td>" + popCode + "</td></tr></table>";
	var btn = findElement(popup,'a',"closeButton");
	btn.style.cssText='cursor:pointer;margin-top:3px;';
	document.body.appendChild(popup);
	it1 = setInterval(function() {floatPop(popParam)},100);
}
function floatPop(popParam){
	if(popParam.winClose>0){
		showtime++;
		if(showtime > popParam.winClose*10){
			hidePop('auto');
			return;
		}
	}
	document.getElementById("popup").style.top=ietruebody().clientHeight+getTop()-marginL-popParam.winHeight+"px";
}
function hidePop(type){
	document.getElementById("popup").style.display="none";
	clearInterval(it1);
	if(typeof type=='undefined') document.cookie="hidepop=1; path=/";
}
function findElement(root,tag,id){
	var ar=root.getElementsByTagName(tag);
	for(var i=0;i<ar.length;i++){
		if(ar[i].id==id) return ar[i];
	}
	return null;
}

function sendmsg(url,data,id) {
	read.obj = (typeof id == 'undefined' || !id) ? null : getObj(id);
	read.guide();
	setTimeout(function(){ajax.send(url,data,ajax.get);},300);
}
function getObj(id) {
	return document.getElementById(id);
}
function objCheck(obj) {
	if (typeof(obj)=='string') {
		obj	= getObj(obj);
	}
	return obj;
}
function ietruebody() {
	if (getObj('upPanel')) {
		return getObj('upPanel');
	}
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;
}
function getTop() {
	return typeof window.pageYOffset != 'undefined' ? window.pageYOffset:ietruebody().scrollTop;
}
function getLeft() {
	return (typeof window.pageXOffset != 'undefined' ? window.pageXOffset:ietruebody().scrollLeft)
}
function IsElement(id) {
	return document.getElementById(id) != null ? true : false;
}