Math.randomInt = function(nMax) { return parseInt(Math.random()*nMax); };
Array.prototype.find = function(e) { for (var i=0; i<this.length; ++i) { if (this[i]==e) { return i; } } return null; };
Array.prototype.findmul = function(e) { var a = []; for (var i=0; i<this.length; ++i) { if (this[i]==e) { a.push(i); } } return a; };
Array.prototype.find_if = function(fnEQ) { for (var i=0; i<this.length; ++i) { if (fnEQ(this[i])) { return i; } } return null; };
Array.prototype.findmul_if = function(fnEQ) { var a = []; for (var i=0; i<this.length; ++i) { if (fnEQ(this[i])) { a.push(i); } } return a; };
Array.prototype.push_not = function(e) { if (this.find(e)==null) { return this.push(e); } return null; };
Array.prototype.push_not_if = function(e, fnEQ) { if (this.find_if(fnEQ)==null) { return this.push(e); } return null; };
Array.prototype.remove = function(e) { var a = this.findmul(e); for (var i=a.length-1; i>=0; --i) { this.splice(a[i], 1); } return a.length; };
Array.prototype.remove_if = function(fnEQ) { var a = this.findmul_if(fnEQ); for (var i=a.length-1; i>=0; --i) { this.splice(a[i], 1); } return a.length; };
Array.prototype.transform = function(fnOp) { for (var i=0; i<this.length; ++i) { this[i] = fnOp(this[i]); } return this; };
Array.prototype.uniq = function() { var i=1; while (i<this.length) { if (this[i]==this[i-1]) { this.splice(i, 1); } else { ++i; } } return this; }
RegExp.showCharSet = /[\x00-\x09\x0B-\x0C\x0E-\x1F\x80-\xFF]/g;
String.prototype.chsetReplace = function() { return this.replace(RegExp.showCharSet , "?"); };String.prototype.chsetAlert = function(v) { if (!this.chsetCheck()) { alert((v?v+"中":"")+'请不要使用"'+this.match(RegExp.showCharSet).toString()+'"等字符。'); return false; }else{ return true; } };
String.prototype.chsetCheck = function() { return !this.match(RegExp.showCharSet); };
String.prototype.between = function(b, e) { var bp = this.indexOf(b); if (bp==-1) { return (""); } bp += b.length; var ep = this.indexOf(e, bp); if (ep==-1) { return (""); } return this.substr(bp, ep-bp); };
String.prototype.replaceAll = function(s, t) { return this.split(s).join(t); };
String.prototype.asclen = function() { return this.replace(/[\u0100-\uffff]/g, "  ").length; };
String.prototype.asccut = function(n) { var i = 0; while (n>0 && i<this.length) { n -= this.charCodeAt(i)>=256 ? 2 : 1; i += (n>=0); } return this.substr(0, i); };
String.prototype.escHtmlEp = function() { return this.replace(/[&'"<>\/\\\-\x00-\x1f\x80-\xff]/g, function(r){ return "&#"+r.charCodeAt(0)+";" }); };
String.prototype.escHtml = function() { return this.replace(/[&'"<>\/\\\-\x00-\x09\x0b-\x0c\x1f\x80-\xff]/g, function(r){ return "&#"+r.charCodeAt(0)+";" }).replace(/\r\n/g, "<BR>").replace(/\n/g, "<BR>").replace(/\r/g, "<BR>").replace(/ /g, "&nbsp;"); };
String.prototype.escScript = function() { return this.replace(/[\\"']/g, function(r){ return "\\"+r; }).replace(/%/g, "\\x25").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\x01/g, "\\x01"); };
String.prototype.escUrl = function() { return escape(this).replace(/\+/g, "%2B"); };
String.prototype.escMiniUrl = function() { return this.replace(/%/g, "%25"); };
String.prototype.escHrefScript = function() { return this.escScript().escMiniUrl().escHtmlEp(); };
String.prototype.escRegexp = function() { return this.replace(/[\\\^\$\*\+\?\{\}\.\(\)\[\]]/g, function(a,b){ return "\\"+a; }); };
String.prototype.escape = function() { return escape(this); };
String.prototype.unescape = function() { return unescape(this); };
String.prototype.trim = function(){ return this.replace(/(^\s*)|(\s*$)/g, "");};
Date.prototype.format = function(v) { var a={"Y":this.getFullYear(), "m":LENFix(this.getMonth()+1, 2), "d":LENFix(this.getDate(), 2), "H":LENFix(this.getHours(), 2), "M":LENFix(this.getMinutes(), 2), "S":LENFix(this.getSeconds(), 2)}; return v.replace(/%[YmdHMS]/g, function(v){ return (a[v.substr(1)]); }); };
function $(n){return document.getElementById(n)};
var	QQSHOW_DOMAIN	=	"show.qq.com";
var QQSHOW_HOMEPAGE	=	"http://show.qq.com";
function UriComponentEncode(sStr)
{
	sStr = encodeURIComponent(sStr);
	sStr = sStr.replace(/~/g,"%7E");
	sStr = sStr.replace(/!/g,"%21");
	sStr = sStr.replace(/\*/g,"%2A");
	sStr = sStr.replace(/\(/g,"%28");
	sStr = sStr.replace(/\)/g,"%29");
	sStr = sStr.replace(/'/g,"%27");
	sStr = sStr.replace(/\?/g,"%3F");
	sStr = sStr.replace(/;/g,"%3B");
	return sStr;
}
function escUrl(v) { return v.escUrl(); };
function escHtml(v) { return v.escHtml(); };
function escHtmlEp(v) { return v.escHtmlEp(); };
function escScript(v) { return v.escScript(); };
function escHrefScript(v) { return v.escHrefScript(); };
function toExpTime(v , sFmt)
{
	if (isNaN(v) ) return 0;
	var nM = truncate (v / 2678400 , 1);
	var nD = truncate (v / 86400 , 1);
	if(!sFmt || sFmt == "M")
	{
		if( nM >= 1)
			return nM + "个月";
		else 
			return parseInt(nD) + " 天 ";
	} else {
		return parseInt(nD) + " 天 ";
	}
}
function truncate (nVal, nNum)
{
	var nRet = null;
	try
	{
		if (nVal==0 || nNum==0)
			return 0;
		nVal = 1 * nVal;
		nNum = 1 * nNum;
		if (isNaN(nVal) || isNaN(nNum))
		{
			nRet = 0;
		}
		else if (nNum >= 0 && nNum <= 18)
		{
			var strX = nVal.toString();
			var arrX = strX.split(".");
			if ( arrX[1] )
			{
				if (arrX[1].length > nNum)
					arrX[1] = arrX[1].substr(0, nNum);
				strX = arrX.join(".");
			}
			else
				strX = arrX[0];
				nRet = parseFloat(strX);
		}
		else
		{
			nRet = 0;
		}
	}
	catch(e)
	{
		nRet = 0;
	}
	return nRet;
}
function SetMulObject(vObject, sName, oValue)
{
	for (var i=0; i<vObject.length; ++i)
	{
		vObject[i][sName] = oValue;
	}
}
function DebugMessage(v)
{
	return "["+v.toString()+"]";
};
function PARAM(valPairs, elemSep, pairSep)
{
	if (valPairs)
	{
		var aElem = valPairs.toString().split(elemSep);
		for (var i=0; i<aElem.length; ++i)
		{
			var aPair = aElem[i].split(pairSep);
			(aPair.length>1) && (this[aPair[0]] = unescape(aPair[1]));
		}
	}
};
function getParam(valPairs, sName, elemSep, pairSep)
{
	var xParam = new PARAM(valPairs, elemSep, pairSep);
	return xParam[sName] ? xParam[sName] : "";
};
function setParam(valPairs, n, v)
{
	valPairs = valPairs.toString();
	n = n.toString();
	v = v.toString().escUrl();
	var r = new RegExp("(^|\\W)"+n+"=[^&]*", "g");
	return (valPairs.match(r)) ? valPairs.replace(r, "$1"+n+"="+v) : valPairs+(valPairs ? "&" : "")+n+"="+v;
};
function getURLParam(sName, sUrl)
{
	(!sUrl) && (sUrl = window.location.href);
	sUrl = sUrl.toString();
	var nIndex = sUrl.indexOf("?");
	return (nIndex>=0) ? getParam(sUrl.substr(nIndex+1), sName, "&", "=") : "";
};
function setURLParam(u, n, v)
{
	u = u.toString();
	n = n.toString();
	v = v.toString().escUrl();
	var r = new RegExp("(^|\\W)"+n+"=[^&]*", "g");
	return (u.match(r)) ? u.replace(r, "$1"+n+"="+v) : u+(u.indexOf("?")==-1 ? "?" : "&")+n+"="+v;
};
function getHashParam(n, l)
{
	l || (l=window.location);
	return l.hash ? getParam(unescape(l.hash.substr(1)), n, "&", "=") : "";
};
function setHashParam(n, v, l)
{
	l || (l=window.location);
	v = v.toString().escUrl();
	var u = unescape(l.hash.substr(1));
	var r = new RegExp("(^|\\W)"+n+"=[^&]*", "g");
	l.hash = 	escape((u.match(r)) ? u.replace(r, "$1"+n+"="+v) : u+(u.length ? "&" : "")+n+"="+v);
};
function setCookie(sName, sValue, nExpireSec, sDomain, sPath) 
{ 
	var sCookie = sName+"="+escape(sValue)+";";  
	if((document.cookie.length+sCookie.length) >= 4096)
	{
		return false;
	}
	if (nExpireSec) 
	{ 
		var oDate = new Date(); 
		oDate.setTime(oDate.getTime()+parseInt(nExpireSec)*1000); 
		sCookie += "expires="+oDate.toUTCString()+";"; 
	}
	if (sDomain) 
	{
		sCookie += "domain="+sDomain+";"; 
	}
	if (sPath) 
	{
		sCookie += "path="+sPath+";" 
	}
	document.cookie = sCookie;	
	return true;
};
function getCookie(sName)
{
	return getParam(document.cookie, sName, "; ", "=");
};
function QQCookie(sName, sValue, nExpSec)
{
	setCookie(sName, sValue, nExpSec, "qq.com", "/");
};
function QSCookie(sName, sValue, nExpSec)
{
	return setCookie(sName, sValue, nExpSec, "show.qq.com", "/");
};
function CheckUrlCredit(sUrl)
{
	return (/^(https?:\/\/)?[\w\-.]+\.(qq|paipai|soso|taotao)\.com($|\/|\\)/i).test(sUrl)||(/^[\w][\w\/\.\-_%]+$/i).test(sUrl)||(/^[\/\\][^\/\\]/i).test(sUrl) ? true : false;
};
function _MSIE() { return (window.navigator.appName.toUpperCase().indexOf("MICROSOFT")>=0); };
function _MSIE6(){return _MSIE()?(window.navigator.appVersion.split(";")[1].replace(/[ ]/g,"")=="MSIE6.0"?true:false):false};
function _FireFox() { return (window.navigator.appName.toUpperCase().indexOf("NETSCAPE")>=0); };
function StopPropagation(oEvent){_MSIE()?oEvent.cancelBubble=true:oEvent.stopPropagation();}
function _MSIEUSERDATA()
{
	function _USERData(oObj, sName, sCookie)
	{
		this._Object = oObj;
		this._svName = sName;
		this._Cookie = sCookie;
		this._Object.addBehavior("#default#userData");			
		this._Object.load(this._svName);
		if (!getCookie(this._Cookie) || parseInt(this._Object.getAttribute(this._Cookie)) < parseInt(getCookie(this._Cookie)))
		{
			this.expiresDiscard();
		}  
		if (!getCookie(this._Cookie))
		{
			QSCookie(this._Cookie, new Date().getTime());
		}
	};
	_USERData.prototype.expiresDiscard = function()
	{
		this._Object.expires = new Date(new Date().getTime()-365*86400000).toUTCString();
		this._Object.save(this._svName);
		this._Object.load(this._svName);
		this._Object.expires = new Date(new Date().getTime()+365*86400000).toUTCString();
	};
	var _userData_ = null;
	window.getUserData = function(sName)
	{
		if (!_userData_)
		{
			_userData_ = new _USERData(document.documentElement, "QQSHOW", "QSUDTMmilliSeconds");
		}
		return _userData_._Object.getAttribute(sName);
	};
	window.setUserData = function(sName, sValue)
	{
		if (!_userData_)
		{
			_userData_ = new _USERData(document.documentElement, "QQSHOW", "QSUDTMmilliSeconds");
		}
		_userData_._Object.setAttribute(sName, sValue);
		_userData_._Object.setAttribute(_userData_._Cookie, new Date().getTime());
		_userData_._Object.save(_userData_._svName);
	};
};
function _FF2XUSERDATA()
{
	window.getUserData = function(sName)
	{
		return window.sessionStorage.getItem(sName);
	};
	window.setUserData = function(sName, sValue)
	{
		return window.sessionStorage.setItem(sName, sValue);
	};
};
function _NOUSERDATA()
{
	window.getUserData = function(sName)
	{
		return !_NOUSERDATA._load&&(_NOUSERDATA._load=true)&&alert("对不起，由于您的浏览器不支持一些特性，QQ秀商城的部分功能您将无法正常使用。\n我们建议您使用Internet Explorer 6.0+或者Firefox 2.0+以获得最佳效果。");
	};
	window.setUserData = function(sName, sValue)
	{
		return !_NOUSERDATA._load&&(_NOUSERDATA._load=true)&&alert("对不起，由于您的浏览器不支持一些特性，QQ秀商城的部分功能您将无法正常使用。\n我们建议您使用Internet Explorer 6.0+或者Firefox 2.0+以获得最佳效果。");
	};
};
_MSIE() ? _MSIEUSERDATA() : (window.sessionStorage) ? _FF2XUSERDATA() : _NOUSERDATA();
function XMLREQ(fnCall, fnFail)
{
	this._XmlREQ = (window.XMLHttpRequest) ? (new XMLHttpRequest()) : (window.ActiveXObject) ? ((function(){try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){return new ActiveXObject("Microsoft.XMLHTTP")};})()) : null;
	var this__XmlREQ = this._XmlREQ;
	this._XmlREQ.onreadystatechange = function() { if (this__XmlREQ.readyState==4) { this__XmlREQ.status==200 ? (fnCall ? fnCall(this__XmlREQ) : null) :  (fnFail ? fnFail(this__XmlREQ) : null); } };
};
XMLREQ.prototype.open = function(sUrl,type)
{
	function TYPE(){ var m = ({GET:"GET", POST:"POST"}[XMLREQ.__method_once] || "POST"); XMLREQ.__method_once && (delete XMLREQ.__method_once); return m; }
	var aDat = sUrl.split("?");
	this._XmlREQ.open(TYPE(), aDat[0], type);
	aDat[1] && this._XmlREQ.setRequestHeader("Content-length", aDat[1].length);
	this._XmlREQ.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	this._XmlREQ.setRequestHeader("If-Modified-Since", "0");
	this._XmlREQ.send(aDat[1] ? aDat[1] : null);
};
XMLREQ.prototype.close = function()
{
	this._XmlREQ.abort();
};
window.QUSER = {};
window.QUSER.getInfo = function(sName)
{
	var sData = getCookie("QSUSRINF");
	var oParam = new PARAM(sData, "&", "=");
	return oParam[sName] ? oParam[sName] : "";
};
window.QUSER.setInfo = function(sName, sValue)
{
	var sData = getCookie("QSUSRINF");
	QSCookie("QSUSRINF", setParam(sData, sName, sValue));
};
window.QUSER.getAvSex = function()
{
	var sSex = QUSER.getInfo("avsex");
	if(sSex.length == 0) 
	{QUSER.setInfo("avsex","F");return "F";}
	else return sSex;
};
window.QUSER.getStyle = function()
{
	var sStyle = QUSER.getInfo("style");
	if(sStyle.length == 0) 
	{QUSER.setInfo("style","1");return 1;}
	else return parseInt(sStyle);
};
window.VIPItemSend = {};
window.VIPItemSend.getTotal = function(iLevel)
{
	var vTotal = [0, 0, 2, 2, 2, 5, 5, 5];
	if (arguments.length==0)
	{
		iLevel = (getCookie("viprank").split("|")[1] || 0);
		return (QUSER.getInfo("vip")!=1 ? 0 : (vTotal[iLevel] || 0));
	}
	return (vTotal[iLevel] || 0);
}
window.VIPItemSend.getUsed = function()
{
	return parseInt(QUSER.getInfo("vipsend")) || 0;
}
window.VIPItemSend.getLeft = function()
{
	var iLeft = VIPItemSend.getTotal()-VIPItemSend.getUsed();
	return iLeft>=0 ? iLeft : 0;
}
window.VIPItemSend.setUsed = function(n)
{
	return QUSER.setInfo("vipsend", n>=0 ? n : 0);
}
window.VIPItemSend.canSend = function()
{
	return VIPItemSend.getTotal() > VIPItemSend.getUsed();
}
window.VIPRank = {};
window.VIPRank.getType = function()  // 0-vip 1-novip0 2-novipn
{
	return (parseInt(getCookie("viprank").split("|")[0]) || 0);
}
window.VIPRank.getLevel = function()
{
	return (parseInt(getCookie("viprank").split("|")[1]) || 0);
}
window.VIPRank.getImageHtml = function(iType, iLevel)
{
	iType>=0 || (iType=VIPRank.getType());
	iLevel>=0 || (iLevel=VIPRank.getLevel());
	var vHtml = [
		'<SPAN class="vip_lv"><SPAN>lv</SPAN><SPAN class="lv lv$LV">$LV</SPAN></SPAN>',
		'<SPAN class="vip_lv_gray"><SPAN>lv</SPAN><SPAN class="lv lv$LV">$LV</SPAN></SPAN>',
		''
	];
	return (vHtml[iType]||"").replace(/\$LV/g, iLevel);
}
window.VIPRank.setImageShow = function(o, iType, iLevel)
{
	iType>=0 || (iType=VIPRank.getType());
	iLevel>=0 || (iLevel=VIPRank.getLevel());
	var vHtml = [
		'<SPAN>lv</SPAN><SPAN class="lv lv$LV">$LV</SPAN>',
		'<SPAN>lv</SPAN><SPAN class="lv lv$LV">$LV</SPAN>',
		''
	];
	var vClass = ["vip_lv", "vip_lv_gray", ""];
	if (o.length)
	{
		for (var i=0; i<o.length; ++i)
		{
			o[i].className = vClass[iType];
			o[i].innerHTML = vHtml[iType].replace(/\$LV/g, iLevel);
		}
	}
	else if (o)
	{
		o.className = vClass[iType];
		o.innerHTML = vHtml[iType].replace(/\$LV/g, iLevel);
	}
}
function getXml(sUrl, fnCall, fnFail, type)
{
	var xmlReq = new XMLREQ(fnCall , fnFail);
	xmlReq.open(sUrl,type);
	return xmlReq;
};
function getQQSHOWXml(sUrl, fnSucc, fnFail, fnError)
{
	function fnCall(xmlReq)
	{
		var xmlDoc = xmlReq.responseXML;
		(xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("code")==0) ? (fnSucc ? fnSucc(xmlDoc) : null) : (fnFail ? fnFail(xmlDoc) : null);
	};
	return getXml(sUrl, fnCall, fnError,true);
};
function getQQSHOWSyncXml(sUrl, fnSucc, fnFail, fnError)
{
	function fnCall(xmlReq)
	{
		var xmlDoc = xmlReq.responseXML;
		(xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("code")==0) ? (fnSucc ? fnSucc(xmlDoc) : null) : (fnFail ? fnFail(xmlDoc) : null);
	};
	return getXml(sUrl, fnCall, fnError,false);
}
function replaceHtmlWithXml(xmlNode, sHtml, mapName, iAbsIndex, iRltIndex)
{
	var eData = {"@abs(I)":iAbsIndex && iAbsIndex.toString() || "0", "@rlt(I)":iRltIndex && iRltIndex.toString() || "0"};
	for (var i=0; i<mapName.length; ++i)
	{
		var vData = (mapName[i][0].constructor!=Array) ? (eData[mapName[i][0]]||xmlNode.getAttribute(mapName[i][0])) : ([].concat(mapName[i][0]).transform(function(v){ return (eData[v]||xmlNode.getAttribute(v)); }));
		sHtml = sHtml.replace(new RegExp(mapName[i][1].escRegexp(), "g"), (mapName[i][2] ? mapName[i][2](vData) : vData).toString().replace(/\$/g, "$$$$"));
	}
	return sHtml;
};
function showQQSHOWXmlNode(xmlDoc, oParent, xmlNodeName, sHtml, mapName, bi, ei, ne)
{
	var xmlNode = xmlDoc.getElementsByTagName(xmlNodeName);
	(!bi || bi<0) && (bi=0);
	(!ei || ei<0) && (ei=xmlNode.length);
	(!ne || ne<0) && (ne=1);
	var sHtmlHd = sHtml.between("<%--HD--%>", "<%--LB--%>");
	var sHtmlTl = sHtml.between("<%--LE--%>", "<%--TL--%>");
	var sHtmlLB = sHtml.between("<%--LB--%>", "<%--EB--%>");
	var sHtmlLE = sHtml.between("<%--EE--%>", "<%--LE--%>");
	var sHtmlEM = sHtml.between("<%--EB--%>", "<%--EE--%>");
	var aHtml = [];
	for (var i=bi; i<ei; i+=ne)
	{
		aHtml.push(sHtmlLB);
		for (var n=0; n<Math.min(ei-i, ne); ++n)
		{
			aHtml.push(replaceHtmlWithXml(xmlNode[i+n], sHtmlEM, mapName, i+n, i-bi+n));
		}
		aHtml.push(sHtmlLE);
	}
	oParent.innerHTML = sHtmlHd+aHtml.join("")+sHtmlTl;
};
function showQQSHOWXml(sUrl, oParent, xmlNodeName, sHtml, mapName, bi, ei, ne, fnSucc, fnFail, fnError)
{
	return getQQSHOWXml(sUrl, function(xmlDoc){ showQQSHOWXmlNode(xmlDoc, oParent, xmlNodeName, sHtml, mapName, bi, ei, ne); fnSucc&&fnSucc(xmlDoc); }, fnFail, fnError);
};
function replaceHtmlWithData(xData, sHtml, mapName, iAbsIndex, iRltIndex)
{
	var eData = {"@abs(I)":iAbsIndex && iAbsIndex.toString() || "0", "@rlt(I)":iRltIndex && iRltIndex.toString() || "0"};
	for (var i=0; i<mapName.length; ++i)
	{
		var vData = (mapName[i][0].constructor!=Array) ? (eData[mapName[i][0]]||xData[mapName[i][0]]) : ([].concat(mapName[i][0]).transform(function(v){ return (eData[v]||xData[v]); }));
		sHtml = sHtml.replace(new RegExp(mapName[i][1].escRegexp(), "g"), (mapName[i][2] ? mapName[i][2](vData) : vData).toString().replace(/\$/g, "$$$$"));
	}
	return sHtml;
};
function showQQSHOWData(xData, oParent, sHtml, mapName, bi, ei, ne, fnSucc)
{
	(!bi || bi<0) && (bi=0);
	(!ei || ei<0) && (ei=xData.length);
	(!ne || ne<0) && (ne=1);
	var sHtmlHd = sHtml.between("<%--HD--%>", "<%--LB--%>");
	var sHtmlTl = sHtml.between("<%--LE--%>", "<%--TL--%>");
	var sHtmlLB = sHtml.between("<%--LB--%>", "<%--EB--%>");
	var sHtmlLE = sHtml.between("<%--EE--%>", "<%--LE--%>");
	var sHtmlEM = sHtml.between("<%--EB--%>", "<%--EE--%>");
	var aHtml = [];
	for (var i=bi; i<ei; i+=ne)
	{
		aHtml.push(sHtmlLB);
		for (var n=0; n<Math.min(ei-i, ne); ++n)
		{
			aHtml.push(replaceHtmlWithData(xData[i+n], sHtmlEM, mapName, i+n, i-bi+n));
		}
		aHtml.push(sHtmlLE);
	}
	oParent.innerHTML = sHtmlHd+aHtml.join("")+sHtmlTl;
	if(fnSucc)fnSucc();
};
function styleQQSHOWPage(nIndex)
{
	this.linkHtml = function(u, t) { return t.toString().link(u); };
	this.activeHtml = function(u, t) { return '<a href="'+u.escMiniUrl().escHtmlEp()+'" class="em">'+t.toString().escHtml()+'</a>'; };
	this.separate = function() { return ('|'); };
	this.positionHtml = function(n, a) { return ('第'+n+'/'+a+'页 '); };
	this.randomHtml = function(u, a) { return (' 跳到<input type="text" id="page_no" name="page_no" class="page_no" size="3" maxlength="5" onkeydown="if(event.keyCode != 13) return;else {var v = parseInt(this.value,10);if((isNaN(v))||(v<=0||v>'+a+')) { alert(\'您输入的页码不正确。\'); } else { window.location=(\''+u('[@_pno]')+'\'.replace(/\\\[@_pno\\\]/g, Math.max(1, Math.min('+a+', parseInt(v))))); };void(0);}"/>页<a onclick="javascript:var v=parseInt(this.parentNode.getElementsByTagName(\'INPUT\')[0].value, 10);if((isNaN(v))||(v<=0||v>'+a+')) { alert(\'您输入的页码不正确。\'); } else { window.location=(\''+u('[@_pno]')+'\'.replace(/\\\[@_pno\\\]/g, Math.max(1, Math.min('+a+', parseInt(v))))); };void(0);" class="go_page"><img src="http://imgcache.qq.com/qqshow/v2_1/global/img/btn_go.gif" alt="GO" /></a>'); };
	this.prevHtml = function(u) { return (u ? "上一页".link(u) : "<a>上一页</a>"); };
	this.nextHtml = function(u) { return (u ? "下一页".link(u) : "<a>下一页</a>"); };
};
function showQQSHOWPage(pno, pall, fnUrl, oParent, nStyle ,thin)
{
	if(thin)
	{
		var iDisPage = thin;
	}else
	{
	  var iDisPage = pno < 10 ? 10 : (pno < 100 ? 8 : 6);
  }
	pno = parseInt(pno);
	pall = parseInt(pall);
	var oStyle = new styleQQSHOWPage(nStyle);
	var aHtml = [];
	aHtml.push(oStyle.prevHtml((pno>1) && fnUrl(pno-1)));
	var bi = Math.min(Math.max(pno - iDisPage / 2 , 1), Math.max(1, pall - iDisPage));
	var ei = Math.max(Math.min(pno + iDisPage / 2, pall), Math.min( bi + iDisPage, pall));
	while (bi <= ei)
	{
		aHtml.push(bi==pno ? oStyle.activeHtml(fnUrl(bi), bi++) : oStyle.linkHtml(fnUrl(bi), bi++));
	}
	aHtml.push(oStyle.nextHtml((pno<pall) && fnUrl(pno+1)));
	oParent.innerHTML = oStyle.positionHtml(pno, pall)+aHtml.join(oStyle.separate())+oStyle.randomHtml(fnUrl, pall);
};
function QQSHOW_CreateFlashObject(sHtml)
{
	document.write(sHtml);
};
function QQSHOW_setFlashObject(sHtml, oParent)
{
	oParent.innerHTML = sHtml;
};
function QQSHOW_avShow(sShow,iW,iH)
{
	var nStyle = (sShow.match(/V1#[MFU]_0_/) ? 0 : 1);
	var w = iW || [140, 186][nStyle];
	var h = iH || [226, 300][nStyle];
	var mapName = [["[@_W]", w], ["[@_H]", h], ["[@_SHOW]", escape(sShow)]];
	var sHtml = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,19,0" width="[@_W]" height="[@_H]">  <param name="movie" value="http://qqshow2-item.qq.com/1000000/53/02/" />  <param name="quality" value="high" />  <param name="flashvars" value="sItems=[@_SHOW]">  <param name="wmode" value="transparent">  <param name="allowScriptAccess" value="always" />  <embed src="http://qqshow2-item.qq.com/1000000/53/02/" flashvars="sItems=[@_SHOW]" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" allowScriptAccess="always" width="[@_W]" height="[@_H]"></embed></object>';
	for (var i=0; i<mapName.length; ++i)
	{
		sHtml = sHtml.replace(new RegExp(mapName[i][0].escRegexp(), "g"), mapName[i][1]);		
	}
	return sHtml;
};
function QQSHOW_photo(sShow , iW , iH)
{
	var nStyle = (sShow.match(/V1#[MFU]_0_/) ? 0 : 1);
	var w = iW ? iW : 280;
	var h = iH ? iH : 226;
	var mapName = [["[@_W]", w], ["[@_H]", h], ["[@_SHOW]", escape(sShow)]];
	var sHtml = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,19,0" width="[@_W]" height="[@_H]">  <param name="movie" value="http://qqshow2-item.qq.com/1000000/55/02/" />  <param name="quality" value="high" />  <param name="flashvars" value="sItems=[@_SHOW]&mode=0">  <param name="wmode" value="transparent">  <param name="allowScriptAccess" value="always" />  <embed src="http://qqshow2-item.qq.com/1000000/55/02/" flashvars="sItems=[@_SHOW]&mode=0" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" allowScriptAccess="always" width="[@_W]" height="[@_H]"></embed></object>';
	for (var i=0; i<mapName.length; ++i)
	{
		sHtml = sHtml.replace(new RegExp(mapName[i][0].escRegexp(), "g"), mapName[i][1]);
	}
	return sHtml;
};
function QQSHOW_firendListShow(itemNo , iW , iH)
{
	var w = iW ? iW : 280;
	var h = iH ? iH : 226;
	var mapName = [["[@_W]", w], ["[@_H]", h], ["[@_itemno]", escape(itemNo)]];
	var sHtml = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="[@_W]" height="[@_H]" id="mlist_flash" align="middle"> <param name="movie" value="/img/swf/qqshow_friendlist.swf" />       <param name="quality" value="best" />  <param name="flashvars" value="itemno=[@_itemno]"> <param name="wmode" value="transparent"> <param name="bgcolor" value="#ffffff" />  <param name="allowScriptAccess" value="always" /> <embed src="/img/swf/qqshow_friendlist.swf" flashvars="itemno=111" quality="high" bgcolor="#ffffff" width="500" height="350" name="mlist_club_qqshowurl" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" /> ';
	for (var i=0; i<mapName.length; ++i)
	{
		sHtml = sHtml.replace(new RegExp(mapName[i][0].escRegexp(), "g"), mapName[i][1]);
	}
	return sHtml;
};
function QQSHOW_commonFlash(swf, iW, iH, arrVar)
{
  var sVar="";
  if(typeof(arrVar)=="undefined")
    arrVar=[];
  if(arrVar.length>0)
  {
    sVar=arrVar.join('&');
  }
	var mapName = [["[@_W]", iW], ["[@_H]", iH], ["[@_swf]", swf], ["[@_var]", sVar]];
	var sHtml = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="[@_W]" height="[@_H]" id="mlist_flash" align="middle"> <param name="movie" value="[@_swf]" />       <param name="quality" value="best" />  <param name="wmode" value="transparent"> <param name="bgcolor" value="#ffffff" />  <param name="allowScriptAccess" value="always" /> <param name="flashvars" value="[@_var]"> <embed src="[@_swf]" quality="high" bgcolor="#ffffff" width="[@_W]" height="[@_H]" name="mlist_club_qqshowurl" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="[@_var]"/> ';
	for (var i=0; i<mapName.length; ++i)
	{
		sHtml = sHtml.replace(new RegExp(mapName[i][0].escRegexp(), "g"), mapName[i][1]);
	}
	return sHtml;
};
function QBPrice(nQPoint)
{
	var iPrice = parseInt(nQPoint ? nQPoint : "0", 10) || 0;	// set to 0 if invalid
	return (parseInt(iPrice/10) +"."+ parseInt(iPrice%10));
};
function GetUin()
{
	return (parseInt(getCookie('uin').match(/\d+/), 10) || 0);
};
function SEX(v)
{
	return (v=="M"||v=="m"||v==1) ? "M" : (v=="U"||v=="u"||v==0) ? "U" : "F"; 
};
function SEX_reverse(v)
{
	return SEX(v)=="F" ? "M" : "F";
};
function SexWord(v)
{
  return (SEX(v)=="M") ? "(男)" : (v=="F"?"(女)":"");
};
function LENFix(i, n)
{
	var sRet = i.toString();
	while (sRet.length < n)
	{
		sRet = "0"+sRet;
	}
	return sRet;
};
function isleapyear(y)
{
	return (y%4==0 && y%100!=0 || y%400==0);
};
function DAYOfMonth(y, m)
{
	return [31, isleapyear(y)?29:28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][m-1];
};
var QSCART_Name = "CART";
var QSCART_SND="CART_SND";
var QSVIPCART_Name = "CART_Free";
var SENDMSG_Name	=	"SndMsg";
function EQCartItem(_1, _2)
{
	return (_1[1]==_2[1] && _1[6]==_2[6]);
};
function EncodeCart(aSet)
{
	aSet[0] = !aSet[0] ? "" : aSet[0].toString().replace(/[#\|%]/g, function(a,b){return "%"+a.charCodeAt(0).toString(16);});
	aSet[7] = !aSet[7] ? "" : aSet[7].toString().replace(/[#\|%]/g, function(a,b){return "%"+a.charCodeAt(0).toString(16);});
	aSet[8] = !aSet[8] ? "" : aSet[8].toString().replace(/[#\|%]/g, function(a,b){return "%"+a.charCodeAt(0).toString(16);});
	return aSet.join("|");
};
function DecodeCart(sSet)
{
	var aSet = sSet.split("|");
	aSet[0] = unescape(aSet[0]);
	aSet[1] = parseInt(aSet[1]);
	aSet[2] = parseInt(aSet[2]);
	aSet[3] = parseInt(aSet[3]);
	aSet[4] = parseInt(aSet[4]);
	aSet[5] = parseInt(aSet[5]);
	aSet[6] = parseInt(aSet[6]);
	aSet[7] = unescape(aSet[7]);
	aSet[8] = unescape(aSet[8]);
	aSet[9] = unescape(aSet[9]);
	return aSet;
};
function CartString(aCart)
{
	return [].concat(aCart).transform(EncodeCart).join("#");
}
function CartVector(sCart)
{
	return sCart.split("#").transform(DecodeCart);
};
function saveCart(aCart)
{
    var oldCart = getCart();
    QSCookie(QSCART_Name, "", -1);//清空购物车
    var bRet = QSCookie(QSCART_Name, CartString(aCart));
    if(!bRet)
    {
        QSCookie(QSCART_Name, CartString(oldCart));
    }
	if(!bRet && !saveCart._alert && (saveCart._alert=true))
	{
		alert("对不起，您的购物车已满，请删除一些后继续购买。");
	}
	setHeaderCartNum();
	return bRet;
};
function saveSndCart(aCart)
{    
    QSCookie(QSCART_SND , "", -1);//清空购物车
    var bRet = QSCookie(QSCART_SND, CartString(aCart));    
		if(!bRet)
		{
			alert("对不起，您的购物车已满，请删除一些后继续购买。");
		}		
		return bRet;
};
function saveVipCart(aCart)
{
	QSCookie(QSVIPCART_Name, CartString(aCart));
	setHeaderCartNum();
};
function _saveCart(aCart, sName)
{
	if(sName==QSCART_Name)
		return saveCart(aCart);
	else if(sName==QSCART_SND)
		return saveSndCart(aCart);
	else if(sName==QSVIPCART_Name)
		return saveVipCart(aCart);		
}
function countCartNum()
{
	var aPrice = getCartPrice();
	return(aPrice[3]);
}
function _getCart(sName)
{
	var sCart = getCookie(sName);
	if (sCart){
		return CartVector(sCart);
	}
	return [];
}
function getCart()
{
	return _getCart(QSCART_Name);	
};
function getSndCart()
{
	return _getCart(QSCART_SND);	
};
function getVipCart()
{
	return _getCart(QSVIPCART_Name);	
};
function getMsgIndex(sMessage)
{
	var sSndMsg	=	getCookie(SENDMSG_Name);
	var aMsg	=	sSndMsg.split("|");
	if(sSndMsg.length == 0)
	{
		aMsg.length = 0;
	}
	for(var i=0; i<aMsg.length;i++)
	{
		if(aMsg[i] == sMessage)
			return i;
	}
	aMsg.push(sMessage);
	QSCookie(SENDMSG_Name, aMsg.join("|"));
	return aMsg.length-1;
};
function _setCart(aSet,sName)
{
	if(sName==QSVIPCART_Name)
	{
			var aCart = getVipCart();
			if (aCart.find_if(function(e){ return EQCartItem(e, aSet); })==null)
			{
				if(aCart.length >=20)
				{
					return false;
				}
				aCart.push(aSet);
				return saveVipCart(aCart);
			}
			return true;
	}
	else
	{
		var aCart = _getCart(sName);
		if (aCart.find_if(function(e){ return EQCartItem(e, aSet); })==null)
		{
			if(aCart.length >=20)
			{
				return false;
			}
			aSet[7]	=	getMsgIndex(aSet[7]);
			aCart.push(aSet);
			return _saveCart(aCart, sName);
		}
		return true;
	}
};
function setCart(aSet)
{
	return _setCart(aSet, QSCART_Name);	
};
function setSndCart(aSet)
{
	return _setCart(aSet,QSCART_SND);
};
function setVipCart(aSet)
{
	return _setCart(aSet,QSVIPCART_Name);
};
function _incCart(aSet,sName)
{
	var aCart = _getCart(sName);
	var afind = aCart.find_if(function(e){ return EQCartItem(e, aSet); });
	if (afind!=null)
	{
		aCart[afind][2] += aSet[2];
		if (aCart[afind][2] <= 0)
		{
			aCart.splice(afind, 1);
		}
		else if (aCart[afind][2] > 10 && sSet[2] > 0)
		{
			return true;
		}
		return _saveCart(aCart, sName);
	}
	else
	{
		if (aSet[2] <= 0)
		{
			return true;
		}
		return _setCart(aSet, sName);
	}
};
function incCart(aSet)
{
	return _incCart(aSet, QSCART_Name);
};
function incSndCart(aSet)
{
	return _incCart(aSet, QSCART_SND);
};
function incVipCart(aSet)
{
	return _incCart(aSet, QSVIPCART_Name);
};
function clsCart()
{
	saveCart([]);
};
function clsSndCart()
{
	saveSndCart([]);
};
function clsVipCart()
{
	saveVipCart([]);
};
function getCartPrice(aCart)
{
	var aCart = arguments[0] || getCart();
	var aPrice = [0, 0, aCart.length, 0];
	for (var i=0; i<aCart.length; ++i)
	{
		aPrice[0] += aCart[i][3]*aCart[i][2];
		aPrice[1] += aCart[i][4]*aCart[i][2];
		aPrice[3] += aCart[i][2];
	}
	return aPrice;
};
function getVipCartPriceInfo(aCart)
{
	var aCart = arguments[0] || getVipCart();
	var aPrice = [0, 0, aCart.length, 0];
	for (var i=0; i<aCart.length; ++i)
	{
		aPrice[0] += aCart[i][3]*aCart[i][2];
		aPrice[1] += aCart[i][4]*aCart[i][2];
		aPrice[3] += aCart[i][2];
	}
	return aPrice;
};
function updateHeaderInfo()
{
	if(top.topshow)
	{
		try{
			top.topshow.updateMsg();
		}catch(e){}
	}
};
function setHeaderCartNum()
{
	if(top.topshow)
	{
		if(top.topshow.document && top.topshow.document.getElementById("cart_num"))
		{
			var nlen = countCartNum();
			var sMessage = "";
			sMessage += nlen==0 ? "" : ("("+nlen+")");
			if(_MSIE())
			{
				top.topshow.document.getElementById("cart_num").innerHTML = sMessage;
			}
			else
			{
				top.topshow.document.getElementById("cart_num").textContent = sMessage;
			}
			updateHeaderInfo();
		}
		else
		{
			setTimeout(setHeaderCartNum, 1000);
		}
	}
};
function SelectAppendOption(oSelect, bi, ei, nlen)
{
	if (bi > ei)
	{
		for (var i=bi; i>=ei; --i)
		{
			oSelect.options[oSelect.options.length] = (new Option(LENFix(i, nlen), LENFix(i, nlen)));
		}
	}
	else
	{
		for (var i=bi; i<=ei; ++i)
		{
			oSelect.options[oSelect.options.length] = (new Option(LENFix(i, nlen), LENFix(i, nlen)));
		}
	}
};
function SelectYearOption(oSelect, bi, ei, nlen)
{
	return SelectAppendOption(oSelect, bi, ei, nlen);
};
function SelectMonthOption(oSelect, nlen)
{
	return SelectAppendOption(oSelect, 1, 12, 2);
};
function SelectDayOption(oSelect, y, m, nlen)
{
	return SelectAppendOption(oSelect, 1, DAYOfMonth(y, m), nlen);
};
function ShowUnsupport()
{
	if(top.shopshow)
		top.shopshow.FloatShow('/inc/note.html', 500, 198);
	else
		FloatShow('/inc/note.html', 500, 198);
}
function ShowLogin()
{
	var height=245,width=406,px=null,py=null;
	if(arguments[0])
	{
			width=arguments[0];
	}
	if(arguments[1])
	{
			height=arguments[1];
	}
	if(arguments[2])
	{		
			px=arguments[2];
	}
	else
	{
		if (_MSIE())
		{
				px=0;
		}
	}
	if(arguments[3])
	{
			py=arguments[3];
	}
	else
	{
		if (_MSIE())
		{
				py=-100;
		}
	}
	var sUrl	=	'/ini_login.aspx';	
	if(arguments[4])
	{
		sUrl=arguments[4];
	}
	if(top.shopshow)
	{
		if(!arguments[4])
		{
			if((top.shopshow.location.href.toString().indexOf("/inc/main.html") == -1) && (top.shopshow.location.href.toString().indexOf("/inc/main_c.html") == -1) && (top.shopshow.location.href.toString().indexOf("/inc/main_f.html") == -1))
			{
				sUrl	=	'/ini_login.aspx';
				sUrl	=	setURLParam(sUrl,"url",setURLParam("","/mainpage.htm",top.shopshow.location.href));
			}
		}
	    top.shopshow.FloatShow(sUrl, width, height, null, null, px, py);
	}
	else
	{  
			FloatShow(sUrl, width, height, null, null, px, py);
    } 		
};
var UIN_MIN	=	10000;
var	UIN_MAX	=	1999999999;
var UIN_BEGIN	=	10000;
var UIN_END	=	2000000000;
function ChkUin(uin)
{
	if (typeof(uin)=="number")
	{
		return (uin>=UIN_MIN && uin<=UIN_MAX) ? true : false;
	}
	if (!uin)
	{
		return false;
	}
	var sUin = uin.toString();
	return ( (/^\s*[123456789][\d]{4,8}\s*$/).test(sUin) || (/^\s*1[\d]{9}\s*$/).test(sUin) ) ? true : false;
};
function CheckLogin(iProcType, url, target)
{
	var iUin = GetUin();
	if(!ChkUin(iUin))
	{
		var loginUrl = "/inc/login_box.html";
		var loginUrlTop = "/inc/login_box.html";
		if(url && url.length >0)
		{
			if(target && target == "top") loginUrl = setURLParam(loginUrl, "url", url);
			else 
			{
				if((url.indexOf("/inc/main.html")!=-1)||(url.indexOf("/inc/main_c.html")!=-1)||(url.indexOf("/inc/main.html")!=-1))
					loginUrl = setURLParam(loginUrl,"url",setURLParam("http://show.qq.com","MUrl",url));
				else
					loginUrl = setURLParam(loginUrl,"url",setURLParam("http://show.qq.com/show.html","MUrl",url));
			}
			if(target && target == "top") loginUrlTop = setURLParam(loginUrlTop, "url", url);
			else 
			{
				if((url.indexOf("/inc/main.html")!=-1)||(url.indexOf("/inc/main_c.html")!=-1)||(url.indexOf("/inc/main.html")!=-1))
					loginUrlTop = setURLParam(loginUrlTop,"url",setURLParam("http://show.qq.com","MUrl",url));
				else
					loginUrlTop = setURLParam(loginUrlTop,"url",setURLParam("http://show.qq.com/show.html","MUrl",url));
			}
		}
		else if(top.shopshow)
		{
			if((top.shopshow.location.href.indexOf("/inc/main.html")!=-1)||(top.shopshow.location.href.indexOf("/inc/main_c.html")!=-1)||(top.shopshow.location.href.indexOf("/inc/main.html")!=-1))
				loginUrl = setURLParam(loginUrl,"url",setURLParam("http://show.qq.com","MUrl",top.shopshow.location.href));
			else
				loginUrl = setURLParam(loginUrl,"url",setURLParam("http://show.qq.com/show.html","MUrl",top.shopshow.location.href));
		}
		if (iProcType==1)
		{
			if(confirm("您还没有登录，是否登录？"))
			{
				if(top.shopshow && typeof(top.shopshow.ShowLogin) == "function") 
				{
				    top.shopshow.ShowLogin();
			    }
				else if(typeof(ShowLogin) == "function"){ShowLogin();}
				else location = loginUrlTop;	
				return false;
			}
		}
		else if(2 == iProcType)
		{
			if (confirm("您还没有登录，是否登录？"))
			{
				if(top.shopshow && typeof(top.shopshow.FloatShow) == "function") 
				{
				  if (_MSIE())
				  {
				    top.shopshow.FloatShow(loginUrl, 408, 360, null, function(){location = "/inc/main.html";}, 0, -100);
				  }else
				  {
				    top.shopshow.FloatShow(loginUrl, 408, 360, null, function(){location = "/inc/main.html";}, 0, 0);
				  }
			    }
				else if(typeof(FloatShow) == "function") FloatShow(loginUrl, 408, 360, null, null, 200, 0);
				else location = loginUrlTop;
				return false;
			}
			else 
			{
				if(top.shopshow) top.shopshow.location.href = '/inc/main.html';
				else location = "http://show.qq.com";
				return false;
			}
		}	
		else return false;
	}
	return iUin;
};
function QQShowCommREQError()
{
	alert("请求失败，请稍候再试。");
};
function QQShowCommXMLError(xmlDoc)
{
	var iCode = xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("code");
	var sMessage = xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("message");
	if (iCode==-1100 || iCode==-1003)
	{
		return alert("操作失败，请稍候再试。");
	}
	else if (iCode==-1001)
	{
		return !QQShowCommXMLError._onlogin && (QQShowCommXMLError._onlogin=true) && confirm("对不起，您还没登录，现在登录？") && (top.location.href="/login.html?url="+("http://show.qq.com/show.html?MUrl="+(top.shopshow||window).location.href.escUrl()).escUrl()) && 0;
	}
	else if (iCode==-1002)
	{
		return alert("您输入的参数有错，请重新输入，谢谢。");
	}
	else if (iCode==-1004)
	{
		return alert("对不起，您操作太频繁，请稍候再试。");
	}
	else if (iCode==-1005)
	{
		return alert("对不起，您还没注册QQ秀。");
	}
	else if(iCode == -1006)
	{
		return alert("对不起，您的好友还没有注册QQ秀！");
	}
	else if(iCode == -1007)
	{
		return alert("对不起，对方不是您的7天好友！");
	}
	else if(iCode == -1008)
	{
		return alert("对不起，您不是对方的7天好友！");
	}
	return true;
};
function goCartWithLocation()
{
	var sUrl = "/mall/inc/cart.html#pmSelect%3DACC";
	goToCart(sUrl);
};
function goToCartFromSave()
{
	var sUrl = "/mall/inc/cart.html#"+escape("saveav=1");
	goToCart(sUrl);
};
function goToCart(sUrl)
{
	var win = top.shopshow || window;
	if (win.location.href.indexOf("http://show.qq.com/mall/inc/cart.html")==0)
	{
		win.location.reload();
		return;
	}
	else if(win.location.href.indexOf("/mall/inc/cart.html")!=-1)
	{	 
		win.location.reload();
	}
	else
	{
		QSCookie("mallloc", win.location.href);				
		win.location = sUrl;
	}	
};
function goMallWithLocation()
{
	var win = top.shopshow || window;
	if ((getCookie("mallloc").length>0) && (getCookie("mallloc").indexOf("/my/inc") == -1))
	{
		win.location = getCookie("mallloc");
	}
	else
	{
	  if("function"==typeof(frameChange))
	  {
		  frameChange(201010000);
	  }
	}
};
function Buy(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom)
{
	if (CheckLogin(1))
	{
		if (iVipItem==1 && QUSER.getInfo("vip")!=1)
		{
			alert("您不是红钻用户，不能购买红钻物品["+sName+"]");
		}
		else
		{
			if(!setCart([sName, iNo, 1, iPrice, iPriceVip, 0, 0, "", vFrom ? vFrom.toString() : "", iVipItem]))
			{
				alert("您的购物车已满，请支付后继续购物。");
			}
			goCartWithLocation();
		}
	}
};
function ShowVipMonthPage(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom, iType)
{
	function OnOK(x)
	{
		XBuy(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom);
	};
	function OnCancel(x)
	{
	};
	if (top.shopshow && top.topshow)
	{
		if(iType&&iType==2)
		{
			if(top.shopshow.FloatShow)			
				top.shopshow.FloatShow("/mall/inc/buy_tips_box.html?itemType="+iVipItem , 555, 390, OnOK, OnCancel, 0, -100, top.shopshow, null);
		}		
		else
		{
			FloatShow("/mall/inc/buy_tips_box.html?itemType="+iVipItem , 555, 390, OnOK, OnCancel, 0, -100, top.shopshow, null);
		}
	}
	else
	{
		setTimeout("ShowVipMonthPage()", 1000);
	}
};
function RBuy(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom, iType)
{
	if (CheckLogin(1))
	{
		_pgvSendClick('ISD.QQShow.Buy.SingalBuy');
		if (QUSER.getInfo("vip") == 1 && iVipItem == 3)
		{
			if (getCookie("viprank").split("|")[1] >= 2)
			{
				ShowVipMonthPage(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom, iType);
				return;
			}else
			{
				XBuy(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom);
				return;
			}
		}
		if (QUSER.getInfo("vip") == 1 && iVipItem != 2)
		{
			ShowVipMonthPage(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom, iType);
			return;
		}else
		{
			XBuy(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom);
		}
	}
};
function Send(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom, iSpecial)
{
	if (CheckLogin(1))
	{
		if (iVipItem==1 && QUSER.getInfo("vip")!=1)
		{
			alert("您不是红钻用户，不能赠送红钻物品["+sName+"]");
			return;
		}
		else
		{
			function OnOK(x)
			{
				var _Prm = new PARAM(x, "&", "=");
				setCart(DecodeCart(_Prm["info"]));
				alert("成功支付后自动赠送!");
				goCartWithLocation();
			};
			var aParam = [sName, iNo, 1, iPrice, iPriceVip, iVipItem, 0, "", vFrom ? vFrom.toString() : "",iVipItem];
			if (iSpecial && iSpecial == 1)
			{
				FloatShow("/mall/inc/don.html?info="+EncodeCart(aParam).escUrl(), 404, 304, OnOK,null,50,-10);
			}
			else if(iSpecial && iSpecial==2 && top && top.shopshow)
			{				
				if(top.shopshow.FloatShow)
						top.shopshow.FloatShow("/mall/inc/don.html?info="+EncodeCart(aParam).escUrl(), 404, 304, OnOK);																														
			}
			else
			{
				FloatShow("/mall/inc/don.html?info="+EncodeCart(aParam).escUrl(), 404, 304, OnOK);
			}
		}
	}
};
function Ask(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom, iSpecial)
{
	if (CheckLogin(1))
	{
		if (iVipItem==1 && QUSER.getInfo("vip")!=1)
		{
			alert("您不是红钻用户，不能索要红钻物品["+sName+"]");
		}
		else
		{
			var aParam = [sName, iNo, 1, iPrice, iPriceVip, iVipItem, 0, "", vFrom ? vFrom.toString() : "", iVipItem];
			if (iSpecial && iSpecial == 1)
			{
				FloatShow("/mall/inc/req.html?info="+EncodeCart(aParam).escUrl(), 404, 304, null,null,50,-10);
			}
			else if(iSpecial && iSpecial==2 && top && top.shopshow)
			{				
				if(top.shopshow.FloatShow)
					top.shopshow.FloatShow("/mall/inc/req.html?info="+EncodeCart(aParam).escUrl(), 404, 304);
			}
			else
			{
				FloatShow("/mall/inc/req.html?info="+EncodeCart(aParam).escUrl(), 404, 304);
			}
		}
	}
};
function AskMul(aCart)
{
	if (CheckLogin(1))
	{
		if (QUSER.getInfo("vip")!=1 && aCart.find_if(function(v){ return (v[5]!=0); })!=null)
		{
			alert("您不是红钻用户不能购买红钻物品["+sName+"]");
		}
		else
		{
			FloatShow("/mall/inc/req.html?info="+CartString(aCart).escUrl(), 500, 225+aCart.length*27)
		}
	}
};
function XBuy(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom)
{
	if (DSAsystem.DSAdata[0]==0)
	{
		return Buy(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom);
	}
	if (CheckLogin(1))
	{
		if (iVipItem==1 && QUSER.getInfo("vip")!=1)
		{
			alert("您不是红钻用户，不能购买红钻物品["+sName+"]");
		}
		else
		{
			DSABuy([sName, iNo, 1, Math.round(iPrice*DSAsystem._ComDsc/100), Math.round(iPriceVip*DSAsystem._VipDsc/100), 0, 0, "", vFrom ? vFrom.toString() : ""], [sName, iNo, 1, iPrice, iPriceVip, 0, 0, "", vFrom ? vFrom.toString() : ""]);
		}
	}
};
function XSend(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom)
{
	if (DSAsystem.DSAdata[0]==0)
	{
		return Send(sName, iNo, iPrice, iPriceVip, iVipItem, vFrom);
	}
	if (CheckLogin(1))
	{
		if (iVipItem==1 && QUSER.getInfo("vip")!=1)
		{
			return alert("您不是红钻用户，不能赠送红钻物品["+sName+"]");
		}
		else
		{
			function OnOK(x)
			{
				var _Prm = new PARAM(x, "&", "=");
				DSABuy(DecodeCart(_Prm["info"]), [sName, iNo, 1, iPrice, iPriceVip, 0, 0, "", vFrom ? vFrom.toString() : ""]);
			};
			var aParam = [sName, iNo, 1, Math.round(iPrice*DSAsystem._ComDsc/100), Math.round(iPriceVip*DSAsystem._VipDsc/100), iVipItem, 0, "", vFrom ? vFrom.toString() : ""];
			FloatShow("/mall/inc/don.html?info="+EncodeCart(aParam).escUrl(), 404, 304, OnOK);
		}
	}
};
function DSAsystem()
{
	if (window.__DSA__data__)
	{
		var vData = window.__DSA__data__.split("#");
		for (var i=0; i<vData.length; ++i)
		{
			xData = vData[i].split("|");
			if (xData[0]==mallMenu[getURLParam("mallno")][0])
			{
				DSAsystem.DSAdata = xData;
				DSAsystem._ComDsc = DSAsystem._VipDsc = parseInt(xData[3]);
				break;
			}
		}
	}
}
DSAsystem._ComDsc = 100;
DSAsystem._VipDsc = 100;
DSAsystem.DSAdata = [0, 0, 0, 100];
function TomorrowDiscount()
{
 return ({"10":20, "20":30, "30":40, "40":50, "50":60, "60":70, "70": 10}[DSAsystem._ComDsc] || 100);
}
function DSABuy(aCart, aCart0)
{
	var aPrice = getCartPrice([aCart]);
	var iPrice = QUSER.getInfo("vip")==1 ? aPrice[1] : aPrice[0];
	var aPrice0 = getCartPrice([aCart0]);
	var iPrice0 = QUSER.getInfo("vip")==1 ? aPrice0[1] : aPrice0[0];
	if (!confirm("您将支付"+QBPrice(iPrice)+"Q币购买“"+aCart[0]+"”，由于折扣购买，此次共为您节省了"+QBPrice(iPrice0-iPrice)+"Q币，是否购买？"))
	{
		return;
	}
	function onSucc(xmlDoc)
	{
		function GETv(sName)
		{
			return xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute(sName);
		}
		QSCookie("mallloc", window.location.href);
		window.location.href = setURLParam(setURLParam(setURLParam("/mall/inc/sys_suc.html", "type", 2), "message", ACCTPAYSuccMessage(GETv("itembuy"), GETv("itemnobuy"), GETv("priceacc"), GETv("priceqpoint"), GETv("pricegwq"), GETv("message"))), "itemno", CartVector(GETv("itembuy"))[0][1]);
	}
	function onFail(xmlDoc)
	{
		if (QQShowCommXMLError(xmlDoc))
		{
			var iRetCode = xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("code");
			var sMessage = xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("message");
			if(sMessage.indexOf("余额不足")!=-1 || sMessage.indexOf("帐户不存在")!=-1 || sMessage.indexOf("余额都不足")!=-1 ||sMessage.indexOf("尚未开通")!=-1||sMessage.indexOf("尚未开户")!=-1)
			{
				sMessage = "您的账户余额不足，无法支付本次费用："+QBPrice(QUSER.getInfo("vip")==1 ? aPrice[1] : aPrice[0])+" Q币，请充值或查看帐户是否开通。";
			}
			window.location = setURLParam(setURLParam("/mall/inc/sys_fail.html", "type", 2), "message", sMessage);
		}
	}
	function onError()
	{
		alert("操作失败");
	}
	getQQSHOWXml("http://show.qq.com/cgi-bin/qqshow_pay_acct?APPLICATION=DSA&LOGIN="+GetUin()+"&mallno="+DSAsystem.DSAdata[0]+"&paymethod=2&CARTTYPE=1&CART="+CartString([aCart]).escUrl(), onSucc, onFail, onError);
};
function DSAInit()
{
	if (DSAsystem.DSAdata[0]!=0)
	{
		document.getElementById("ID_discount_today").innerHTML = (DSAsystem._ComDsc/10);
		document.getElementById("ID_discount_tomorrow").innerHTML = (TomorrowDiscount(DSAsystem._ComDsc)/10);
		document.getElementById("banner_760_148").style.display = "";
		document.getElementById("note").style.display = "";
	}
}
function ItemCollectionAdd(ino)
{
	function onResp(xmlDoc)
	{
		MaskEnd([top.shopshow, top.qqshow, top.topshow]);
		if (QQShowCommXMLError(xmlDoc))
		{
		    var node = xmlDoc.getElementsByTagName("QQSHOW")[0] ; 
			var iCode = xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("code");
			var mapCodeMessage = {
				"-1" : "收藏物品号无效",
				"-10": "该物品已经在收藏中"
			};
			if (iCode == 0)
			{
				 try{ top.shopshow.FloatShow('/mall/inc/alert_light_rb_collect.html', 506, 216, null , null, 40, -50); }catch(e){alert("收藏成功");} ; 
			}
			else if (mapCodeMessage[iCode])
			{
				alert("操作失败["+mapCodeMessage[iCode]+"]");
			}
			else
			{
				alert("操作失败"+DebugMessage(iCode));
			}
		}
	};
	function onError()
	{
		MaskEnd([top.shopshow, top.qqshow, top.topshow]);
		alert("操作失败");
	};
	if(CheckLogin(1))
	{
		MaskStart([top.shopshow,top.qqshow, top.topshow]);
		getQQSHOWXml("http://show.qq.com/cgi-bin/qqshow_user_itemcollection_add?item="+ino, onResp, onResp, onError);
	}
};
function ItemCollectionDel(ino, fnCallBack)
{
	if (!confirm("确定删除吗？"))
	{
		return;
	}
	function onResp(xmlDoc)
	{
		setTimeout("MaskEnd([top.shopshow, top.qqshow, top.topshow])", 1000);
		var iCode = xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("code");
		if (iCode == 0)
		{
		}
		else if (QQShowCommXMLError(xmlDoc))
		{
			alert("操作失败");
		}
		fnCallBack && fnCallBack(xmlDoc);
	};
	function onError()
	{
		setTimeout("MaskEnd([top.shopshow, top.qqshow, top.topshow])", 1000);
		alert("操作失败");
	};
	if(CheckLogin(1))
	{
		MaskStart([top.shopshow, top.qqshow, top.topshow]);
		getQQSHOWXml("http://show.qq.com/cgi-bin/qqshow_user_itemcollection_del?item="+ino, onResp, onResp, onError);
	}
};
function ShowCollectionAdd(vData, fnCallBack)
{
	function onResp(xmlDoc)
	{
		MaskEnd([top.shopshow, top.qqshow, top.topshow]);
		if (QQShowCommXMLError(xmlDoc))
		{
		    var node = xmlDoc.getElementsByTagName("QQSHOW")[0] ; 
			var iCode = node.getAttribute("code");
			var sName = node.getAttribute("itemname");
			var mapCodeMessage = {
				"-20":"当前形象中有游戏秀物品，不能收藏",
				"-23": "原始形象不能收藏",
				"-25": "整套收藏时，身上物品不能超过20件，请您删除为20件以下再进行收藏。",
				"-26": "当前形象内"+(sName?"的物品["+sName+"]":"有")+"与您的形象性别不一致，请脱下后再收藏。",
				"-27": "当前形象内"+(sName?"的物品["+sName+"]":"有")+"与您的形象风格不一致，请脱下后再收藏。"
			};
			if (iCode == 0)
			{
				try{ top.shopshow.FloatShow('/mall/inc/alert_light_rb_collect.html?show='+ (hasface>0 ? 2: 1) , 506, 216+(hasface>0 ? 40: 0), null , null, 0, 0); }catch(e){alert("收藏成功");} ; 	   
				fnCallBack && fnCallBack(0);
			}
			else if (mapCodeMessage[iCode])
			{
				alert("操作失败["+mapCodeMessage[iCode]+"]");
				fnCallBack && fnCallBack(-1);
			}
			else
			{
				alert("操作失败"+DebugMessage(iCode));
				fnCallBack && fnCallBack(-1);
			}
		}
	};
	function onError()
	{
		MaskEnd([top.shopshow, top.qqshow, top.topshow]);
		alert("操作失败");
		fnCallBack && fnCallBack(-1);
	};
	if (arguments[0][0].length==0)
	{
		return alert("参数错误");
	}
	var sShow = arguments[0][0];
	var hasface = SpecTypeItemCount(sShow, 102);
	if(hasface > 0)
	{
		sShow = ChangeShowface(sShow, 1);
	}
	var sName = arguments[0][1] || "我的收藏";
	var sTags = arguments[0][2] || "";
	var sDesc = arguments[0][3] || "";
	var iType = arguments[0][4] || 0;
	var sUrl = setURLParam("http://show.qq.com/cgi-bin/qqshow_user_showcollection_add", "show", huffcompress(sShow));
	sUrl = setURLParam(sUrl, "name", sName);
	sUrl = setURLParam(sUrl, "tags", sTags);
	sUrl = setURLParam(sUrl, "desc", sDesc);
	sUrl = setURLParam(sUrl, "type", iType);
	MaskStart([top.shopshow, top.qqshow, top.topshow]);
	getQQSHOWXml(sUrl, onResp, onResp, onError);
};
function ShowCollectionSet(vData, fnCallBack, vWndMask)
{
	vWndMask || (vWndMask = [top.shopshow, top.qqshow, top.topshow]);
	function onResp(xmlDoc)
	{
		setTimeout(function(){ MaskEnd(vWndMask); }, 1000);
		if (QQShowCommXMLError(xmlDoc))
		{
			var iCode = xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("code");
			var mapCodeMessage = {
				"-11": "作品名称中含有不能发表的内容",
				"-12": "作品名称不能为空",
				"-13": "作品描述中含有不能发表的内容",
				"-14": "标签中含有不能发表的内容"
			};
			if (iCode == 0)
			{
				alert("保存成功");
				fnCallBack && fnCallBack(0);
			}
			else if (mapCodeMessage[iCode])
			{
				alert("操作失败["+mapCodeMessage[iCode]+"]");
				fnCallBack && fnCallBack(-1);
			}
			else
			{
				alert("操作失败"+DebugMessage(iCode));
				fnCallBack && fnCallBack(-1);
			}
		}
	};
	function onError()
	{
		setTimeout(function(){ MaskEnd(vWndMask); }, 1000);
		alert("操作失败");
		fnCallBack && fnCallBack(-1);
	};
	if(CheckLogin(1))
	{
		if (!(arguments[0][0]>=0))
		{
			return alert("参数错误");
			fnCallBack && fnCallBack(-1);
		}
		var iID = arguments[0][0];
		var sName = arguments[0][1] || "我的收藏";
		var sTags = arguments[0][2] || "";
		var sDesc = arguments[0][3] || "";
		var iType = arguments[0][4] || 0;
		var sUrl = setURLParam("http://show.qq.com/cgi-bin/qqshow_user_showcollection_set", "id", iID);
		sUrl = setURLParam(sUrl, "name", sName);
		sUrl = setURLParam(sUrl, "tags", sTags);
		sUrl = setURLParam(sUrl, "desc", sDesc);
		sUrl = setURLParam(sUrl, "type", iType);
		MaskStart(vWndMask);
		getQQSHOWXml(sUrl, onResp, onResp, onError);
	}
};
function ShowCollectionDel(iID, fnCallBack)
{
	if (!confirm("确定删除吗？"))
	{
		return;
	}
	function onResp(xmlDoc)
	{
		setTimeout("MaskEnd([top.shopshow, top.qqshow, top.topshow])", 1000);
		var iCode = xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("code");
		if (iCode == 0)
		{
		}
		else if (QQShowCommXMLError(xmlDoc))
		{
			alert("操作失败");
		}
		fnCallBack && fnCallBack(xmlDoc);
	};
	function onError()
	{
		setTimeout("MaskEnd([top.shopshow, top.qqshow, top.topshow])", 1000);
		alert("操作失败");
	};
	if(CheckLogin(1))
	{
		MaskStart([top.shopshow, top.qqshow, top.topshow]);
		getQQSHOWXml("http://show.qq.com/cgi-bin/qqshow_user_showcollection_del?id="+iID, onResp, onResp, onError);
	}
};
function ShowCollectionPrepare()
{
if(CheckLogin(1))
	{
		var oQSAV = document.getElementById(g_sAVId).cQSAV;
		var sItemSn = oQSAV.ToItemSn(0, 0, 0);
		if(SpecTypeItemCount(sItemSn, 101) > 0){
			alert("形象中包含游戏秀物品不能收藏");			
			return;
		}
		if(SpecTypeItemCount(sItemSn, 103) > 0)
		{
			alert("形象中包含相片秀物品不能收藏");			
			return;
		}		
		var facecount = SpecTypeItemCount(sItemSn,102);
		var count = SpecTypeItemCount(sItemSn,3) + SpecTypeItemCount(sItemSn,4) + facecount;
		var itemNum = oQSAV.ItemCount();
		var itemNum = itemNum - count;
		if(itemNum == 0)
		{
			if (facecount != 0)
			{
				return alert("您收藏的形象中仅有真脸头像，不能进行收藏。请选择其他QQ秀衣服再试。");
			}
			else
			{
				return alert("原始形象不可以收藏哦。");
			}
		}
		else  if(itemNum > 20)
		{
			alert("身上物品超过了20件，请您删除一些再收藏。");return;
		}
	    var sItemSn = top.qqshow.document.getElementById("myavatar").cQSAV.ToItemSn(0, 0, 0);
		sItemSn = filterForSpecItem(sItemSn,3);
		sItemSn = filterForSpecItem(sItemSn,4);
	    ShowCollectionAdd([sItemSn, "我的收藏", "", "", 0]);
	}
};
function PutOn(iItemNo, chSex, sPlyNo, iFStl, bPoseBind, iDefX, iDefY, bMov, bRot, bSelc, bSpecail, sText, sMallNo)
{
	top.qqshow && top.qqshow.ShopTryItem && top.qqshow.ShopTryItem(iItemNo, chSex, sPlyNo, iFStl, bPoseBind, iDefX, iDefY, bMov, bRot, bSelc, bSpecail, sText, sMallNo);
};
function PutOnShow(sShow, sFrom)
{
	top.qqshow && top.qqshow.TryOnShow && top.qqshow.TryOnShow(sShow, sFrom);
};
function ReturnMallNo()
{
	if(getHashParam("mallno").length > 0) return getHashParam("mallno");
	else if(top.g_iMallNo) return top.g_iMallNo;
	else return 0;
}
function DivCreate(oWin, oParent, sID, zIndex, iLeft, iTop, sWidth, sHeight, sDisplay)
{
	if (oWin && oWin.document && !oWin.document.getElementById(sID))
	{
		var e = oWin.document.createElement("DIV");
		e.id = sID;
		e.style.position = "absolute";
		e.style.zIndex = zIndex;
		e.style.left = iLeft;
		e.style.top = iTop;
		e.style.width = sWidth;
		e.style.height = sHeight;
		e.style.display = sDisplay;
		try{ oParent && oParent.appendChild(e); } catch(e) { }
		return e;
	}
	if (oWin.document.getElementById(sID)) return oWin.document.getElementById(sID);
	else return null;
};
function PageMaskCreate(oWin)
{
	if(oWin && oWin.document)
	{
		if (!oWin.document.getElementById("ID_QQSHOW_WAIT_BACKGND"))
		{
			var ebg = DivCreate(oWin, oWin.document.body, "ID_QQSHOW_WAIT_BACKGND", 65529, 0, 0, "100%", "100%", "none");
			ebg.style.backgroundColor = "#0000FF";
			ebg.style.opacity = 0.35;
			ebg.style.filter = "alpha(opacity=35)";
		}
		return oWin.document.getElementById("ID_QQSHOW_WAIT_BACKGND");
	}
	else return null;
};
function ProcessCreate(oWin)
{
	if(oWin && oWin.document && oWin.document.body)
	{
		if (!oWin.document.getElementById("ID_QQSHOW_WAIT_PROCESS"))
		{
			var epr = DivCreate(oWin, oWin.document.body, "ID_QQSHOW_WAIT_PROCESS", 65530, 0, 0, "100%", "100%", "none");
			epr.innerHTML = '<table width="100%" height="200" border="0"><tr><td>&nbsp;</td><td width="308" valign="bottom"><div style="width:308px;height:54px;"><span style="display:block;float:left;width:58px;height:54px;background:url(http://imgcache.qq.com/qqshow/v2/img/loading_bg_l.gif);"></span><span style="display:block;float:left;width:250px;height:54px;background:url(http://imgcache.qq.com/qqshow/v2/img/loading_bg_m.gif);line-height:54px;color:#fff;text-indent:10px;font-size:12px;font-weight:bold;">处理中，请稍候...</span></div></td><td>&nbsp;</td></tr></table>';
		}
		return oWin.document.getElementById("ID_QQSHOW_WAIT_PROCESS");
	}
	else return null;
};
function PageMaskShow(oWin)
{
	var e = PageMaskCreate(oWin);
	if(e)
	{
		e.style.height = Math.max((oWin.document.body.offsetHeight), oWin.document.documentElement.clientHeight)+"px";
		e.style.display = "block";
	}
};
function ProcessShow(oWin, lTxt)
{
	var e = ProcessCreate(oWin);
	if(!lTxt) lTxt = ["处理中，请稍候..."];
	if(e && oWin.document.body)
	{
		(lTxt) && (e.getElementsByTagName("SPAN")[1].innerHTML = lTxt[0]);
		e.style.height = (oWin.document.body.offsetHeight)+"px";
		e.getElementsByTagName("TABLE")[0].height = Math.max(Math.min(oWin.document.documentElement.scrollTop+150, 	oWin.document.body.offsetHeight-100), 100);
		e.style.display = "block";
	}
};
function PageMaskHide(oWin)
{
	var e = PageMaskCreate(oWin);
	e.style.display = "none";
};
function ProcessHide(oWin)
{
	var e = ProcessCreate(oWin);
	e.style.display = "none";
};
function MaskStart(lWin)
{
	for (var i=0; i<arguments[0].length; ++i)
	{
		try{ PageMaskShow(arguments[0][i]); } catch(e) { }
	}
};
function MaskEnd(lWin)
{
	for (var i=0; i<arguments[0].length; ++i)
	{
		try{ PageMaskHide(arguments[0][i]); } catch(e) { }
	}
};
function WaitStart(lWin, lTxt, bTxt)
{
	for (var i=0; i<arguments[0].length; ++i)
	{
		if(arguments[0][i])
		{
			PageMaskShow(arguments[0][i]);
		}
	}
	if(arguments[0][0] && !bTxt) ProcessShow(arguments[0][0], lTxt);
};
function WaitEnd(lWin)
{
	for (var i=0; i<arguments[0].length; ++i)
	{
		try{ PageMaskHide(arguments[0][i]);} catch(e){ }
	}
	try{ ProcessHide(arguments[0][0]); } catch(e) { }
};
function FloatShow(sUrl, iWidth, iHeight, OnOK, OnCancel, iLeft, iTop, oWin, fras, zIndex)
{
	var izIndex = zIndex?zIndex:65530;
	oWin = oWin || window;
	iLeft = typeof(iLeft)=="number" ? iLeft : 75;
	iTop = typeof(iTop)=="number" ? iTop : 45;
	var ifras = null;
	if (typeof(fras) != "undefined" && fras != null && fras != "null")
	{
	  ifras = fras;
	}else
	{
		ifras = [window, top.shopshow, top.qqshow, top.topshow];
	}
	FloatShow.Show = function(sUrl, iWidth, iHeight, iLeft, iTop)
	{
		//MaskStart(ifras);
	    Show_LoadBar();
		MaskBgDIV();
		var e = DivCreate(oWin, oWin.document.body, "ID_QQSHOW_FLOAT_WIN", izIndex, 0, 50, "100%", "1", "none");
		if(e && "object" == typeof(e) && "div" == e.tagName.toString().toLowerCase())
		{
		e.style.top = (Math.max(Math.min(oWin.document.documentElement.scrollTop+100, Math.max(oWin.document.body.offsetHeight-100,100)), 50))+"px";
		e.innerHTML = '<table id="w_head" align="center" style="position:absolute;left:'+iLeft+'px;top:'+iTop+'px;"><tr><td align="center"><iframe allowtransparency=true id="ID_QQSHOW_FLOAT_IFRAME" name="ID_QQSHOW_FLOAT_IFRAME" width="'+iWidth+'" height="'+iHeight+'" frameborder="0" scrolling="no"></iframe></td></tr></table><div id="d_border" style="display:none;border:1px dotted #000000; position:absolute;"></div>';
		e.getElementsByTagName("IFRAME")[0].src = sUrl;
		e.style.display = "block";
		document.getElementById("ID_QQSHOW_FLOAT_Load").style.display="none";
		//window_drag("ID_QQSHOW_FLOAT_WIN");
		}
		
		else throw "create div failed ";
	};
	FloatShow.Hide = function()
	{
	  MaskEnd([window, top.shopshow, top.qqshow, top.topshow]);
		if (arguments[0])
		{
		  var fra = arguments[0];
		  if (fra && fra.document)
		  {
		    if(fra.document.getElementById("ID_QQSHOW_FLOAT_WIN"))
				fra.document.getElementById("ID_QQSHOW_FLOAT_WIN").style.display = "none";	
		  }
		}else
		{
			if(document.getElementById("ID_QQSHOW_FLOAT_WIN"))
				document.getElementById("ID_QQSHOW_FLOAT_WIN").style.display = "none";	
		}
	};
	FloatShow.DireOnCancel = function()
	{
		OnCancel && OnCancel(arguments[0]);
	};
	FloatShow.OnOK = function()
	{
		FloatShow.Hide();
		OnOK && OnOK(arguments[0]);
	};
	FloatShow.OnCancel = function()
	{
		FloatShow.Hide();
		OnCancel && OnCancel(arguments[0]);
	};
	FloatShow.AutoSize = function()
	{
		try
		{
			function FindIFrame(sName) { for (var i=0; i<window.frames.length; ++i) { if (window.frames[i].name==sName) { return window.frames[i]; } } return null; };
			var e = document.getElementById("ID_QQSHOW_FLOAT_IFRAME");
			var w = _MSIE() ? window.frames["ID_QQSHOW_FLOAT_IFRAME"] : FindIFrame("ID_QQSHOW_FLOAT_IFRAME");
			if ((w.document.documentElement.scrollTop=500) && (w.document.documentElement.scrollTop!=0))
			{
				e.height = parseInt(e.height)+w.document.documentElement.scrollTop+"px";
				w.document.documentElement.scrollTop = 0;
			}
			if ((w.document.documentElement.scrollLeft=500) && (w.document.documentElement.scrollLeft!=0))
			{
				e.width = parseInt(e.width)+w.document.documentElement.scrollLeft+"px";
				w.document.documentElement.scrollLeft = 0;
			}
		}
		catch(e)
		{
		}
	};
	FloatShow.Show(sUrl, iWidth, iHeight, iLeft, iTop);
};
function RBuyAll(show,from,iType){
	if (CheckLogin(1)){
		if(!iType){
			_pgvSendClick('ISD.QQShow.Buy.MultiBuy1');
		}
		else if(parseInt(iType)==1){//整套详情
			_pgvSendClick('ISD.QQShow.Buy.MultiBuy2');
		}
		if (QUSER.getInfo("vip") == 1)
		{
			ShowVipMonthPageAll(show,from);
			return;
		}else
		{
			BuyAll(show,from);
		}
	}
};
function ShowVipMonthPageAll(show,from)
{
	function OnOK(x)
	{
		BuyAll(show,from);
	};
	function OnCancel(x)
	{
	};
	if (top.shopshow && top.topshow)
	{
		FloatShow("/mall/inc/buy_tips_box.html", 555, 390, OnOK, OnCancel, 0, -100, top.shopshow, null);
	}
	else
	{
		FloatShow("/mall/inc/buy_tips_box.html", 555, 390, OnOK, OnCancel, 0, -100, window, null);
	}
};
function BuyAll(show, from)
{
	show = filterForSpecItem(show,3);
	show = filterForSpecItem(show,4);
	if(CheckLogin(1))
	{
		if (top.qqshow)
		{
		var arrObj = top.qqshow.GetItemInfArr(show);
	  }
	  else
		{
	    var arrObj = GetItemInfArr(show);
	  }
		var sItemNo = "";
		for(var i = 0; i<arrObj.length; i++)
		{
			if(sItemNo.length > 0) sItemNo += "|";
			sItemNo += arrObj[i]._iItemNo;  
		}
		var sUrl = "/cgi-bin/qqshow_item_info?item="+sItemNo.escUrl();
		function fnSucc(xmlDoc)
		{
			var aItemXml = xmlDoc.getElementsByTagName("node");
			for(var i=0;i<aItemXml.length;i++)					 
			{
			  setCart([aItemXml[i].getAttribute("iname"),aItemXml[i].getAttribute("ino"),1,aItemXml[i].getAttribute("ipriceori"),aItemXml[i].getAttribute("ipricevip"),0, 0, "",from.length>0?from:"", aItemXml[i].getAttribute("itype")]);
			}
			goCartWithLocation();
		}
		function fnFail(xmlDoc)
		{
            var sMessage = xmlDoc.getElementsByTagName("QQSHOW")[0].getAttribute("message");
			if (sMessage == "")
			{
			  sMessage = "获取物品详情失败";
			}
			alert(sMessage);
			return;
		}
		function fnError()
		{
			alert("对不起，系统繁忙，请稍后再试。");
			return;
		}
		getQQSHOWXml(sUrl, fnSucc, QQShowCommXMLError&&fnFail, fnError);
	}
}
function sendAll(i)
{
	var n = i || 0;
	if (CheckLogin(1))
	{
		var oQSAV = document.getElementById(g_sAVId).cQSAV;
		var sItemSn = oQSAV.ToItemSn(0, 0, 0);
		if(SpecTypeItemCount(sItemSn, 101) > 0){
			alert("形象中包含游戏秀物品不能赠送");
			return;
		}
		if(SpecTypeItemCount(sItemSn, 103) > 0){
			alert("形象中包含相片秀物品不能赠送");
			return;
		}
		var facecount = SpecTypeItemCount(sItemSn,102);
		var count = SpecTypeItemCount(sItemSn,3) + SpecTypeItemCount(sItemSn,4) + facecount;
		var itemNum = oQSAV.ItemCount();
		itemNum = itemNum - count;
		if(itemNum == 0) 
		{
			if (facecount != 0)
			{
				return alert("您选择的形象中仅有真脸头像，不能进行赠送。请选择其他QQ秀再试。");
			}
			else
			{
				return alert("您的身上没有任何物品，请添加物品之后赠送");
			}
		}
		else if(itemNum > 20)
		{
			return alert("对不起，单次赠送物品数量不能超过20件。");
		}
		if (top.shopshow && "function"==typeof(top.shopshow.FloatShow))
		{
			top.shopshow.FloatShow("http://show.qq.com/mall/inc/don_mul.html", 434, 346, null, null, 0, -100);
		}
		else if(n == 0)
		{
			top.shopshow.location.href = "/inc/main.html";
			setTimeout(function(){sendAll(n+1)}, 400);
		}
		else if(n < 10)
		{
			setTimeout(function(){sendAll(n+1)}, 400);
		}
	}
};
function askAll(i)
{
	var n = i || 0;
	if (CheckLogin(1))
	{
		var oQSAV = document.getElementById(g_sAVId).cQSAV;
		var sItemSn = oQSAV.ToItemSn(0, 0, 0);
		if(SpecTypeItemCount(sItemSn, 101) > 0){
			alert("形象中包含游戏秀物品不能索要");
			return;
		}
		if(SpecTypeItemCount(sItemSn, 103) > 0)
		{
			alert("形象中包含相片秀物品不能索要");
			return;
		}
		var facecount = SpecTypeItemCount(sItemSn,102);
		var count = SpecTypeItemCount(sItemSn,3) + SpecTypeItemCount(sItemSn,4) + facecount;
		var itemNum = oQSAV.ItemCount();
		var itemNum = itemNum - count;
		if(itemNum == 0) 
		{
			if (facecount != 0)
			{
				return alert("您选择的形象中仅有真脸头像，不能进行索要。请选择其他QQ秀再试.");
			}
			else
			{
				return alert("您的身上没有任何物品，请添加物品后索要.");
			}
		}
		else if(itemNum > 20)
		{
			return alert("对不起，单次索要物品数量不能超过20件。");
		}
		if (top.shopshow && "function"==typeof(top.shopshow.FloatShow))
		{
			top.shopshow.FloatShow("http://show.qq.com/mall/inc/req_mul.html",434,346,null,null,0, -100);
		}
		else if(n == 0)
		{
			top.shopshow.location.href = "/inc/main.html";
			setTimeout(function(){askAll(n+1)},400);
		}
		else if(n < 10)
		{
			setTimeout(function(){askAll(n+1)},400);
		}
	}
};
function EventRouter(event)
{
	var sType = event.type;
	var oEle = event.srcElement || event.target;
	var oWindow = document.getElementById("w_head");
	var oBorder = document.getElementById("d_border");
	switch (sType)
	{
	case "mousedown":
        if(oEle.tagName.toUpperCase() == "A")
        {
            return;
        }
        oWindow.m_bDown = true;
        oBorder.style.width = oWindow.offsetWidth + 2 + "px";
        oBorder.style.height = oWindow.offsetHeight + 2 + "px";
        oBorder.style.left =  oWindow.offsetLeft + "px";
        oBorder.style.top =  oWindow.offsetTop  +"px";
        oBorder.style.display = "";
        addEventListener(document.body,"onmousemove",EventRouter);
        addEventListener(document.body,"onmouseup",EventRouter);
        if(document.all)
            oBorder.setCapture(true);
		break;
	case "mouseup":
		if(!oWindow.m_bDown ) return;
		oWindow.style.left = oBorder.style.left;
		oWindow.style.top = oBorder.style.top;
		oBorder.style.display = "none";
		removeEventListener(document.body,"onmousemove",EventRouter);
		removeEventListener(document.body,"onmouseup",EventRouter);
		oWindow.m_bDown = false;
		if(document.all)
			oBorder.releaseCapture(true);
		break;
	case "mousemove":
        if(!oWindow.m_bDown) return;
        var iM_x = event.clientX;
        var iM_y;
        var iScrollTop = document.body.scrollTop + document.documentElement.scrollTop;
        iM_y = event.clientY + iScrollTop;
        var oMask = document.getElementById("ID_QQSHOW_FLOAT_WIN");
        var _left = iM_x - oWindow.clientWidth / 2;
        var _top = iM_y - 20;
        var iW = oWindow.clientWidth ;
        var iH = oWindow.clientHeight ; 
		var oWin;
		if(window.frameElement) oWin = window.frameElement;
		else oWin = document.body;
        _left = _left < 15 ? 0 : (_left + iW > oWin.offsetWidth ? (oWin.offsetWidth - iW) : _left);
        _top = _top < 15 ? 0 : (_top + iH - iScrollTop > (document.all ? oWin.clientHeight : document.body.clientHeight ) ? ( (document.all ? oWin.clientHeight :document.body.clientHeight ) - iH  + iScrollTop) : _top );
        _top = _top - oMask.offsetTop;
        _top = _top < (-oMask.offsetTop) ? (-oMask.offsetTop):_top;
        oBorder.style.left = _left + "px";
        oBorder.style.top =  _top + "px";
		break;
	default:
		break;
	}
};
function addEventListener (oElem, oEvents, fnHandler) {
	if (!oElem || !oEvents || !fnHandler) return;
	if ((typeof oEvents == "string" || oEvents instanceof String)) {
		_addEventListener(oElem, oEvents, fnHandler);
	} else {
		for (var i=0,nLen=oEvents.length; i<nLen; i++) {
			_addEventListener(oElem, oEvents[i], fnHandler);
		}
	}
};
function _addEventListener(oElem, sEvent, fnHandler) {
	if (!oElem || !sEvent || !fnHandler) return;
	if (oElem.attachEvent) {
		if (sEvent.indexOf("on") == -1)
			sEvent = "on" + sEvent;
		oElem.attachEvent(sEvent, fnHandler);
	} else {
		if (sEvent.indexOf("on") == 0)
			sEvent = sEvent.substr(2);
		oElem.addEventListener(sEvent, fnHandler, false);
	}
};
function removeEventListener (oElem, oEvents, fnHandler) {
	if (!oElem || !oEvents || !fnHandler) return;
	if ((typeof oEvents == "string" || oEvents instanceof String)) {
		_removeEventListener(oElem, oEvents, fnHandler);
	} else {
		for (var i=0,nLen=oEvents.length; i<nLen; i++) {
			_removeEventListener(oElem, oEvents[i], fnHandler);
		}
	}
};
function _removeEventListener(oElem, sEvent, fnHandler) {
	if (!oElem || !sEvent || !fnHandler) return;
	if (oElem.detachEvent) {
		if (sEvent.indexOf("on") == -1)
			sEvent = "on" + sEvent;
		oElem.detachEvent(sEvent, fnHandler);
	} else {
		if (sEvent.indexOf("on") == 0)
			sEvent = sEvent.substr(2);
		oElem.removeEventListener(sEvent, fnHandler, false);
	}
};
function GetJs(url,loadFn, loadFn2, charset)
{
	this.bExec = false;
	this.sUrl = url;  
	this.sCharset	=	charset?charset:"gb2312";
	this.fnOnload = function()
	{
		if(!this.bExec)
		{
			loadFn();
			this.bExec = true;
		}
	};
};
GetJs.prototype.init = function()
{
	var t = this;
	var oScript = document.createElement("SCRIPT");
	oScript.onload = function()
	{
		t.fnOnload();	
	};
	oScript.onerror = function()
	{
		t.bExec = true;
	};
	oScript.onreadystatechange = function()
	{
		if((oScript.readyState!="loaded")&&(oScript.readyState!="complete")) return;
		oScript.onreadystatechange = null;		
		t.fnOnload();
	}; 
	oScript.setAttribute("TYPE","text/javascript");
	oScript.setAttribute("charset",t.sCharset);
	oScript.src = t.sUrl;
	document.getElementsByTagName("HEAD")[0].appendChild(oScript);
};
function CheckClientScreen()
{
	var iScreenW = parseInt(screen.width);
	var iScreenH = parseInt(screen.height);
	if( iScreenW <= 800 || iScreenH <=600 )
	{
		alert("对不起，您的电脑分辨率太低，无法正常浏览商城，请调整电脑分辨率到1024*768以上！");
		return -1;
	}
	return 0;
};
function QQShowHelpBox(sContent, sTitle, sWinTitle, oWin, iType, bTxt)
{
    QQShowHelpBox.OnClose = function()
    {
        WaitEnd([top.shopshow, top.qqshow, top.topshow]);
        FloatShow.Hide();
    };
    QQShowHelpBox.init = function(oDoc)
    {
        var eWinTitle = oDoc.getElementById("ID_WinTitle");
        var eTitle    = oDoc.getElementById("ID_Title");
        var eContent  = oDoc.getElementById("ID_Content");
        sWinTitle && eWinTitle && (eWinTitle.innerHTML = sWinTitle.escHtml());
        sTitle    && eTitle    && (eTitle.innerHTML    = sTitle.escHtml());
        sContent  && eContent  && (eContent.innerHTML  = sContent.escHtml());
    };
    QQShowHelpBox.Show = function()
    {
        var sFile = '/help/inc/help_box.html';
        iType && (!isNaN(iType)) && (sFile = '/help/inc/help_box_' + iType + '.html');
        var iWidth  = 461;
        var iHeight = 230;
        oWin || (oWin = top.shopshow ? top.shopshow : window);
	    oWin.FloatShow(sFile, iWidth, iHeight);
    };
	WaitStart([top.shopshow, top.qqshow, top.topshow], null, bTxt);
	QQShowHelpBox.Show();
};
function QQShowDialog( iType , sMsg , sTitle , fnOk , fnNo , fnCancel, oWin, iWidth, iHeight, bTxt)
{
	var m_itype = iType ? iType :  1 ;
	var m_sMsg  = sMsg ? sMsg: "";
	var m_sTitle = sTitle ?sTitle : "提示";
	var m_func_ok = fnOk? fnOk: function(){};
	var m_func_no = fnNo ?fnNo: function(){};
	var m_func_cancel = fnCancel ?fnCancel: function(){};	
	var _width = iWidth?iWidth:504;	
	var _height = iHeight?iHeight:198;
	var _bShow = true  ; 
	QQShowDialog.Show = function ()
	{		
		if(oWin)
			oWin.FloatShow('/inc/alert.html',  _width,  _height);			
		else if(top.shopshow)
			top.shopshow.FloatShow('/inc/alert.html', _width,  _height);
		else
			FloatShow('/inc/alert.html', _width,  _height);
	};
	QQShowDialog.OnOk = function ()
	{
		try{
			m_func_ok();
		}catch(e){};
		FloatShow.Hide();
		_bShow = false ; 
		WaitEnd([top.shopshow, top.qqshow, top.topshow]);
	};
	QQShowDialog.OnNo = function ()
	{
		try{
			m_func_no();
		}catch(e){};
		FloatShow.Hide();
		_bShow = false ; 
		WaitEnd([top.shopshow, top.qqshow, top.topshow]);
	};
	QQShowDialog.OnCancel = function ()
	{
		try{
			m_func_cancel();
		}catch(e){};
		FloatShow.Hide();
		_bShow = false ; 
		WaitEnd([top.shopshow, top.qqshow, top.topshow]);
	};
	QQShowDialog.IsShow = function ()
	{
		return _bShow ; 
	};
	QQShowDialog.AddListener = function(oEle , fnEvt)
	{
		if(oEle){
			addEventListener(oEle ,"onclick" , fnEvt );
		}
	};
	QQShowDialog.init = function(oDoc)
	{
		if( oDoc.getElementById("title") != null) oDoc.getElementById("title").innerHTML = m_sTitle.escHtml();
		if( oDoc.getElementById("msg") != null) oDoc.getElementById("msg").innerHTML = m_sMsg.escHtml();
		    var oBok = oDoc.getElementById("b_ok");
		    var oBno = oDoc.getElementById("b_no");
		    var oBcancel = oDoc.getElementById("b_cancel");
		QQShowDialog.AddListener(oBok,QQShowDialog.OnOk);
		QQShowDialog.AddListener(oBno,QQShowDialog.OnNo);
		QQShowDialog.AddListener(oBcancel,QQShowDialog.OnCancel);
		if(m_itype == 1)		
		{
			oBok.className="left_btn_1";	
		}
		else if(m_itype == 2){
			oBno.style.display = "";
		}else if(m_itype == 3){
			oBno.style.display = "";
			oBcancel.style.display = "";
		}
	};
	WaitStart([top.shopshow, top.qqshow, top.topshow],null,bTxt);
	QQShowDialog.Show();
};


function GetTypes()
{
	return ["休闲","正装","运动","礼服","奇幻","卡通"];
}
function InitCombo(oEle)
{
	if(oEle.tagName != "SELECT") return;
	var sType = GetTypes();
	oEle.options.length = 0;
	for(var i=0;i<sType.length;i++)
	{
		oEle.options[i] = (new Option(sType[i], sType[i]));
	}
}
function encodehuffman(sSrc)
{
	var mapName = [];
mapName[48] = [1,String.fromCharCode( 0 )];
mapName[57] = [6,String.fromCharCode( 1 )];
mapName[124] = [6,String.fromCharCode( 33 )];
mapName[46] = [5,String.fromCharCode( 17 )];
mapName[49] = [4,String.fromCharCode( 9 )];
mapName[54] = [6,String.fromCharCode( 5 )];
mapName[56] = [6,String.fromCharCode( 37 )];
mapName[52] = [5,String.fromCharCode( 21 )];
mapName[50] = [6,String.fromCharCode( 13 )];
mapName[38] = [8,String.fromCharCode( 45 , 0 )];
mapName[10] = [9,String.fromCharCode( 173 , 0 )];
mapName[70] = [10,String.fromCharCode( 173 , 1 )];
mapName[100] = [15,String.fromCharCode( 173 , 3 )];
mapName[105] = [16,String.fromCharCode( 173 , 67 , 0 )];
mapName[65] = [18,String.fromCharCode( 173 , 195 , 0 )];
mapName[69] = [18,String.fromCharCode( 173 , 195 , 2 )];
mapName[4] = [23,String.fromCharCode( 173 , 195 , 1 )];
mapName[5] = [23,String.fromCharCode( 173 , 195 , 65 )];
mapName[2] = [23,String.fromCharCode( 173 , 195 , 33 )];
mapName[3] = [23,String.fromCharCode( 173 , 195 , 97 )];
mapName[8] = [23,String.fromCharCode( 173 , 195 , 17 )];
mapName[9] = [23,String.fromCharCode( 173 , 195 , 81 )];
mapName[6] = [23,String.fromCharCode( 173 , 195 , 49 )];
mapName[7] = [23,String.fromCharCode( 173 , 195 , 113 )];
mapName[34] = [22,String.fromCharCode( 173 , 195 , 9 )];
mapName[36] = [22,String.fromCharCode( 173 , 195 , 41 )];
mapName[0] = [23,String.fromCharCode( 173 , 195 , 25 )];
mapName[1] = [23,String.fromCharCode( 173 , 195 , 89 )];
mapName[33] = [22,String.fromCharCode( 173 , 195 , 57 )];
mapName[22] = [23,String.fromCharCode( 173 , 195 , 5 )];
mapName[23] = [23,String.fromCharCode( 173 , 195 , 69 )];
mapName[20] = [23,String.fromCharCode( 173 , 195 , 37 )];
mapName[21] = [23,String.fromCharCode( 173 , 195 , 101 )];
mapName[26] = [23,String.fromCharCode( 173 , 195 , 21 )];
mapName[27] = [23,String.fromCharCode( 173 , 195 , 85 )];
mapName[24] = [23,String.fromCharCode( 173 , 195 , 53 )];
mapName[25] = [23,String.fromCharCode( 173 , 195 , 117 )];
mapName[13] = [23,String.fromCharCode( 173 , 195 , 13 )];
mapName[14] = [23,String.fromCharCode( 173 , 195 , 77 )];
mapName[11] = [23,String.fromCharCode( 173 , 195 , 45 )];
mapName[12] = [23,String.fromCharCode( 173 , 195 , 109 )];
mapName[18] = [23,String.fromCharCode( 173 , 195 , 29 )];
mapName[19] = [23,String.fromCharCode( 173 , 195 , 93 )];
mapName[15] = [23,String.fromCharCode( 173 , 195 , 61 )];
mapName[17] = [23,String.fromCharCode( 173 , 195 , 125 )];
mapName[62] = [22,String.fromCharCode( 173 , 195 , 3 )];
mapName[64] = [22,String.fromCharCode( 173 , 195 , 35 )];
mapName[59] = [22,String.fromCharCode( 173 , 195 , 19 )];
mapName[60] = [22,String.fromCharCode( 173 , 195 , 51 )];
mapName[84] = [22,String.fromCharCode( 173 , 195 , 11 )];
mapName[91] = [22,String.fromCharCode( 173 , 195 , 43 )];
mapName[78] = [22,String.fromCharCode( 173 , 195 , 27 )];
mapName[83] = [22,String.fromCharCode( 173 , 195 , 59 )];
mapName[41] = [22,String.fromCharCode( 173 , 195 , 7 )];
mapName[42] = [22,String.fromCharCode( 173 , 195 , 39 )];
mapName[39] = [22,String.fromCharCode( 173 , 195 , 23 )];
mapName[40] = [22,String.fromCharCode( 173 , 195 , 55 )];
mapName[47] = [22,String.fromCharCode( 173 , 195 , 15 )];
mapName[58] = [22,String.fromCharCode( 173 , 195 , 47 )];
mapName[43] = [22,String.fromCharCode( 173 , 195 , 31 )];
mapName[44] = [22,String.fromCharCode( 173 , 195 , 63 )];
mapName[67] = [14,String.fromCharCode( 173 , 35 )];
mapName[117] = [13,String.fromCharCode( 173 , 19 )];
mapName[103] = [16,String.fromCharCode( 173 , 11 , 0 )];
mapName[165] = [23,String.fromCharCode( 173 , 139 , 0 )];
mapName[166] = [23,String.fromCharCode( 173 , 139 , 64 )];
mapName[162] = [23,String.fromCharCode( 173 , 139 , 32 )];
mapName[164] = [23,String.fromCharCode( 173 , 139 , 96 )];
mapName[169] = [23,String.fromCharCode( 173 , 139 , 16 )];
mapName[170] = [23,String.fromCharCode( 173 , 139 , 80 )];
mapName[167] = [23,String.fromCharCode( 173 , 139 , 48 )];
mapName[168] = [23,String.fromCharCode( 173 , 139 , 112 )];
mapName[156] = [23,String.fromCharCode( 173 , 139 , 8 )];
mapName[157] = [23,String.fromCharCode( 173 , 139 , 72 )];
mapName[154] = [23,String.fromCharCode( 173 , 139 , 40 )];
mapName[155] = [23,String.fromCharCode( 173 , 139 , 104 )];
mapName[160] = [23,String.fromCharCode( 173 , 139 , 24 )];
mapName[161] = [23,String.fromCharCode( 173 , 139 , 88 )];
mapName[158] = [23,String.fromCharCode( 173 , 139 , 56 )];
mapName[159] = [23,String.fromCharCode( 173 , 139 , 120 )];
mapName[181] = [23,String.fromCharCode( 173 , 139 , 4 )];
mapName[182] = [23,String.fromCharCode( 173 , 139 , 68 )];
mapName[179] = [23,String.fromCharCode( 173 , 139 , 36 )];
mapName[180] = [23,String.fromCharCode( 173 , 139 , 100 )];
mapName[185] = [23,String.fromCharCode( 173 , 139 , 20 )];
mapName[186] = [23,String.fromCharCode( 173 , 139 , 84 )];
mapName[183] = [23,String.fromCharCode( 173 , 139 , 52 )];
mapName[184] = [23,String.fromCharCode( 173 , 139 , 116 )];
mapName[173] = [23,String.fromCharCode( 173 , 139 , 12 )];
mapName[174] = [23,String.fromCharCode( 173 , 139 , 76 )];
mapName[171] = [23,String.fromCharCode( 173 , 139 , 44 )];
mapName[172] = [23,String.fromCharCode( 173 , 139 , 108 )];
mapName[177] = [23,String.fromCharCode( 173 , 139 , 28 )];
mapName[178] = [23,String.fromCharCode( 173 , 139 , 92 )];
mapName[175] = [23,String.fromCharCode( 173 , 139 , 60 )];
mapName[176] = [23,String.fromCharCode( 173 , 139 , 124 )];
mapName[132] = [23,String.fromCharCode( 173 , 139 , 2 )];
mapName[133] = [23,String.fromCharCode( 173 , 139 , 66 )];
mapName[130] = [23,String.fromCharCode( 173 , 139 , 34 )];
mapName[131] = [23,String.fromCharCode( 173 , 139 , 98 )];
mapName[136] = [23,String.fromCharCode( 173 , 139 , 18 )];
mapName[137] = [23,String.fromCharCode( 173 , 139 , 82 )];
mapName[134] = [23,String.fromCharCode( 173 , 139 , 50 )];
mapName[135] = [23,String.fromCharCode( 173 , 139 , 114 )];
mapName[30] = [23,String.fromCharCode( 173 , 139 , 10 )];
mapName[31] = [23,String.fromCharCode( 173 , 139 , 74 )];
mapName[28] = [23,String.fromCharCode( 173 , 139 , 42 )];
mapName[29] = [23,String.fromCharCode( 173 , 139 , 106 )];
mapName[128] = [23,String.fromCharCode( 173 , 139 , 26 )];
mapName[129] = [23,String.fromCharCode( 173 , 139 , 90 )];
mapName[32] = [23,String.fromCharCode( 173 , 139 , 58 )];
mapName[127] = [23,String.fromCharCode( 173 , 139 , 122 )];
mapName[148] = [23,String.fromCharCode( 173 , 139 , 6 )];
mapName[149] = [23,String.fromCharCode( 173 , 139 , 70 )];
mapName[146] = [23,String.fromCharCode( 173 , 139 , 38 )];
mapName[147] = [23,String.fromCharCode( 173 , 139 , 102 )];
mapName[152] = [23,String.fromCharCode( 173 , 139 , 22 )];
mapName[153] = [23,String.fromCharCode( 173 , 139 , 86 )];
mapName[150] = [23,String.fromCharCode( 173 , 139 , 54 )];
mapName[151] = [23,String.fromCharCode( 173 , 139 , 118 )];
mapName[140] = [23,String.fromCharCode( 173 , 139 , 14 )];
mapName[141] = [23,String.fromCharCode( 173 , 139 , 78 )];
mapName[138] = [23,String.fromCharCode( 173 , 139 , 46 )];
mapName[139] = [23,String.fromCharCode( 173 , 139 , 110 )];
mapName[144] = [23,String.fromCharCode( 173 , 139 , 30 )];
mapName[145] = [23,String.fromCharCode( 173 , 139 , 94 )];
mapName[142] = [23,String.fromCharCode( 173 , 139 , 62 )];
mapName[143] = [23,String.fromCharCode( 173 , 139 , 126 )];
mapName[230] = [23,String.fromCharCode( 173 , 139 , 1 )];
mapName[231] = [23,String.fromCharCode( 173 , 139 , 65 )];
mapName[228] = [23,String.fromCharCode( 173 , 139 , 33 )];
mapName[229] = [23,String.fromCharCode( 173 , 139 , 97 )];
mapName[234] = [23,String.fromCharCode( 173 , 139 , 17 )];
mapName[235] = [23,String.fromCharCode( 173 , 139 , 81 )];
mapName[232] = [23,String.fromCharCode( 173 , 139 , 49 )];
mapName[233] = [23,String.fromCharCode( 173 , 139 , 113 )];
mapName[222] = [23,String.fromCharCode( 173 , 139 , 9 )];
mapName[223] = [23,String.fromCharCode( 173 , 139 , 73 )];
mapName[220] = [23,String.fromCharCode( 173 , 139 , 41 )];
mapName[221] = [23,String.fromCharCode( 173 , 139 , 105 )];
mapName[226] = [23,String.fromCharCode( 173 , 139 , 25 )];
mapName[227] = [23,String.fromCharCode( 173 , 139 , 89 )];
mapName[224] = [23,String.fromCharCode( 173 , 139 , 57 )];
mapName[225] = [23,String.fromCharCode( 173 , 139 , 121 )];
mapName[246] = [23,String.fromCharCode( 173 , 139 , 5 )];
mapName[247] = [23,String.fromCharCode( 173 , 139 , 69 )];
mapName[244] = [23,String.fromCharCode( 173 , 139 , 37 )];
mapName[245] = [23,String.fromCharCode( 173 , 139 , 101 )];
mapName[250] = [23,String.fromCharCode( 173 , 139 , 21 )];
mapName[251] = [23,String.fromCharCode( 173 , 139 , 85 )];
mapName[248] = [23,String.fromCharCode( 173 , 139 , 53 )];
mapName[249] = [23,String.fromCharCode( 173 , 139 , 117 )];
mapName[238] = [23,String.fromCharCode( 173 , 139 , 13 )];
mapName[239] = [23,String.fromCharCode( 173 , 139 , 77 )];
mapName[236] = [23,String.fromCharCode( 173 , 139 , 45 )];
mapName[237] = [23,String.fromCharCode( 173 , 139 , 109 )];
mapName[242] = [23,String.fromCharCode( 173 , 139 , 29 )];
mapName[243] = [23,String.fromCharCode( 173 , 139 , 93 )];
mapName[240] = [23,String.fromCharCode( 173 , 139 , 61 )];
mapName[241] = [23,String.fromCharCode( 173 , 139 , 125 )];
mapName[198] = [23,String.fromCharCode( 173 , 139 , 3 )];
mapName[199] = [23,String.fromCharCode( 173 , 139 , 67 )];
mapName[196] = [23,String.fromCharCode( 173 , 139 , 35 )];
mapName[197] = [23,String.fromCharCode( 173 , 139 , 99 )];
mapName[202] = [23,String.fromCharCode( 173 , 139 , 19 )];
mapName[203] = [23,String.fromCharCode( 173 , 139 , 83 )];
mapName[200] = [23,String.fromCharCode( 173 , 139 , 51 )];
mapName[201] = [23,String.fromCharCode( 173 , 139 , 115 )];
mapName[189] = [23,String.fromCharCode( 173 , 139 , 11 )];
mapName[190] = [23,String.fromCharCode( 173 , 139 , 75 )];
mapName[187] = [23,String.fromCharCode( 173 , 139 , 43 )];
mapName[188] = [23,String.fromCharCode( 173 , 139 , 107 )];
mapName[194] = [23,String.fromCharCode( 173 , 139 , 27 )];
mapName[195] = [23,String.fromCharCode( 173 , 139 , 91 )];
mapName[192] = [23,String.fromCharCode( 173 , 139 , 59 )];
mapName[193] = [23,String.fromCharCode( 173 , 139 , 123 )];
mapName[214] = [23,String.fromCharCode( 173 , 139 , 7 )];
mapName[215] = [23,String.fromCharCode( 173 , 139 , 71 )];
mapName[212] = [23,String.fromCharCode( 173 , 139 , 39 )];
mapName[213] = [23,String.fromCharCode( 173 , 139 , 103 )];
mapName[218] = [23,String.fromCharCode( 173 , 139 , 23 )];
mapName[219] = [23,String.fromCharCode( 173 , 139 , 87 )];
mapName[216] = [23,String.fromCharCode( 173 , 139 , 55 )];
mapName[217] = [23,String.fromCharCode( 173 , 139 , 119 )];
mapName[206] = [23,String.fromCharCode( 173 , 139 , 15 )];
mapName[207] = [23,String.fromCharCode( 173 , 139 , 79 )];
mapName[204] = [23,String.fromCharCode( 173 , 139 , 47 )];
mapName[205] = [23,String.fromCharCode( 173 , 139 , 111 )];
mapName[210] = [23,String.fromCharCode( 173 , 139 , 31 )];
mapName[211] = [23,String.fromCharCode( 173 , 139 , 95 )];
mapName[208] = [23,String.fromCharCode( 173 , 139 , 63 )];
mapName[209] = [23,String.fromCharCode( 173 , 139 , 127 )];
mapName[102] = [16,String.fromCharCode( 173 , 75 , 0 )];
mapName[72] = [20,String.fromCharCode( 173 , 203 , 0 )];
mapName[82] = [20,String.fromCharCode( 173 , 203 , 8 )];
mapName[96] = [22,String.fromCharCode( 173 , 203 , 4 )];
mapName[112] = [22,String.fromCharCode( 173 , 203 , 36 )];
mapName[93] = [22,String.fromCharCode( 173 , 203 , 20 )];
mapName[94] = [22,String.fromCharCode( 173 , 203 , 52 )];
mapName[123] = [22,String.fromCharCode( 173 , 203 , 12 )];
mapName[125] = [22,String.fromCharCode( 173 , 203 , 44 )];
mapName[118] = [22,String.fromCharCode( 173 , 203 , 28 )];
mapName[121] = [22,String.fromCharCode( 173 , 203 , 60 )];
mapName[80] = [21,String.fromCharCode( 173 , 203 , 2 )];
mapName[81] = [21,String.fromCharCode( 173 , 203 , 18 )];
mapName[254] = [23,String.fromCharCode( 173 , 203 , 10 )];
mapName[255] = [23,String.fromCharCode( 173 , 203 , 74 )];
mapName[252] = [23,String.fromCharCode( 173 , 203 , 42 )];
mapName[253] = [23,String.fromCharCode( 173 , 203 , 106 )];
mapName[61] = [21,String.fromCharCode( 173 , 203 , 26 )];
mapName[99] = [20,String.fromCharCode( 173 , 203 , 6 )];
mapName[88] = [21,String.fromCharCode( 173 , 203 , 14 )];
mapName[126] = [22,String.fromCharCode( 173 , 203 , 30 )];
mapName[120] = [22,String.fromCharCode( 173 , 203 , 62 )];
mapName[75] = [20,String.fromCharCode( 173 , 203 , 1 )];
mapName[79] = [20,String.fromCharCode( 173 , 203 , 9 )];
mapName[16] = [21,String.fromCharCode( 173 , 203 , 5 )];
mapName[163] = [22,String.fromCharCode( 173 , 203 , 21 )];
mapName[191] = [22,String.fromCharCode( 173 , 203 , 53 )];
mapName[89] = [20,String.fromCharCode( 173 , 203 , 13 )];
mapName[97] = [19,String.fromCharCode( 173 , 203 , 3 )];
mapName[109] = [19,String.fromCharCode( 173 , 203 , 7 )];
mapName[101] = [15,String.fromCharCode( 173 , 43 )];
mapName[107] = [21,String.fromCharCode( 173 , 107 , 0 )];
mapName[122] = [21,String.fromCharCode( 173 , 107 , 16 )];
mapName[85] = [21,String.fromCharCode( 173 , 107 , 8 )];
mapName[106] = [21,String.fromCharCode( 173 , 107 , 24 )];
mapName[71] = [20,String.fromCharCode( 173 , 107 , 4 )];
mapName[76] = [20,String.fromCharCode( 173 , 107 , 12 )];
mapName[63] = [19,String.fromCharCode( 173 , 107 , 2 )];
mapName[87] = [20,String.fromCharCode( 173 , 107 , 6 )];
mapName[90] = [20,String.fromCharCode( 173 , 107 , 14 )];
mapName[92] = [19,String.fromCharCode( 173 , 107 , 1 )];
mapName[73] = [21,String.fromCharCode( 173 , 107 , 5 )];
mapName[98] = [21,String.fromCharCode( 173 , 107 , 21 )];
mapName[74] = [20,String.fromCharCode( 173 , 107 , 13 )];
mapName[114] = [21,String.fromCharCode( 173 , 107 , 3 )];
mapName[119] = [21,String.fromCharCode( 173 , 107 , 19 )];
mapName[104] = [21,String.fromCharCode( 173 , 107 , 11 )];
mapName[113] = [21,String.fromCharCode( 173 , 107 , 27 )];
mapName[68] = [19,String.fromCharCode( 173 , 107 , 7 )];
mapName[116] = [16,String.fromCharCode( 173 , 235 , 0 )];
mapName[37] = [14,String.fromCharCode( 173 , 27 )];
mapName[66] = [16,String.fromCharCode( 173 , 59 , 0 )];
mapName[108] = [17,String.fromCharCode( 173 , 187 , 0 )];
mapName[115] = [17,String.fromCharCode( 173 , 187 , 1 )];
mapName[111] = [16,String.fromCharCode( 173 , 123 , 0 )];
mapName[110] = [16,String.fromCharCode( 173 , 251 , 0 )];
mapName[77] = [11,String.fromCharCode( 173 , 7 )];
mapName[45] = [9,String.fromCharCode( 109 , 0 )];
mapName[86] = [9,String.fromCharCode( 109 , 1 )];
mapName[35] = [8,String.fromCharCode( 237 , 0 )];
mapName[53] = [6,String.fromCharCode( 29 )];
mapName[55] = [7,String.fromCharCode( 61 )];
mapName[51] = [7,String.fromCharCode( 125 )];
mapName[95] = [2,String.fromCharCode( 3 )];
	var curbyte = 0;
	var curbit  = 0;
	var result="";
	if (sSrc.substr(0,1)!='V'||sSrc.length>1024*6)
	{
		alert("对不起,形象串错误。");
		return "";
	}
	result += String.fromCharCode(Math.floor(sSrc.length/256)%256);
	result += String.fromCharCode((sSrc.length)%256);
	for (i=0;i<sSrc.length ;i++ )
	{
		for (j=0;j< mapName[sSrc.charCodeAt(i)][0];j++ )
		{
			curbyte |= ((mapName[sSrc.charCodeAt(i)][1].charCodeAt(j/8)>>(j%8))&1)<<curbit;
			if (++curbit==8)
			{
				result +=  String.fromCharCode(curbyte);
				curbyte = 0;
				curbit = 0;
			}
		}
	}
	if (curbit>0)
	{
		result +=  String.fromCharCode(curbyte);
	}
	return result;
};
function conv64(instr)
{
	var mapSymbol =["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E",
					"F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T",
					"U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i",
					"j","k","l","m","n","o","p","q","r","s","t","u","v","w","x",
					"y","z","-","_"];
	var sSrc = instr;	
	var curbyte = 0;
	var curbit  = 0;
	var encode  = "";
	for (i=0;i<sSrc.length ;i++ )
	{
		for (j=0;j< 8;j++ )
		{ 
			curbyte |=(sSrc.charCodeAt(i)>>(7-j)&1)<<(5-curbit);
			if (++curbit==6)
			{ 
				encode +=  mapSymbol[curbyte];
				curbyte = 0;
				curbit  = 0;
			}
		}
	}
	if (curbit>0)
	{
		encode += mapSymbol[curbyte];
	}
	return encode;
};
function huffcompress(str)
{
	return "Z2"+conv64(encodehuffman(str));
};
function filterForSpecItem(sStr,type){
  var retArr = [];
  var defArr = sStr.split("#");
  if(defArr.length < 3){    
    return sStr;
  }
  var itemArr = defArr[2].split("|");
  for (var i=0; i<itemArr.length; i++){
    var itemSpcArr = itemArr[i].split("_");
    if (itemSpcArr.length < 18){     
      return sStr;
    }
    if (itemSpcArr[8]==type){
      continue;
    }
    else if(type==100&&itemSpcArr[8]>type){
    	continue;
    }
    else{
      retArr.push(itemArr[i]);
    }
  }
  return (defArr[0]+"#"+defArr[1]+"#"+retArr.join("|")+"#");
};
function SpecTypeItemCount(sStr,type){
	var itemNoArr = [];
  var count = 0;
  var defArr = sStr.split("#");
  if(defArr.length < 3){    
    return count;
  }
  var itemArr = defArr[2].split("|");
  for (var i=0; i<itemArr.length; i++){
    var itemSpcArr = itemArr[i].split("_");
    if (itemSpcArr.length < 18){      
      return count;
    }
    if (itemSpcArr[8] == type){
      IncreaceAtom(itemSpcArr[0]);
    }else if(type==100&&itemSpcArr[8]>type){
    	IncreaceAtom(itemSpcArr[0]);
    }else{
    	continue;
    }
  }
  function IncreaceAtom(itemNo){
  	for (var i=0;i<itemNoArr.length;i++){
  		if(itemNoArr[i]==itemNo){
  			return;	
  		}
  	}
  	count++;
  	itemNoArr.push(itemNo);
  }
  return count;
};
function SpecTypeArrayStr(sStr,type){
  var TypeArray = new Array();
  var defArr = sStr.split("#");
  if(defArr.length < 3){   
    return TypeArray;
  }
  var itemArr = defArr[2].split("|");
  for (var i=0; i<itemArr.length; i++){
    var itemSpcArr = itemArr[i].split("_");
    if (itemSpcArr.length < 18){   
      return TypeArray;
    }
    if (itemSpcArr[8] == type){
      TypeArray.push(itemSpcArr.join("_"));
    }else if(type==100&&itemSpcArr[8]>type){
    	TypeArray.push(itemSpcArr.join("_"));
    }else{
    	continue;
    }
  }
  return TypeArray;
};
function SpecTypeFindFirst(sStr,type){  
  var defArr = sStr.split("#");
  if(defArr.length < 3){   
    return -1;
  }
  var itemArr = defArr[2].split("|");
  for (var i=0; i<itemArr.length; i++){
    var itemSpcArr = itemArr[i].split("_");
    if (itemSpcArr.length < 18){   
      return -1;
    }
    if (itemSpcArr[8] == type){
      return itemSpcArr[8];
    }else if(type==100&&itemSpcArr[8]>type){
    	return itemSpcArr[8];
    }else{
    	continue;
    }
  }
  return -1;
};
function ChangeShowface(sShow, filter)
{
	var	Defface =[["1_402_0_0_0_0_0_0_0_402_0_0_0_0_0_0_100_0_|3_451_0_0_0_0_0_0_0_451_0_0_0_0_0_0_100_0_|2_461_0_0_0_0_0_0_0_461_0_0_0_0_0_0_100_0_|6_473_0_0_0_0_0_0_0_473_0_0_0_0_0_0_100_0_|1_482_0_0_0_0_0_0_0_482_0_0_0_0_0_0_100_0_","7_402_0_0_0_0_0_0_0_402_0_0_0_0_0_0_100_0_|9_451_0_0_0_0_0_0_0_451_0_0_0_0_0_0_100_0_|8_461_0_0_0_0_0_0_0_461_0_0_0_0_0_0_100_0_|12_473_0_0_0_0_0_0_0_473_0_0_0_0_0_0_100_0_|7_482_0_0_0_0_0_0_0_482_0_0_0_0_0_0_100_0_"],[	"1000013_402_0_0_0_0_0_0_0_402_0_0_0_0_0_0_100_0_|1000014_451_0_0_0_0_0_0_0_451_0_0_0_0_0_0_100_0_|1000012_450_0_0_0_0_0_0_0_450_0_0_0_0_0_0_100_0_|1000020_461_0_0_0_0_0_0_0_461_0_0_0_0_0_0_100_0_|1000011_465_0_0_0_0_0_0_0_465_0_0_0_0_0_0_100_0_|1000019_469_0_0_0_0_0_0_0_469_0_0_0_0_0_0_100_0_|1000015_473_0_0_0_0_0_0_0_473_0_0_0_0_0_0_100_0_|1000013_482_0_0_0_0_0_0_0_482_0_0_0_0_0_0_100_0_","1000003_402_0_0_0_0_0_0_0_402_0_0_0_0_0_0_100_0_|1000004_451_0_0_0_0_0_0_0_451_0_0_0_0_0_0_100_0_|1000002_450_0_0_0_0_0_0_0_450_0_0_0_0_0_0_100_0_|1000010_461_0_0_0_0_0_0_0_461_0_0_0_0_0_0_100_0_|1000001_465_0_0_0_0_0_0_0_465_0_0_0_0_0_0_100_0_|1000009_469_0_0_0_0_0_0_0_469_0_0_0_0_0_0_100_0_|1000005_473_0_0_0_0_0_0_0_473_0_0_0_0_0_0_100_0_|1000003_482_0_0_0_0_0_0_0_482_0_0_0_0_0_0_100_0_"]
	];
	if(filter)
	{
		sShow = filterForSpecItem(sShow,102);	
	}	
	var defArr = sShow.split("#");
	var aUserInfo = defArr[1].split("_");
	var iSex = aUserInfo[0] == 'M' ? 1: 0;
	var iStyle = aUserInfo[1];
	return (defArr[0]+"#"+defArr[1]+"#"+Defface[iStyle][iSex]+"|" + defArr[2]+"#");
}				
function getVipLevel(score)
{
	var level2 = 400;
	var level3 = 800;
	var level4 = 1600;
	var level5 = 3000;
	var level6 = 5000;
	var level7 = 7000;
	var level_distin = 2000;
	if (score <= 0) return 0;	
	else if (score >0 && score <level2) return 1;
	else if (score <level3) return 2;
	else if (score <level4) return 3;
	else if (score <level5) return 4;
	else if (score <level6) return 5;
	else if (score <level7) return 6;
	else return 7;//(parseInt((score-level7)/level_distin,10) + 7);
};
function getVipLevelVal(level)
{
	switch(level)
	{
		case 1:
			return 0;
			break;
		case 2:
			return 400;
			break;
		case 3:
			return 800;
			break;
		case 4:
			return 1600;
			break;
		case 5:
			return 3000;
			break;
		case 6:
			return 5000;
			break;
		case 7:
			return 7000;
			break;
		default:
			return ((level-7)*2000 + 7000);
			break;
	}
};
function HtmlEncode(sStr)
{
	sStr = sStr.replace(/&/g,"&amp;");
	sStr = sStr.replace(/>/g,"&gt;");
	sStr = sStr.replace(/</g,"&lt;");
	sStr = sStr.replace(/"/g,"&quot;");
	sStr = sStr.replace(/'/g,"&#39;");
	return sStr;
};
function HtmlUnEncode(sStr)
{
	sStr = sStr.replace(/&amp;/g,"&");
	sStr = sStr.replace(/&gt;/g,">");
	sStr = sStr.replace(/&lt;/g,"<");
	sStr = sStr.replace(/&quot;/g,'"');
	sStr = sStr.replace(/&#39;/g,"'");
	return sStr;
};
function HtmlAttributeEncode(sStr)
{
	sStr = sStr.replace(/&/g,"&amp;");
	sStr = sStr.replace(/>/g,"&gt;");
	sStr = sStr.replace(/</g,"&lt;");
	sStr = sStr.replace(/"/g,"&quot;");
	sStr = sStr.replace(/'/g,"&#39;");
	sStr = sStr.replace(/=/g,"&#61;");
	sStr = sStr.replace(/`/g,"&#96;");
	return sStr;
};
function CheckDefaultShow(sItems)
{
    var defAV = new QQSHOWAV();
    var userArr = sItems.split("#");
    var defArr = defAV._arrDefShow[userArr[1].substr(0,5)];
    var itemArr = userArr[2].split("|");
    var iFlag = 0;
    for (var i=0; i<itemArr.length; i++)
    {
        iFlag = 0;
        var itemSpcArr = itemArr[i].split("_");
        if (itemSpcArr[1] >= 406 && itemSpcArr[1] <= 448)
        {
            for(var j=0;j<defArr.length;j++)
            {
                if(itemSpcArr[1] == defArr[j][0])
                {
                    iFlag++
                    if(itemSpcArr[0] != defArr[j][1])
                    {
                        return 1;
                    }
                }
            }
            if(iFlag == 0)
            {                                                                                                     
                return 1;                                                                                         
            }                                                                                                     
        }                                                                                                         
    }                                                                                                             
    return 0;                                                                                                     
}  


function MaskBgDIV()
{
if(top.shopshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND"))
		{		top.shopshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND").style.display = "block";
		    	top.shopshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND").style.width =window.screen.availWidth;
				top.shopshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND").style.height =window.screen.availHeight;
    	}
    	else
    	{
    
    	  	var e = top.shopshow.document.createElement("div");
		    e.id = "ID_QQSHOW_WAIT_BACKGND";
		    e.style.position = "absolute";
		    e.style.zIndex = 10000;
		    e.style.left = 0;
		    e.style.top = 0;
		    e.style.width = window.screen.availWidth;
		    e.style.height = window.screen.availHeight;
		    e.style.backgroundColor="#0000FF";
		    e.className="filters";
		   e.style.display = "block";
		try{ top.shopshow.document.body.appendChild(e); } catch(e) { }

    	}
if(top.qqshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND"))
			{	top.qqshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND").style.display = "block";
		        top.qqshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND").style.width =window.screen.availWidth;
				top.qqshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND").style.height =window.screen.availHeight;}
if(top.topshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND"))
			{	top.topshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND").style.display = "block";
						top.topshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND").style.width =window.screen.availWidth;
						top.topshow.document.getElementById("ID_QQSHOW_WAIT_BACKGND").style.height =window.screen.availHeight;
			}
}
function  Show_LoadBar()
{
	    var izIndex =99999;
        var	oWin = oWin || window;
		var height=245,width=406,px=null,py=null;	
var e = DivCreate(oWin, oWin.document.body, "ID_QQSHOW_FLOAT_Load", izIndex, 0, 50, width, height, "none");
		if(e && "object" == typeof(e) && "div" == e.tagName.toString().toLowerCase())
		{
		e.style.top = (Math.max(Math.min(oWin.document.documentElement.scrollTop+100, Math.max(oWin.document.body.offsetHeight-100,100)), 50))+"px";
		e.innerHTML = "<div style='width:"+width+"px;height:"+height+"px;text-align:center; background-color:White ;'><img src='images/loading1.gif'><br/>正在加载请稍等....</div>";
		e.style.display = "block";
		}	
}