﻿if (typeof (Main) == 'undefined')
    Main = {};

Main.Mploger = function() { }

Main.Mploger.prototype = {
    OnChangeProgressBar: function(SelectedIndex) {
        //alert('6666' + SelectedIndex);
        var hdnSelectedIndexChange = document.getElementById("ctl00_MasterHolder_Main_Administrator1_hdnSelectedIndexChange");
        hdnSelectedIndexChange.value = SelectedIndex;

        __doPostBack('ctl00$MasterHolder$Main_Administrator1$btnSelectIndexChange', '');
    }
}


Main.League = function() {}

Main.League.prototype = {
    OnChangeDisplay: function(Obj) {
        //alert(Obj.id);
        if (Obj.style.display == 'none')
            Obj.style.display = 'block';
        else
            Obj.style.display = 'none';
    }
}

function GamOnTabSwitcher(tabIndex) {
    $("ul.gamtabs").find('li').each(function(index) {
        $(this).removeClass();
        $("#GamOnTab" + index).css('display', 'none');
        if (index == tabIndex) {
            $(this).addClass("selected");
            $("#GamOnTab" + index).css('display', 'block');
        }
    });
    
//    for (var i = 0; i < 4; i++) {
//        if (tabIndex == i) {
//            document.getElementById("GamOnTab" + i).style.display = "block";
//            $("GamOnTabLi" + i).addClass("selected");
//            //document.getElementById("GamOnTabLi" + i).setAttribute("class", "selected");
//        }
//        else {
//            document.getElementById("GamOnTab" + i).style.display = "none";
//            alert($("GamOnTabLi" + i));
//            alert($("GamOnTabLi" + i).attr('class'));
//            $("GamOnTabLi" + i).removeClass();
//            //document.getElementById("GamOnTabLi" + i).setAttribute("class", "");
//        }
//    }
}

function GamOnSupportedGamesIconIn(e, iconType) {
    if (!e) var e = window.event;

    var eventElement = (e) ? e.srcElement : e.target;

    if (!eventElement)
        eventElement = e.currentTarget;

    var el = $(eventElement).position();

    var xfrom = el.left + $(eventElement).width() + 2;
    var yfrom = el.top;

    document.getElementById("gComment" + iconType).style.position = "absolute";
    document.getElementById("gComment" + iconType).style.display = "block";
    document.getElementById("gComment" + iconType).style.left = xfrom + "px";
    document.getElementById("gComment" + iconType).style.top = yfrom + "px";
}

function GamOnSupportedGamesIconOut(e, iconType) {
    document.getElementById("gComment" + iconType).style.display = "none";
}