function ShowGameList(game,storageFlag)
{
	document.getElementById("showgame").src='Homes/HomeGameList.aspx?game='+game;
	
	document.getElementById("hidSelectGame").value = game;
	
	if(game == "WOW")
	{
		document.getElementById("tabTWOWGameTitle").style.display = "block";
		document.getElementById("tabTWOWGameTitle2").style.display = "none";	
		document.getElementById("tabWOWGameTitle").style.display = "none";
		document.getElementById("tabOtherGameTitle").style.display = "none";
	}
	else if(game == "EUWOW" || storageFlag =="1")
	{
		document.getElementById("tabTWOWGameTitle").style.display = "none";
		document.getElementById("tabTWOWGameTitle2").style.display = "none";	
		document.getElementById("tabWOWGameTitle").style.display = "block";
		document.getElementById("tabOtherGameTitle").style.display = "none";
	}
	else
	{
		document.getElementById("tabTWOWGameTitle").style.display = "none";
		document.getElementById("tabTWOWGameTitle2").style.display = "none";	
		document.getElementById("tabWOWGameTitle").style.display = "none";
		document.getElementById("tabOtherGameTitle").style.display = "block";
	}
}

function ShowWOWGameListHeader2()
{
	document.getElementById("tabTWOWGameTitle").style.display = "none";
	document.getElementById("tabTWOWGameTitle2").style.display = "block";	
	document.getElementById("tabWOWGameTitle").style.display = "none";
	document.getElementById("tabOtherGameTitle").style.display = "none";
}


function showItem(obj)
{
	if(obj.id == "divBtn1")
	{
		obj.style.backgroundImage="url(images/index_44_1.gif)";
		obj.style.color = "orangered";
		
		document.getElementById("divBtn2").style.backgroundImage ="url(images/index_44_2.gif)";
		document.getElementById("divBtn2").style.color = "#808080";
		
		document.getElementById("divUI1").style.display = "block";
		document.getElementById("divUI2").style.display = "none";
	}
	if(obj.id == "divBtn2")
	{
		obj.style.backgroundImage="url(images/index_44_21.gif)";
		obj.style.color = "orangered";
		
		document.getElementById("divBtn1").style.backgroundImage ="url(images/index_44_12.gif)";
		document.getElementById("divBtn1").style.color = "#808080";
		
		document.getElementById("divUI2").style.display = "block";
		document.getElementById("divUI1").style.display = "none";
	}
	if(obj.id == "divBtn3")
	{
		obj.style.backgroundImage="url(images/index_44_1.gif)";
		obj.style.color = "orangered";
		
		document.getElementById("divBtn4").style.backgroundImage ="url(images/index_44_2.gif)";
		document.getElementById("divBtn4").style.color = "#808080";
		
		document.getElementById("divUI3").style.display = "block";
		document.getElementById("divUI4").style.display = "none";
	}
	if(obj.id == "divBtn4")
	{
		obj.style.backgroundImage="url(images/index_44_21.gif)";
		obj.style.color = "orangered";
		
		document.getElementById("divBtn3").style.backgroundImage ="url(images/index_44_12.gif)";
		document.getElementById("divBtn3").style.color = "#808080";
		
		document.getElementById("divUI4").style.display = "block";
		document.getElementById("divUI3").style.display = "none";
	}
}

function validateQQ()
{
	var valiInfo = "0";
	
	var txtValiDateQQ = document.getElementById("txtValiDateQQ").value;
	if(txtValiDateQQ == "") return;
	
	if(isNaN(txtValiDateQQ))
	{
		alert("ÇëÊäÈëQQºÅÂë£¡");
		document.getElementById("txtValiDateQQ").value = "";
		return;
	}
	
	var allQQStr =document.getElementById("hidAllQQStr").value;
	
	var allQQStrArr = allQQStr.split('$');
	for(var i=0;i< allQQStrArr.length;i++)
	{
		if(allQQStrArr[i] == txtValiDateQQ)
		{
			valiInfo = allQQStrArr[i];
		}
	}
	
	var url="Homes/ValidateQQResult.aspx?valiInfo="+valiInfo;
	var aObj = document.getElementById("aValitateQQ");
	
	var targetName = 'chat_'+(new Date()).getTime();

	aObj.target = targetName;
	aObj.href = url;

	window.open(''+url+'',''+targetName+'','height=410,width=464,location=no,menubar=no,resizable=no,scrollbars=yes,status=no,titlebar=no,toolbar=no,directories=no,top=0,left=0');
}

//******************* login part *******************

function gotoRegUrl()
{
	var type = "0";
	var setValue = document.getElementById("RadioButtonList1").getElementsByTagName("INPUT");
	for(var i =0;i<setValue.length;i++ )
	{
		if(setValue[i].checked)
			type = setValue[i].value;
	}

	if(type == "0")
	{
		window.location.href = "Workgroup/RegNote.aspx";
	}
	
	if(type == "1")
	{
		window.location.href = "Customer/RegNote.aspx";
	}
}

function gotoAccountUrl()
{
	if(document.getElementById("hidWgType").value == "1")
	{
		window.location.href = "Workgroup/index.aspx";
	}
	else if( document.getElementById("hidCustType").value == "1")
	{
		window.location.href = "Customer/index.aspx";
	}
}

function seekForPwd()
{
	var seekObj = document.getElementById("RadioButtonList1");
	var rbs= seekObj.getElementsByTagName("INPUT");
	var seekFlg = "0";
	for(var i =0;i< rbs.length;i++)
	{
		if(rbs[i].checked)
			seekFlg = rbs[i].value;
	}
	
	window.location.href = "Workgroup/SeekForPwd.aspx?clientFlg="+seekFlg;
}

function submitSignin()
{
	if(!Validator.Validate(document.getElementById("Form1")))
	{
		return;
	}
	document.getElementById("divWeitImg").style.display = "block";
	document.getElementById("imgSignin").style.display = "none";
	document.getElementById("divWeitImg").innerHTML = "<font color=#690000>ÑéÖ¤ÖÐ...</font><img src =images/waitFor.gif border=0 align=absMiddle>";
	
	document.getElementById("hidSigninID").value = document.getElementById("txtUsername").value;
	document.getElementById("hidSigninPwd").value = document.getElementById("txtUserPwd").value;
	document.getElementById("hidSigninValid").value = document.getElementById("txtValid").value;
	
	var radioBtnObj = document.getElementById("RadioButtonList1").getElementsByTagName("INPUT");
	var type = "0";
	for(var i =0;i<radioBtnObj.length;i++ )
	{
		if(radioBtnObj[i].checked)
			type = radioBtnObj[i].value;
	}
	document.getElementById("hidSigninRadioBtn").value = type;
	
	var fromSubmitObj = document.getElementById("FromSignin");
	fromSubmitObj.action = "Homes/Signin.aspx?n=1";
	fromSubmitObj.target = "iframeSignin";
	fromSubmitObj.submit();
	
	document.getElementById("txtUsername").value = "";
	document.getElementById("txtUserPwd").value = "";
	document.getElementById("txtValid").value = "";
	document.getElementById('RadioButtonList1_0').checked;
}

function SigninAlert(words)
{
	alert(words);
	ShowValicode();
}

function SigningOut()
{
	var wgType = document.getElementById("hidWgType").value;
	var custType = document.getElementById("hidCustType").value;
	
	var fromSubmitObj = document.getElementById("FromSignin");
	
	if( wgType == "1" && custType == "1")
	{
		fromSubmitObj.action = "Homes/Signin.aspx?n=0&type=1&cust=1";
		fromSubmitObj.target = "iframeSignin";
		fromSubmitObj.submit();
	}
	else if(wgType == "1" && custType == "0")
	{
		fromSubmitObj.action = "Homes/Signin.aspx?n=0&type=1&cust=0";
		fromSubmitObj.target = "iframeSignin";
		fromSubmitObj.submit();
	}
	else if(wgType == "0" && custType == "1")
	{
		fromSubmitObj.action = "Homes/Signin.aspx?n=0&type=2&cust=1";
		fromSubmitObj.target = "iframeSignin";
		fromSubmitObj.submit();
	}
	else if(wgType == "0" && custType == "0")
	{
		fromSubmitObj.action = "Homes/Signin.aspx?n=0&type=0&cust=0";
		fromSubmitObj.target = "iframeSignin";
		fromSubmitObj.submit();
	}
		
	
}

function ShowValicode()
{
	var me = (Math.random()).toString();
	me = me.substr(3,4);
	
	document.getElementById("hidValiCode").value = me;
	
	document.getElementById("img1").src ="images/numberImg/"+me.substr(0,1)+".GIF";
	document.getElementById("img2").src ="images/numberImg/"+me.substr(1,1)+".GIF";
	document.getElementById("img3").src ="images/numberImg/"+me.substr(2,1)+".GIF";
	document.getElementById("img4").src ="images/numberImg/"+me.substr(3,1)+".GIF";
}

function login(evt)
{
	evt = evt ? evt : (window.event ? window.event : null);
	if(evt.keyCode==13 )
	{
		submitSignin();
	}
}

//************* goods **************

function showSellList(sellType)
{
	if(sellType == "1")
	{
		document.getElementById("divGameListBtn").style.backgroundImage = "url(images/homeGameList1.gif)";
		document.getElementById("divGoodsListBtn").style.backgroundImage = "url(images/homeGoodsList.gif)";
		
		document.getElementById("divAllGameList").style.display = "block";
		document.getElementById("divAllGoodsList").style.display = "none";
		
		var game = document.getElementById("hidSelectGame").value;
		if(game != null && game != "")
		{
			document.getElementById("tabWOWGameTitle").style.display = "block";
			document.getElementById("tabOtherGameTitle").style.display = "none";
			document.getElementById("tabGoodsTitle").style.display = "none";
		
			ShowGameList(game);
		}
	}
	
	if(sellType == "2") //goods
	{
		document.getElementById("divGameListBtn").style.backgroundImage = "url(images/homeGameList.gif)";
		document.getElementById("divGoodsListBtn").style.backgroundImage = "url(images/homeGoodsList1.gif)";
		
		document.getElementById("divAllGameList").style.display = "none";
		document.getElementById("divAllGoodsList").style.display = "block";
		
		var gameInfo = document.getElementById("hidSelectGoodsGame").value;
		if(gameInfo != null && gameInfo != "")
		{
			document.getElementById("tabWOWGameTitle").style.display = "none";
			document.getElementById("tabOtherGameTitle").style.display = "none";
			document.getElementById("tabGoodsTitle").style.display = "block";
			
			ShowGoodsList(gameInfo);
		}
		
		var gameCount = document.getElementById("hidGameCount").value;
		if(Number(gameCount)*23 > 230)
			document.getElementById("divAllGoodsList").style.height = Number(gameCount)*23-4;
		else
			document.getElementById("divAllGoodsList").style.height = 230;
	}
}

function ShowGoodsList(gameInfo)
{
	document.getElementById("hidSelectGoodsGame").value = gameInfo;
	
	document.getElementById("showgame").src='Homes/GoodsList.aspx?gameInfo=' + gameInfo;
	
	
}

//********************* QQ  List *******************

/*function ShowQQList()
{
	document.getElementById("divUI1").innerHTML = " <img src=images/spinner.gif border =0 align=absmiddle> ...";
	document.getElementById("divUI3").innerHTML = " <img src=images/spinner.gif border =0 align=absmiddle> ...";
	www17yoocom.Home.Default.GetQQList(ShowQQList_callback);
}

function ShowQQList_callback(res)
{
	var QQlistStr = res.value;
	if(QQlistStr != null)
	{
		var QQlistStrArr = QQlistStr.split("$");
		document.getElementById("divUI1").innerHTML = QQlistStrArr[0];
		document.getElementById("divUI2").innerHTML = QQlistStrArr[1];
		document.getElementById("divUI3").innerHTML = QQlistStrArr[2];
		document.getElementById("divUI4").innerHTML = QQlistStrArr[3];
	}
}*/



