﻿var jsondata = null;
function GetWebSiteContent() {
    $.get("/ReceiveResult.aspx?get=websitejson&lanname=" + lan + "&rand" + Math.random() + "d" + Math.random(), function (data) {
        jsondata = eval("(" + data + ")");
        ChangeLanByFlash();
        getIndexTitleContent();
        $("#Index_top").html(jsondata.title);
        $("#Index_left").html(jsondata.content);
        $("#Index_ceneter").html(jsondata.content1);
        DeserializeObject(data);
    });
}
function SwitchLan(lanname) {
    if (lanname == lan)
        return;
    lan = lanname;
    $.get("/ReceiveResult.aspx?lan=" + lanname + "&rand" + Math.random(), function(data) {
        GetWebSiteContent();
        if (clickIndex == "newsalon")
            GetnewsalonPage();
        if (clickIndex == "clubs")
            GetClubs(lanname);
        Getsevice(lanname);
        Getwebtitle();
    });
}
function GetnewsalonPage() {
    //$("#salon2content").html("Loading");
    $.get("/newSalon.aspx?newsalonlan=" + lan + "&rand" + Math.random(), function(data) {
        $("#salonload").css("display", "none");
        $("#salon2content").css("display", "block");
        $("#salon2content").html(data);
        Image_init();
    });
}
function Getwebtitle() {
    $.get("/ReceiveResult.aspx?lanname=" + lan + "&get=webtitle&rand" + Math.random(), function(data) {
        document.title = data;
    });
}
function Getsevice(lanname) {
    $.get("/ReceiveResult.aspx?lanname=" + lanname + "&get=websevice&rand" + Math.random(), function(data) {
        $("#salon7 div").html(data);
    });
}

function GetClubs(lanname) {
    //$("#clubs").html("Loading");
    $.get("/SalonClubs.aspx?lanname=" + lanname + "&rand" + Math.random(), function(data) {
        $("#clubsload").css("display", "none");
        $("#clubs").css("display", "block");
        //$("#clubs").css("text-align", "left");
        $("#clubs").html(data);
    });
}


//nav
function navLoadOver() {
    ChangeLanByFlash();
    return SetGamelan();
}
function getIndexContent() {
    getIndexTitleContent();
}
function getIndexTitleContent() {
    try {
        if (getbrowser()) {
            __flash__addCallback(getswf("gameIndex"), "getLanChange");
        }
        getswf("gameIndex").getLanChange(SetGamelan());
    } catch (err) { }
    try {
        if (getbrowser()) {
            __flash__addCallback(getswf("glogin"), "getLanChange");
        }
        getswf("glogin").getLanChange(SetGamelan());
    } catch (err) { }
}
