var CSS={
    hasClass:function(element,className){
        element=$(element);
        if(element&&className&&element.className){
            return new RegExp('\\b'+trim(className)+'\\b').test(element.className);
        }
        return false;
    },
    addClass:function(element,className){
        element=$(element);
        if(element&&className){
            if(!CSS.hasClass(element,className)){
                className=trim(className);
                if(element.className){
                    element.className+=' '+className;
                }
                else{
                    element.className=className;
                }
                window.CssManager&&CssManager.useClasses(className);
            }
        }
        return this;
    },
    removeClass:function(element,className){
        element=$(element);
        if(element&&className&&element.className){
            className=trim(className);var regexp=new RegExp('\\b'+className+'\\b','g');
            element.className=element.className.replace(regexp,'');
        }
        return this;
    },
    conditionClass:function(element,className,shouldShow){
        element=$(element);
        if(shouldShow){
            CSS.addClass(element,className);
        }
        else{
            CSS.removeClass(element,className);
        }
    },
    setClass:function(element,className){
        element=$(element,true);
        element.className=className;
        window.CssManager&&CssManager.useClasses(className);
        return this;
    },
    toggleClass:function(element,className){
        element=$(element);
        if(CSS.hasClass(element,className)){
            return CSS.removeClass(element,className);
        }
        else{
            return CSS.addClass(element,className);
        }
    },
    setStyle:function(element,name,value){
        element.style[name]=value;return element;
    },
    getStyle:function(element,property){
        element=$(element);
        function hyphenate(property){
        return property.replace(/[A-Z]/g,function(match){return'-'+match.toLowerCase();});}
if(window.getComputedStyle){
return window.getComputedStyle(element,null).getPropertyValue(hyphenate(property));
}
if(document.defaultView&&document.defaultView.getComputedStyle){
    var computedStyle=document.defaultView.getComputedStyle(element,null);
if(computedStyle) 
return computedStyle.getPropertyValue(hyphenate(property));if(property=="display")
return"none";
Util.error("Can't retrieve requested style %q due to a bug in Safari",property);}
if(element.currentStyle){return element.currentStyle[property];}
return element.style[property];},setOpacity:function(element,opacity){element=$(element);var opaque=(opacity==1);
try{element.style.opacity=(opaque?'':''+opacity);
}
catch(ignored){}
try{element.style.filter=(opaque?'':'alpha(opacity='+(opacity*100)+')');
}
catch(ignored){}
},
getOpacity:function(element){element=$(element);var opacity=CSS.getStyle(element,'filter');var val=null;if(opacity&&(val=/(\d+(?:\.\d+)?)/.exec(opacity))){return parseFloat(val.pop())/100;}else if(opacity=CSS.getStyle(element,'opacity')){return parseFloat(opacity);}else{return 1.0;}},Cursor:{kGrabbable:'grabbable',kGrabbing:'grabbing',kEditable:'editable',set:function(element,name){element=$(element);element=element||document.body;switch(name){
case CSS.Cursor.kEditable:name='text';
break;
case CSS.Cursor.kGrabbable:if(ua.firefox()){name='-moz-grab';
}
else{
name='move';
}
break;
case CSS.Cursor.kGrabbing:if(ua.firefox()){name='-moz-grabbing';}else{name='move';}
break;}
element.style.cursor=name;
        }
    }  
};






function hideNav(){
        presence.style.display = 'none';
    
    
   
}
/*
unhideNav:function() {
    document.nav.style.display = 'block';
    document.links.style.display = 'block';
}
unfocus:function () {
    var wasFocused=this._unfocus();
    if(wasFocused) {
        this.disableUnfocus=wasFocused;
        setTimeout( function() { this.disableUnfocus=null; }.bind(this),50);
    }
},
toggleTab:function ( wrapperID,tabID,scrollContentID ) {
    var wrapper=ge(wrapperID);
    var tab=ge(tabID);
    if(!wrapper||!tab||tabID==this.disableUnfocus) {
        return;
    }
    if (wrapper.style.display=='none') {
        this.openTab( wrapperID,tabID,scrollContentID );
    }
    else {
        this.closeTab();
    }
},
closeTab:function () {
    var tab=this.focusedTab;
    if(!tab){
        return;
    }
    this.unfocus();
    CSS.removeClass( tab,'focused' );
    CSS.removeClass( this.holder,'tab_open' );
    for ( var i=0;i<this.tabCloseHandlers.length;i++ ) {
        this.tabCloseHandlers[i]();
    }
},
openTabDelayed:function( wrapperID,tabID,scrollContentID ) { 
    this.openTab.bind( this,wrapperID,tabID,scrollContentID).defer();
},
openTab:function( wrapperID,tabID,scrollContentID ){
    if(this.focusedTab==tabID){
        return;
    }
    this._unfocus();
    this.focusedWrapper=wrapperID;
    this.focusedContent=scrollContentID;
    this.focusedTab=tabID;
    this.disableUnfocus=this.focusedTab;
    setTimeout( function() { 
        this.disableUnfocus=null;
    }.bind(this),50);
    if(scrollContentID&&!this.contentResized[scrollContentID]){
        ge(wrapperID).style.visibility='hidden';
        show(wrapperID);
        this.tabContentResize(wrapperID,scrollContentID);
        ge(wrapperID).style.visibility='';}else{show(wrapperID);
    }
    CSS.addClass(ge(tabID),'focused');
    CSS.addClass( this.holder,'tab_open');
    for(var i=0;i<this.tabOpenHandlers.length;i++){ this.tabOpenHandlers[i]();}
}
toggleTab:function() {
    if(CSS.hasClass(presence.holder,'buddy_list_hidden')&&!this.flLive){return;}
    if(!this.buddyListOpen){this.openTab(true);}
    else{this.closeTab();}
},
openTab:function ( focusTypeahead ){
    if(this.buddyListOpen){return;}
    var offline=CSS.hasClass(presence.holder,'buddy_list_hidden');
    if(offline&&!this.flLive){this.buddyListOpen=false;return;}
    if(offline){this._goOfflineUI();
    presence.openTab(this.wrapperID,this.tabID,this.contentID);}
    else if(!this.rendered){
        var availableList=this.availableList;
        this.availableList={};
        this.shouldShowLoading=true;
        this._firstRender();
        presence.openTab(this.wrapperID,this.tabID);
        this.availableList=availableList;
        if(this.haveFullList){
        this._render.bind(this).defer();setTimeout(this._availableListChanged.bind(this,true),10);}}else{presence.openTab(this.wrapperID,this.tabID,this.contentID);}
this.buddyListOpen=true;if(!offline){setTimeout(this._openTabPostProcess.bind(this,focusTypeahead),50);}}

*/
