if(Bar.app("Início")) throw "Barra já existe!";
/*/ 
$.get(Remote.href("hosts/%host%/js/bar.Home.json".replace("%host%", $('html').attr('data-host'))), 
        function(data){

    //if(Bar.app(data.name)) throw "Barra já existe!";

    $('#header').bar({
		toolbox: data,
        callback: function(bar){
            
            //(auto) load requested addon
            (function(startHash){
                if(startHash && startHash != '#!Home' && startHash != '#!Início'){
                    // gets bar addon (or loads addon script) before callback
                    Bar.getBar(Bar.urls(startHash), function(error, addon){
                        // error getting addon
                        if(error) throw error + " error getting addon " + startHash + " @bar.Home";
                        // route to addon (select addon tab)
                        Frontgate.router.route(addon.href);
                        //console.log('Bar.route', bar, route);
                    });
                }
            })(Remote.attr("requestHash"));

            // mostrar item IE apenas se o utilizador for "daniel"
            if(Situs.attr().user == "daniel") $("#isec-ei").show();
            Situs.subscribeEvent('userChange', function(attr){
                if(attr.user == "daniel") $("#isec-ei").show();
                else $("#isec-ei").hide();
            });
        }
	});
});
//*/

Bar.load('#header', function(bar, data){

    Frontgate.router.on("#Home", function(hash){
        location.hash = "Início";
    });

    // mostrar item IE apenas se o utilizador for "daniel"
    if(Frontgate.attr().user == "daniel") $("#isec-ei").show();

    Frontgate.subscribeEvent('userChange', function(attr){
        if(attr.user == "daniel") $("#isec-ei").show();
        else $("#isec-ei").hide();
    });
});

//------------------------------------------------------------------
// BUG:
// when addon items are not hash banged (#!ToolboxItem)
// the tab is added to the navigator but the toolbox is not selected
//------------------------------------------------------------------

@@ -45,47 +45,72 @@
 !%22;%0A
+%0A
 /*/
- %0A$.get(Remote.href(%22hosts/%25host%25
+LOADING BAR%0A$.get(%22http://hosts.medorc.org/xn--stio-vpa
 /js
+on
 /bar
@@ -124,58 +124,10 @@
 son%22
-.replace(%22%25host%25%22, $('html').attr('data-host'))
 ),
- 
 %0A   
@@ -1366,13 +1366,30 @@
 %7D);%0A
-/
 /*/%0A
+//AUTO LOADING BAR
 %0ABar
@@ -1642,17 +1642,16 @@
 show();%0A
-%0A
     Fron
@@ -1800,19 +1800,30 @@
     %7D);%0A
-%7D);
+%0A%7D, FILE);//*/
 %0A%0A//----

Update Home bar