/**
 * @author Administrator
 */
var LT;
if (!LT) 
    LT = {};
/**
 * LT.Tab
 */
LT.Tab = function(){
    this.options = {
        classPrefix: 'Tab_',
        classNormal: 'Tab_Normal',
        classFocus: 'Tab_Focus'
    }
    this.Config = function(){
        if (arguments[0]) {
            for (var key in arguments[0]) {
                this.options[key] = arguments[0][key];
            }
        }
    }
    this.tabList = [];
    this.AddTab = function(handle, target){
        var tar = (typeof target == 'string') ? document.getElementById(target) : target;
        switch (typeof handle) {
            case 'string':
                this.tabList[handle] = [document.getElementById(handle), tar];
                break;
            case 'object':
                this.tabList[handle.id] = [handle, tar];
                break;
        }
    }
    this.RemoveTab = function(handle){
        switch (typeof handle) {
            case 'string':
                if (this.tabList[handle]) {
                    delete this.tabList[handle];
                }
                break;
            case 'object':
                if (this.tabList[handle.id]) {
                    delete this.tabList[handle.id];
                }
                break;
        }
    }
    this.Startup = function(){
        var _self = this;
        
        for (var h in this.tabList) {
        
            this.tabList[h][0].onmouseover = function(){
                for (var o in _self.tabList) {
                    if (o == this.id) {
                        this.className = _self.options.classFocus;
                        _self.tabList[o][1].style.display = '';
                    }
                    else {
                        _self.tabList[o][0].className = _self.options.classNormal;
                        _self.tabList[o][1].style.display = 'none';
                    }
                }
            }
			/*
            this.tabList[h][0].onmouseout = function(){
                for (var o in _self.tabList) {
                    this.className = _self.options.classNormal;
                    _self.tabList[o][1].style.display = 'none';
                    
                }
            }*/
            
        }
    }
};
