function showupdatr() { 
    $('indicator').show();
}

function hideupdatr() { 
    $('indicator').hide();
}

Event.observe(window, 'load', function() {

    initialiseStateFromURL(global_username);

})
  
function initialiseStateFromURL(userid) {
     var hash = window.location.hash;
     
     if(hash == '#stream') { 
     
        //Do nothing.
     
     }else if(hash == '#forum') { 
     
     stopStream(); 
     new Ajax.Updater('nm_stream', '/forums/latest', {asynchronous:true, evalScripts:false, onLoading:showupdatr(), onComplete:hideupdatr()}); 
     switchtabs(2);
     
     }else if(hash == '#notice') { 
     
     stopStream(); 
     new Ajax.Updater('nm_stream', '/replies', {asynchronous:true, evalScripts:false, onLoading:showupdatr(), onComplete:hideupdatr()}); $('new_comm').innerHTML=''; 
     switchtabs(3);
     
     }else if(hash == '#friends') { 
     
     stopStream(); 
     new Ajax.Updater('nm_stream', '/users/' + userid + '/friends', {asynchronous:true, evalScripts:false, onLoading:showupdatr(), onComplete:hideupdatr()}); $('new_comm').innerHTML=''; switchtabs(4); 
     window.location.hash = 'friends';
     
     }
}