/* General Javascript include */
var countryDropdown;
var loginDropdown;


(function ($) {
    $(document).ready(function () {
        try {
            $('.country .styledSelect').change(navigateToCountry);
            $('.login .styledSelect').change(navigateToSubsystemLogin);

            countryDropdown = $('.country .styledSelect').msDropDown({visibleRows:20}).data("dd");
            loginDropdown = $('.login .styledSelect').msDropDown().data("dd");
            
            $('.ddChild .selected').hide();
        }
        catch (e) {
        }
    });
})(jQuery)

function navigateToCountry() {
    var menuIndex = $('.country .styledSelect').get(0).selectedIndex;
    if (menuIndex == 0) return;
    countryDropdown.selectedIndex(0);
    location = $('.country .styledSelect').get(0).options[menuIndex].value;
}

function navigateToSubsystemLogin() {
    var menuIndex = $('.login .styledSelect').get(0).selectedIndex;
    if (menuIndex == 0) return;
    loginDropdown.selectedIndex(0);
    window.open($('.login .styledSelect').get(0).options[menuIndex].value);
}

jQuery(function () {
    jQuery(".standart-table thead").find("tr:first th:first").addClass("rounded-left");
    jQuery(".standart-table thead").find("tr:first th:last").addClass("rounded-right");
    jQuery(".standart-table tbody").find("tr:odd").addClass("alt");
});

