﻿    // JScript 文件
var image_Country = new Array();
image_Country[0] = "style/images/flags/enflag.gif";
image_Country[1] = "style/images/flags/enflag_gray.gif";
image_Country[2] = "style/images/flags/deflag.gif";
image_Country[3] = "style/images/flags/deflag_gray.gif";
image_Country[4] = "style/images/flags/frflag.gif";
image_Country[5] = "style/images/flags/frflag_gray.gif";
image_Country[6] = "style/images/flags/esflag.gif";
image_Country[7] = "style/images/flags/esflag_gray.gif";
image_Country[8] = "style/images/flags/icon_all.gif";
image_Country[9] = "style/images/flags/icon_all_gray.gif";
function setCountryFlag()
{
    try{
    var img_all = document.getElementById("img_all");
    var img_en = document.getElementById("img_en");
    var img_de = document.getElementById("img_de");
    var img_fr = document.getElementById("img_fr");
    var img_es = document.getElementById("img_es");
    var CountryStr = document.getElementById("CountryStr");
    var Country = document.getElementById("ServerList_UC1_txt_Country").value;
    var GameID = document.getElementById("ServerList_UC1_txt_GameID").value;
    if(GameID == 1)
    {
        CountryStr.style.display = "block";
        if(Country != "")
        {
            if(Country.toLowerCase() == "en")
            {

            }
            else if(Country.toLowerCase() == "de")
            {
                img_en.src = image_Country[1];
                img_de.src = image_Country[2];
            }
            else if(Country.toLowerCase() == "fr")
            {
                img_en.src = image_Country[1];
                img_fr.src = image_Country[4];
            }
            else if(Country.toLowerCase() == "es")
            {
                img_en.src = image_Country[1];
                img_es.src = image_Country[6];
            }
        }
        else
        {
            img_all.src = image_Country[8];
            img_en.src = image_Country[1];
        }
    }
    else
    {
        CountryStr.style.display = "none";
    }  
    }
    catch(e)      
    {
    }
}
