var strUrl = location;
if(GetCookie("s1")==null || GetCookie("s1") == ""){

document.writeln("	<style type=\"text/css\">");
document.writeln("	<!--");
document.writeln("	body {");
document.writeln("		background:url(\"images/log_bj.jpg\") repeat-x 0 0;");
document.writeln("	}");
document.writeln("	-->");
document.writeln("	</style><div class=\"chs_loghead\"></div><table width=\"190\" height=\"260\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
document.writeln("	<form name=form1 method=post action=http://apps1.ourgame.com/login/login.asp>");
document.writeln("	  <tr>");
document.writeln("	    <td width=\"100%\" height=\"182\" valign=\"top\"><div id=\"login_online4\">");
document.writeln("        ");
document.writeln("    <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=center>");
document.writeln("	");
document.writeln("	          <tr>");
document.writeln("	            <td height=\"5\"></td>");
document.writeln("	          </tr>");
document.writeln("	");
document.writeln("	");
document.writeln("	");
document.writeln("	          <tr>");
document.writeln("	            <td height=\"25\" tabindex=1 style=\"padding:0 0 0 3\" class=\"f_g2\">游戏账号");
document.writeln("	            <input name=\"username\" type=\"text\" class=\"login_input\" size=\"12\" style=\"width:115px\"></td>");
document.writeln("	          </tr>");
document.writeln("	          <tr>");
document.writeln("	            <td height=\"25\" tabindex=2 style=\"padding:0 0 0 3\" class=\"f_g2\">密　　码");
document.writeln("	            <input name=\"password\" type=\"password\" class=\"login_input\" size=\"12\" style=\"width:115px\"></td>");
document.writeln("	          </tr>");
document.writeln("	          <tr>");
document.writeln("	            <td height=\"25\" tabindex=3 style=\"padding:0 0 0 3\" class=\"f_g2\">附 加 码");
document.writeln("	            <input name=\"rndnumber\" type=\"text\" class=\"login_input\" size=\"12\" style=\"width:57px\" onfocus=\'this.select()\' onmouseover=\'javascript:clearChr();\'  AUTOCOMPLETE=\'off\'><img src=http://apps1.ourgame.com/inc/autoimagenew.asp hspace=2 vspace=2 align=absmiddle><input type=hidden name=nexturl value=" + strUrl +"></td>");
document.writeln("	          </tr><tr>");
document.writeln("	            <td height=\"6\"></td>");
document.writeln("	          </tr>");
document.writeln("	          <tr>");
document.writeln("	            <td height=\"37\" align=\"center\" valign=\"middle\"><input name=imageField type=image src=http://www.ourgame.com/images/but_loging.gif align=middle class=\"pic\"></td>");
document.writeln("	          </tr>");
document.writeln("	          <tr>");
document.writeln("	            <td height=\"35\" align=\"center\" valign=\"middle\"><a href=\"http://register.ourgame.com/regist/index.asp?from=chesssite\" target=\"_blank\" class=\"a_login1\" style=\"line-Height:20px\">账号申请</a>　<A href=\"http://register.ourgame.com/regist/getpassword.html\" target=\"_blank\" class=\"a_login2\">查询密码</A></td>");
document.writeln("	          </tr>");
document.writeln("	  <tr>");
document.writeln("	    <td height=\"105\" align=\"center\"><table width=100% height=92 border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td width=50% align=center valign=\"middle\"><a href=\"http://counter.ourgame.com/CounterPage.ashx?id=4059&d=chess_dl_hall\" target=\"_blank\" class=\"pic\"><img src=\"images/download_home.jpg\" alt=\"下载大厅\" width=\"74\" height=\"64\" border=\"0\" id=\"index_r25_c59\" /></a></td><td width=50% align=center valign=\"middle\"><a href=\"http://counter.ourgame.com/CounterPage.ashx?id=4060&d=chess_dl_game\" target=\"_blank\" class=\"pic\"><img src=\"images/download_game.jpg\" alt=\"下载游戏\" name=\"index_r25_c65\" width=\"74\" height=\"64\" border=\"0\" id=\"index_r25_c65\" /></a></span></td></tr></table></td>");
document.writeln("	  </tr>");
document.writeln("        </table></div></td>");
document.writeln("	  </tr>");
document.writeln("	  <tr>");
document.writeln("	    <td height=\"6\"></td>");
document.writeln("	  </tr>");
document.writeln("	</form>");
document.writeln("	</table>");
}else{
	var s2=DecodeCookie(GetCookie("s2"))
	var arS2=s2.split("*@")
	var strUsername=arS2[0];
	var strNickname=arS2[1];
	var nMale=arS2[2];
	var strNowSex=arS2[3];
	var nMemberDays=arS2[4];
	var nCoin=arS2[5];
	var nMoney=arS2[6];
	var strDigitalID=arS2[7];
	var bPPApplySign=arS2[8];
	var strGroupName=arS2[9];
	var strDuty=arS2[10];
	var strMemberStartDate=arS2[11];
	var nMemberRank=arS2[12];
	var nMemberRankDays=arS2[13];
	var nMemberNextRankNeedDays=arS2[14];
	var strMemberContinueDate=arS2[15];
	var nMemberContinueDays=arS2[16];
	var nLuckyBean=arS2[19];
	var nPowerCoin = 0;
	
	try 
	{ 
		nPowerCoin=arS2[20]; 
	} 
	catch(err) 
	{ 
		
	} 
	var download_url = 'http://dltel.ourgame.com/download/Avatar27.CAB#version=2,7,0,14';
	
	//document.writeln("<link href=\"http://www.ourgame.com/glnew.css\" rel=\"stylesheet\" type=\"text\/css\" \/>");
	document.writeln("<table width=\'100%\' border=\'0\' cellpadding=\'0\' cellspacing=\'1\' bgcolor=\'D4D7D9\'>");
	document.writeln("  <tr>");
	document.writeln("    <td align=\'center\' bgcolor=\'ECEFF2\' style=\'padding:0px 0 0 0\'>");
	document.writeln("      <table width=\'100%\' border=\'0\' align=\'center\' cellpadding=\'0\' cellspacing=\'0\' bgcolor=#ffffff>");
	document.writeln("        <tr><td width=\'21\' valign=\"top\" style=\'padding:4px 0 0 0\'><td></tr>");
	document.writeln("          <tr><td width=\'21\' valign=\"top\" style=\'padding:4px 0 0 0\'>");
	document.writeln("          <td width=\'104\' valign=\'top\'>");
	document.writeln("");
	document.writeln("			<span id=\'show_2\'>");
	document.writeln("			<table width=\'104\' border=\'0\' cellspacing=\'0\' cellpadding=\'0\'>");
	document.writeln("            <tr>");
	document.writeln("              <td height=\'128\' valign=\'middle\' style='cursor: hand;padding:3px 0 3px 0' onclick='go(1)'>");
	document.writeln(" <div id='gameshow1' style='PADDING-RIGHT: 1px; PADDING-LEFT: 1px; LEFT: 1px; PADDING-BOTTOM: 1px; WIDTH: 100px; PADDING-TOP: 0px; POSITION: relative; TOP: 0px; HEIGHT: 120px; overflow:hidden; border-color:#CCCCCC; border-width:1px;' class='border_show border_pic'></div><\/td>");
	document.writeln("            <\/tr>");
	document.writeln("          <\/table>");
	document.writeln("		  ");
	document.writeln("		  <\/span>");
	document.writeln("		  ");
	document.writeln("		  ");
	document.writeln("		  <\/td>");
	document.writeln("          <td valign=\'top\' style='padding-left:2px'><table width=\'100%\' border=\'0\' cellspacing=\'0\' cellpadding=\'0\'>");
	document.write("              <TR>")
	document.write("                <TD height=10></TD>")
	document.write("              </TR>")
	
	document.write("              <TR>")
	document.write("                <TD class=f_o1>昵称</TD>")
	document.write("              </TR>")
	document.writeln("            <tr>");
	document.writeln("              <td>");
	if(strNickname==null)
	{
  		document.write("空");
  	}
  	else
  	{
  		document.write(strNickname);
  	}
	document.writeln(" <\/td>");
	document.writeln("            <\/tr>");
	document.write("                                 <TR>")
	 document.write("                                   <TD class=f_o1>游戏账号</TD>")
	 document.write("                                 </TR>")
	 document.write("                                 <TR>")
	if(strUsername.length>9)
	{
		strUsername = strUsername.substring(0,8)+"..";
	}
	else
	{
		strUsername = strUsername;
	}
	document.write("                                   <TD>" + strUsername +"</TD>")
	document.write("                                </TR>")
	document.write("                                <TR>")
	document.write("                                  <TD class=f_o1>数字ID</TD>")
	document.write("                                 </TR>")
	document.write("                                 <TR>")
	document.write("                                   <TD>" + strDigitalID +"</TD>")
	document.write("                                 </TR>")
	document.writeln("          <\/table><\/td>");
	document.writeln("        <\/tr>");
	document.writeln("      <\/table>");
	document.writeln("	  ");
	document.writeln("	  <table width=\'90%\' border=\'0\' cellspacing=\'0\' cellpadding=\'0\'>");
	document.writeln("        <tr>");
	document.writeln("          <td><A href=http://loginserver.ourgame.com/login/LoginOut.aspx?nexturl="+strUrl+"><img src=\'http:\/\/www.ourgame.com\/index\/htm\/images\/right_exit1.gif\' height=\'19\' hspace=\'4\' vspace=\'4\' border='0'></a><\/td>");
	document.writeln("          <td><A href=http://www.ourgame.com/autorun.asp target=_blank><img src=\'http:\/\/www.ourgame.com\/index\/htm\/images\/right_ingame1.gif\' height=\'19\' hspace=\'4\' vspace=\'2\' border='0'></a><\/td>");
	document.writeln("        <\/tr>");
	document.writeln("      <\/table>");
	document.writeln("	  ");
	document.writeln("	    <table width=\'176\' border=\'0\' align=\'center\' cellpadding=\'0\' cellspacing=\'0\'>");
	document.writeln(" <tr>");
	document.writeln("            <td><img src=\'http:\/\/www.ourgame.com\/images\/bj_show_tab1_t.gif\' width=\'176\' height=\'5\'><\/td>");
	document.writeln("          <\/tr>");
	document.writeln("          <tr>");
	document.writeln("            <td background=\'http:\/\/www.ourgame.com\/images\/bj_show_tab1_m.gif\'><table width=\'97%\' border=\'0\' align=\'center\' cellpadding=\'0\' cellspacing=\'0\'>");
	//document.writeln("              <tr>");
	//document.writeln("                <td height=\'21\' align=\'center\'><IMG src='http://www.ourgame.com/index/htm/images/dot_tu_mp.gif' hspace='3' vspace='2' border=0 align=\'absmiddle\'><a href=http://jh.ourgame.com/ target=_blank>门　　派</a><\/td>");
	//document.writeln("                <td width=\'98\' align=\'right\' class=\'bj_show\'>");
	//if(strGroupName==null){
  	//	document.write("空");
  	//}else{
  	//	document.write(strGroupName);
  	//}
	//document.writeln("<\/td>");
	//document.writeln("              <\/tr>");
	
	document.writeln("              <tr>");
	document.writeln("                <td height=\'21\' align=\'center\'><img src=\'http:\/\/www.ourgame.com\/index\/htm\/images\/dot_tu_cf.gif\' width=\'13\' height=\'12\' hspace=\'4\' vspace=\'2\' align=\'absmiddle\'><a href=http://shop.ourgame.com/help/cf.html target=_blank>财 富 值</a><\/td>");
	document.writeln("                <td align=\'right\' class=\'bj_show\'><a href=http://apps1.ourgame.com/srvcenter/bank/ target=_blank>" + nMoney + "点</a>&nbsp;<\/td>");
	document.writeln("              <\/tr>");
	document.writeln("              <tr>");
	document.writeln("                <td height=\'21\' align=\'center\'><img src=\'http:\/\/www.ourgame.com\/index\/htm\/images\/dot_tu_lzb.gif\' width=\'11\' height=\'13\' hspace=\'4\' vspace=\'2\' align=\'absmiddle\'><a href=http://shop.ourgame.com/BuyCoins.asp target=_blank>联 众 币</a><\/td>");
	document.writeln("                <td align=\'right\' class=\'bj_show\'><b><a href=http://shop.ourgame.com/my_account/coin_search.asp target=_blank>" + nCoin + "个</a><\/b>&nbsp;<\/td>");
	document.writeln("              <\/tr>");
	
	document.writeln("              <tr>");
	document.writeln("                <td height=\'21\' align=\'center\'><IMG src='http://www.ourgame.com/index/htm/images/dot_tu_wnd.gif' hspace='3' vspace='2' border=0 align=\'absmiddle\'>万 能 豆<\/td>");
	document.writeln("                <td width=\'98\' align=\'right\' class=\'bj_show\'><b>"+nPowerCoin+"</b>个&nbsp;<\/td>");
	document.writeln("              <\/tr>");
	document.writeln("              <tr>");
	
	document.writeln("                <td height=\'21\' align=\'center\'><img src=\'http:\/\/www.ourgame.com\/resume\/images\/icon_09.gif\' width=\'12\' height=\'12\' hspace=\'4\' vspace=\'2\' align=\'absmiddle\'><a href=http://shop.ourgame.com/lucky/ target=_blank>幸 运 点</a><\/td>");
	document.writeln("                <td align=\'right\' class=\'bj_show\'>"+nLuckyBean+"点&nbsp;<\/td>");
	document.writeln("              <\/tr>");
	document.writeln("              <tr>");
	document.writeln("                <td height=\'21\' align=\'center\'><img src=\'http://www.ourgame.com/index/htm/images/dot_tu_hy.gif\' hspace=\'4\' vspace=\'2\' align=\'absmiddle\'><a href=http://www.ourgame.com/member/ target=_blank>资格</a><img src=\'http:\/\/www.ourgame.com\/index\/htm\/images\/sline.gif\' width=\'2\' hspace=\'1\' vspace=\'1\' align=\'absmiddle\'><a href=http://www.ourgame.com/resume/icon.html target=_blank>资历</a><\/td>");
	document.writeln("                <td align=\'right\' class=\'bj_show\'><b><a href=http://www.ourgame.com/resume/searchres.asp target=_blank>" + nMemberDays + "天</a><\/b>/<b><a href=http://www.ourgame.com/resume/searchres.asp  target=_blank>" + nMemberRank + "级</a><\/b>&nbsp;<\/td>");
	document.writeln("              <\/tr>");
	document.writeln("");
	document.writeln("            <\/table><\/td>");
	document.writeln("          <\/tr>");
	document.writeln("          <tr>");
	document.writeln("            <td><img src=\'http:\/\/www.ourgame.com\/images\/bj_show_tab1_b.gif\' width=\'176\' height=\'5\'><\/td>");
	document.writeln("          <\/tr>");
	document.writeln("        <\/table>");
	document.writeln("	    <table width=\'100%\' border=\'0\' align=\'center\' cellpadding=\'0\' cellspacing=\'0\'>");
	document.writeln("          <tr>");
	document.writeln("            <td align=\'center\'><img src=\'http:\/\/www.ourgame.com\/images\/dot_sz1.gif\' width=\'6\' height=\'6\' hspace=\'2\' vspace=\'5\' align=\'absmiddle\'><A href=http://shop.ourgame.com/my_account/my_account.asp target=_blank><u><font color=FD8D29>账户管理<\/font><\/u><A><\/td>");
	document.writeln("            <td align=\'center\'><img src=\'http:\/\/www.ourgame.com\/images\/dot_sz.gif\' width=\'6\' height=\'6\' hspace=\'2\' vspace=\'5\' align=\'absmiddle\'><A href=http://www.ourgame.com/download/ target=\'_blank\'><u>下载大厅<\/u><A><\/td>");
	document.writeln("            <td align=\'center\'><img src=\'http:\/\/www.ourgame.com\/images\/dot_sz.gif\' width=\'6\' height=\'6\' hspace=\'2\' vspace=\'5\' align=\'absmiddle\'><A href=http://www.ourgame.com/srvcenter/newuser/service_newuser.html target=\'_blank\'><u>新手指南<\/u><A><\/td>");
	document.writeln("          <\/tr>");
	document.writeln("        <\/table><\/td>");
	document.writeln("  <\/tr>");
	document.writeln("<\/table>");
	document.writeln("	    <table width=\'90%\' border=\'0\' align=\'center\' cellpadding=\'0\' cellspacing=\'0\'>");
	document.writeln("          <tr>");
	document.writeln("            <td height=\'6\'><\/td>");
	document.writeln("          <\/tr>");
	document.writeln("        <\/table>");

	BeautyContest(GetCookie("GLAvatarValue"),'gameshow1',strNowSex,'100','120'); 
}
	
function getCookieVal (offset) 
{ 
	var endstr = document.cookie.indexOf (";", offset); 
	if (endstr == -1) 
	endstr = document.cookie.length; 
	return unescape(document.cookie.substring(offset, endstr)); 
} 

function GetCookie (name) 
{ 
	var arg = name + "="; 
	var alen = arg.length; 
	var clen = document.cookie.length; 
	var i = 0; 
	while (i < clen) { 
		var j = i + alen; 
		if (document.cookie.substring(i, j) == arg) 
			return getCookieVal (j); 
		i = document.cookie.indexOf(" ", i) + 1; 
		if (i == 0) break; 
	} 
	return null; 
}

function show(user)
{
  	//alert(user);
  	GLAvatar1.SetSex(GetCookie("glmale"));
  	GLAvatar1.ShowUser(user, GetCookie("glmale"), GetCookie("glmember"), GetCookie("glimage"), 0);
}

function init()
{
	GLAvatar1.SetUserProviderWnd(0, 0);
	GLAvatar1.SetAvatarServer("play.ourgame.com", 2000);
	GLAvatar1.FetchMetaData();
	GLAvatar1.WebInit();
}

function DecodeCookie(str) 
{ 
	var strArr; 
	var strRtn=""; 
	
	strArr=str.split("a"); 
	
	for (var i=strArr.length-1;i>=0;i--) 
	strRtn+=String.fromCharCode(eval(strArr[i])); 
	
	return strRtn; 
}

function setCookie(name, value, expires)
{ 
	document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString() + "; path=/; domain=.ourgame.com"; 
} 

function clearChr(){
	this.focus();
}

function onloadclear()
{
	if(GetCookie("s1")==null)
	{
		form1.rndnumber.value="请输入附加码";
	}
}

function ChangeShow(t)
{
	if(t==0){
		img_1.style.display = "";
		img_2.style.display = "none";
		img_3.style.display = "none";
		img_4.style.display = "";
		show_1.style.display = "";
		show_2.style.display = "none";
		var time = new Date("December 31,2023");
		//time.setTime(time.getTime + 365 * 24 * 3600 * 1000);
		setCookie("GLDISPLAYSHOW","0",time);
	}else{
		img_1.style.display = "none";
		img_2.style.display = "";
		img_3.style.display = "";
		img_4.style.display = "none";
		show_1.style.display = "none";
		show_2.style.display = "";
		var time = new Date("December 31,2023");
		//time.setTime(time.getTime + 365 * 24 * 3600 * 1000);
		setCookie("GLDISPLAYSHOW","1",time);
	}
}
	
function go(s)
{
	if(s==1){
		window.open("http://gameshow.ourgame.com");
	}else{
		window.open("http://mm.ourgame.com");
	}
}