﻿// JScript File
var aLang = ["English", "Russian", "Ukrainian"];

function OnBtnLanguageClick() {
    SwitchObjectById('DropdownLanguage', true);
    ShowObjectById('DropdownLogin', false);
    SetStyle(GetLanguageBtn(), "Selected");
    SetStyle("btnLogin", "");
}

function SwitchObjectById(oName, bShow) 
{
    SwitchObject(document.getElementById(oName), bShow);
}

function SwitchObject(obj, bShow) 
{
    if (obj != null && obj.style) 
    {
        obj = obj.style;
        obj.visibility = bShow ? ((obj.visibility == 'hidden') ? 'visible' : 'hidden') : 'hidden';
    }
}

function ShowObject(obj, bShow) 
{
    if (obj != null && obj.style)
    {
        obj = obj.style;
        obj.visibility = bShow ? 'visible' : 'hidden';
    }
}

function ShowObjectById(oName, bShow) {
    ShowObject(document.getElementById(oName), bShow);
}


function GetLanguageBtn()
{
    for(var i = 0; i < aLang.length; i++)
        with (document) 
            if (getElementById && ((obj=getElementById(aLang[i]))!=null))
                return obj;
    return null;
}

function any_pop(url, width, height) {
    newWin = window.open(url, "", "width=" + width + ",height=" + height + ",toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes");
    newWin.focus();
}

function OnBtnLoginClick()
{
    SwitchObjectById('DropdownLogin', true);
    ShowObjectById('DropdownLanguage', false);
    SetStyle(GetLanguageBtn(), "");
    SetStyle("btnLogin", "Selected");
}

// Dreamweaver AI product ;)
function MM_showHideLayers() 
{ //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

/// set/reset style functions
function SetStyle(obj, style)
{
    if (obj != null)
        obj.className = style;
}

function SetStyleById(oName, style)
{
    SetStyle(document.getElementById(oName), style);
}
