﻿// login form...
function showLoginForm()
{    
    document.getElementById('loginArea').style.visibility='visible';
    document.getElementById('mygenwi').style.visibility='hidden';
    document.getElementById('loginArea').style.left=735;
    document.getElementById('loginArea').style.top=0;
}

function cancelLoginForm() 
{
	document.getElementById('loginArea').style.visibility='hidden';
	document.getElementById('mygenwi').style.visibility='visible';
}

function initLogin()
{
    if (typeof aFocusElems == 'undefined')
        aFocusElems = ['userIdTextBox', 'passwordTextBox'];
    
    setTextFocus(aFocusElems);
    
    if (typeof sPageName != 'undefined' && sPageName == 'home')
    {
        if (typeof aItemTabs == 'undefined')
            return;
        
        for (var i in aItemTabs)
        {
            var oTab = _GL.getUIElem(i);
            if (oTab)
            {
                oTab.sTab = aItemTabs[i][0];
                oTab.sItemDiv = aItemTabs[i][1];
                oTab.onclick = function()
                {
                    if (this.className == 'activeTab')
                        return;
                        
                    var curTab = _GL.getUIElem(this.sTab), curDiv = _GL.getUIElem(this.sItemDiv);
                    curTab.className = 'activeTab';
                    curDiv.style.display = 'block';
                    this.removeAttribute('href');
                    
                    for (var j in aItemTabs)
                    {
                        if (j == this.id)
                            continue;
                        
                        var t = _GL.getUIElem(aItemTabs[j][0]), 
                            l = _GL.getUIElem(j)
                            lyr = _GL.getUIElem(aItemTabs[j][1]);
                        t.className = 'inactiveTab';
                        l.setAttribute('href','#');
                        lyr.style.display = 'none';
                    }
                }
            }
        }
        
    }
}

_GL.addOnLoadListener(initLogin);