Index: Dev/branches/jQueryUI/api.php
===================================================================
--- Dev/branches/jQueryUI/api.php	(revision 247)
+++ Dev/branches/jQueryUI/api.php	(revision 248)
@@ -21,5 +21,5 @@
                 $user = $user_results[0];
                 if ($password == $user->password) {
-                    $output['uid'] = $user->uid;
+                    $output = $user;
                     $returnValue = 200;
                 }
@@ -37,5 +37,5 @@
                 $user->password = $password;
                 $user->save();
-                $output['uid'] = $user->uid;
+                $output = $user;
                 $returnValue = 200;
             }
Index: Dev/branches/jQueryUI/index.php
===================================================================
--- Dev/branches/jQueryUI/index.php	(revision 247)
+++ Dev/branches/jQueryUI/index.php	(revision 248)
@@ -14,10 +14,12 @@
         <script type="text/javascript" src="js/api.js"></script>
         <script type="text/javascript" src="js/main.js"></script>
-        
-        <?php new StyleSheet("visualeditors"); ?>
+        <link type="text/css" href="css/visualeditors.css" rel="stylesheet"></link>	
     </head>
     <body>
         <div id="header">
-            <?php new Logo(); ?>
+            <div id="logo">
+                <div id="logoImage">Research Tool</div>
+                <div id="logoControls">Log in</div>
+            </div>
         </div>
 
Index: Dev/branches/jQueryUI/js/api.js
===================================================================
--- Dev/branches/jQueryUI/js/api.js	(revision 247)
+++ Dev/branches/jQueryUI/js/api.js	(revision 248)
@@ -37,13 +37,17 @@
         api: {
             post: function(action,args) {
+                req = {
+                    action:action, 
+                    args:args
+                }
+                user = rft.auth.getUser();
+                if ( user ) {
+                    req.uid = user.uid
+                }
                 return $.ajax({
                     type: "POST",
                     url: "api.php",
                     contentType: "application/json",
-                    data: JSON.stringify({
-                        uid:rft.auth.getUid(),
-                        action:action, 
-                        args:args
-                    })
+                    data: JSON.stringify(req)
                 });
             },
@@ -102,5 +106,5 @@
         auth: new (function() {
             var self = this;
-            var currentUid = null;
+            var currentUser = null;
             
             self.login = function(username,password,success,error) {
@@ -112,6 +116,6 @@
                 })
                 .done(function(data, textStatus, jqXHR) {
-                    currentUid = data.uid;
-                    d.resolve(data.uid);
+                    currentUser = data;
+                    d.resolve(data);
                 })
                 .fail(function(jqXHR,textStatus,errorThrown){
@@ -129,6 +133,6 @@
                 })
                 .done(function(data, textStatus, jqXHR) {
-                    currentUid = data.uid;
-                    d.resolve(data.uid);
+                    currentUser = data;
+                    d.resolve(data);
                 })
                 .fail(function(jqXHR,textStatus,errorThrown){
@@ -138,6 +142,6 @@
             };
             
-            self.getUid = function(){
-                return currentUid;
+            self.getUser = function(){
+                return currentUser;
             };
         })(),
@@ -168,22 +172,23 @@
                 var d = $.Deferred();
                 $.get("pages/"+location+"/"+location+".html")
-                .done(function(html){
-                    $("#content").html(html);
-                    $.getScript("pages/"+location+"/"+location+".js")
-                    .done(function(){
-                        d.resolve(); 
-                    })
-                    .fail(function(){
-                        d.reject(); 
-                    })
-                })
                 .fail(function(){
                     $("#content").html("Page "+location+" not found.");
                     d.reject();
-                }).then(function(){
+                })
+                .always(function(){
                     $.bbq.pushState({
                         "content": location
                     });
                 })
+                .pipe(function(html){
+                    $("#content").html(html);
+                    return $.getScript("pages/"+location+"/"+location+".js")
+                })
+                .done(function(){
+                    d.resolve(); 
+                })
+                .fail(function(){
+                    d.reject(); 
+                })
                 return d;
             }
Index: Dev/branches/jQueryUI/js/main.js
===================================================================
--- Dev/branches/jQueryUI/js/main.js	(revision 247)
+++ Dev/branches/jQueryUI/js/main.js	(revision 248)
@@ -1,3 +1,10 @@
 $(function() {
+
+    $("#logoControls").click(function(){
+        user = rft.auth.getUser();
+        if ( !user ) {
+            $("#loginForm").dialog("open");
+        }
+    });
 
     function loadMenu() {
@@ -9,7 +16,7 @@
             "Login": function() {
                 rft.auth.login($("#username").val(),$("#password").val())
-                .done(function(){
-                    $("#info").html("Login succesful.");
+                .done(function(user){
                     $("#loginForm").dialog("close");
+                    $("#logoControls").text("Welcome, "+user.name);
                     loadMenu();
                 })
@@ -20,6 +27,8 @@
             "Register": function() {
                 rft.auth.register($("#username").val(),$("#password").val())
-                .done(function(){
-                    $("#info").text("Succesfully registered, please login now.");
+                .done(function(user){
+                    $("#loginForm").dialog("close");
+                    $("#logoControls").text("Welcome, "+user.name);
+                    loadMenu();
                 })
                 .fail(function(){
