function pagestyle(cssPrefix)
{
	var n = readcookie('LIVE_PPPS_CN');
	var url = "images/LIVE_PPPS_CN/"+cssPrefix+n+".CSS";
	var oCSS = document.getElementById("cssfile");
	if (oCSS!=null && oCSS.tagName.toLowerCase()=="link") {
		document.getElementsByTagName("head").item(0).removeChild(oCSS);
	}
	oCSS = document.createElement('link');
	oCSS.setAttribute("rel","stylesheet");
	oCSS.setAttribute("type","text/css");
	oCSS.setAttribute("id",'cssfile');
	oCSS.setAttribute("href", url);
	document.getElementsByTagName("head").item(0).appendChild(oCSS);
}

function changestyle(n){
	writecookie('LIVE_PPPS_CN',n);
	if(top && top.frames.length > 0){
		for(var i =0;i<top.frames.length;i++){
			var od = top.frames[i];
			try{
				var oCSS  = od.document.getElementById('cssfile');
				if(oCSS){
					var oldCss = oCSS.href;
					var idx = oldCss.indexOf(".CSS");
					if(idx != -1){
						var newCss = oldCss.substring(0,idx-1);
						newCss=newCss+n+".CSS";
						oCSS.href = newCss;
					}
				}
			}catch(e){
				continue;
			}
		}
	}
	try{
		var oCSS = document.getElementById("cssfile");
		if(!oCSS) return;
		var oldCss = oCSS.href;
		var idx = oldCss.indexOf(".CSS");
		if(idx != -1){
			var newCss = oldCss.substring(0,idx-1);
			newCss=newCss+n+".CSS";
			oCSS.href = newCss;
		}
	}catch(e){}
}

function writecookie(name,n)
{
	if (n=="") {n=1}
	var expires = new Date();
	expires.setTime(expires.getTime() + 24*60*60*365*1000);
	var flag = name+"="+n;
	var host = window.location.host;
	document.cookie=flag+";domain="+host+";path=/;expires="+expires.toGMTString();
}

function readcookie(name)
{
	var j = 0
	var mycookie = document.cookie;
	var start1 = mycookie.indexOf(name+"=");
	if (start1 == -1){
		j=1;
	}else{
		start=mycookie.indexOf("=",start1)+1;
		var end = mycookie.indexOf(";",start);
		if (end==-1){
			end=mycookie.length;
		}
		var value=unescape(mycookie.substring(start,end));
		if (value==null){
			j=1;
		}else{
			j=value;
		}
	}
	return j;
}
pagestyle("Style_Ppps_Cn");

function AlertLogin(bbname,sitename){
var eSrc=(document.all)?window.event.srcElement:arguments[1];
var shield = document.createElement("DIV");
shield.id = "shield";
shield.style.position = "absolute";
shield.style.left = "0px";
shield.style.top = "0px";
shield.style.width = "100%";
shield.style.height = document.body.scrollHeight+"px";
shield.style.background = "#333";
shield.style.textAlign = "center";
shield.style.zIndex = "10000";
shield.style.filter = "alpha(opacity=0)";
shield.style.opacity = 0;
var alertFram = document.createElement("DIV");
alertFram.id="alertFram";
alertFram.style.position = "absolute";
alertFram.style.left = "50%";
alertFram.style.top = "50%";
alertFram.style.marginLeft = "-255px" ;
alertFram.style.marginTop = -150+document.documentElement.scrollTop+"px";
alertFram.style.width = "515px";
alertFram.style.height = "300px";
alertFram.style.textAlign = "center";
alertFram.style.zIndex = "10001";
strHtml = "<ul id=\"login\">\n";
strHtml += "<form id=\"loginform\" method=\"post\" name=\"login\" action=\"logging.php?action=login&amp;loginsubmit=true\">\n";
strHtml += "<input type=\"hidden\" name=\"formhash\" value=\"\" />\n";
strHtml += "<input type=\"hidden\" name=\"cookietime\" value=\"2592000\" />\n";
strHtml += "<input type=\"hidden\" name=\"loginfield\" value=\"username\" />\n";
strHtml += "<input type=\"submit\" style=\"display:none\" id=\"submit\" />\n";
strHtml += " <li id=\"close\"><a id=\"do_OK\" onclick=\"doOk()\"></a></li>";
strHtml += " <li id=\"loginbbn\">"+bbname+"</li>";
strHtml += " <li id=\"loginstn\">"+sitename+"</li>";
strHtml += " <li id=\"boxuname\"><input type=\"text\" id=\"username\" name=\"username\" maxlength=\"40\" TabIndex=\"1\" onkeydown=\"if(event.keyCode==13)event.keyCode=9;\"/></li>";
strHtml += " <li id=\"boxupass\"><input class=\"upass\" type=\"password\" id=\"password\" name=\"password\" TabIndex=\"2\" onkeydown=\"if(event.keyCode==13)loginst();\"/></li>";
strHtml += " <li id=\"logo\" class=\"loginbt\"><a onclick=\"loginst()\" TabIndex=\"3\" onkeydown=\"if(event.keyCode==13)loginst();\"></a></li>";
strHtml += "</form>\n";
strHtml += "</ul>\n";
alertFram.innerHTML = strHtml;
document.body.appendChild(alertFram);
document.body.appendChild(shield);
this.setOpacity = function(obj,opacity){
if(opacity>=1)opacity=opacity/100;
try{ obj.style.opacity=opacity; }catch(e){}
try{
if(obj.filters.length>0&&obj.filters("alpha")){
obj.filters("alpha").opacity=opacity*100;
}else{
obj.style.filter="alpha(opacity=\""+(opacity*100)+"\")";
}
}catch(e){}
}
var c = 0;
this.doAlpha = function(){
if (++c > 20){clearInterval(ad);return 0;}
setOpacity(shield,c);
}
var ad = setInterval("doAlpha()",1);
this.doOk = function(){
document.body.removeChild(alertFram);
document.body.removeChild(shield);
eSrc.focus();
document.body.onselectstart = function(){return true;}
document.body.oncontextmenu = function(){return true;}
}
this.loginst = function(){
document.getElementById("submit").click();
}
document.getElementById("do_OK").focus();
eSrc.blur();
document.body.onselectstart = function(){return false;}
document.body.oncontextmenu = function(){return false;}
}

function DisAD(disbad,showad){
	var n = getcookie('discuz_disad');
	if (n==""|| n==null) {
	n=1;
	setcookie('discuz_disad', n, (1 ? 365 * 86400 * 30 : -(365 * 86400 * 30 * 1000)));
	}
	document.getElementById("isadbt").innerHTML= n == 1 ? disbad : showad;
}
function IsDisAD(disbad,showad){
	var n = getcookie('discuz_disad');
	var m = getcookie('discuz_headad');
	if (n==""|| n==null) {n=1;}
	n = n==1 ? 0 : 1;
	if (m==""|| m==null) {m=0;}
	document.getElementById("isadbt").innerHTML= n == 1 ? disbad : showad;
	setcookie('discuz_disad', n, (1 ? 365 * 86400 * 30 : -(365 * 86400 * 30 * 1000)));
	if(n==1 && m==0){
		document.getElementById("ad_headerbanner").style.display= '';
		setcookie('discuz_headad', 1, (1 ? 365 * 86400 * 30 : -(365 * 86400 * 30 * 1000)));
	}
	location.reload();
}
function DisHeadAD(){
	document.getElementById("ad_headerbanner").style.display= 'none';
	setcookie('discuz_headad', 0, (1 ? 365 * 86400 * 30 : -(365 * 86400 * 30 * 1000)));
	location.reload();
}
