HT=0;W=0;
function GetObj(ID){return document.getElementById(ID)}
function getCookieVal (offset){var endstr = document.cookie.indexOf (";", offset);if (endstr == -1){endstr = document.cookie.length;};return unescape(document.cookie.substring(offset,endstr));}
function getCookie(name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while (i < clen){var j = i + alen;if (document.cookie.substring(i,j) == arg){return getCookieVal (j);};i = document.cookie.indexOf(" ",i) + 1;if (i==0){break};};return null;}
function SetCookie (name, value) {	var argv = SetCookie.arguments; var argc = SetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; document.cookie = name + "=" + escape (value) + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain)) + ((secure == true) ? "; secure" : "");}
function Loc(url){document.location=url}
function PopClose(){Pop('hide')}
function Pop(ShowHide){GetObj('pop_bg').className=ShowHide;GetObj('shadow_bg').className=ShowHide;}
function ShowPopup(ContentID){
	GetObj('pop_title').innerHTML=ContentID[0];
	GetObj('pop_message').innerHTML=ContentID[1];
	Pop('show');
	HT=GetObj('pop_bg').offsetHeight;W=GetObj('pop_bg').offsetWidth;
	rePos();
}
function rePos(){
	B=document.body;POP=GetObj('pop');
	POP.style.top=HT / 2 - POP.offsetHeight / 2;
	POP.style.left=W / 2 - POP.offsetWidth / 2;
	GetObj('pop_bg').style.height=B.scrollHeight
	GetObj('shadow_bg').style.height=B.scrollHeight
}
function KP(CookieID){SetCookie(CookieID,3,null,'/');PopClose()}
function LoadPopup(ContentID){
	var dynCookie=getCookie(PopID)
	if(dynCookie==null){dynCookie=1}else{dynCookie=parseFloat(dynCookie)+1}
	SetCookie(PopID,dynCookie,null,'/')
	if(dynCookie <= 2){ShowPopup(ContentID)}
}