﻿function bookmarkit()
{
    window.external.addFavorite('http://yy.91.com','《YY仙战》');
}
    
function showArea(id)
{     
    $("div[name='childdiv']").attr("class", "hidden");  
    $("#"+id).attr("class", "view");  
}
function LogOnToYY()
{
    $("#yy_login_content").show();
    
}

function LogClose()
{

    //document.getElementById("yy_login_content").style.display="none";
    $("#yy_login_content").hide();
}

function ShowServerList()
{
    var winTop = $(window).scrollTop();
    var winHeight = $(window).height();
    var alertHeight = $("#yy_ServerListChooseContent").height();
    var top  =  winTop +  winHeight/2 - alertHeight/2;
    $("#yy_ServerListChooseContent").css("top",top).add(".popUp").show();
    
    if($("#isGetServerList").val()=="0")
    {
        GetServerList();
    }
    //$("#yy_ServerListChooseContent").show();
//     var str='';
//       str +='<div class="YYIndexChooseServer"  >';
//       str +='     <div id="YY_serverMainChoose" runat="server"> '; 
//       str +='数据加载中...';
//       //str +=data.ServerTitle;              
//       str +='     </div>';
//       str +='      <span><a href="javascript:;" onclick="closeServerList()"></a></span>';
//       str +=' </div>';
//       str +=' <div class="YYIndexServerList" >';
//       str +='     <div id="YYIndexChooseSet" runat="server" style=" display:inline;">';
//       str +='数据加载中...';
//       //str +=data.ServerList;
//       str +='</div> ';   	 
//       str +='     <div>';
//       str +='         <span><img src="style/image/NewServerIco.gif" /><p>新开</p></span>';
//       str +='         <span><img src="style/image/NormalServerIco.gif" /><p>正常</p></span>';
//       str +='         <span><img src="style/image/HotServerIco.gif" /><p>爆满</p></span>';
//       str +='         <span><img src="style/image/MaintenanceServerIco.gif" /><p>维护</p></span>';
//       str +='     </div>';
//       str +=' </div>';
//       str +=' <div class="YYIndexServerBottom"></div>    ';  
//     //alert( "Data Saved: " + msg );
//        $("#yy_ServerListChooseContent").html(str);
   
   
    
}

function closeServerList()
{
    $(".popUp,#yy_ServerListChooseContent").hide();
    //document.getElementById("yy_ServerListChooseContent").style.display="none";        
}

function GetServerList()
{

    $.getJSON("Default.aspx?type=json",
        function(data){        
            $("#YY_serverMainChoose").html(data.ServerTitle);
            $("#YYIndexChooseSet").html(data.ServerList);  
            $("#isGetServerList").val(1);  
    }); 
    

}