var wrongJIDMap=[];
wrongJIDMap[206170000]=[106190000];
wrongJIDMap[106190000]=[206170000];
wrongJIDMap[206160000]=[106200000];
wrongJIDMap[106200000]=[206160000];
wrongJIDMap[107130000]=[207020000];
wrongJIDMap[207020000]=[107130000];


function refreshHeader()
{
	
	if(top.topfra && ("function" == typeof(top.topfra.strongFir)))
	{
		top.topfra.strongFir();	 
	}
	else return;
};
function frameChange(mallno)
{
	if(top.topfra && ("function" == typeof(top.topfra.mainFrameChange)))
	{
		top.topfra.mainFrameChange(mallno);
	}
	else 
	{
		function loadMall()
		{
			function loadMain()
			{
				mainFrameChange(mallno);
			}
			var url = "http://imgcache.qq.com/qqshow/v2/js/inc/qqshow_header.js";
			var o = new GetJs(url,loadMain,loadMain);
			o.init();
		}
		var u = "http://imgcache.qq.com/qqshow/v2/js/mk/mall.js";
		var a = new GetJs(u,loadMall,loadMall);
		a.init();
	}
};
function setSexFn(sUserSex)	
{
	if("F" == sUserSex) 
	{
		document.getElementById("sex_m").setAttribute("href","javascript:swapS();");
		document.getElementById("sex_f").removeAttribute("href");
	}
	else 
	{
		document.getElementById("sex_m").removeAttribute("href");
		document.getElementById("sex_f").setAttribute("href","javascript:swapS();");
	}
};
function swapS()
{
	if('function' == typeof(top.leftfra.SwitchAvSex)) top.leftfra.SwitchAvSex(true);
	return;
};
function swapItemType(i,type)
{
	if(wrongJIDMap[top.g_iMallNo])
	{
	    top.g_iMallNo=wrongJIDMap[top.g_iMallNo][0];
	    frameChange(top.g_iMallNo);
	    refreshHeader();
	    return;
	}
	
	top.g_iMallNo = parseInt(((parseInt(QUSER.getStyle(),10)+1)+top.g_iMallNo.toString().substr(1,4)+"0000"),10);
	//对不同的页面调用不同的function

	 if(location.href.indexOf("/mall/inc/item.html")!=-1)
	{
		top.mainfra.tabChange(top.g_iMallNo);
	}
	else if(location.href.indexOf("mall/inc/red_beans.html")!=-1)
	{
		top.mainfra.tabChange(top.g_iMallNo);
	}
	else if(location.href.indexOf("mall/inc/act_hot.html")!=-1)
	{
		top.mainfra.init();
	}
	else if(location.href.indexOf("/inc/main.html")!=-1)
	{		
		location.reload();
	}
	else if(location.href.indexOf("/my/inc/item.html")!=-1)
	{
		swapStyle();
	}
	else if(location.href.indexOf("/rank/inc/hot.html")!=-1)
	{
		refreshHtml(0);
	}
	else if(location.href.indexOf("/my/inc/home.html")!=-1)
	{
		init();
	}
	else if(location.href.indexOf("/mall/inc/sa_nike.html") != -1)
	{
		location = "/inc/main.html";
	}
	else if(location.href.indexOf("/mall/inc/sys_suc.html") != -1)
	{
		return;
	}
	else if(location.href.indexOf("/mall/inc/sys_fail.html") != -1)
	{
		return;
	}
	else if(location.href.indexOf("/mall/inc/vip_index.html") != -1)
	{
		location.reload();
	}
	else if(location.href.indexOf("/mall/inc/suit.html") != -1)
	{
		return;
	}
	else if(location.href.indexOf("/my/inc/friend_item.html") != -1)
	{
		return;
	}
	else if(location.href.indexOf("/js/item_detail/") != -1)
	{
		return;
	}
	else if(location.href.indexOf("/my/inc/recmdview.html") != -1)
	{
		return;
	}
	else if(location.href.indexOf("/live/free/free.html") != -1)
	{
		location.reload();
	}
	else if(location.href.indexOf("/live/free/list.html") != -1)
	{
		location.reload();
	}
  	else if (location.href.indexOf("/mall/inc/set_detail.html") != -1)
  	{
  		return;
  	}
	else if(location.href.indexOf("/mall/inc/commend_club.html") != -1)
	{
		return;
	}	
	else 
	{
		frameChange(top.g_iMallNo);
	}
	
	//做导航栏切换。
	refreshHeader();
	return;
};
function swapSex(type)
{	
	if(top.g_iMallNo) 
	{
		if(location.href.indexOf("/mall/inc/item.html") != -1) 
		{
			top.g_iMallNo = parseInt(top.g_iMallNo/10000, 10)*10000;
			top.mainfra.tabChange(top.g_iMallNo);
		}
		else if(location.href.indexOf("/mall/inc/item_clothes.html")!=-1){
			top.g_iMallNo=parseInt(top.g_iMallNo/10000, 10)*10000;
			top.mainfra.tabChange2(top.g_iMallNo);			
		}
		else if(location.href.indexOf("/mall/inc/emotion.html") != -1)
		{
			top.mainfra.initList();
		}
		else if(location.href.indexOf("/mall/inc/commend_set.html") != -1)
		{
			top.mainfra.ChangeType(0);
		}
		else if(location.href.indexOf("/mall/inc/red_beans.html") != -1) 
		{
			top.mainfra.reLoadBeanJs();
		}
		else if(location.href.indexOf("/mall/inc/qqshow_xp_classical.html") != -1 || location.href.indexOf("/mall/inc/qqshow_xp_fad.html") != -1)
		{
			top.mainfra.loadJs();
		}
		else if(location.href.indexOf("/mall/inc/mall_subject_")!=-1)
		{
			top.mainfra.mainFrameChange(top.g_iMallNo);
		}
		else if(location.href.indexOf("/mall/inc/commend_club.html") != -1)
		{
			top.mainfra.Init();
		}
		else return;
	}
	return;
};
function selectCss(array, k, css)
{							 
	for (var i=0; i<array.length; i++)
	{
		if(i == k)
		{
			array[i].setAttribute("class", css);
			array[i].setAttribute("className", css);
		}
		else 
		{											
			array[i].setAttribute("class", "");
			array[i].setAttribute("className", "");
		}
	}
};
//形象切换
function swapType(i)
{
	if('function' == typeof(top.leftfra.ChangeAvStyle)) top.leftfra.ChangeAvStyle(parseInt(i,10),true);
	return;
};
function ShowSearchRecommend()
{
	var sSearchRecm = '';
	if(typeof(arySearchRecommend) != "undefined" && arySearchRecommend.length >0)
	{
		for(i =0; i< arySearchRecommend.length; i++)
		{
			sSearchRecm += '<a href="/mall/inc/search_set.html?keyword='+escape(arySearchRecommend[i])+'">'+arySearchRecommend[i]+'</a> ';
		}
	} 		
	document.getElementById("ID_hotword").innerHTML = sSearchRecm;		
};
function SendRcmdSet(cmd, uin, id)
{
	if(CheckLogin(1))
	{
		FloatShow("http://show.qq.com/mall/inc/don_mul.html?cmd="+cmd+"&uin="+uin+"&id="+id, 434, 356, null, null, 0, -100);
	}
};
function AskRcmdSet(cmd, uin, id)
{
	if(CheckLogin(1))
	{
		FloatShow("http://show.qq.com/mall/inc/req_mul.html?cmd="+cmd+"&uin="+uin+"&id="+id, 434, 346, null, null, 0, -100);
	}
};

function AddCollectionRcmdSet(show_sn)
{
	if(CheckLogin(1))
	{
		ShowCollectionAdd([show_sn, "我的收藏", "", "", 0]);
	}
}
function printFoot()
{
	var strHtml = "";
	strHtml += '<div class="copyright" id="copyright">';
	strHtml += '<div class="menu">';
	strHtml += '<a href="http://www.tencent.com/" target="new">关于腾讯</a> | <a href="http://www.tencent.com/index_e.shtml" target="new">AboutTencent</a> | <a href="http://www.qq.com/contract.shtml" target="new">服务条款</a> | <a href="http://www.tencent.com/adver/" target="new">广告服务</a> | <a href="http://hr.tencent.com/" target="new">腾讯招聘</a> | <a href="http://service.qq.com/" target="new">客服中心</a> | <a href="http://www.qq.com/map/" target="new">网站导航</a>';
	strHtml += '</div>';
	strHtml += '<strong class="num">Copyright &copy; 1998 - 2008 Tencent Inc. <a href="http://www.tencent.com.hk/law/mo_law_e.shtml?/law/copyright_e.htm" target="new" class="clink">All Rights Reserved</a></strong><br />';
	strHtml += '腾讯公司 <a href="http://www.tencent.com/law/mo_law.shtml?/law/copyright.htm" target="new" class="clink">版权所有</a> ';
	strHtml += '</div>';
	document.write(strHtml);
	return;
};
//以下为pv统计
function sendPgv()
{
	function pageView()
	{
		if ('function' == typeof(pgvMain))
		{
			pgvMain("", {statIframe:true});
		}
	}
	var sUrl = "http://pingjs.qq.com/ping.js";
	var o = new GetJs(sUrl,pageView);
	o.init();	
}
function addCharactor(itemCharactor, mallCharactor)
{
	var code = "";	
	var iCharator = parseInt(itemCharactor, 10);		
	if(parseInt(mallCharactor, 10) == iCharator)	return "";
	else
	{
		switch(iCharator)
		{			
			case 1:
				code = '<sup class="new_item">新</sup>';				
				break;
			case 2:
				code = '<sup class="hot_item">热</sup>';
				break;
			case 10:
				code = '<sup class="se_item">精</sup>';
				break;			
			case 4:
				code ='<sup class="lover_item">情侣</sup>';				
				break;				
			case 11:
				code = '<sup class="prize_item">奖</sup>';
				break;
			case 12:
				code = '<sup class="gift_item">赠</sup>';
				break;		 
			case 21:
				code = '<sup class="free_item">免费</sup>';
				break;
			case 20:
				code = '<sup class="s_3">3折</sup>';
				break;
			case 5:				
				code = '<sup class="s_5">5折</sup>';
				break;
			case 6:
				code = '<sup class="s_6">6折</sup>';
				break;
			case 8:
				code = '<sup class="s_8">8折</sup>';
				break;
		 }
	 }	
	return code; 		
}
function GoMatch_m(iNo, ext1)
{
	_pgvSendClick("ISD.QQShow.BaiBian.BBDP_Out_Main");			
	var iMatchSex=QUSER.getAvSex()=="F"?0:1;
	if((ext1 & 4) > 0)	
		window.location="/mall/inc/suit.html?itemno=" + iNo + "&sex=" + iMatchSex;
	else
		return;
}

function checkCanMatch_m(ext1)
{	
	if((ext1 & 4) > 0)
		return true;
	return false;
}
/*************************************************************
***  FelitHuang Create @ 2005-10-13
***
***  This JScript Is To Show Tips For Items.
***  To Include This JScript Before Using The Tips Show/Hide Function.
***
*************************************************************/

/***  To Create The Tip Object, This Should Call Before Show/Hide  ***/
function QQShowTipCreate()
{
	if (!document.getElementById("QQSHOWTIPDIV"))
	{
		var e = document.createElement("DIV");
		e.id = "QQSHOWTIPDIV";
		e.style.position = "absolute";
		e.style.visibility = "hidden";
		e.style.zIndex = 1001;
		e.innerHTML	= '<table border="1" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">'
					+ '<tr><td align="center"><img id="QQSHOWTIPIMG" src="" alt="预览"></td></tr>'
					+ '<tr><td height="24" align="center" valign="middle" id="QQSHOWTIPINFO"></td></tr>'
					+ '</table>';
		document.body.appendChild(e);
	}
};

/*** This TipShow Function Should Be Call Only By The MouseEvents  ***/
function QQShowTipShow(strUrl, strName)
{
	try
	{
		var e = arguments[2] || window.event;
		if (!e)
		{
			return false;
		}
		if (!document.getElementById("QQSHOWTIPDIV"))
		{
			QQShowTipCreate();
		}

		if (document.getElementById("QQSHOWTIPIMG").src!=strUrl)
		{
			document.getElementById("QQSHOWTIPIMG").src = strUrl;
		}
		document.getElementById("QQSHOWTIPINFO").innerHTML = strName;

		var wTipDiv = document.getElementById("QQSHOWTIPDIV").scrollWidth;
		var hTipDiv = document.getElementById("QQSHOWTIPDIV").scrollHeight;

		var wBody = document.body.clientWidth;
		var hBody = document.body.clientHeight;

		var xPos = typeof(e.clientX)!="undefined" ? e.clientX : (e.pageX-document.documentElement.scrollLeft);
		var yPos = typeof(e.clientY)!="undefined" ? e.clientY : (e.pageY-document.documentElement.scrollTop);

		xPos = (xPos+wTipDiv<=wBody) ? (xPos+document.documentElement.scrollLeft+10) : (xPos+document.documentElement.scrollLeft-10-wTipDiv);
		yPos = (yPos+hTipDiv<=hBody) ? (yPos+document.documentElement.scrollTop+10) : (yPos+document.documentElement.scrollTop-10-hTipDiv);

		document.getElementById("QQSHOWTIPDIV").style.left = xPos+"px";
		document.getElementById("QQSHOWTIPDIV").style.top = yPos+"px";
		document.getElementById("QQSHOWTIPDIV").style.visibility = "visible";
	}
	catch(e)
	{
		return false;
	}
	return true;
};

function QQShowTipHide()
{
	try
	{
		if (!document.getElementById("QQSHOWTIPDIV"))
		{
			QQShowTipCreate();
		}
		document.getElementById("QQSHOWTIPDIV").style.visibility = "hidden";
		document.getElementById("QQSHOWTIPIMG").removeAttribute("src");
	}
	catch(e)
	{
		return false;
	}
	return true;
};

function DisplayItemTips(sHtml, objEvent, sId, sCss, index)
{
	var x = 0;
	var y = 0;
	var iBodyX = document.documentElement.scrollLeft;
	var iBodyY = document.documentElement.scrollTop;
	if((objEvent.x)&&typeof(objEvent.x)!="undefined")
	{
		x = objEvent.clientX+iBodyX;
		y = objEvent.clientY+iBodyY;
	}
	else
	{
		x = objEvent.pageX;
		y = objEvent.pageY;
	}
	if(!document.getElementById(sId))
	{
		var oDiv = document.createElement("div");
		oDiv.id = sId;
		oDiv.setAttribute("class", sCss);
		oDiv.setAttribute("className",sCss);
		oDiv.style.display = "none";
		oDiv.style.position = "absolute";
		oDiv.style.zIndex = index;
		document.body.appendChild(oDiv);
		document.getElementById(sId).innerHTML = sHtml;
	}
	var objItemTips = document.getElementById(sId);
	objItemTips.style.position = "absolute";
	var iX = x - 20;
	var iY = y + 20;
	if((iX + 130)>document.body.scrollWidth) iX = document.body.scrollWidth - 130;
	objItemTips.style.left = iX + "px";
	objItemTips.style.top = iY + "px";
	document.getElementById(sId).innerHTML = sHtml;
	return objItemTips;
};

function DisplayItemPriceTips(sName, sPrice, sVipPrice, objEvent, iTime, nDiscount, nVipDiscount,iType)
{
	if(typeof(iType) == "undefined")
		iType = 1;
	function PRICETxt(iPrice, iDiscount, iPrePrice)
	{
		iPrice = parseInt(iPrice);
		iDiscount = parseInt(iDiscount);
		if (window.DSAsystem && window.DSAsystem.DSAdata && window.DSAsystem.DSAdata[0]!=0)
		{
		     return (iDiscount>=0 && iDiscount<100) ? ('<del class="em f_d"><strong>'+QBPrice(iPrice)+'</strong></del> <ins class="em">'+QBPrice(Math.round(iPrice*iDiscount/100))+'Q币('+(iDiscount/10)+'折)'+'</ins>') : (QBPrice(iPrice)+'Q币');
		}
	  else
		{
			  
			  return (iDiscount>=0 && iDiscount<100) ? ('<del class="em f_d"><strong>'+QBPrice(iPrePrice)+'</strong></del> <ins class="em">'+QBPrice(iPrice)+'Q币'+'</ins>') : (QBPrice(iPrice)+'Q币');
		}
	}
	var str = "";
	str += '<div class="tipGlobal">';
	str += '	<h3>点击图片换装</h3>';
	str += '	<p>';
	str += '		价&nbsp;&nbsp;&nbsp;格：<span>--Q币</span><br />';
	if(iType == 2)
	{
		str += '		<em>红钻价：<span>--Q币</span></em><br />';
	}
	else if (iType == 3)
	{
		str += '<em><font color="#FF9900"><B>红钻</B></font>LV2免费</em><span style="display:none">--</span><br />';
	}
	else
	{
		str += '		<em><font color="#FF9900"><B>红钻免费穿</B></font><span style="display:none">--</span></em><br />';
	}
	str += '		<em>有效期：<span>--</span></em><br />';
	if (window.DSAsystem && window.DSAsystem.DSAdata && window.DSAsystem.DSAdata[0]!=0)
	{
		str += '		<em>只有点击<strong class="btns">购买、赠送</strong>才能享受折扣</em><br />';
	}
	str += '	</p>';
	str += '</div>'; 
	var oDiv = DisplayItemTips(str, objEvent, "id_itemprice_tips", "p_tips", 199);
	var iPrice = parseInt(sPrice);
	var iDiscount = parseInt(nDiscount);
	var iRowPrice = Math.round(iPrice/iDiscount*100);
	oDiv.getElementsByTagName("SPAN")[0].innerHTML = PRICETxt(sPrice, nDiscount,iRowPrice);
	oDiv.getElementsByTagName("SPAN")[1].innerHTML = PRICETxt(sVipPrice, nVipDiscount,iRowPrice);
	oDiv.getElementsByTagName("SPAN")[2].innerHTML = iTime ? iTime : "  ";	
	oDiv.style.display = "";
};

function HideItemPriceTips()
{
	if(document.getElementById("id_itemprice_tips"))document.getElementById("id_itemprice_tips").style.display = "none";
};
function DisplaySetPriceTips(sName, sPrice, sVipPrice, objEvent)
{
	var str = "";
	str += '<div class="tipGlobal col-two">';
	str += '	<h3>点击图片换装</h3>';
	str += '	<p>';
	//str += '		<span class="nowrap text-overflow item-name">--</span><br />';
	str += '		<em>价&nbsp;&nbsp;&nbsp;格：<span>--</span>Q币</em><br />';
	str += '		<em>红钻价：<span>--</span>Q币</em><br />';
	str += '	</p>';
	str += '	<div class="alpha"></div>';
	str += '</div>'; 
	var oDiv = DisplayItemTips(str, objEvent, "id_setprice_tips", "p_tips", 199);
	//oDiv.getElementsByTagName("SPAN")[0].innerHTML = sName.escHtml();
	oDiv.getElementsByTagName("SPAN")[0].innerHTML = QBPrice(sPrice);
	oDiv.getElementsByTagName("SPAN")[1].innerHTML = QBPrice(sVipPrice);	
	oDiv.style.display = "";
};

function HideSetPriceTips()
{
	if(document.getElementById("id_setprice_tips"))document.getElementById("id_setprice_tips").style.display = "none";
};

function showOldPrice(v)
{
	if(QUSER.getInfo("vip") == 1 || GetUin()<=10000)
	{
		return '<li class="old_price"><del>价&nbsp;&nbsp;格：'+QBPrice(v)+'Q币</del></li>';
	}
	else
	{
		return '<li class="old_price">价&nbsp;&nbsp;格：'+QBPrice(v)+'Q币</li>';
	}
}

	function showNewPrice(v)
	{
		if(QUSER.getInfo("vip") == 1 || GetUin()<=10000)
		{
			if(v[0] == 2)
			{
				return '<li class="now_price">红钻价：'+QBPrice(v[1])+'Q币</li>';
			}
			else if (v[0] == 3)
			{
				return '<li class="now_price vip_price"><strong><a onclick="pgvSendClick({hottag:\'ISD.QQshow.VipMain.84TipFree2\'});" href="http://paycenter.qq.com/cgi-bin/showopenservice.cgi?service_type=qqshow" target="_blank">红钻</a></strong>LV2免费</li>';
			}else
			{
				return '<li class="now_price vip_price"><strong><a onclick="pgvSendClick({hottag:\'ISD.QQshow.VipMain.84TipFree2\'});" href="http://paycenter.qq.com/cgi-bin/showopenservice.cgi?service_type=qqshow" target="_blank">红钻</a></strong>免费穿</li>';
			}
		}
		else
		{
			if(v[0] == 2)
			{
				return '<li class="now_price">红钻价：'+QBPrice(v[1])+'Q币</li>';
			}
			else if (v[0] == 3)
			{
				return '<li class="now_price vip_price"><strong><a onclick="pgvSendClick({hottag:\'ISD.QQshow.VipMain.84TipFree2\'});" href="http://paycenter.qq.com/cgi-bin/showopenservice.cgi?service_type=qqshow" target="_blank">红钻</a></strong>LV2免费</li>';
			}
			else
			{
				return '<li class="now_price vip_price"><strong><a onclick="pgvSendClick({hottag:\'ISD.QQshow.VipMain.84TipFree2\'});" href="http://paycenter.qq.com/cgi-bin/showopenservice.cgi?service_type=qqshow" target="_blank">红钻</a></strong>免费穿</li>';
			}
		}
	}
function showClubPrice(v)
{
	if(GetUin() > 10000 && QUSER.getInfo("club")  == 1)
		return '<li class="qqvip_price">QQ会员：'+QBPrice(v)+'Q币</li>';
	else
		return '';
}
function GoMatch_U(iNo, ext1)
{
        var iMatchSex;

        if (!arguments[2])
        {
                _pgvSendClick("ISD.QQShow.BaiBian.BBDP_Out");
                 iMatchSex = QUSER.getAvSex() == "F" ? 0 : 1;
        }

        else
        {

		    iMatchSex =arguments[2]=="F" ? 0 : 1;
        }

	
	if((ext1 & 4) > 0)	
		window.location="/mall/inc/suit.html?itemno=" + iNo + "&sex=" + iMatchSex;
	else
		return;
}

function checkCanMatch_U(ext1)
{	
	if((ext1 & 4) > 0)
		return true;
	return false;
}
function addCharactor(itemCharactor, mallCharactor)
{	 
	var iCharactor	=	 itemCharactor.toString();
	var code = "";	
	if(mallCharactor == itemCharactor)
	{	
		return "";
	}
	else
	{
		switch(iCharactor)
		{
			case '1':
				code = '<sup class="new_item">新</sup>'; 				
				break;
			case '2':
				code = '<sup class="hot_item">热</sup>';
				break;
			case '10':
				code = '<sup class="se_item">精</sup>';
				break;			
			case '4':
				code ='<sup class="lover_item">情侣</sup>' 				
				break;						
			case '11':
				code = '<sup class="prize_item">奖</sup>'
				break;
			case '12':
				code = '<sup class="gift_item">赠</sup>'
				break;	  		 
			case '21':
				code = '<sup class="free_item">免费</sup>';
				break;
			case '20':
				code = '<sup class="s_3">3折</sup>';
				break;
			case '5':				
				code = '<sup class="s_5">5折</sup>';
				break;
			case '6':
				code = '<sup class="s_6">6折</sup>';
				break;
			case '8':
				code = '<sup class="s_8">8折</sup>';
				break;
			/*case '9':
				//9折物品
				break;
			*/
		 }
		 
		 if(itemCharactor=="a")//绝版标识
		 	code = '<sup class="super_item">绝</sup>';
	 }		
	return code; 		
}

function addSpecial(itemCharactor)
{
	var code = "<%new_tag%>"
	switch(itemCharactor)
	{
		case '2':
			code = '<sup class="discount_item">特</sup>'; 				
			break;
		case '3':
			code = '<sup class="vip2">lv2专属</sup>';
			break;			
	}
	return code; 		
}


function MM_preloadImages() { //v3.0
  var d=document; 
  if(d.images){
	if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; 
	for(i=0; i<a.length; i++)
		if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}
	}
};

function ACCTPAYSuccMessage(sItemBuy, sItemNoBuy, iPriceAcc, iPriceQD, iPriceGWQ, sMessage)
{
	var aPrice = getCartPrice(CartVector(sItemBuy));

	var aPayInfo = [];
	if (iPriceGWQ > 0)
	{
		aPayInfo.push("购物券中扣除了"+QBPrice(iPriceGWQ)+"个购物券");
	}
	if (iPriceAcc > 0)
	{
		aPayInfo.push("个人帐户的Q币中扣除了"+QBPrice(iPriceAcc)/10+"个Q币");
	}
	if (iPriceQD > 0)
	{
		aPayInfo.push("Q点帐户中扣除了"+iPriceQD/10+"个Q点");
	}
	if(0 == iPriceGWQ && 0 == iPriceAcc && 0 == iPriceQD)
	{
		aPayInfo.push("个人账户中扣除了 0 Q币。");
	}
	
	var sPayInfo = (aPayInfo.length>0) ? ("共从您的"+aPayInfo.join(" ")+"。") : ("");

	var sMessage = "您此次共购买了"+aPrice[3]+"件QQ秀。"+sPayInfo;

	return sMessage;
}

function view(no,dirUrl)
{
	if(top.topfra && top.mainfra)
	{
		frameChange(no);
	}else
	{
	  window.open("http://show.qq.com/show.html?MUrl=" + (dirUrl).escUrl(),"_blank");
  }
};



if (!top.g_iMallNo)
{
top.g_iMallNo = parseInt(getURLParam("mallno"),10);
}
var no = top.g_iMallNo;
var dataArr;

/* 已改为管理端控制,请勿在此修改,详情build_banner.js
var mapBanner = [
	[],
	["106020400", "http://imgcache.qq.com/qqshow/swf/mb_banner20080526.jpg",1,"javascript:frameChange(106020409)"],
	["206010400", "http://imgcache.qq.com/qqshow/swf/mb_banner20080526.jpg",1,"javascript:frameChange(206010408)"],
	["206180000", "http://imgcache.qq.com/qqshow/swf/diney_banner_20080527.jpg",1,"javascript:frameChange(206180800)"],
	["106110000", "http://imgcache.qq.com/qqshow/swf/diney_banner_20080527.jpg",1,"javascript:frameChange(106110800)"],
	["106020800", "http://imgcache.qq.com/qqshow/swf/chicaloca_760_60_20070925.swf",0],	
	["101130000","http://imgcache.qq.com/qqshow/swf/banner_christmas.swf",0],
	["206080500","http://imgcache.qq.com/qqshow/swf/slamdunk.jpg",1],
	["206060300","http://imgcache.qq.com/qqshow/swf/banner_luolita.jpg",1,"http://lady.qq.com/zt/2008/luolita/index.htm","_blank"],
	["107060000","http://imgcache.qq.com/qqshow/swf/cib_20080409.jpg",1,"/live/cib/cib_reg.html","mainfra"],
	["206080600","http://imgcache.qq.com/qqshow/swf/a080402.jpg",1],
	["206080700","http://imgcache.qq.com/qqshow/swf/gfzw.jpg",1],
	["204000000","http://imgcache.qq.com/qqshow/swf/banner_disneydzp.gif",1,"http://show.qq.com/live/disneydzp/","_blank"],
	["206080800","http://imgcache.qq.com/qqshow/swf/cb.jpg",1],
	//["203000000","http://imgcache.qq.com/qqshow/swf/christ_20080625.jpg",1,"http://ad.cn.doubleclick.net/clk;202743922;26926050;a?http://ad.qq.com/crest/","_blank"],
	//["103000000","http://imgcache.qq.com/qqshow/swf/christ_20080625.jpg",1,"http://ad.cn.doubleclick.net/clk;202743922;26926050;a?http://ad.qq.com/crest/","_blank"],
	["206080000","http://imgcache.qq.com/qqshow/swf/banner_disneydzp.gif",1,"http://show.qq.com/live/disneydzp/","_blank"],
	["106080000","http://imgcache.qq.com/qqshow/swf/banner_disneydzp.gif",1,"http://show.qq.com/live/disneydzp/","_blank"]
];
*/

function getNavList(iNo)
{
	var aNav = new Array();
	while(mallMenu[iNo])
	{		
		aNav[aNav.length] = mallMenu[iNo];
		aNav[aNav.length-1][5] = iNo;
		iNo += 100;
	}	
	return aNav;
}
function initThirNav()
{
	if(!top.g_iMallNo) top.g_iMallNo = 201010000;
	var iNo = parseInt(top.g_iMallNo/10000,10)*10000 + 100;
	var aArray = new Array();
	while(mallMenu[iNo])
	{		
		aArray[aArray.length] = getNavList(iNo);
		iNo = parseInt(iNo/1000,10)*1000+2100;	
	}
	var sHtmlTpl = document.body.innerHTML.between("<!--TPL.LIST1","TPL.LIST1-->");
	var sHead = sHtmlTpl.between("<%--LB--%>","<%--EB--%>");
	var sBody1 = sHtmlTpl.between("<%--EB--%>","<%--EC--%>");
	var sBody2 = sHtmlTpl.between("<%--EC--%>", "<%--EE--%>");
	var sTail = sHtmlTpl.between("<%--EE--%>","<%--LE--%>");
	var sOutHtml = "";
	var iThirNavNum = 0;
	for(var i = 0;i < aArray.length;i++)
	{
		sOutHtml += sHead;
		for(var j = 0; j < aArray[i].length; j++)
		{
			if( j == 0) sOutHtml += sBody1.replace(/<%style%>/g,aArray[i][j][1]);
			else 
			{						
				if((aArray[i][j][4].toString().length==0) || (aArray[i][j][4].toString() == QUSER.getAvSex())) 
				{	  
					if(j > 1) sOutHtml += "|";
					sOutHtml += sBody2.replace(/<%nav_name%>/g,aArray[i][j][1]).replace(/<%nav_mallno%>/g,aArray[i][j][5]).replace(/<%css%>/g,(parseInt(aArray[i][j][5].toString().substr(5,2),10)==parseInt(top.g_iMallNo.toString().substr(5,2),10)?"now":(((top.g_iMallNo%10000 == 0)&&(iThirNavNum==1))?"now":"")));
				}
			}
			iThirNavNum++;
		}
		sOutHtml += sTail;
	}
	if(iThirNavNum > 0)
	{
		document.getElementById("menu_class_3_m").innerHTML = sOutHtml;
		document.getElementById("menu_class_3_t").style.display = "";
		document.getElementById("menu_class_3_m").style.display = "";
		document.getElementById("menu_class_3_f").style.display = "";
	}
	else
	{
		document.getElementById("menu_class_3_m").innerHTML = "";
		document.getElementById("menu_class_3_t").style.display = "none";
		document.getElementById("menu_class_3_m").style.display = "none";
		document.getElementById("menu_class_3_f").style.display = "none";
	}

}
function initForthNav()
{ 
	var iNo = parseInt(top.g_iMallNo/100,10)*100 + 1;
	//修正点击三级菜单，四级菜单不加注的体验
	if(parseInt(top.g_iMallNo.toString().substr(7,2),10)==0 &&  mallMenu[iNo])
	{	
		top.g_iMallNo = iNo;
		initList();
	}
	var sHtmlTpl = document.body.innerHTML.between("<!--TPL.LIST2","TPL.LIST2-->");
	var sHead = sHtmlTpl.between("<%--HD--%>","<%--LB--%>");
	var sBody = sHtmlTpl.between("<%--EB--%>","<%--EE--%>");
	var sTail = sHtmlTpl.between("<%--LE--%>","<%--TL--%>");
	var sOutHtml  = sHead;
	var iForthNavNum = 0;
	while( mallMenu[iNo])
	{	
		if(parseInt(iNo%100,10)>1) sOutHtml += "|";
		sOutHtml += sBody.replace(/<%name%>/g,mallMenu[iNo][1]).replace(/<%nav_mallno%>/g,iNo).replace(/<%css%>/g,(parseInt(iNo.toString().substr(7,2),10)==parseInt(top.g_iMallNo.toString().substr(7,2),10)?"now":""));
		iNo += 1;
		iForthNavNum++;
	}
	sOutHtml += sTail;
	if(iForthNavNum > 0)
	{
		document.getElementById("menu_class_4").innerHTML = sOutHtml;
		document.getElementById("menu_class_4").style.display = "";
	}
}
function load()
{
	var iPage = 1;
	if(getHashParam("pno").length>0)iPage = parseInt(getHashParam("pno"),10);
	try
	{
		DSAsystem();
		DSAInit();
		var sex = "F";
		if(QUSER)
		{
			sex = QUSER.getAvSex();
		}
		var id = mallMenu[top.g_iMallNo][0];
		dataArr = eval("item"+id+"_"+sex);
		printList(dataArr,iPage);
	}
	catch(e)
	{}
}
function loadJs()
{
	var sex = "F";
	if(QUSER) sex = QUSER.getAvSex();
	var id = mallMenu[top.g_iMallNo][0];
	var url = "http://imgcache.qq.com/qqshow/v2/js/mall/qqshow_mall_"+id+"_"+sex+".js";
	var o = new GetJs(url,load,load);
	o.init();
}
function tabChange(n)
{
	dataArr = [];
	top.g_iMallNo = n;
	setHashParam("pno",1);
	initItem();
}
function initList()
{
	selectCss(document.getElementById("ID_sort").getElementsByTagName("a"), 0, "em");
	document.getElementById("list").innerHTML = "";	
	document.getElementById("ID_page").innerHTML = "";

	if(top.g_iMallNo) no = parseInt(top.g_iMallNo, 10);
	else return;

	if(isNaN(no) || no.toString().length !=9 ) return;
	
	//如果是一级菜单，则寻找她的二级菜单是否存在
	if((no%1000000 == 0)&&(mallMenu[no+10000])) no += 10000;
	
	//如果切换过来后，找不到对应的菜单，则向前推算
	while(!mallMenu[no] || (mallMenu[no][4].length>0&&(mallMenu[no][4]!="N"&&mallMenu[no][4]!=QUSER.getAvSex())))
	{
		if(no%1000000 == 0) break;
		else no -= 10000;
	}
	
	//实在找不到，回到首页
	if(!mallMenu[no])
	{
		no = 101010000;
		frameChange(no);
		return;
	}
	else if(mallMenu[no][2].length>5)
	{
		frameChange(no);
		return;
	}
	if((mallMenu[no][4].toString().length>0) && (mallMenu[no][4].toString()!=QUSER.getAvSex())) 
		no = parseInt((no.toString().substr(0,5)+"0000"), 10);
	if(top.g_iMallNo != no)
	{
		top.g_iMallNo = no;
		frameChange(no);
	}
	var sex = QUSER.getAvSex();
	setSexFn(sex);
	if(top.g_iMallNo.toString().length == 9)
	{	
		fillTemple();
	}
	else 
	{
		location="/inc/main.html";
	}
}

//fillTemple,填充模版	 
function fillTemple()
{ 
	var style = 1;
	if("undefined"!=typeof(QUSER)) style = QUSER.getStyle();
	top.g_iMallNo = parseInt((style+1).toString()+top.g_iMallNo.toString().substr(1,8));

	//对特效QQ秀做特殊处理，每次进来都直接到"前景"
	if(top.g_iMallNo.toString().substr(1,8).indexOf("04050000") != -1)
		top.g_iMallNo += 200;
	//拉取js文件	
	loadJs();	 	
};

function itemDiscription(x)
{
	if (x == 2)
	{
		return "<a href=\"javascript:view(208010000,'http://show.qq.com/mall/inc/vip_index.html')\" class=\"em\">红钻</a>价：<ins><%vpricePage%> Q币</ins>";
	}else
	{
		return "<a href=\"javascript:view(208010000,'http://show.qq.com/mall/inc/vip_index.html')\" class=\"em\">红钻免费保存形象</a>";
	}
};

function _pgvSendClick(tag)
{
	if(typeof(pgvSendClick) == 'function')
		pgvSendClick({hottag:tag});
}

function GoMatch(iNo, iType)
{
	_pgvSendClick("ISD.QQShow.BaiBian.BBDP_Out");	
	var iMatchSex=QUSER.getAvSex()=="F"?0:1;	
	var sUrl="/mall/inc/suit.html?itemno=" + iNo + "&sex=" + iMatchSex;	
	if(iType&&iType==1){
		if(top&&top.mainfra)top.mainfra.location=sUrl;
	}
	else{
		window.location=sUrl;
	}
}

function checkCanMatch(ext1)
{		
	if((ext1 & 4) > 0)
		return true;
	return false;
}
var g_perPage=30;
// 打印item列表	
function printList(arr,pagenum)
{
	var sHtml = document.body.innerHTML.between("<!--TPL.LIST3","TPL.LIST3-->");
	if (top.g_iMallNo=="212020000"||
		top.g_iMallNo=="212060000"||
		top.g_iMallNo=="212020200"||
		top.g_iMallNo=="212020300"||
		top.g_iMallNo=="212020400"||	
		top.g_iMallNo=="112020000"||
		top.g_iMallNo=="112060000"||
		top.g_iMallNo=="112020200"||
		top.g_iMallNo=="112020300"||
		top.g_iMallNo=="112020400"
	)
	{
		 sHtml = document.body.innerHTML.between("<!--TPL.LIST4","TPL.LIST4-->");
		 document.getElementById("list").setAttribute("class","clearfix item_single_btn");
		 document.getElementById("list").setAttribute("className","clearfix item_single_btn");
	}
	var iPage = 1;
	var iItemPerPage = g_perPage;
	var iTotalPageNum = Math.ceil(dataArr.length/iItemPerPage);
	if(pagenum) iPage = parseInt(pagenum,10);

	/*add by terrencefan,2008.05.13*/
	var sItemNo	=	getURLParam("itemno");
	if(sItemNo)
	{
		for(var k=0; k<dataArr.length; k++)
		{
			if(parseInt(dataArr[k][0], 10) == parseInt(sItemNo, 10))
			{
				iPage = parseInt(k/iItemPerPage, 10)+1;
				break;
			}
		}
	}
	/***********end*********/

	setHashParam("pno",iPage);
	var iBegin = (iPage-1)*iItemPerPage;
	var iEnd = Math.min(iBegin+iItemPerPage,dataArr.length);
	var oParent = document.getElementById("list");
	var style = 1;
	if("undefined"!=typeof(QUSER)) style = QUSER.getStyle();

	function showOldPrice(v)
	{
		if(QUSER.getInfo("vip") == 1 || GetUin()<=10000)
		{
			return '<li class="old_price"><del>价&nbsp;&nbsp;格：'+QBPrice(v)+'Q币</del></li>';
		}
		else
		{
			return '<li class="old_price">价&nbsp;&nbsp;格：'+QBPrice(v)+'Q币</li>';
		}
	}

	function showNewPrice(v)
	{
		if(QUSER.getInfo("vip") == 1 || GetUin()<=10000)
		{
			if(v[0] == 2)
			{
				return '<li class="now_price">红钻价：'+QBPrice(v[1])+'Q币</li>';
			}
			else if (v[0] == 3)
			{
				return '<li class="now_price vip_price"><strong><a onclick="pgvSendClick({hottag:\'ISD.QQshow.VipMain.84TipFree2\'});" href="http://paycenter.qq.com/cgi-bin/showopenservice.cgi?service_type=qqshow" target="_blank">红钻</a></strong>LV2免费</li>';
			}else
			{
				return '<li class="now_price vip_price"><strong><a onclick="pgvSendClick({hottag:\'ISD.QQshow.VipMain.84TipFree2\'});" href="http://paycenter.qq.com/cgi-bin/showopenservice.cgi?service_type=qqshow" target="_blank">红钻</a></strong>免费穿</li>';
			}
		}
		else
		{
			if(v[0] == 2)
			{
				return '<li class="now_price">红钻价：'+QBPrice(v[1])+'Q币</li>';
			}
			else if (v[0] == 3)
			{
				return '<li class="now_price vip_price"><strong><a onclick="pgvSendClick({hottag:\'ISD.QQshow.VipMain.84TipFree2\'});" href="http://paycenter.qq.com/cgi-bin/showopenservice.cgi?service_type=qqshow" target="_blank">红钻</a></strong>LV2免费</li>';
			}
			else
			{
				return '<li class="now_price vip_price"><strong><a onclick="pgvSendClick({hottag:\'ISD.QQshow.VipMain.84TipFree2\'});" href="http://paycenter.qq.com/cgi-bin/showopenservice.cgi?service_type=qqshow" target="_blank">红钻</a></strong>免费穿</li>';
			}
		}
	}
	function showClubPrice(v)
	{
		if(GetUin() > 10000 && QUSER.getInfo("club")  == 1)
			return '<li class="qqvip_price">QQ会员：'+QBPrice(v)+'Q币</li>';
		else
			return '';
	}
	

	var mapName=[
		['0','<%no%>'],
		['1','<%discription%>',itemDiscription],
		['0', '<%img%>',function(v){return "http://qqshow2-item.qq.com/"+v+"/00/00/";}],
		['0', '<%img_css%>',function(v){return style==0?"old":""}],
		['14', '<%itemname%>', function(v){ return v.asccut(8).escHtml(); }],		
		['12','<%sex%>'],
		['11','<%playno%>'],
		['3','<%pose%>'],
		['4','<%posebind%>'],
		['8','<%x%>'],
		['9','<%y%>'],
		['5','<%bmove%>'],
		['6','<%brot%>'],
		['7','<%bselc%>'],
		['21','<%bspecial%>'],
		['16','<%price%>'],
		['17','<%vprice%>'],
		['16','<%pricePage%>',QBPrice],
		['17','<%vpricePage%>',QBPrice],
		['1', '<%type%>'],
		[['1','16','17','0', '25'], '<%item_main_price%>',function(v){return showMainPrice(v);}],
		['16', '<%item_old_price%>',function(v){return showOldPrice(v);}],
		['17', '<%item_club_price%>',function(v){return showClubPrice(v);}],
		[['1','17'], '<%item_new_price%>',function(v){return showNewPrice(v);}],
		['0', '<%slogo%>',function(v){return "";}],
		["12","<%sexname%>",function(v){return SexWord(v)}],
		["15","<%vtime%>",toExpTime],
		["14","<%name%>",function(v){return v.escScript().escHtml();}],
		['0','<%from%>',function(v){return top.g_iMallNo;}],
		['1','<%new_tag%>',function(v){return addSpecial(v);}],
		["20","<%new_tag%>",function(v){return addCharactor(v, mallMenu[mallNo][7]);}],
		["0", "<%COMMENT_B%>", function(v){ return (DSAsystem.DSAdata[0]==0 ? "" : "<\!--"); }],
		["0", "<%COMMENT_E%>", function(v){ return (DSAsystem.DSAdata[0]==0 ? "" : "--\>"); }],
		['18','<%discount%>'],
		['19','<%vip_discount%>'],
		['25', "<%display%>", function(v){return "none";}],
		[ '@abs(I)','<%imgno%>',function(v){return (v%30);}],
		['16', '<%button1_display%>', function(v){return v>0?"":"none"}],
		['16', '<%button2_display%>', function(v){return v>0?"none":""}]
		];

	//get the correct css class name.
	var itemCss = 'item_84_84';	
	
	if("undefined"!=typeof(QUSER)) style = QUSER.getStyle();	
	top.g_iMallNo = parseInt((style+1).toString()+top.g_iMallNo.toString().substr(1,8));	
	mallNo = top.g_iMallNo;
	
	if(!isNaN(mallNo) && mallMenu[mallNo][6] != undefined && mallMenu[mallNo][6].length > 0){		
		itemCss = mallMenu[mallNo][6];
	}
	sHtml = sHtml.replace(/<%itemCss%>/g, itemCss);

	//set the parent class
	if(itemCss == "item_140_140")
	{
		oParent.className="item_140_ol clearfix";
	}
	else if(itemCss == "item_90_120")
	{
		oParent.className ="item_90_ol clearfix";
	}else if(itemCss == "item_110_165")
	{
		oParent.className ="item_140_ol clearfix";
	}else if(itemCss == "item_84_84")
	{
		oParent.className	=	"clearfix";
	}
		
	showQQSHOWData(dataArr, oParent, sHtml, mapName, iBegin, iEnd, 4);	
	showQQSHOWPage(iPage,iTotalPageNum,function(n){return "javascript:printList(dataArr,"+n+");";},document.getElementById("ID_page"),0);
	refreshMatchItem(iPage);
	
	prevItem('list','li');
	if("undefined"!=typeof(QUSER)) 
		style = QUSER.getStyle();	
	top.g_iMallNo = parseInt((style+1).toString()+top.g_iMallNo.toString().substr(1,8));	
	var mallNo = top.g_iMallNo;
	if(!isNaN(mallNo) && mallMenu[mallNo][6] != undefined && mallMenu[mallNo][6].length > 0)
	{	
		document.getElementById("list").className += " "+ mallMenu[mallNo][6] + "_ol";
	}

	window.scrollTo(0, 0);
};
function refreshMatchItem(pno){	
	var iItemNo;
	function fnSucc(xmlDoc){
		var ob=xmlDoc.getElementsByTagName("QQSHOW")[0];
		changeMatchItem(iItemNo,ob.getAttribute("show"),ob.getAttribute("time"),ob.getAttribute("sid"));				
	};
	function fnFail(xmlDoc){};
	function partSortArray(iBegin,iEnd,arr)
	{
		var newArr=[];
		for(var i=iBegin,j=0;i<iEnd;i++,j++)
		{
			newArr[j]=arr[i];
		}
		return newArr.sort(function sortFunction2(x,y){return parseInt(y[23],10)-parseInt(x[23],10)});
	}
	if(g_bMatchItem){
		var iSex=QUSER.getAvSex()=="F"?0:1;		
		var iBegin=g_perPage*(pno-1),iEnd=iBegin;				
		var tmpArr=[];
		while(true)
		{
			if(dataArr.length-iBegin>g_perPage){
				iEnd+=g_perPage;
			}
			else{
				iEnd=dataArr.length;
			}						
			tmpArr=partSortArray(iBegin,iEnd,dataArr);			
			for(i=0;i<tmpArr.length;i++){					
				if((tmpArr[i][25]&(iSex+1))>0){
					if(tmpArr[i][0]==matchItem[0]){
						changeMatchItem(matchItem[0],matchItem[1],matchItem[2],matchItem[3]);
						return;
					}
					iItemNo=tmpArr[i][0];
					getQQSHOWXml("http://show.qq.com/cgi-bin/qqshow_match_single_figure?itemno="+iItemNo+"&sex="+iSex,fnSucc,fnFail,fnFail);				
					return;			
				}
			}			
			if(iEnd==dataArr.length){
				break;
			}			
			iBegin=iEnd;			
		}		
	}
}
function showMainPrice(v)
{
	if(v[1] >0)
	{
		if(checkCanMatch(v[4]))
		{
			return '<strong ><a href="javascript:GoMatch('+v[3]+', '+v[4]+')" class="em">相关搭配</a></strong>';
		}
		else 
		{
			return '<strong >&nbsp;&nbsp;&nbsp;&nbsp;</strong>';
		}
	}
	else
	{	
		return '<strong ><span class="em">免费物品</span></strong>';
	}
};
//item根据时间和人气排序功能
function itemSort(i)
{
	var dataArr2 = dataArr;
	if(("undefined" != typeof(dataArr))&&(dataArr.length>0))
	{
		if(i=="0")
		{
			//按新品排序
			printList(dataArr2.sort(function sortFunction1(x,y){return parseInt(x[22],10)-parseInt(y[22],10)}));
		}
		else
		{
			//按人气排序
			printList(dataArr2.sort(function sortFunction2(x,y){return parseInt(y[23],10)-parseInt(x[23],10)}));
		}
	}
	selectCss(document.getElementById("ID_sort").getElementsByTagName("a"), i, "em");
	return;
}
function initItem()
{
	initList();
	refreshHeader();
	initThirNav();
	if(parseInt(top.g_iMallNo.toString().substr(5,2),10) != 0) initForthNav();
	else document.getElementById("menu_class_4").style.display = "none";
}
var g_mItems0=[],g_mItems1=[],g_bMatchItem=0;
var mapMatchItem=[
		['0','<%no%>'],				
		['12','<%sex%>'],
		['11','<%playno%>'],
		['3','<%pose%>'],
		['4','<%posebind%>'],
		['8','<%x%>'],
		['9','<%y%>'],
		['5','<%bmove%>'],
		['6','<%brot%>'],
		['7','<%bselc%>'],
		['21','<%bspecial%>'],		
		['17','<%vprice%>'],		
		['1', '<%type%>'],		
		['16', '<%price%>',QBPrice],		
		['0', '<%slogo%>',function(v){return "";}],
		["12","<%sexname%>",function(v){return SexWord(v)}],
		["15","<%vtime%>",toExpTime],
		["14","<%name%>",function(v){return v.escScript().escHtml();}],
		['0','<%from%>',function(v){return top.g_iMallNo;}]		
		];

function XSendAll(sItem, sFrom){
	if (CheckLogin(1)){
		FloatShow("http://show.qq.com/mall/inc/don_mul.html?show="+sItem.escUrl(), 434, 346, null, null, 0, -100);
	}
}
function XAskAll(sItem, sFrom){
	if (CheckLogin(1)){
		FloatShow("http://show.qq.com/mall/inc/req_mul.html?&show="+sItem.escUrl(), 434, 346, null, null, 0, -100);
	}
}
function AddCollection(show_sn)
{
	if(CheckLogin(1))
	{
		ShowCollectionAdd([show_sn, "我的收藏", "", "", 0]);
	}
}
function initMatchItems()
{
		var id = mallMenu[top.g_iMallNo][0];
		var sex = QUSER?QUSER.getAvSex():"F";		
		try{
			dataArr = eval("item"+id+"_"+sex);
		}catch(e){return false;}
		if(typeof(matchItem)=="undefined"){	
			window.location="/mall/inc/item.html"+window.location.search;			
			return;
		}
		for(var i=0;i<dataArr.length&&i<4;i++){
			g_mItems1[i]=dataArr[i];
		}					
		var dataArr2=[].concat(dataArr);
		dataArr2.sort(function sortFunction2(x,y){return parseInt(y[23],10)-parseInt(x[23],10)})
		for(var i=0;i<dataArr2.length&&i<4;i++){
			g_mItems0[i]=dataArr2[i];
		}
		
		g_bMatchItem=1;					
		var sPno=getHashParam("pno");
		var iPno=sPno.length>0?parseInt(sPno):1;					
		if(iPno==1&&matchItem instanceof Array && matchItem.length==4){
			changeMatchItem(matchItem[0],matchItem[1],matchItem[2],matchItem[3]);			
		}
		else{			
			refreshMatchItem(iPno);						
		}		
		document.getElementById("match_item_ID").style.display="";
		return true;
}
function setMatchItems(type)
{	
	if(g_mItems0.length==0){
		if(!initMatchItems()){setTimeout(setMatchItems,100);return;};
	}			
	var items=[];
	items=(type==1?g_mItems1:g_mItems0);
	var oParent = document.getElementById("matchItem_ID");
	var sHtml = document.body.innerHTML.between("<!--TPL.LISTITEM","TPL.LISTITEM-->");
	showQQSHOWData(items, oParent, sHtml, mapMatchItem, -1, -1, -1);		
}
function changeMatchItem(iItemNo,show,time,sid){
		var sMall=top.g_iMallNo+"";
		document.getElementById("match_total_ID").src="http://qqshow-item.qq.com/"+time+"/"+sid%100+"/"+sid+".gif"
		show=show.escScript().escMiniUrl();
		document.getElementById("match_total_ID").onclick=function(){PutOnShow(show, sMall)};			
		document.getElementById("buyAll_ID").onclick = function(){RBuyAll(show, sMall,0)};
		document.getElementById("sendAll_ID").onclick=function(){XSendAll(show, sMall)};
		document.getElementById("askAll_ID").onclick=function(){XAskAll(show, sMall)};
		document.getElementById("favAll_ID").onclick=function(){AddCollection(show)};			
		document.getElementById("match_single_ID").src="http://qqshow2-item.qq.com/"+iItemNo+"/00/00/cache.gif"			
}
function change2hot(){
	document.getElementById("match_hot_ID").className="here";
	document.getElementById("match_new_ID").className="";
	setMatchItems(0);	
}
function change2new(){
	document.getElementById("match_hot_ID").className="";
	document.getElementById("match_new_ID").className="here";
	setMatchItems(1);	
}
function tabChange2(n)
{
	tabChange(n);
	g_mItems0=[],g_mItems1=[];
	setMatchItems(0);
}

function objMouseEvent(overObj,outObj,targetObj,overClass,outClass){
	var _o = "init";
	overObj.onmouseover = function(){
		_o = "overOverObj";
		targetObj.className=overClass;
		outObj.onmouseover = function(){
			_o='overOutObj';targetObj.className=overClass;
		}
	}
	overObj.onmouseout = function(){_o='outOverObj';}
	outObj.onmouseout = function(){
		_o = "outOutObj";
		if(_o!='outOverObj')
			targetObj.className=outClass;
	}
}

function prevItem(wrap,tName,cName){
	if(!wrap)return;
	if(!cName){cName=['global_item','global_item preview','global_item preview first_item','global_item preview last_item']}
	var items = document.getElementById(wrap).getElementsByTagName(tName);
	if(items.length <= 0)
	{
		return setTimeout(function(){ prevItem(wrap, tName); }, 1000);
	}
	for(var i=0;i<items.length;i++){
		if(items[i].className!=cName[0])continue;
		var _tObj = items[i];
		if(_tObj.offsetLeft>document.getElementById(wrap).offsetWidth-_tObj.offsetWidth-50){
			objMouseEvent(items[i].getElementsByTagName('img')[0],items[i].getElementsByTagName('div')[0],items[i],cName[3],cName[0]);
		}else if(_tObj.offsetLeft<50){
			objMouseEvent(items[i].getElementsByTagName('img')[0],items[i].getElementsByTagName('div')[0],items[i],cName[2],cName[0]);
		}else{
			objMouseEvent(items[i].getElementsByTagName('img')[0],items[i].getElementsByTagName('div')[0],items[i],cName[1],cName[0]);
		}		
	}
}
