//选择服务器
var FontNotice  = new Array(5); //五条通知
var FServer     = new Array(8); //八个大区
var EntryServer = new EntryFunction();//进入服务器选择
//初始化
InitServer();
//******************************************************************************
window.onresize = function()
{
   EntryServer.SetPos();
}
function InitServer()
{
   for(var i = 0; i < 8; ++i)
   {
      FServer[i] = new WeiHuFunction();
   }
   LoadServerXML();
   EntryServer.Init();
}
function WeiHuFunction()
{
   this.AddressIP    = ''; //服务器地址
   this.FServerNick  = ''; //服务器名称
   this.IsWH         = false;//是否维护
}
function  LoadServerXML()
{
    var xmlDoc;
    try //Internet Explorer
    {
        xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
    }
    catch(e)
    {
        try //Firefox, Mozilla, Opera, etc.
        {
            xmlDoc=document.implementation.createDocument("","",null);
        }
        catch(e)
        {
            alert(e.message);
            return;
        }
    }
    xmlDoc.async = false;
    xmlDoc.load('EntryServer/FServerIP.Xml');

    for(var i = 0; i < 5; ++i)
    {
        FontNotice[i] = xmlDoc.getElementsByTagName('yifeimeimei'+(i+1))[0].childNodes[0].nodeValue;
        if(FontNotice[i] == 'false') FontNotice[i] = '';
    }

    for(var i = 0; i < 8; ++i)
    {
        FServer[i].AddressIP   = xmlDoc.getElementsByTagName('IP'+(i+1))[0].childNodes[0].nodeValue;
        FServer[i].FServerNick = xmlDoc.getElementsByTagName('like'+(i+1))[0].childNodes[0].nodeValue;
        FServer[i].IsWH        = xmlDoc.getElementsByTagName('IsWeiHu'+(i+1))[0].childNodes[0].nodeValue;
    }
}

function EntryFunction()
{
    var Fthis = this;
    Fthis.Init;
    Fthis.SetPos;
    //Fthis.show;
    //Fthis.close;

    var SetStyle;//设置样式

    var FEntryBJ  = document.createElement('DIV');//背景最大DIV
    var FEntryKJ1 = document.createElement('DIV');

    var FEntryKJ2 = document.createElement('DIV');
    var FEntryKJ3 = document.createElement('DIV');

    var FEntry1  = document.createElement('DIV');//上左
    var FEntry2  = document.createElement('DIV');//上中
    var FEntry3  = document.createElement('DIV');//上右
    var FEntry4  = document.createElement('DIV');//中左
    var FEntry5  = document.createElement('DIV');//中中
    var FEntry6  = document.createElement('DIV');//中右
    var FEntry7  = document.createElement('DIV');//下左
    var FEntry8  = document.createElement('DIV');//下中
    var FEntry9  = document.createElement('DIV');//下右


    var FEFont1  = document.createElement('DIV');//登陆服务器字
    var FEFont2  = document.createElement('DIV');//登陆服务器字
    var FEFont3  = document.createElement('DIV');//登陆服务器字
    
    var FEFont4  = document.createElement('DIV');//登陆服务器字
    var FSureButton  = document.createElement('DIV');//确定按钮



    var FKJ1 =  document.createElement('DIV');
    var FKJ2 =  document.createElement('DIV');
    var FKJ3 =  document.createElement('DIV');
    var FKJ4 =  document.createElement('DIV');
    var FKJ5 =  document.createElement('DIV');
    var FKJ6 =  document.createElement('DIV');

    var FLine1 = document.createElement('DIV');
    var FLine2 = document.createElement('DIV');
    var FLine3 = document.createElement('DIV');
    var FLine4 = document.createElement('DIV');

    var FNotice1 = document.createElement('DIV');
    var FNotice2 = document.createElement('DIV');
    var FNotice3 = document.createElement('DIV');
    var FNotice4 = document.createElement('DIV');
    var FNotice5 = document.createElement('DIV');
    //服务器组选择
    var FSelectServer = new Array();
    var FSelectFont   = new Array();
    var MoreButton = document.createElement('Input');//更多按钮
    FSelectFont[0] = document.createElement('Input');
    FSelectFont[1] = document.createElement('Input');
    FSelectFont[2] = document.createElement('Input');
    FSelectFont[3] = document.createElement('Input');
    FSelectFont[4] = document.createElement('Input');
    FSelectFont[5] = document.createElement('Input');
    FSelectFont[6] = document.createElement('Input');
    FSelectFont[7] = document.createElement('Input');
    var FSFontDB1;
    var FSFontDB2;
    var FSFontDB3;
    var FSFontDB4;
    var FSFontDB5;
    var FSFontDB6;
    var FSFontDB7;
    var FSFontDB8;

    var MoreInfo;
    var MoreFunction;
    var SureButtonDB;
    var SetServer;
    var SelectServer;
    var SetButtonServer;
    var InitEntryServer;

    var FTest1 =  document.createElement('DIV');
    var FTest2 =  document.createElement('DIV');
    //更多 新打开官方网站页面
    MoreFunction = function()
    {
        var BrowserAddress = 'http://www.tlonl.com/news/newsnotice.html';
        window.open(BrowserAddress);//打开一个新的连接
    }
    LianJieGuanWang = function()
    {
        var BrowserAddress = 'http://www.tlonl.com';
        window.open(BrowserAddress);//打开一个新的连接
    }
    //确定 跳转到所选区的游戏页面 
    SureButtonDB = function()
    {
        var BrowserAddress;
        var FSTemp = false;
				
        if ((FSelectServer[0].checked == false) && (FSelectServer[1].checked == false) &&
            (FSelectServer[2].checked == false) && (FSelectServer[3].checked == false) &&
            (FSelectServer[3].checked == false) && (FSelectServer[5].checked == false) &&
            (FSelectServer[4].checked == false) && (FSelectServer[7].checked == false))
        {
            alert('请选择你要进入的游戏服务器！');
            FSTemp = true;
        }
        if (!FSTemp)
        {
            if (FSelectServer[0].checked == true)
            {
                top.window.location = FServer[0].AddressIP;
            }
            else
            if (FSelectServer[1].checked == true)
            {
                top.window.location = FServer[1].AddressIP;
            }
            else
            if (FSelectServer[2].checked == true)
            {
                top.window.location = FServer[2].AddressIP;
            }
            else
            if (FSelectServer[3].checked == true)
            {
                top.window.location = FServer[3].AddressIP;
            }
            else
            if (FSelectServer[4].checked == true)
            {
                top.window.location = FServer[4].AddressIP;
            }
            else
            if (FSelectServer[5].checked == true)
            {
                top.window.location = FServer[5].AddressIP;
            }
            else
            if (FSelectServer[6].checked == true)
            {
                top.window.location = FServer[6].AddressIP;
            }
            else
            if (FSelectServer[7].checked == true)
            {
                top.window.location = FServer[7].AddressIP;
            }
        }
    }
   
    InitEntryServer = function()
    {    
         for(var i = 0; i < 8; ++i)
         {
             if (FServer[i].FServerNick == 'false')
             {
                 FSelectFont[i].style.display   = 'none';
                 FSelectServer[i].style.display = 'none';
             }
             else
             if (FServer[i].FServerNick != 'false')
             {
                 FSelectFont[i].style.display   = 'inline';
                 FSelectServer[i].style.display = 'inline';
             }
         }
         for(var i = 0; i < 8; ++i)
         {
             if (FServer[i].IsWH == 'true')
             {
                 FSelectFont[i].disabled  = true;
                 FSelectServer[i].disabled = true;
             }
             else
             if (FServer[i].IsWH == 'false')
             {
                 FSelectFont[i].disabled  = false;
                 FSelectServer[i].disabled = false;
             }
         }

         for(var i = 1; i < 8; ++i)
         {
            FSelectServer[i].checked = false;
         }
         FSelectServer[0].checked = true;
    }
    SelectServer = function()
    {
       //IE内核
       if(navigator.userAgent.indexOf("MSIE")>0)
       {
           FSelectServer[0] = document.createElement('<Input type="radio" name="Sex">');
           FSelectServer[1] = document.createElement('<Input type="radio" name="Sex">');
           FSelectServer[2] = document.createElement('<Input type="radio" name="Sex">');
           FSelectServer[3] = document.createElement('<Input type="radio" name="Sex">');
           FSelectServer[4] = document.createElement('<Input type="radio" name="Sex">');
           FSelectServer[5] = document.createElement('<Input type="radio" name="Sex">');
           FSelectServer[6] = document.createElement('<Input type="radio" name="Sex">');
           FSelectServer[7] = document.createElement('<Input type="radio" name="Sex">');
       }
       else //FireFox
       {
           FSelectServer[0]  = document.createElement('Input');
           FSelectServer[1]  = document.createElement('Input');
           FSelectServer[2]  = document.createElement('Input');
           FSelectServer[3]  = document.createElement('Input');
           FSelectServer[4]  = document.createElement('Input');
           FSelectServer[5]  = document.createElement('Input');
           FSelectServer[6]  = document.createElement('Input');
           FSelectServer[7]  = document.createElement('Input');
           FSelectServer[0].type  = 'radio';
           FSelectServer[1].type  = 'radio';
           FSelectServer[2].type  = 'radio';
           FSelectServer[3].type  = 'radio';
           FSelectServer[4].type  = 'radio';
           FSelectServer[5].type  = 'radio';
           FSelectServer[6].type  = 'radio';
           FSelectServer[7].type  = 'radio';
           FSelectServer[0].name  = 'Sex';
           FSelectServer[1].name  = 'Sex';
           FSelectServer[2].name  = 'Sex';
           FSelectServer[3].name  = 'Sex';
           FSelectServer[4].name  = 'Sex';
           FSelectServer[5].name  = 'Sex';
           FSelectServer[6].name  = 'Sex';
           FSelectServer[7].name  = 'Sex';
       }

       SetServer(FSelectServer[0],'7px','15px','22px','21px');
       SetServer(FSelectServer[1],'166px','15px','22px','21px');
       SetServer(FSelectServer[2],'7px','36px','22px','21px');
       SetServer(FSelectServer[3],'166px','36px','22px','21px');
       SetServer(FSelectServer[4],'7px','57px','22px','21px');
       SetServer(FSelectServer[5],'166px','57px','22px','21px');
       SetServer(FSelectServer[6],'7px','78px','22px','21px');
       SetServer(FSelectServer[7],'166px','78px','22px','21px');


       SetButtonServer(FSelectFont[0],FServer[0].FServerNick,'28px','17px','125px','21px','14px','#CE6C01');
       SetButtonServer(FSelectFont[1],FServer[1].FServerNick,'164px','17px','125px','21px','14px','#CE6C01');
       SetButtonServer(FSelectFont[2],FServer[2].FServerNick,'28px','38px','130px','21px','14px','#CE6C01');
       SetButtonServer(FSelectFont[3],FServer[3].FServerNick,'188px','38px','130px','21px','14px','#CE6C01');
       SetButtonServer(FSelectFont[4],FServer[4].FServerNick,'28px','59px','130px','21px','14px','#CE6C01');
       SetButtonServer(FSelectFont[5],FServer[5].FServerNick,'188px','59px','130px','21px','14px','#CE6C01');
       SetButtonServer(FSelectFont[6],FServer[6].FServerNick,'28px','80px','130px','21px','14px','#CE6C01');
       SetButtonServer(FSelectFont[7],FServer[7].FServerNick,'188px','80px','130px','21px','14px','#CE6C01');
       

       FSelectServer[0].onclick  =  FSFontDB1;
       FSelectServer[1].onclick  =  FSFontDB2;
       FSelectServer[2].onclick  =  FSFontDB3;
       FSelectServer[3].onclick  =  FSFontDB4;
       FSelectServer[4].onclick  =  FSFontDB5;
       FSelectServer[5].onclick  =  FSFontDB6;
       FSelectServer[6].onclick  =  FSFontDB7;
       FSelectServer[7].onclick  =  FSFontDB8;
       FSelectFont[0].onclick   =  FSFontDB1;
       FSelectFont[1].onclick   =  FSFontDB2;
       FSelectFont[2].onclick   =  FSFontDB3;
       FSelectFont[3].onclick   =  FSFontDB4;
       FSelectFont[4].onclick   =  FSFontDB5;
       FSelectFont[5].onclick   =  FSFontDB6;
       FSelectFont[6].onclick   =  FSFontDB7;
       FSelectFont[7].onclick   =  FSFontDB8;

       FEntryKJ3.appendChild(FSelectServer[0]);
       FEntryKJ3.appendChild(FSelectServer[1]);
       FEntryKJ3.appendChild(FSelectServer[2]);
       FEntryKJ3.appendChild(FSelectServer[3]);
       FEntryKJ3.appendChild(FSelectServer[4]);
       FEntryKJ3.appendChild(FSelectServer[5]);
       FEntryKJ3.appendChild(FSelectServer[6]);
       FEntryKJ3.appendChild(FSelectServer[7]);
       FEntryKJ3.appendChild(FSelectFont[0]);
       FEntryKJ3.appendChild(FSelectFont[1]);
       FEntryKJ3.appendChild(FSelectFont[2]);
       FEntryKJ3.appendChild(FSelectFont[3]);
       FEntryKJ3.appendChild(FSelectFont[4]);
       FEntryKJ3.appendChild(FSelectFont[5]);
       FEntryKJ3.appendChild(FSelectFont[6]);
       FEntryKJ3.appendChild(FSelectFont[7]);
    }
    Fthis.Init = function()
    {
       SetStyle(FEntryBJ,Math.floor((document.body.clientWidth - 479)/ 2)-205 + 'px','49px','479px','345px','inline','','','','');

       SetStyle(FEntry1,'0px','0px','3px','21px','inline','','','','EntryServer/BiaoTiZuo.gif');
       SetStyle(FEntry2,'3px','0px','473px','21px','inline','','','','EntryServer/BiaoTiZhong.gif');
       SetStyle(FEntry3,'476px','0px','3px','21px','inline','','','','EntryServer/BiaoTiYou.gif');

       SetStyle(FEntry4,'0px','21px','7px','317px','inline','','','','EntryServer/MLeft.gif');
       SetStyle(FEntry5,'7px','21px','465px','317px','inline','','','','');
       SetStyle(FEntry6,'472px','21px','7px','317px','inline','','','','EntryServer/MRight.gif');

       SetStyle(FEntry7,'0px','338px','7px','7px','inline','','','','EntryServer/DLeft.gif');

       SetStyle(FEntry8,'7px','338px','465px','7px','inline','','','','EntryServer/DMid.gif');
       SetStyle(FEntry9,'472px','338px','7px','7px','inline','','','','EntryServer/DRight.gif');

       SetStyle(FEFont1,'203px','4px','84px','22px','inline','14px','#822C83','登陆服务器','');

       SetStyle(FEFont2,'179px','28px','84px','22px','inline','14px','#715794','公告栏','');
       SetStyle(FEFont3,'179px','160px','84px','22px','inline','14px','#715794','选择服务器','');
       FEntry5.style.backgroundColor  = 'white';
       //五条公告  
       SetStyle(FNotice1,'4px','7px','308px','22px','inline','14px','white',FontNotice[0],'');
       SetStyle(FNotice2,'4px','27px','304px','22px','inline','14px','white',FontNotice[1],'')
       SetStyle(FNotice3,'4px','47px','304px','22px','inline','14px','white',FontNotice[2],'')
       SetStyle(FNotice4,'4px','67px','304px','22px','inline','14px','white',FontNotice[3],'')
       SetStyle(FNotice5,'4px','87px','304px','22px','inline','14px','white',FontNotice[4],'')


       SetStyle(FSureButton,'273px','301px','79px','39px','inline','14px','#715794','','EntryServer/ButtonE1.gif');
       SetStyle(FEFont4,'23px','13px','84px','22px','inline','14px','#715794','确 定','');
       FSureButton.onclick = SureButtonDB;
       //测试
       SetStyle(FEntryKJ1,'7px','28px','152px','306px','inline','','','','EntryServer/banner.jpg');
       FEntryKJ1.onclick = LianJieGuanWang;


       //FEntryKJ1.style.border      = "1px solid chartreuse";
       //FEntryKJ1.style.borderColor = 'black';
       
       SetStyle(FEntryKJ2,'161px','45px','311px','109px','inline','','','','');
       SetStyle(FKJ1,'0px','0px','3px','109px','inline','','','','EntryServer/GuanLiZuo.gif');
       SetStyle(FKJ2,'3px','0px','305px','109px','inline','','','','EntryServer/GuanLiZhong.gif');
       SetStyle(FKJ3,'308px','0px','3px','109px','inline','','','','EntryServer/GuanLiYou.gif');

       SetStyle(FEntryKJ3,'161px','178px','311px','116px','inline','','','','');
       SetStyle(FKJ4,'0px','0px','3px','116px','inline','','','','EntryServer/XinZuo.gif');
       SetStyle(FKJ5,'3px','0px','305px','116px','inline','','','','EntryServer/XinZhong.gif');
       SetStyle(FKJ6,'308px','0px','3px','116px','inline','','','','EntryServer/XinYou.gif');

       SetStyle(FLine1,'163px','35px','13px','1px','inline','','','','EntryServer/LaoGaiFenGeXian.gif');
       SetStyle(FLine2,'223px','35px','215px','1px','inline','','','','EntryServer/LaoGaiFenGeXian.gif');
       SetStyle(FLine3,'163px','167px','13px','1px','inline','','','','EntryServer/LaoGaiFenGeXian.gif');
       SetStyle(FLine4,'252px','167px','215px','1px','inline','','','','EntryServer/LaoGaiFenGeXian.gif');


       document.body.appendChild(FEntryBJ);
       FEntryBJ.appendChild(FEntry1);
       FEntryBJ.appendChild(FEntry2);
       FEntryBJ.appendChild(FEntry3);
       FEntryBJ.appendChild(FEntry4);
       FEntryBJ.appendChild(FEntry5);
       FEntryBJ.appendChild(FEntry6);

       FEntryBJ.appendChild(FSureButton);
       FSureButton.appendChild(FEFont4);

       FEntryBJ.appendChild(FEntry7);
       FEntryBJ.appendChild(FEntry8);
       FEntryBJ.appendChild(FEntry9);

       FEntryBJ.appendChild(FEFont1);
       FEntryBJ.appendChild(FEFont2);
       FEntryBJ.appendChild(FEFont3);


       FEntryBJ.appendChild(FLine1);
       FEntryBJ.appendChild(FLine2);
       FEntryBJ.appendChild(FLine3);
       FEntryBJ.appendChild(FLine4);

       FEntryBJ.appendChild(FEntryKJ1);
       FEntryBJ.appendChild(FEntryKJ2);
       FEntryBJ.appendChild(FEntryKJ3);

       FEntryKJ2.appendChild(FKJ1);
       FEntryKJ2.appendChild(FKJ2);
       FEntryKJ2.appendChild(FKJ3);
       FEntryKJ3.appendChild(FKJ4);
       FEntryKJ3.appendChild(FKJ5);
       FEntryKJ3.appendChild(FKJ6);

       FEntryKJ2.appendChild(FNotice1);
       FEntryKJ2.appendChild(FNotice2);
       FEntryKJ2.appendChild(FNotice3);
       FEntryKJ2.appendChild(FNotice4);
       FEntryKJ2.appendChild(FNotice5);
       MoreInfo();
       SelectServer();
       InitEntryServer();
       //广告招商
       SetStyle(FTest1,'30px','37px','150px','22px','inline','14px','#715794','','');
       SetStyle(FTest2,'30px','66px','200px','22px','inline','14px','#715794','','');
       FEntryBJ.appendChild(FTest1);
       FEntryBJ.appendChild(FTest2);
    }
    Fthis.SetPos = function()
    {
       FEntryBJ.style.left = Math.floor((document.body.clientWidth - 479)/ 2)-205 + 'px';
    }
    MoreInfo = function()
    {
       MoreButton.type = 'button';
       MoreButton.value = '更多';
       MoreButton.style.position   = 'absolute';
       MoreButton.style.left       = '438px';
       MoreButton.style.top        = '26px';
       MoreButton.style.width      = '38px';
       MoreButton.style.height     = '21px';
       MoreButton.style.fontSize   = '14px';
       MoreButton.style.color      = 'blue';
       MoreButton.style.fontfamily        = '宋体'; //设置字体样式 宋体
       MoreButton.style.backgroundColor   = 'transparent';//设置背景透明   transparent
       MoreButton.style.borderBottomWidth = 0;
       MoreButton.style.borderTopWidth    = 0;
       MoreButton.style.borderLeftWidth   = 0;
       MoreButton.style.borderRightWidth  = 0;
       MoreButton.onclick = MoreFunction;
       FEntryBJ.appendChild(MoreButton);
    }
    SetButtonServer = function(FOBJ,value,left,top,width,height,fsize,color)
    {
       FOBJ.type = 'button';
       FOBJ.value = value;
       FOBJ.style.position   = 'absolute';
       FOBJ.style.left       = left;
       FOBJ.style.top        = top;
       FOBJ.style.width      = width;
       FOBJ.style.height     = height;
       FOBJ.style.fontSize   = fsize;
       FOBJ.style.color      = color;
       FOBJ.style.fontfamily        = '宋体'; //设置字体样式 宋体
       FOBJ.style.backgroundColor   = 'transparent';//设置背景透明   transparent
       FOBJ.style.borderBottomWidth = 0;
       FOBJ.style.borderTopWidth    = 0;
       FOBJ.style.borderLeftWidth   = 0;
       FOBJ.style.borderRightWidth  = 0;
    }
    SetServer = function(obj,left,top,width,height)
    {
       obj.style.position = "absolute";
       obj.style.left     = left;
       obj.style.top      = top;
       obj.style.width    = width;
       obj.style.height   = height;
       obj.display        = 'inline';
    }
    FSFontDB1 = function()
    {
       FSelectServer[0].checked = true;
       FSelectServer[1].checked = false;
       FSelectServer[2].checked = false;
       FSelectServer[3].checked = false;
       FSelectServer[4].checked = false;
       FSelectServer[5].checked = false;
       FSelectServer[6].checked = false;
       FSelectServer[7].checked = false;
       FSelectFont[0].style.color  = 'red';
       FSelectFont[1].style.color  = '#CE6C01';
       FSelectFont[2].style.color  = '#CE6C01';
       FSelectFont[3].style.color  = '#CE6C01';
       FSelectFont[4].style.color  = '#CE6C01';
       FSelectFont[5].style.color  = '#CE6C01';
       FSelectFont[6].style.color  = '#CE6C01';
       FSelectFont[7].style.color  = '#CE6C01';
    }
    FSFontDB2 = function()
    {
       FSelectServer[0].checked = false;
       FSelectServer[1].checked = true;
       FSelectServer[2].checked = false;
       FSelectServer[3].checked = false;
       FSelectServer[4].checked = false;
       FSelectServer[5].checked = false;
       FSelectServer[6].checked = false;
       FSelectServer[7].checked = false;
       FSelectFont[0].style.color  = '#CE6C01';
       FSelectFont[1].style.color  = 'red';
       FSelectFont[2].style.color  = '#CE6C01';
       FSelectFont[3].style.color  = '#CE6C01';
       FSelectFont[4].style.color  = '#CE6C01';
       FSelectFont[5].style.color  = '#CE6C01';
       FSelectFont[6].style.color  = '#CE6C01';
       FSelectFont[7].style.color  = '#CE6C01';
    }
    FSFontDB3 = function()
    {
       FSelectServer[0].checked = false;
       FSelectServer[1].checked = false;
       FSelectServer[2].checked = true;
       FSelectServer[3].checked = false;
       FSelectServer[4].checked = false;
       FSelectServer[5].checked = false;
       FSelectServer[6].checked = false;
       FSelectServer[7].checked = false;
       FSelectFont[0].style.color  = '#CE6C01';
       FSelectFont[1].style.color  = '#CE6C01';
       FSelectFont[2].style.color  = 'red';
       FSelectFont[3].style.color  = '#CE6C01';
       FSelectFont[4].style.color  = '#CE6C01';
       FSelectFont[5].style.color  = '#CE6C01';
       FSelectFont[6].style.color  = '#CE6C01';
       FSelectFont[7].style.color  = '#CE6C01';
    }
    FSFontDB4 = function()
    {
       FSelectServer[0].checked = false;
       FSelectServer[1].checked = false;
       FSelectServer[2].checked = false;
       FSelectServer[3].checked = true;
       FSelectServer[4].checked = false;
       FSelectServer[5].checked = false;
       FSelectServer[6].checked = false;
       FSelectServer[7].checked = false;
       FSelectFont[0].style.color  = '#CE6C01';
       FSelectFont[1].style.color  = '#CE6C01';
       FSelectFont[2].style.color  = '#CE6C01';
       FSelectFont[3].style.color  = 'red';
       FSelectFont[4].style.color  = '#CE6C01';
       FSelectFont[5].style.color  = '#CE6C01';
       FSelectFont[6].style.color  = '#CE6C01';
       FSelectFont[7].style.color  = '#CE6C01';
    }
    FSFontDB5 = function()
    {
       FSelectServer[0].checked = false;
       FSelectServer[1].checked = false;
       FSelectServer[2].checked = false;
       FSelectServer[3].checked = false;
       FSelectServer[4].checked = true;
       FSelectServer[5].checked = false;
       FSelectServer[6].checked = false;
       FSelectServer[7].checked = false;
       FSelectFont[0].style.color  = '#CE6C01';
       FSelectFont[1].style.color  = '#CE6C01';
       FSelectFont[2].style.color  = '#CE6C01';
       FSelectFont[3].style.color  = '#CE6C01';
       FSelectFont[4].style.color  = 'red';
       FSelectFont[5].style.color  = '#CE6C01';
       FSelectFont[6].style.color  = '#CE6C01';
       FSelectFont[7].style.color  = '#CE6C01';
    }
    FSFontDB6 = function()
    {
       FSelectServer[0].checked = false;
       FSelectServer[1].checked = false;
       FSelectServer[2].checked = false;
       FSelectServer[3].checked = false;
       FSelectServer[4].checked = false;
       FSelectServer[5].checked = true;
       FSelectServer[6].checked = false;
       FSelectServer[7].checked = false;
       FSelectFont[0].style.color  = '#CE6C01';
       FSelectFont[1].style.color  = '#CE6C01';
       FSelectFont[2].style.color  = '#CE6C01';
       FSelectFont[3].style.color  = '#CE6C01';
       FSelectFont[4].style.color  = '#CE6C01';
       FSelectFont[5].style.color  = 'red';
       FSelectFont[6].style.color  = '#CE6C01';
       FSelectFont[7].style.color  = '#CE6C01';
    }
    FSFontDB7 = function()
    {
       FSelectServer[0].checked = false;
       FSelectServer[1].checked = false;
       FSelectServer[2].checked = false;
       FSelectServer[3].checked = false;
       FSelectServer[4].checked = false;
       FSelectServer[5].checked = false;
       FSelectServer[6].checked = true;
       FSelectServer[7].checked = false;
       FSelectFont[0].style.color  = '#CE6C01';
       FSelectFont[1].style.color  = '#CE6C01';
       FSelectFont[2].style.color  = '#CE6C01';
       FSelectFont[3].style.color  = '#CE6C01';
       FSelectFont[4].style.color  = '#CE6C01';
       FSelectFont[5].style.color  = '#CE6C01';
       FSelectFont[6].style.color  = 'red';
       FSelectFont[7].style.color  = '#CE6C01';
    }
    FSFontDB8 = function()
    {
       FSelectServer[0].checked = false;
       FSelectServer[1].checked = false;
       FSelectServer[2].checked = false;
       FSelectServer[3].checked = false;
       FSelectServer[4].checked = false;
       FSelectServer[5].checked = false;
       FSelectServer[6].checked = false;
       FSelectServer[7].checked = true;
       FSelectFont[0].style.color  = '#CE6C01';
       FSelectFont[1].style.color  = '#CE6C01';
       FSelectFont[2].style.color  = '#CE6C01';
       FSelectFont[3].style.color  = '#CE6C01';
       FSelectFont[4].style.color  = '#CE6C01';
       FSelectFont[5].style.color  = '#CE6C01';
       FSelectFont[6].style.color  = '#CE6C01';
       FSelectFont[7].style.color  = 'red';
    }
    
    MoreButton.onmouseover = function()
    {
       MoreButton.style.cursor          = 'pointer';
    }
    MoreButton.onmouseout = function()
    {
       MoreButton.style.cursor          = 'default';
    }
    FSureButton.onmouseover = function()
    {
       FSureButton.style.cursor          = 'pointer';
       FSureButton.style.backgroundImage = 'URL('+'EntryServer/ButtonE2.gif'+')';
    }
    FSureButton.onmouseout = function()
    {
       FSureButton.style.cursor          = 'default';
       FSureButton.style.backgroundImage = 'URL('+'EntryServer/ButtonE1.gif'+')';
    }
    SetStyle = function(FDiv,left,top,width,height,display,size,color,StrFont,backgroundImage)
    {
       FDiv.style.overflow  = 'hidden';
       FDiv.style.position  = 'absolute';
       FDiv.style.left      = left;
       FDiv.style.top       = top;
       FDiv.style.width     = width;
       FDiv.style.height    = height;
       FDiv.style.display   = display;
       FDiv.style.fontSize  = size;
       FDiv.style.color     = color;
       FDiv.innerHTML       = StrFont;
       //FDiv.style.border  = "1px solid chartreuse";
       if ((backgroundImage != '') && (backgroundImage != null))
       {
           FDiv.style.backgroundImage = 'URL('+backgroundImage+')';
       }
    }
}
//******************************************************************************
function TGameNewsButton(aPDiv) 
{
	var Fthis = this;
	var BackDiv = new Array();
	var FShowInDiv = new Array();
	var FShowBtn;
	var GameFarmeInit;           //带按钮提示框初始化
        var FShowBtnClick;
        var FX = 0;
        var FY = 0;
        FX = 600;
        FY = 350;
	Fthis.Show;                  //提示框显示
        Fthis.FHintButtonDB;
        //提示框事件  Str-显示内容 B1显示内容多少  B2-是否自动显示字体 B3事件
	Fthis.Show = function(Str)
	{
            BackDiv[0].style.display = 'inline';
            FShowInDiv[1].innerHTML  = Str;
	}

	Fthis.FHintButtonDB = function()
	{
            BackDiv[0].style.display = 'none';
	}
  FShowBtnClick = function()
  {
      BackDiv[0].style.display = 'none';
  }
	GameFarmeInit = function()  
	{
            BackDiv[0]  = new BackgroundDiv(aPDiv,0,0,970,540,20,'inline',null);
            BackDiv[1]  = new BackgroundDiv(BackDiv[0],(970-FX)/4*3,(540-FY)/2,FX,FY,5,'inline',null);
            //开始拼框框
            BackDiv[2]  = new BackgroundDiv(BackDiv[1],0,0,5,5,5,'inline','Images/TiShiKuang/ULeft.gif');
            BackDiv[3]  = new BackgroundDiv(BackDiv[1],FX-10,0,5,5,5,'inline','Images/TiShiKuang/URight.gif');
            BackDiv[4]  = new BackgroundDiv(BackDiv[1],FX-10,114,5,5,5,'inline','Images/TiShiKuang/DRight.gif');
            BackDiv[5]  = new BackgroundDiv(BackDiv[1],0,FY,5,5,5,'inline','Images/TiShiKuang/DLeft.gif');
            BackDiv[6]  = new BackgroundDiv(BackDiv[1],5,1,FX-15,4,5,'inline','Images/TiShiKuang/UMid.gif');//最上面那快
            BackDiv[7]  = new BackgroundDiv(BackDiv[1],FX-10,5,4,FY-5,5,'inline','Images/TiShiKuang/MRight.gif');
            BackDiv[8]  = new BackgroundDiv(BackDiv[1],5,FY,FX-13,4,5,'inline','Images/TiShiKuang/DMid.gif');//最下面那快
            BackDiv[9]  = new BackgroundDiv(BackDiv[1],1,5,4,FY-5,5,'inline','Images/TiShiKuang/MLeft.gif');
            BackDiv[10] = new BackgroundDiv(BackDiv[1],5,5,FX-15,FY-5,5,'inline','Images/TiShiKuang/MMid.gif');//中间快
            //标题
            BackDiv[11] = new BackgroundDiv(BackDiv[1],5,4,FX-15,23,5,'inline','Images/TiShiKuang/BiaoTi.gif');
            FShowInDiv[0] = new ShowInfoDiv(BackDiv[1],5,9,FX-20,18,6,'center','#E3FFF0',14);
            FShowInDiv[0].innerHTML = '游戏公告';
            //按钮
            FShowBtn = new ShowMyTextIMGBtn(BackDiv[1],(FX-73)/2,FY-35,73,25,0,6,73,19,7,'Images/TiShiKuang/BtnF1.gif',
               'Images/TiShiKuang/BtnF2.gif','Images/TiShiKuang/BtnF2.gif','确定','center','#044944',14,null);
            FShowBtn.onclick = FShowBtnClick;
            //内容
            FShowInDiv[1] = new ShowInfoDiv(BackDiv[1],25,30,FX-40,FY-30,6,'Left','#2D7310',13);
            FShowInDiv[1].innerHTML = '';
            FShowInDiv[1].style.lineHeight = '19px';
            BackDiv[0].style.display = 'inline';
	}
	GameFarmeInit();
}

// --------------------------- 创建背景DIV --------------------------
// aParent为显示的目的对象，aLeft,aTop,aWidth,aHeight显示对象的左，上，宽，高
// aZindex显示对象的zIndex, aShowStyle表示显示对象当前是否显示，aSrc为图片地址

function BackgroundDiv(aParent,aLeft,aTop,aWidth,aHeight,aZindex,aShowStyle,aSrc,aClick)
{                                    
    var Fthis;
    Fthis = document.createElement("div");
    Fthis.style.position = 'absolute';
    Fthis.style.left     = aLeft+'px';
    Fthis.style.top      = aTop+'px';
    Fthis.style.width    = aWidth+"px";
    Fthis.style.height   = aHeight+"px";
    Fthis.style.zIndex   = aZindex;
    Fthis.style.display  = aShowStyle;
    Fthis.style.overflow = "hidden";
    //Fthis.style.border   = "1px solid chartreuse";
    if(typeof aSrc != "undefined" && aSrc != null && aSrc != "")
    	Fthis.style.backgroundImage = 'url('+ aSrc + ')';    // 在此添加背景图片
    if(typeof aClick != 'undefined' && aClick != null && aClick != "")
    	Fthis.onclick = aClick;
    if(typeof aParent != "undefined" && aParent != "")
    	aParent.appendChild(Fthis);
    Fthis.MovePos = function(pos_x,pos_y)
    {
    	Fthis.style.left     = pos_x+'px';
    	Fthis.style.top      = pos_y+'px';
    }
    Fthis.SetSize = function(pos_x,pos_y,w,h)
    {
    	Fthis.style.left     = pos_x+'px';
    	Fthis.style.top      = pos_y+'px';
	    Fthis.style.width    = w+"px";
	    Fthis.style.height   = h+"px";
    }
    return Fthis;
}


// ------------------------- 创建显示文字的DIV -------------------------
// aParent为显示的目的对象，aLeft,aTop,aWidth,aHeight显示对象的左，上，宽，高
// aZindex显示对象的zIndex, aAlign为显示的方式，aColor,aFontSize为显示文字的颜色和大小
function ShowInfoDiv(aParent,aLeft,aTop,aWidth,aHeight,aZindex,aAlign,aColor,aFontSize)
{
	var Fthis;
	Fthis = document.createElement("div");
	Fthis.style.position = "absolute";
	Fthis.style.left = aLeft+"px";
	Fthis.style.top  = aTop+"px";
	Fthis.style.width = aWidth + "px";
	Fthis.style.height= aHeight + "px";
	Fthis.style.textAlign = aAlign;
	Fthis.style.zIndex = aZindex;
	Fthis.style.clear = "left";
	Fthis.style.fontfamily        = '宋体'; //设置字体样式
	//Fthis.style.border = "1px solid chartreuse";
	Fthis.style.color = aColor;
	Fthis.style.fontSize  = aFontSize + "px";	
	if(typeof aParent != "undefined" && aParent != "")
    	aParent.appendChild(Fthis);
	Fthis.ShowText = function(aStr)
	{
		if(Fthis.innerHTML != "")
		{
			Fthis.innerHTML = "";
		}
		Fthis.innerHTML = aStr;
	}
	Fthis.SetTextColor = function(aaColor)
	{
		Fthis.style.color = aaColor;
	}
	Fthis.onmouseover = function()
	{
		Fthis.style.cursor = 'default';
	}
	return Fthis;
}
// ---------------------------- 创建空白DIV ------------------------------
///*aSrc1,aSrc2,aImgBtnDown 填""或者填null或者不填但是要有“,”*/
// ---------------------------- 创建一张图片的按钮 -----------------------
///*aSrc2 填""或者填null或者不填但是要有“,”*/
// ---------------------------- 创建两张图片的按钮 -----------------------
///*所有参数必填*/
// ---------------------------- 创建背包显页按钮 -------------------------
///*aSrc2 填""或者填null或者不填但是要有“,” , 通过Fthis.SetSrc设置按钮图片*/
///*aShowStyle 控制对象是否显示*/
function ShowMyDivBtn(aParent,aLeft,aTop,aWidth,aHeight,aZindex,aShowStyle,aSrc1,aSrc2,aSrc3,aImgBtnDown)
{
	var Fthis;
	var MouseOver;
	var MouseOut;
	var Disabled = true;
	var CanClick = true;
	Fthis = document.createElement("div");
	Fthis.style.position = "absolute";
	Fthis.style.left = aLeft + "px";
	Fthis.style.top  = aTop + "px";
	Fthis.style.width = aWidth + "px";
	Fthis.style.height= aHeight + "px";
	Fthis.style.zIndex = aZindex;
	Fthis.style.display  = aShowStyle;
		
	if(typeof aSrc1 != "undefined" && aSrc1 != null && aSrc1 != "")
  	Fthis.style.backgroundImage = 'url('+ aSrc1 + ')';    // 在此添加背景图片
        if(typeof aImgBtnDown != "undefined" && aImgBtnDown != null && aImgBtnDown != "")
        {
              Fthis.onclick = function()
              {      
                      if(Disabled)
                              aImgBtnDown();
                      else return ;
              }
        }
  
  MouseOver = function()
	{
		if(Disabled && CanClick)
		{
			Fthis.style.cursor = 'pointer';
			Fthis.SetSrc(aSrc2);
		}
	}
	MouseOut  = function()
	{
		if(Disabled && CanClick)
		   Fthis.SetSrc(aSrc1);
	}
	if(typeof aSrc2 != "undefined" && aSrc2 != "" && aSrc2 != null)
	{
		Fthis.onmouseover = MouseOver;
		Fthis.onmouseout  = MouseOut;
	}
	Fthis.SetChange = function(aSrc5)
	{
		aSrc2 = aSrc5;
		Fthis.onmouseover = MouseOver;
		Fthis.onmouseout  = MouseOut;
	}
	Fthis.SetSrc = function(aSrc4)
	{
		Fthis.style.backgroundImage = 'url('+ aSrc4 + ')';
	}
	Fthis.SetSate = function(aBool)
	{
		if(aBool)
		{
			Disabled = true;
			Fthis.style.backgroundImage = 'url('+ aSrc1 + ')';
		}else
		{
			Disabled = false;
			Fthis.style.backgroundImage = 'url('+ aSrc3 + ')';
		}
	}
	Fthis.SetClick = function(_Bool)
	{
		if(_Bool)
		{
			CanClick = true;
			Fthis.style.backgroundImage = 'url('+ aSrc1 + ')';
		}
		else
		{
			CanClick = false;
			Fthis.style.backgroundImage = 'url('+ aSrc3 + ')';
		}
	}
	Fthis.SetBtnState = function(aBool)
	{
		if(aBool)
			Disabled = true;
		else
			Disabled = false;
	}
	// 音乐开关
	Fthis.SetMusicBtn = function(aImg1,aImg2)
	{
		aSrc1 = aImg1;
		aSrc2 = aImg2;
		Fthis.style.backgroundImage = 'url('+ aSrc1 + ')';
	}
  if(typeof aParent != "undefined" && aParent != "" && aParent != null)
  {
  	aParent.appendChild(Fthis);
		return Fthis;
	}else return;
	
}

// ------------------- 创建显示文字的图片按钮	---------------------
// aParent为显示的目的对象，aLeft,aTop,aWidth,aHeight显示对象的左，上，宽，高， aX,aY 为矫正值
// aSrc1,aSrc2 图片地址；aText按钮显示的文字；aAlign文字显示的方式；aColor,aFontSize文字的颜色和大小；aImgBtnDown
function ShowMyTextIMGBtn(aParent,aLeft,aTop,aWidth,aHeight,aLeft1,aTop1,aWidth1,aHeight1,aZindex,aSrc1,aSrc2,aSrc3,aText,aAlign,aColor,aFontSize,aImgBtnDown)
{
	var Fthis;
	var FShow = true;           
	var Fthis = new ShowMyDivBtn(aParent,aLeft,aTop,aWidth,aHeight,aZindex,"inline",aSrc1,aSrc2,aSrc3,aImgBtnDown);
	var IMGText = new ShowInfoDiv(Fthis,aLeft1,aTop1,aWidth1,aHeight1,0,aAlign,aColor,aFontSize);
	IMGText.ShowText(aText);
        Fthis.SetBName = function(Str)
        {
            IMGText.ShowText(Str);
        }
	Fthis.SetTextColor = function(aaColor)
	{
		IMGText.SetTextColor(aaColor);
	}
	Fthis.DisShow = function(aShow)
	{
		if(aShow == true)
			Fthis.style.display = "inline";
		else
			Fthis.style.display = "none";
	}
	Fthis.SetEvent = function(aEvent)
	{
		Fthis.onclick = aEvent;
	}
	Fthis.SetSize = function(pos_x,pos_y,w,h)
        {
              Fthis.style.left     = pos_x+'px';
              Fthis.style.top      = pos_y+'px';
              Fthis.style.width    = w+"px";
              Fthis.style.height   = h+"px";
        }
        //设置背景图片
        Fthis.SetBackImage = function(SrcImg)
        {
            Fthis.style.backgroundImage = 'url('+ SrcImg + ')';//在此添加背景图片
        }
	return Fthis;
}