/*
 * Copyright (c) 2008, Aleajecta
 * All rights reserved.
 * 
 * The Service and any necessary software used in connection with the 
 * Service ("Software") contain proprietary and confidential information 
 * that is protected by applicable intellectual property and other laws.
 * You agree not to modify, rent, lease, loan, sell, distribute or create
 * derivative works based on the Service or the Software, in whole or in part.
 */
/**
 * @author Greenseed
 */
function Tab(){}(function()
{
    var EleChatWrapper = null;
    var EleFaqBox = null;
    var EleStatBox = null;
    var EleVSDBox = null;
    var EleTabChat = null;
    var EleTabFaq = null;
    var EleTabStat = null;
    var EleTabVSD = null;
    var EleTabAbout = null;
    
    Tab.mouseup = function(owner)
    {
        switch(owner.id)
        {
            case "tabFaq":
            {
                EleChatWrapper.style.display = 'none';
                EleStatBox.style.display = 'none';
                EleVSDBox.style.display = 'none';
                EleAboutBox.style.display = 'none';
                EleFaqBox.style.display = 'block';
                owner.className = 'tabActive';
                EleTabChat.className = "tabInactive ";
                EleTabStat.className = "tabInactive ";
                EleTabVSD.className = "tabInactive ";
                EleTabAbout.className = "tabInactive ";
            }break;
            case "tabChat":
            {
                EleFaqBox.style.display = 'none';
                EleStatBox.style.display = 'none';
                EleVSDBox.style.display = 'none';
                EleAboutBox.style.display = 'none';
                EleChatWrapper.style.display = 'block';
                owner.className = 'tabActive';
                EleTabFaq.className = "tabInactive ";
                EleTabStat.className = "tabInactive ";
                EleTabVSD.className = "tabInactive ";
                EleTabAbout.className = "tabInactive ";
            }break;
            case "tabStat":
            {
                EleChatWrapper.style.display = 'none';
                EleFaqBox.style.display = 'none';
                EleVSDBox.style.display = 'none';
                EleAboutBox.style.display = 'none';
                EleStatBox.style.display = 'block';
                owner.className = 'tabActive';
                EleTabChat.className = "tabInactive ";
                EleTabFaq.className = "tabInactive ";
                EleTabVSD.className = "tabInactive ";
                EleTabAbout.className = "tabInactive ";
            }break;
            case "tabVSD":
            {
                EleChatWrapper.style.display = 'none';
                EleFaqBox.style.display = 'none';
                EleStatBox.style.display = 'none';
                EleAboutBox.style.display = 'none';
                EleVSDBox.style.display = 'block';
                owner.className = 'tabActive';
                EleTabChat.className = "tabInactive ";
                EleTabFaq.className = "tabInactive ";
                EleTabStat.className = "tabInactive ";
                EleTabAbout.className = "tabInactive ";
            }break;
            case "tabAbout":
            {
                EleChatWrapper.style.display = 'none';
                EleFaqBox.style.display = 'none';
                EleStatBox.style.display = 'none';
                EleVSDBox.style.display = 'none';
                EleAboutBox.style.display = 'block';
                owner.className = 'tabActive';
                EleTabChat.className = "tabInactive ";
                EleTabFaq.className = "tabInactive ";
                EleTabStat.className = "tabInactive ";
                EleTabVSD.className = "tabInactive ";
            }break;
        }  
    };
    Tab.init = function()
    {
        EleChatWrapper = GetElementById('chatWrapper');
        EleFaqBox = GetElementById('faqBox'); 
        EleStatBox = GetElementById('statBox'); 
        EleVSDBox = GetElementById('vsdBox'); 
        EleAboutBox = GetElementById('aboutBox'); 
        EleTabChat = GetElementById('tabChat');
        EleTabFaq = GetElementById('tabFaq');
        EleTabStat = GetElementById('tabStat');
        EleTabVSD = GetElementById('tabVSD');
        EleTabAbout = GetElementById('tabAbout');
        
        //EleFaqBox.onmouseover = EleChatWrapper.onmouseover = function(){Chat.isMouseOver = true;};
        //EleFaqBox.onmouseover = EleChatWrapper.onmouseout = function(){Chat.isMouseOver = false;}; 
    };
})();
commonInit.push
(
    function()
    {
        Tab.init();
    }
);