// JScript 文件
function to(id)
{
    var objForm =  document.getElementById( id );
	return objForm;
}
function emailCheck(obj)
{
  var str = obj.value;
  var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
  var flag = reg.test(str);
  return flag;
}
function isChinese(name){ 
	if(name.length == 0)
		return false;
	for(i = 0; i < name.length; i++) {
		if(name.charCodeAt(i) > 128)
	 		return true;
	}
	return false;
}

function checkInputChar(str){
	var reg = /^(\w|[\u4E00-\u9FA5])*$/; 

	if(str.match(reg)) 
	 { 
	   return true;
	 }else 
	 { 
	   return false;
	 }  
}
function Filter_SQL_key(strData)
{
	var strFilter="admin,fuck,Nextgame,管理员,系统消息,管理员,邓小平,胡锦涛,共产党,国民党,妈的,毛主席,毛泽东,panda,官方消息,系统公告,客服,官方,政府,消息,公告,pm";
	var blnFlag
	strFilter=strFilter.split(',');
	for(var i=0;i<=strFilter.length-1;i++)
	{
		if(strData.indexOf(strFilter[i])>-1)
		{
			return false;
		}
	}
	return true;
}

function InitShowLeft()
{

     $.post("/ajaxRequests/ajax.aspx",function(xml){
                   to("leftside").innerHTML = xml;  
                
            });
}

///1.平台首页。2.用户中心
function FriendLink(obj)
{
    var info = "";
    if(obj==1)
    {
        info = "<li><a href='http://www.doloso.com ' target='_blank'>插件补丁</a></li>"
        +"<li><a href='http://www.wyao45.com' target='_blank'>传奇开区预告</a></li>"
        +"<li><a href='http://hunsha.3839.com/' target='_blank'>婚纱小游戏</a></li>"
        +"<li><a href='http://www.kuyoux.com/' target='_blank'>酷游戏</a></li>"
        +"<li><a href='http://www.58yx.com' target='_blank'>58同城游戏</a></li>"
        +"<li><a href='http://www.158game.com/' target='_blank'>158game</a></li>"
        +"<li><a href='http://www.reyoo.net/' target='_blank'>热游网</a></li>"
        +"<li><a href='http://www.yeyouxi.com/' target='_blank'>椰游网</a></li>"
        +"<li><a href='http://www.96u.com/' target='_blank'>96U游戏网</a></li>"
        +"<li><a href='http://www.313g.com/' target='_blank'>313G游戏</a></li>"
        +"<li><a href='http://www.51wuduan.com/' target='_blank'>51WuDuan</a></li>"
        +"<li><a href='http://www.xskhome.com/' target='_blank'>新手卡之家</a></li>"
        +"<li><a href='http://www.cwebgame.com/' target='_blank'>网页游戏网</a></li>"
        +"<li><a href='http://www.6dan.com/' target='_blank'>6担网</a></li>"
        +"<li><a href='http://www.ztwan.com/' target='_blank'>整天玩</a></li>"
        +"<li><a href='http://www.ezz.cc/' target='_blank'>易众网</a></li>"
        +"<li><a href='http://www.2366.com' target='_blank'>2366网页游戏</a></li>"
        +"<li><a href='http://www.13kuai.com/' target='_blank'>13KUAI</a></li>"
        +"<li><a href='http://www.178.com/' target='_blank'>游戏网</a></li>"
        +"<li><a href='http://www.ufojoy.com/' target='_blank'>星碟网络</a></li>"
        +"<li><a href='http://www.57yx.com/' target='_blank'>我的游戏</a></li>"
        +"<li><a href='http://www.2u.com.cn/' target='_blank'>兔友网</a></li>"
        +"<li><a href='http://www.wandodo.com/' target='_blank'>玩多多</a></li>"
        +"<li><a href='http://www.51netu.com/' target='_blank'>耐游</a></li>"
        +"<li><a href='http://www.9v8v.com' target='_blank'>9v8v</a></li>"
        +"<li><a href='http://www.zwy.cc/' target='_blank'>找网游</a></li>"
        +"<li><a href='http://www.19yxw.com' target='_blank'>游戏先锋</a></li>"
        +"<li><a href='http://www.juyouxi.com' target='_blank'>聚游戏网</a></li>"
        +"<li><a href='http://web.96u.com/' target='_blank'>96U</a></li>"
        +"<li><a href='http://www.177.cn' target='_blank'>177</a></li>"
        +"<li><a href='http://www.bnplay.com/' target='_blank'>佰年游戏</a></li>"
        +"<li><a href='http://www.9u8u.com/' target='_blank'>久忧网页游戏</a></li>"
        +"<li><a href='http://www.zwy.cc/' target='_blank'>找网游</a></li>"
        +"<li><a href='http://www.uc999.com' target='_blank'>uc99</a></li>"
        +"<li><a href='http://www.ewoka.com' target='_blank'>ewoka</a></li>"
        +"<li><a href='http://www.wangye2.com/' target='_blank'>WangYe2</a></li>";
    }else if(obj==2)
    {
        info = "<li><a href='http://www.265g.com/' target='_blank'>265G</a></li>"
        +"<li><a href='http://www.766.com/' target='_blank'>766</a></li>"
        +"<li><a href='http://www.6dan.com/' target='_blank'>6担网</a></li>"
        +"<li><a href='http://www.xskhome.com/' target='_blank'>新手卡之家</a></li>";
    }
    else    
    {
        
        info = "<li><a href='http://www.doloso.com ' target='_blank'>插件补丁</a></li>"
        +"<li><a href='http://www.wyao45.com' target='_blank'>传奇开区预告</a></li>"
        +"<li><a href='http://www.52pcgame.com/' target='_blank'>52pcgame</a></li>"
        +"<li><a href='http://www.265g.com/' target='_blank'>265G</a></li>"
        +"<li><a href='http://www.766.com/' target='_blank'>766</a></li>"
        +"<li><a href='http://www.158game.com/' target='_blank'>158game</a></li>"
        +"<li><a href='http://www.reyoo.net/' target='_blank'>热游网</a></li>"
        +"<li><a href='http://www.yeyouxi.com/' target='_blank'>椰游网</a></li>"
        +"<li><a href='http://www.96u.com/' target='_blank'>96U游戏网</a></li>"
        +"<li><a href='http://www.313g.com/' target='_blank'>313G游戏</a></li>"
        +"<li><a href='http://www.51wuduan.com/' target='_blank'>51WuDuan</a></li>"
        +"<li><a href='http://www.xskhome.com/' target='_blank'>新手卡之家</a></li>"
        +"<li><a href='http://www.cwebgame.com/' target='_blank'>网页游戏网</a></li>"
        +"<li><a href='http://www.6dan.com/' target='_blank'>6担网</a></li>"
        +"<li><a href='http://www.ztwan.com/' target='_blank'>整天玩</a></li>"
        +"<li><a href='http://www.ezz.cc/' target='_blank'>易众网</a></li>"
        +"<li><a href='http://www.2366.com' target='_blank'>2366网页游戏</a></li>"
        +"<li><a href='http://www.13kuai.com/' target='_blank'>13KUAI</a></li>"
        +"<li><a href='http://www.178.com/' target='_blank'>游戏网</a></li>"
        +"<li><a href='http://www.ufojoy.com/' target='_blank'>星碟网络</a></li>"
        +"<li><a href='http://www.57yx.com/' target='_blank'>我的游戏</a></li>"
        +"<li><a href='http://www.2u.com.cn/' target='_blank'>兔友网</a></li>"
        +"<li><a href='http://www.wandodo.com/' target='_blank'>玩多多</a></li>"
        +"<li><a href='http://www.51netu.com/' target='_blank'>耐游</a></li>"
        +"<li><a href='http://www.9v8v.com' target='_blank'>9v8v</a></li>"
        +"<li><a href='http://www.zwy.cc/' target='_blank'>找网游</a></li>"
        +"<li><a href='http://www.19yxw.com' target='_blank'>游戏先锋</a></li>"
        +"<li><a href='http://www.juyouxi.com' target='_blank'>聚游戏网</a></li>"
        +"<li><a href='http://web.96u.com/' target='_blank'>96U</a></li>"
        +"<li><a href='http://www.177.cn' target='_blank'>177</a></li>"
        +"<li><a href='http://www.bnplay.com/' target='_blank'>佰年游戏</a></li>"
        +"<li><a href='http://www.9u8u.com/' target='_blank'>久忧网页游戏</a></li>"
        +"<li><a href='http://www.zwy.cc/' target='_blank'>找网游</a></li>"
        +"<li><a href='http://www.uc999.com' target='_blank'>uc99</a></li>"
        +"<li><a href='http://www.ewoka.com' target='_blank'>ewoka</a></li>"
        +"<li><a href='http://www.wangye2.com/' target='_blank'>WangYe2</a></li>";
    }
   
   document.getElementById("divFriendLink").innerHTML = "<ul>"+info+"</ul>";
   
   var bottom = "<p class=\"note_01\">抵制不良游戏 拒绝盗版游戏 注意自我保护 谨防受骗上当</p>";
       bottom += " <p class=\"note_02\">适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活</p>";
       bottom += " <div class=\"f_nav\"><a href=\"/about.html\">关于我们</a> <a href=\"/law.html\">法律声明</a> <a href=\"/rules.html\">玩家守则</a><a href=\"/service.html\">用户条款</a><a href=\"/contact.html\">联系我们</a> <a href='http://www.awo.cn/faq/faq_list_1.html'>常见问题</a><a href='http://www.awo.cn/sitemap.html'>网站地图</a> <a href='http://www.awo.cn/friendlink.html'>友情链接</a></div>";
        bottom += " <p class=\"copyright\">欢动（北京）科技有限公司 文网文[2009]107号 京新出音[2010]427号</p>";
       bottom += "  <p class=\"copyright\"><a href=\"http://www.awo.cn/\">欢动世界</a>版权所有&copy;<a href=\"http://www.miibeian.gov.cn/\" target=\"_blank\"> 2009 京ICP备09039662号</a>&nbsp;&nbsp;&nbsp;<a href=\"http://www.miibeian.gov.cn/\" target=\"_blank\">京ICP证：100047</a></p>";//&nbsp;&nbsp;&nbsp;ISBN 978-7-900763-95-2
       bottom += "  <p class=\"copyright\"></p>";
   document.getElementById("bottom").innerHTML = bottom;

}


function WriteFooter()
{

  var footer ='<div class="fd"  id="webDiv"><div>';
        footer+='<a href="http://www.reyoo.net" target="_blank" title="热游网"><img src="/images/foot/reyoologo.gif" width="88" height="31"/></a>';
        footer+='<a href="http://www.9u8u.com/" target="_blank" title="9u8u"><img src="/images/foot/9ulogo.gif" width="88" height="31"/></a>';
        footer+='<a href="http://www.97jr.com/" target="_blank" title="杰瑞游戏"><img src="/images/foot/jryx.gif" width="88" height="31"/></a>';
       footer+='<a href="http://www.cwebgame.com/" target="_blank" title="网页游戏网"><img src="/images/foot/200909071742463163.gif" width="88" height="31"/></a>';
        footer+='<a href="http://web.51haogame.com/" target="_blank" title="我要好游戏"><img src="/images/foot/haogame.gif" width="88" height="31"/></a>';
        footer+='<a href="http://www.zwy.cc/" target="_blank" title="找网游"><img src="/images/foot/zhaowangyou.gif" width="88" height="31"/></a>';
          footer+='<a href="http://www.6dan.com/" target="_blank" title="6担网"><img src="/images/foot/6dan_logo.gif" width="88" height="31"/></a>';
          footer+='<a href="http://www.uc999.com/" target="_blank" title="uc999"><img src="/images/foot/uc999.jpg" width="88" height="31"/></a>';
          footer+='<a href="http://www.zwy.cc/" target="_blank" title="找游戏"><img src="/images/foot/zyx.gif" width="88" height="31"/></a>';
        footer+='<a href="http://www.ztwan.com/" target="_blank" title="整天玩"><img src="/images/foot/atwan_logo.gif" width="88" height="31"/></a>';
      footer+='<a href="http://www.ezz.cc/" target="_blank" title="易众网"><img src="/images/foot/ezz_logo.jpg" width="88" height="31"/></a>';
    footer+='<a href="http://www.2366.com" target="_blank" title="2366网页游戏"><img src="/images/foot/2366.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.13kuai.com/" target="_blank" title="13KUAI"><img src="/images/foot/13kuai.jpg" width="88" height="31"/></a>';
    footer+='<a href="http://www.178.com/" target="_blank" title="178游戏网"><img src="/images/foot/88-31.jpg" width="88" height="31"/></a>';
    footer+='<a href=" http://www.wo173.com/" target="_blank" title="wo173网页游戏"><img src="/images/foot/wo173.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.ufojoy.com/" target="_blank" title="星碟网络"><img src="/images/foot/ufojoy.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.57yx.com/ " target="_blank" title="我的游戏"><img src="/images/foot/57yx.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.175w.com/" target="_blank" title="便利商店"><img src="/images/foot/175u.jpg" width="88" height="31"/></a>';
    footer+='<a href="http://www.2u.com.cn/" target="_blank" title="兔友网"><img src="/images/foot/2tu.jpg" width="88" height="31"/></a>';
    footer+='<a href="http://www.wandodo.com/" target="_blank" title="玩多多"><img src="/images/foot/wanduoduo.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.51netu.com/" target="_blank" title="耐游"><img src="/images/foot/naiyou.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.9v8v.com " target="_blank" title="9v8v"><img src="/images/foot/9v8v.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.313g.com " target="_blank" title="313g"><img src="/images/foot/313g.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.51wuduan.com" target="_blank" title="51wuduan"><img src="/images/foot/51wuduan.gif" width="88" height="31"/></a>';
    footer+='<a href=" http://www.juyouxi.com" target="_blank" title="juyouxi"><img src="/images/foot/linklogo.gif" width="88" height="31"/></a>';
    footer+='<a href=" http://web.96u.com/" target="_blank" title="96u"><img src="/images/foot/96u.jpg" width="88" height="31"/></a>';
    footer+='<a href="http://www.177.cn/" target="_blank" title="177"><img src="/images/foot/177logo.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.19yxw.com/" target="_blank" title="19yxw"><img src="/images/foot/19yxw.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.bnplay.com/" target="_blank" title="佰年游戏"><img src="/images/foot/bnyx.jpg" width="88" height="31"/></a>';
    footer+='<a href="http://www.wangye2.com/" target="_blank" title="WangYe2"><img src="/images/foot/wangye2.gif" width="88" height="31"/></a>';
    footer+='<a href="http://www.ewoka.com" target="_blank" title="ewoka"><img src="/images/foot/ewoka.jpg" width="88" height="31"/></a>';
    
  footer+='<a href="http://www.nextwar.cn/" target="_blank" title="现代战争"><img src="/images/foot/xdzz.jpg" width="88" height="31"/></a><a href="http://www.173eg.com/" target="_blank" title="东游网"><img src="/images/foot/173eg.jpg" width="88" height="31"/></a><a href="http://www.wowowang.com" target="_blank" title="窝窝网"><img src="/images/foot/wowowang.gif" width="88" height="31"/></a><a href="http://www.07073.com/" target="_blank" title="07073"><img src="/images/foot/07073.jpg" width="88" height="31"/></a><a href="http://www.com92.com/" target="_blank" title="久玩网络"><img src="/images/foot/com92.jpg" width="88" height="31"/></a><a href="http://www.116wy.com/" target="_blank" title="116wy"><img src="/images/foot/116wy.gif" width="88" height="31"/></a><a href="http://www.ledao.cn/" target="_blank" title="265G"><img src="/images/foot/ledao.jpg" width="88" height="31"/></a><a href="http://www.gamecheng.com/" target="_blank" title="265G"><img src="/images/foot/gamecity.gif" width="88" height="31"/></a><a href="http://www.265g.com/" target="_blank" title="265G"><img src="/images/foot/Mt-265g.gif" width="88" height="31"/></a><a href="http://www.52pk.com/" target="_blank" title="52PK"><img src="/images/foot/Mt-52pk.jpg" width="88" height="31" /></a><a target="_blank" href="http://www.5617.com/" title="5617"><img src="/images/foot/Mt-5617.jpg" width="88" height="31" /></a><a target="_blank" href="http://www.86wan.com/" title="86Wan"><img src="/images/foot/Mt-86wan.gif" width="88" height="31" /></a><a target="_blank" href="http://www.popwan.com/" title="泡泡玩"><img src="/images/foot/Mt_popwan.gif" width="88" height="31" /></a><a target="_blank" href="http://www.xunlei.com/" title="迅雷"><img src="/images/foot/Mt-xunlei.JPG" width="88" height="31" /></a><a href="http://www.zol.com.cn/" target="_blank" title="中关村在线"><img src="/images/foot/Mt-zol.jpg" width="88" height="31" /></a><a target="_blank" href="http://www.duowan.com/" title="多玩"><img src="/images/foot/Mt_duowan.jpg" width="88" height="31" /></a></div></div>';
  document.getElementById("footer").innerHTML = footer;
  
  var bottom = "<p class=\"note_01\">抵制不良游戏 拒绝盗版游戏 注意自我保护 谨防受骗上当</p>";
       bottom += " <p class=\"note_02\">适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活</p>";
        bottom += " <div class=\"f_nav\"><a href=\"/about.html\">关于我们</a> <a href=\"/law.html\">法律声明</a> <a href=\"/rules.html\">玩家守则</a><a href=\"/service.html\">用户条款</a><a href=\"/contact.html\">联系我们</a>  <a href='http://www.awo.cn/faq/faq_list_1.html'>常见问题</a><a href='http://www.awo.cn/sitemap.html'>网站地图</a> <a href='http://www.awo.cn/friendlink.html'>友情链接</a></div>";
        bottom += " <p class=\"copyright\">欢动（北京）科技有限公司 文网文[2009]107号 京新出音[2010]427号</p>";
       bottom += "  <p class=\"copyright\">&copy;<a href=\"http://www.miibeian.gov.cn/\" target=\"_blank\"> 2009 京ICP备09039662号</a>&nbsp;&nbsp;&nbsp;<a href=\"http://www.miibeian.gov.cn/\" target=\"_blank\">京ICP证：100047</a></p>";//&nbsp;&nbsp;&nbsp;ISBN 978-7-900763-95-2
       bottom += "  <p class=\"copyright\"></p>";
   document.getElementById("bottom").innerHTML = bottom;
}
function WriteLeft()
{
       
    $.post("/ajaxrequests/LoginLeftAjax.aspx",function(xml){
    
    if(xml=="no")
    {
        to("login_off").style.display = "block";
    }
    else
    {
        if(to("login_on") != null)
        {
            to("login_on").style.display = "block";
            to("login_on").innerHTML = xml;
        }
    }
        
    });

    
}
function InitPage()
{
    WriteHeader();
    WriteLeft();
//    WriteFooter();
//       $("#webDiv").jMarquee({
//    visible:9,
//    step:1,
//    direction:"left"
//    });
    
}

function InitIndexPage()
{
WriteHeader();
var bottom = "<p class=\"note_01\">抵制不良游戏 拒绝盗版游戏 注意自我保护 谨防受骗上当</p>";
       bottom += " <p class=\"note_02\">适度游戏益脑 沉迷游戏伤身 合理安排时间 享受健康生活</p>";
       bottom += " <div class=\"f_nav\"><a href=\"/about.html\">关于我们</a> <a href=\"/law.html\">法律声明</a> <a href=\"/rules.html\">玩家守则</a> <a href=\"/service.html\">用户条款</a> <a href=\"/contact.html\">联系我们</a> <a href='http://www.awo.cn/faq/faq_list_1.html'> 常见问题</a> <a href='http://www.awo.cn/sitemap.html'>网站地图</a> <a href='http://www.awo.cn/friendlink.html'>友情链接</a></div>";
        bottom += " <p class=\"copyright\">欢动（北京）科技有限公司 文网文[2009]107号 京新出音[2010]427号</p>";
       bottom += "  <p class=\"copyright\">&copy;<a href=\"http://www.miibeian.gov.cn/\" target=\"_blank\"> 2009 京ICP备09039662号</a>&nbsp;&nbsp;&nbsp;<a href=\"http://www.miibeian.gov.cn/\" target=\"_blank\">京ICP证：100047</a></p>";//&nbsp;&nbsp;&nbsp;ISBN 978-7-900763-95-2
       bottom += "  <p class=\"copyright\"></p>";
   document.getElementById("bottom").innerHTML = bottom;
//    WriteFooter();
//     $("#webDiv").jMarquee({
//    visible:9,
//    step:1,
//    direction:"left"
//    });   
}
function InitIndexHearder()
{
    WriteHeader();
}
function InitIndexLoginLeft()
{
    $.post("/ajaxrequests/LoginIndex.aspx",null,function(xml){ 
            if (xml.length != 0)
            {      
                document.getElementById("indexLog").innerHTML = xml; 
                $("#part_div").attr("class","part_02"); 
            }       
    }); 
}

function checkUserName(target,type)
{
    
  if(to(target).value !="")
    {
    
        if(!emailCheck(to(target)))
        {
           to("regErrorDiv").style.display = "";
            showErrorImg("userName",type);
           to("regErrorMessage").innerHTML = "Email不正确！请填写正确的邮箱地址！";
            
            return false;
        }
    }
   else
    {
       to("regErrorDiv").style.display = "";
       showErrorImg("userName",type);
       to("regErrorMessage").innerHTML = "Email不正确！请填写正确的邮箱地址！";
       return false;
    } 
    
    return true;
}
function checkPassword(target,type)
{
 if(to(target).value.length < 6 || to(target).value.length > 12){
     to("regErrorDiv").style.display = "";
     showErrorImg("password",type);
     to("regErrorMessage").innerHTML = "密码长度不正确！须由6～12位数字或字母组成！";
		return false;
	}
	else
	{
	    if (isChinese(to(target).value)){
            to("regErrorDiv").style.display = "";
            showErrorImg("password",type);
            to("regErrorMessage").innerHTML = "登录密码中不能包含中文，须由6～12位数字或字母组成！";             
		    return false;
	    }
	}
    to("regErrorDiv").style.display = "none";
    to("regErrorMessage").innerHTML = "";   
	showErrorImg("",type);
	return true;
}

var times;       
function start()
{
  times=setTimeout( "window.location='http://www.nexttime.cn:8080';",15000);//自动跳转
}
function end()
{
    clearTimeout(times);
}
function checkRegist(userName,password,confirmPassword,nickName,agreeMent,type)
{
    
   if(!checkUserName(userName,type))
   {

     return false; 
   } 
   if(!chekcNickName(nickName,type))
   {

     return false; 
   }
   if(!checkPassword(password,type))
   {

       return false; 
   }
   if(!checkConfirmPassword(password,confirmPassword,type))
   {

    return false; 
   }
   
    if(to(agreeMent).checked == false)
    {

       to("regErrorDiv").style.display = "";
       showErrorImg("",type);
       to("regErrorMessage").innerHTML = "请仔细阅读并接受“服务协议”！";  
	     return false ;
    }
   if(type == "index")
   {
    
        $.post("ajaxRequests/RegisteAjax.aspx",{userName:to(userName).value,password:to(password).value,nickName:to(nickName).value},function(xml){
        if(xml=="1")
        {
       
            //to("regDiv").style.display = "none";
            messageInfo("注册失败！","该Email和用户昵称都已被使用！","index");

            return;
        }
        else if(xml =="2")
        {
             //to("regDiv").style.display = "none";
            messageInfo("注册失败！","该Email地址已被使用！","index");

            return ;
        }
        else if(xml =="3")
        {
         //to("regDiv").style.display = "none";
            messageInfo("注册失败！","该用户昵称已被使用！","index");

            return;
        }
        else if(xml == "4")
        {
            //to("regDiv").style.display = "none";
            messageInfo("注册失败！","密码长度不正确！","index");

            return;
        }
        else if(xml == "5")
        {
            //to("regDiv").style.display = "none";
            messageInfo("注册失败！","您输入的昵称含有非法字符！","index");

            return;
        }
        else
        {
            //alert(xml);
//            var lastNum =  xml.substr(4);
//            $.post("/ajaxrequests/RegisteSuccessAjax.aspx",{type:"registeSuccess"},function(data){
//            
//            
//            });
            WriteHeader();
            WriteLeft();
            to("pop_wrap").style.display = "none";
            to("pop_message").style.display = "";       
            to("pop_message").innerHTML  ="<div class=\"pop_top \"><div class=\"head\"><h3></h3><a href=\"javascript:closeDivs()\" class=\"close_btn\">关闭</a></div></div><div class=\"pop_cont\"><div class=\"pop_info\"><div class=\"p_block\"><p  class=\"tc\">恭喜您<b> "+to(nickName).value+"</b>注册成功</p><p class=\"tl\">公测服务器“玉门关”将于2010年5月25日14时盛世开启。欢动游戏期盼您的加入，共创黄金时代。您可通过官网了解游戏相关活动等内容，或在论坛与众家英雄调侃交流。</p></div></div><div class=\"buttons\"> <span class=\"btn btn_into\"><a href=\"/interface/gold/goldLogin.aspx?si=10002\" ></a></span><span class=\"btn btn_back\"><a href=\"javascript:closeDivs()\"></a></span> </div></div><div class=\"pop_foot\"> </div>";
            //to("pop_message").className = "reg_div_2";
            to("cover_div").style.display = "";
            //start();
           
        }
    
    });
   }
    return true;
 
}
function checkRegist1(userName,password,confirmPassword,nickName,agreeMent,type,realName,realCode,codeType)
{
    
   if(!checkUserName(userName,type))
   {

     return false; 
   } 
   if(!chekcNickName(nickName,type))
   {

     return false; 
   }
   if(!checkPassword(password,type))
   {

       return false; 
   }
   if(!checkConfirmPassword(password,confirmPassword,type))
   {

    return false; 
   }
    if(to("realName").value.length == 0)
   {
        to("regErrorDiv").style.display = "";     
        to("regErrorMessage").innerHTML = "请入您的真实姓名！";        
        return false;
   }else
   {
        if (to("realName").value.length==1)
        {
            to("regErrorDiv").style.display = "";     
        to("regErrorMessage").innerHTML = "真实姓名在一个字以上！";    
             return false;
        }else if (to("realName").value.length > 4) {
            to("regErrorDiv").style.display = "";     
            to("regErrorMessage").innerHTML = "真实姓名最多4个汉字！"; 
            return false;
        }
        var nnname=to("realName").value;
        var reg = /^[\u4e00-\u9fa5]*$/;
        if(arr=nnname.match(reg)) 
        {
             if(!checkRealName(nnname))
             {
                to("regErrorDiv").style.display = "";     
                to("regErrorMessage").innerHTML = "真实姓名请遵循百家姓规则！";   
                return false;
             }
        }
        else
        {
          to("regErrorDiv").style.display = "";     
          to("regErrorMessage").innerHTML = "真实姓名为中文！";    
         return false;
        }
   }
   if(to("realCode").value.length == 0)
   {
        to("regErrorDiv").style.display = "";     
        to("regErrorMessage").innerHTML = "请入您的证件号码！";
        return false;
   }
//   if(to("realCode").value.length < 18)
//   {
//        to("regErrorDiv").style.display = "";     
//        to("regErrorMessage").innerHTML = "请正确输入您的证件号码！";
//        return false;
//   }
  
//   if(!checkID(to("realCode").value))
//   {
//        to("regErrorDiv").style.display = "";     
//        to("regErrorMessage").innerHTML = "请正确输入您的证件号码";
//      return false;
//   }
   
   if(to("realCode").value.length == 18)
   {
        var dateyear = to("realCode").value.substr(6,4);
        var datemonth = to("realCode").value.substr(10,2);
        var dateday = to("realCode").value.substr(12,2);
        var info = dateyear + "-" + datemonth + "-" + dateday;
        var myDate = new Date();
        if (dateyear < 1900 || dateyear > myDate.getFullYear())
        {
            to("regErrorDiv").style.display = "";    
            to("regErrorMessage").innerHTML = "请正确输入您的证件号码！";
            return false;
        }
        if (!checkRegiteDate(info))
        {
            to("regErrorDiv").style.display = "";    
            to("regErrorMessage").innerHTML = "请正确输入您的证件号码！";
            return false;
        }        
   }
   else if ( to("realCode").value.length == 15)
   {
        var dateyear = to("realCode").value.substr(6,2);
        var datemonth = to("realCode").value.substr(8,2);
        var dateday = to("realCode").value.substr(10,2);
        var info = "19"+ dateyear + "-" + datemonth + "-" + dateday;
        if (!checkRegiteDate(info))
        {
            to("regErrorDiv").style.display = "";    
            to("regErrorMessage").innerHTML = "请正确输入您的证件号码！";
            return false;
        }        
    }else{
            to("regErrorDiv").style.display = "";    
            to("regErrorMessage").innerHTML = "请正确输入您的证件号码！";
            return false;
    }
   
    if(to(agreeMent).checked == false)
    {

       to("regErrorDiv").style.display = "";
       showErrorImg("",type);
       to("regErrorMessage").innerHTML = "请仔细阅读并接受“服务协议”！";  
	     return false ;
    }
   if(type == "index")
   {
        $.post("ajaxRequests/RegisteAjax.aspx",{userName:to(userName).value,password:to(password).value,nickName:to(nickName).value,realName:to(realName).value,realCode:to(realCode).value,codeType:to(codeType).value},function(xml){
        if(xml=="1")
        {
       
            //to("regDiv").style.display = "none";
            messageInfo("注册失败！","该Email和用户昵称都已被使用！","index");

            return;
        }
        else if(xml =="2")
        {
             //to("regDiv").style.display = "none";
            messageInfo("注册失败！","该Email地址已被使用！","index");

            return ;
        }
        else if(xml =="3")
        {
         //to("regDiv").style.display = "none";
            messageInfo("注册失败！","该用户昵称已被使用！","index");

            return;
        }
        else if(xml == "4")
        {
            //to("regDiv").style.display = "none";
            messageInfo("注册失败！","密码长度不正确！","index");

            return;
        }
        else if(xml == "5")
        {
            //to("regDiv").style.display = "none";
            messageInfo("注册失败！","您输入的昵称含有非法字符！","index");

            return;
        }
        else if(xml=="6")
        {
             messageInfo("注册失败！","您所输入的身份信息已存在！","index");
        }
        else
        {
            //alert(xml);
//            var lastNum =  xml.substr(4);
//            $.post("/ajaxrequests/RegisteSuccessAjax.aspx",{type:"registeSuccess"},function(data){
//            
//            
//            });
            WriteHeader();
            WriteLeft();
            to("pop_wrap").style.display = "none";
            to("pop_message").style.display = "";       
            to("pop_message").innerHTML  ="<div class=\"pop_top \"><div class=\"head\"><h3></h3><a href=\"javascript:closeDivs()\" class=\"close_btn\">关闭</a></div></div><div class=\"pop_cont\"><div class=\"pop_info\"><div class=\"p_block\"><p  class=\"tc\">恭喜您<b> "+to(nickName).value+"</b>注册成功</p><p class=\"tl\">公测服务器“玉门关”将于2010年5月25日14时盛世开启。欢动游戏期盼您的加入，共创黄金时代。您可通过官网了解游戏相关活动等内容，或在论坛与众家英雄调侃交流。</p></div></div><div class=\"buttons\"> <span class=\"btn btn_into\"><a href=\"/interface/gold/goldLogin.aspx?si=10002\" ></a></span><span class=\"btn btn_back\"><a href=\"javascript:closeDivs()\"></a></span> </div></div><div class=\"pop_foot\"> </div>";
            //to("pop_message").className = "reg_div_2";
            to("cover_div").style.display = "";
            //start();
           
        }
    
    });
   }
    return true;
 
}
function checkRegiteDate(dateStr){ 
    var matchArray = dateStr.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/); 
    if (matchArray == null) return false;
    var month = matchArray[3];
    var day = matchArray[4];
    var year = matchArray[1];
    if (month < 1 || month > 12) return false;
    if (day < 1 || day > 31) return false;
    if ((month==4 || month==6 || month==9 || month==11) && day==31) return false;
    if (month == 2){
        var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
        if (day > 29 || (day==29 && !isleap)) return false;
    }
    return true;
} 

function checkRealName(str)
{
    var str=str.substr(0,1); //截取用户提交的用户名的前两字节，也就是姓。
    var surname=" 赵钱孙李周吴郑王冯陈褚卫蒋沈韩杨朱秦尤许何吕施张孔曹严华金魏陶姜戚谢邹喻柏水窦章云苏潘葛奚范彭郎鲁韦昌马苗凤花方俞任袁柳酆鲍史唐费廉岑薛雷贺倪汤 滕殷罗毕郝邬安常乐于时傅皮卞齐康伍余元卜顾孟平黄和穆萧尹姚邵堪汪祁毛禹狄米贝明臧计伏成戴谈宋茅庞熊纪舒屈项祝董粱杜阮蓝闵席季麻强贾路娄危江童颜郭 梅盛林刁钟徐邱骆高夏蔡田樊胡凌霍虞万支柯咎管卢莫经房裘缪干解应宗宣丁贲邓郁单杭洪包诸左石崔吉钮龚程嵇邢滑裴陆荣翁荀羊於惠甄魏加封芮羿储靳汲邴糜松 井段富巫乌焦巴弓牧隗山谷车侯宓蓬全郗班仰秋仲伊宫宁仇栾暴甘钭厉戎祖武符刘姜詹束龙叶幸司韶郜黎蓟薄印宿白怀蒲台从鄂索咸籍赖卓蔺屠蒙池乔阴郁胥能苍双 闻莘党翟谭贡劳逄姬申扶堵冉宰郦雍郤璩桑桂濮牛寿通边扈燕冀郏浦尚农温别庄晏柴瞿阎充慕连茹习宦艾鱼容向古易慎戈廖庚终暨居衡步都耿满弘匡国文寇广禄阙东 殴殳沃利蔚越夔隆师巩厍聂晁勾敖融冷訾辛阚那简饶空曾毋沙乜养鞠须丰巢关蒯相查后江红游竺权逯盖益桓公万俟司马上官欧阳夏侯诸葛闻人东方赫连皇甫尉迟公羊 澹台公冶宗政濮阳淳于仲孙太叔申屠公孙乐正轩辕令狐钟离闾丘长孙慕容鲜于宇文司徒司空亓官司寇仉督子车颛孙端木巫马公西漆雕乐正壤驷公良拓拔夹谷宰父谷粱 晋楚闫法汝鄢涂钦段干百里东郭南门呼延妫海羊舌微生岳帅缑亢况後有琴梁丘左丘东门西门商牟佘佴伯赏南宫墨哈谯笪年爱阳佟第五言福兰";
      r = surname.search(str);             // 查找字符串。
      if(r==-1)
         return false
      else
         return true
}
function checkID(f) {   
        // 身份证验证 18 位数字   
    // 1. 18位   
    if(f.length != 18&&f.length != 15) {   
        //alert("请输入中国公民的18位身份证号码, 您当前输入了" + f.length + "位号码" );   
        //f.ID.focus();   
        return false;   
    }   
    // 2. 确保前17位每一位都是数字   
    for(i = 0; i < f.length - 1; i++) {   
        // 如何判断一个字母是数字   
        if(isNaN( parseInt( f.charAt(i) ) )) {   
            //alert("您输入的身份证号码前17位包含有字母, 不合要求" );   
            //f.ID.focus();   
            return false;       
        }   
    }   
    if(f.length == 18)
    {
    // 3. 确保最后一位是数字或者X   
    var lastIDNum = f.charAt(17);   
    if( isNaN(parseInt( f.charAt(i) )) &&  lastIDNum.toLowerCase() != 'x') {   
        //alert("您输入的身份证号码最后一位不是数字也不是x, 不合要求" );   
        //f.ID.focus();   
        return false;   
    }   
    }
       
    return true;   
}



function checkConfirmPassword(password,confirmPassword,type)
{
    if (to(password).value !=to(confirmPassword).value )
	{
	     to("regErrorDiv").style.display = "";
	     showErrorImg("confirm",type);
         to("regErrorMessage").innerHTML = "确认密码与登录密码不符！请重新输入！";  
		 return false; 
	}
	else
	{
	     to("regErrorDiv").style.display = "none";
         to("regErrorMessage").innerHTML = ""; 
         showErrorImg("",type);
	}
	return true;
}
function chekcNickName(nickName,type)
{
 if (to(nickName).value != "" ) {
			    if (!(checkInputChar(to(nickName).value))){
			        
	                to("regErrorDiv").style.display = "";
	                if(type == "reg")
	                {
	                    to("errRegNickName").style.display = "";
	                }
                    to("regErrorMessage").innerHTML = "用户昵称须由数字,字母或汉字组成！";  
				   return false; 
			    }else{
		               var strlength=0;
                       for (j=0;(j<to(nickName).value.length);j++)
                      {
                        if (isChinese(to(nickName).value.charAt(j))==true)
                            strlength=strlength + 2;
                        else
                            strlength=strlength + 1;
                      }			    
			         if (strlength < 4 || strlength >16){
			                to("regErrorDiv").style.display = "";
			            showErrorImg("nickName",type);
                        to("regErrorMessage").innerHTML = "用户昵称长度不正确！须由4-16位字符组成！";  
     
			            return false; 
		            }
			        if(!(Filter_SQL_key(to(nickName).value))){
		                to("regErrorDiv").style.display = "";
		                 showErrorImg("nickName",type);
                        to("regErrorMessage").innerHTML = "用户昵称包含非法信息！请重新填写！";  
				        return false; 
			        }
			        else
			        {
			            showErrorImg("",type);
			        }
			        
			    }
		}else{
                 to("regErrorDiv").style.display = "";
                  showErrorImg("nickName",type);
                 to("regErrorMessage").innerHTML = "请填写用户昵称！";  
				 return false ;
		}
		return true;
}
function showErrorImg(target,type)
{
    var userNameError = "none";
    var passwordError = "none";
    var confirmError = "none";
    var nickNameError = "none";
    
    switch(target)
    {
            case "userName":
                userNameError ="";
             break;
             case "password":
             passwordError ="";
            break;
             case "confirm":
             confirmError ="";
            break;
             case "nickName":
             nickNameError ="";
            break; 
                
    }
    if(type == "reg")
    {
        to("errRegUserName").style.display = userNameError;
        to("errRegPassword").style.display = passwordError;
        to("errRegConfirmPassword").style.display = confirmError;
        to("errRegNickName").style.display = nickNameError;
    }
    else
    {
        to("errRegUserName").style.display = userNameError;
        to("errRegPassword").style.display = passwordError;
        to("errRegConfirmPassword").style.display = confirmError;
        to("errRegNickName").style.display = nickNameError;
    }
       
}
function checkRegistName(nameType,target,type)
{
    var name ="";
    if(nameType == "userName")
    {
        name = to(target).value;
        if(checkUserName(target,type))
        {
            $.post("/ajaxrequests/CheckRegistInfo.aspx",{type:"userName",name:name},function(xml){
                if(xml == "1"){
                        to("regErrorDiv").style.display = "";
                        to("regErrorMessage").innerHTML = "很遗憾！该用户名已被使用！";  
                        showErrorImg("userName",type);                      
                        
                }
                else{
                     to("regErrorDiv").style.display = "none";
                     to("regErrorMessage").innerHTML = "";  
                     showErrorImg("",type);
                }
            });
        }
    }
    else if(nameType == "nickName"){
        name = to(target).value;
        if(chekcNickName(target,type)){
            $.post("/ajaxrequests/CheckRegistInfo.aspx",{type:"nickName",name:name},function(xml){
                if(xml == "1"){
                    to("regErrorDiv").style.display = "";
                    showErrorImg("nickName",type);
                    to("regErrorMessage").innerHTML = "很遗憾！该用户昵称已被使用！";  
                }else{
                     to("regErrorDiv").style.display = "none";
                       to("regErrorMessage").innerHTML = "";  
                     showErrorImg("",type);
                }
            });
        }
    }
}

function gamea()
{
		window.open ('/game/game.html', '轰炸天堂岛', 'height=580, width=430, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')  
}
function gameb()
{
	    window.open ('/game/tank.html', '坦克大战', 'height=413, width=580, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')  

}
function gamepalya()
{
		window.open ('game/game.html', '轰炸天堂岛', 'height=580, width=430, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')  
}
function resetRegForm(userName,password,confirmPassword,nickName,type)
{
        to(userName).value = "";
        to(password).value = "";
        to(confirmPassword).value = "";
        to(nickName).value = "";
        to("regErrorDiv").style.display = "none";
        to("regErrorMessage").innerHTML = "";    
        showErrorImg("",type);
        if(to("realName")!=null)
        {
        resetrealinfo();
        }
    
}
function showOrHidDiv(target)
{
    if( to(target).style.display == "none")
    {
        to(target).style.display = "block"
        to("webdiv1").style.display = "none";
        to("colseLink").className = "close"
       
    }
    else
    {
        to(target).style.display = "none"
         $("#webdiv1").show();
        //to("webdiv1").style.display = "block";
         to("colseLink").className = "open"
    }
}


function userLogin(userName,password,passwordKeepOn)
{
    var isKeepOn = false;
    if(to(userName).value == "" ||to(password).value =="")
    {
        messageInfo("登录失败！","登录信息不完整！请继续填写！");
    }
    else
    {
            if(!emailCheck(to(userName)))
            {
                messageInfo("登录失败！","登录邮箱格式不正确！");
            }
            else
            {
                if(passwordKeepOn != undefined)
                {
                    isKeepOn = to(passwordKeepOn).checked;
                }

               $.post("/ajaxRequests/LoginAjax.aspx",{loginName:to(userName).value,loginPassword:to(password).value,isKeepOnPassword:isKeepOn},function (xml)
            {
                if(xml.indexOf("&") >0)
                {
                   var result = xml.substr(0,xml.indexOf("&"));
                   if(result == 1){
                       messageInfo("登录失败！","登录邮箱或密码不正确！");
                   }
                   else if(result == 3)
                   {
                      messageInfo("登录失败！","您的账号已被禁用！请及时联系网站管理人员！");
                   }
                   else
                   {
                       
                      WriteHeader();
                      WriteLeft();
                   }
                  
                }
            });
            
          }
    }
}
function WriteHeader()
{  
   $.post("/ajaxRequests/Loginajax.aspx",function(xml){
     var index = xml.indexOf("&");
     to("headDiv2").innerHTML = xml.substr(index+1);
      

    
    });
}
function ShowRegisteForm()
{
    resetRegForm('indexUserName','indexNickName','indexPassword','indexConfirm','index');
    to("pop_wrap").style.display = "";
    to("cover_div").style.display="";
    //<td align="right" height="50"><a href="javascript:closeDivs()"><img src="http://www.nexttime.cn/images/foot/close.gif" border="0" style="margin-right:20px;margin-top:16px;" /></a></td> </tr></table><table width="98%" height="50" border="0" cellpadding="0" cellspacing="0"> <tr> <td><img src="http://www.nexttime.cn/images/foot/reg_01.gif" align="absmiddle" class="imgs"  style="display:none"  id="regErrorDiv"/><font class="fCCFF00"  id="regErrorMessage"></font></td> </tr></table><table width="98%"  border="0"  cellpadding="0" cellspacing="0"> <tr> <td width="110" height="35"align="right" valign="top" class="reg_c2">E-mail</td> <td width="151" height="35" valign="top"><input name="indexUserName" maxLength="30"  id="indexUserName"  onblur="checkRegistName(\'userName\',\'indexUserName\',\'index\');" type="text" class="reg_input" /></td>   <td width="27" height="35" valign="top"><img src="http://www.nexttime.cn/images/foot/reg_02.gif" id="errIndexUserName"  style="display:none" /></td>   <td  height="35" valign="top" class="reg_c3">·为保证帐号的安全性，请填写真实有效的邮箱地址</td> </tr><tr><td width="110" height="35" align="right" valign="top" class="reg_c2">用户昵称</td><td width="151" height="35" valign="top"><input id="indexNickName" maxlength="16"  onblur="checkRegistName(\'nickName\',\'indexNickName\',\'index\');" type="text" class="reg_input" /></td> <td width="27" height="35" valign="top"><img id="errIndexNickName"  style="display:none"  src="http://www.nexttime.cn/images/foot/reg_02.gif"/></td> <td height="35" valign="top" class="reg_c3">·请输入您在游戏中所使用的昵称，长度4-16位字符、不含特殊符、一个汉字占两字符</td></tr><tr>  <td width="110" height="35" align="right" valign="top" class="reg_c2">密码</td><td width="151" height="35" valign="top"><input  name="indexPassword" id="indexPassword"  maxLength="12" onblur="checkPassword(\'indexPassword\',\'index\')"  type="password" class="reg_input" /></td> <td width="27" height="35" valign="top"><img id="errIndexPassword"  style="display:none"  src="http://www.nexttime.cn/images/foot/reg_02.gif" /></td>   <td  height="35" valign="top" class="reg_c3">·密码长度6～12位字符、字母区分大小写</td></tr><tr> <td width="110" height="35" align="right" valign="top" class="reg_c2">确认密码</td> <td width="151" height="35" valign="top"><input name="indexConfirm" maxLength="12" onblur="checkConfirmPassword(\'indexPassword\',\'indexConfirm\',\'index\')" id="indexConfirm" type="password" class="reg_input" /></td>   <td width="27" height="35" valign="top"><img id="errIndexConfirm"  style="display:none"  src="http://www.nexttime.cn/images/foot/reg_02.gif" /></td>  <td  height="35" valign="top" class="reg_c3">·再次确认登录密码</td> </tr></table><table width="98%" height="40" border="0" align="center" cellpadding="0" cellspacing="0"> <tr>  <td width="134"></td><td width="417" valign="middle" class="reg_c4"><input id="indexAgreement" checked="checked" name="indexAgreement" type="checkbox" class="reg_cinput" value="" /> 我已经仔细阅读并同意《<a href="/protocol.html"  target="_blank">现代战争用户注册协议</a>》</td></tr></table><table height="50" border="0" cellpadding="0" cellspacing="0"><tr><td width="140"></td> <td width="184" valign="middle" class="reg_c4"><a style="cursor:pointer" onclick="checkRegist(\'indexUserName\',\'indexPassword\',\'indexConfirm\',\'indexNickName\',\'indexAgreement\',\'index\')"><img src="http://www.nexttime.cn/images/foot/btn_teg.gif" /></a></td><td width="238" valign="middle" class="reg_c4"><a href="javascript:resetRegForm(\'indexUserName\',\'indexNickName\',\'indexPassword\',\'indexConfirm\',\'index\')"><img src="http://www.nexttime.cn/images/foot/btn_reg2.gif"  /></a></td></tr></table>';
   
}
function messageInfo(title,message)
{
   
    to("cover_div").style.display = "";
    var result ="<div class=\"pop_top pop_topinfo \"><div class=\"head\"><h3></h3><a href=\"javascript:closeDivs();\" class=\"close_btn\">关闭</a></div></div>";
    result += "<div class=\"pop_cont\"><div class=\"pop_info\"><p class=\"txt02\">"+message+"</p>"
    result +="</div><div class=\"buttons\"> <span class=\"btn btn_sure\"><a href=\"javascript:closeDivs();\"></a></span></div></div><div class=\"pop_foot\"> </div>";
  to("pop_message").innerHTML  = result;
  to("pop_message").style.display = "";
  return false;

}

function closeDivs()
{
       
         to("pop_wrap").style.display = "none";  
        
        to("cover_div").style.display = "none";
        to("pop_message").style.display = "none";
        end();
}

function drawCode()
{
    $.post("/ajaxrequests/RegisteSuccessAjax.aspx",{type:"drawCode"},function(xml){ 
        to("messageDiv").className = "reg_div_2   reg_div_3";
        if(xml.indexOf("@") != -1)
        {
            messageInfo("激活码领取成功！","恭喜您，指挥官！您已成功领取《现代战争》激活码！<br /> 请登录首页，点击“查看激活码/礼品券”按钮进行查看！<br /><b>您是第 <span style='color:#C3D304'>" + xml.substr(0,xml.indexOf("@")) + "</span> 位激活码领取人</b><br/>您的激活码为<b><span style='color:#C3D304'>"+xml.substr(xml.indexOf("@")+1)+"</span></b>");
        }
        else
        {
            messageInfo("激活码领取失败！",xml);
        }
     });
}

function showGamePlayInfo1()
{
    $("#selectList1").toggle();
}

function doChkChecked()
{
  to("logState").checked=!to("logState").checked;
}

function getUserPaih(){
    
    //$("#userPaih").load("http://124.238.249.105:8080/game/Ranking.aspx");
    //$("#userPaih").load("http://www.nextwar.cn/aaa/default.aspx");
    $("#userPaih").load("/UserPh.ashx");
}

function CallBack()
{
     $.post("/ajaxrequests/CallBack.aspx",{}, function(xml){});
}
window.setInterval("CallBack()",30000);

//add by HS, 2010-01-15
function indexFlash(strSwfUrl,strFlashVars,intWidth,intHeight){
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+intWidth+'" height="'+intHeight+'" align="top">');
    document.write('<param name="flashVars" value="'+strFlashVars+'" />');
    document.write('<param name="movie" value="'+strSwfUrl+'" />');
    document.write('<param name="quality" value="high" />');
    document.write('<param name="wmode" value="transparent" />');
    document.write('<embed src="'+strSwfUrl+'" flashVars="'+strFlashVars+'" quality="high" align="top" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+intWidth+'" height="'+intHeight+'"></embed>');
    document.write('</object>');
}

//add by HS 2010-01-18
(function($) { 
 $.fn.jMarquee = function(o) {
    o = $.extend({
    speed:30,
    step:1,//滚动步长
    direction:"up",//滚动方向
    visible:1//可见元素数量
    }, o || {});
    //获取滚动内容内各元素相关信息
    var i=0;
    var div=$(this);
    var ul=$("div",div);
    var tli=$("a",ul);
    var liSize=tli.size();
    if(o.direction=="left")
        tli.css("float","left");
    var liWidth=tli.innerWidth();
    var liHeight=tli.height();
    var ulHeight=liHeight*liSize;
    var ulWidth=liWidth*liSize;
    //如果对象元素个数大于指定的显示元素则进行滚动，否则不滚动。
    if(liSize>o.visible){
        ul.append(tli.slice(0,o.visible).clone())  //复制前o.visible个li，并添加到ul的最后
        li=$("a",ul);
        liSize=li.size();
        
          //给滚动内容添加相关CSS样式
        div.css({"position":"relative","overflow":"hidden"});
        ul.css({"position":"relative","margin":"0","padding":"0","list-style":"none"});
        li.css({"margin":"0","padding":"0","position":"relative"});
        switch(o.direction){
            case "left":
                div.css("width",(liWidth*o.visible)+"px");
                ul.css("width",(liWidth*liSize)+"px");
                li.css("float","left");
                break;
            case "up":
                div.css({"height":(liHeight*o.visible)+"px"});
                ul.css("height",(liHeight*liSize)+"px");
                break;
        }
        
       
        var MyMar=setInterval(ylMarquee,o.speed);
        ul.hover(
            function(){clearInterval(MyMar);},
            function(){MyMar=setInterval(ylMarquee,o.speed);}
        );
    };
    function ylMarquee(){
         
        if(o.direction=="left"){
            
            if(div.scrollLeft()>=parseInt(ulWidth)-10){
                div.scrollLeft(0);
               
            }
            else
            {
                var leftNum=div.scrollLeft();
                leftNum+=parseInt(o.step);
                div.scrollLeft(leftNum)
               
            }
        }
        
        if(o.direction=="up"){
            if(div.scrollTop()>=ulHeight){
               div.scrollTop(0);
                
            }
            else{
               var topNum=div.scrollTop();
               topNum+=parseInt(o.step);
               div.scrollTop(topNum);
            }
        }
        
    };
   
}; 
     
})(jQuery);
 
$(document).ready(function(){
 
});

function WriteGoldCookie(userName,password)
{
//var s=document.createElement('SCRIPT');   
//s.src='http://www.nexttime.cn/interface/gold/writeGoldCookice.aspx?username='+ to(userName).value +"&userpass="+to(password).value;   
//document.body.appendChild(s);  
getUserCookie();
}

function getUserCookie()
{
   var cookieStr = document.cookie; 
   var s=document.createElement('SCRIPT');
   s.src='http://www.nextwar.cn/interface/cookie/setCookie.aspx?info='+ cookieStr.substring(5,cookieStr.length);
   document.body.appendChild(s);
    
   var s1=document.createElement('SCRIPT');
   s1.src='http://www.nextworld.cn/interface/cookie/setCookie.aspx?info='+ cookieStr.substring(5,cookieStr.length);
   document.body.appendChild(s1);
}   

function resetrealinfo()
{
    to("realName").value = "";
    to("realCode").value = "";
}


//设为首页
function SetHome(obj){
var url="http://www.nextworld.cn";//window.location.href;

try{
 obj.style.behavior='url(#default#homepage)';obj.setHomePage(url);

}
catch(e){
if(window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch (e) {
alert("此操作被浏览器拒绝！\n请在浏览器地址栏输入“about:config”并回车\n然后将 [signed.applets.codebase_principal_support]的值设置为'true',双击即可。");
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',url);
}
}
}
//添加到收藏夹
function AddFavorite()
{
var url="http://www.nextworld.cn";//window.location.href;
try
{
window.external.addFavorite(url, "欢动游戏");
}
catch (e)
{
try
{
window.sidebar.addPanel("欢动游戏", url, "");
}
catch (e)
{
alert("加入收藏失败，请使用Ctrl+D进行添加");
}
}
}

