Index: main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py	(revision 7467)
+++ main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py	(revision 7484)
@@ -216,4 +216,9 @@
         tabs.need()
         datatable.need()
+        self.tab1 = self.tab2 = ''
+        qs = self.request.get('QUERY_STRING', '')
+        if not qs:
+            qs = 'tab1'
+        setattr(self, qs, 'active')
         super(HostelManageFormPage, self).update()
         return
@@ -231,5 +236,5 @@
         self.flash(message)
         write_log_message(self, message)
-        self.redirect(self.url(self.context, '@@manage')+'#tab-2')
+        self.redirect(self.url(self.context, '@@manage')+'?tab2')
         return
 
@@ -241,5 +246,5 @@
         else:
             self.flash('No item selected.')
-            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
+            self.redirect(self.url(self.context, '@@manage')+'?tab2')
             return
         if not isinstance(child_id, list):
@@ -253,5 +258,5 @@
                 self.flash('Could not switch %s: %s: %s' % (
                         id, sys.exc_info()[0], sys.exc_info()[1]))
-                self.redirect(self.url(self.context, '@@manage')+'#tab-2')
+                self.redirect(self.url(self.context, '@@manage')+'?tab2')
                 return
         if len(switched):
@@ -259,5 +264,5 @@
             self.flash('Successfully switched beds: %s' % message)
             write_log_message(self, 'switched: %s' % message)
-            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
+            self.redirect(self.url(self.context, '@@manage')+'?tab2')
         return
 
@@ -269,5 +274,5 @@
         else:
             self.flash('No item selected.')
-            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
+            self.redirect(self.url(self.context, '@@manage')+'?tab2')
             return
         if not isinstance(child_id, list):
@@ -282,8 +287,8 @@
             self.flash('Successfully released beds: %s' % message)
             write_log_message(self, 'released: %s' % message)
-            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
+            self.redirect(self.url(self.context, '@@manage')+'?tab2')
         else:
             self.flash('No allocated bed selected.')
-            self.redirect(self.url(self.context, '@@manage')+'#tab-2')
+            self.redirect(self.url(self.context, '@@manage')+'?tab2')
         return
 
@@ -302,5 +307,5 @@
     def save(self, **data):
         msave(self, **data)
-        self.redirect(self.url(self.context.__parent__, '@@manage')+'#tab-2')
+        self.redirect(self.url(self.context.__parent__, '@@manage')+'?tab2')
         return
 
@@ -310,4 +315,4 @@
             # Beds must be released first before they can be allocated to
             # other students.
-            self.redirect(self.url(self.context.__parent__, '@@manage')+'#tab-2')
-        return
+            self.redirect(self.url(self.context.__parent__, '@@manage')+'?tab2')
+        return
Index: main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser_templates/hostelmanagepage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser_templates/hostelmanagepage.pt	(revision 7467)
+++ main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser_templates/hostelmanagepage.pt	(revision 7484)
@@ -3,10 +3,10 @@
 
   <ul class="tabs" data-tabs="tabs">
-    <li class="active"><a href="#tab-1"><span>Hostel Data</span></a></li>
-    <li><a href="#tab-2"><span>Beds</span></a></li>
+    <li tal:attributes="class view/tab1"><a href="#tab-1"><span>Hostel Data</span></a></li>
+    <li tal:attributes="class view/tab2"><a href="#tab-2"><span>Beds</span></a></li>
   </ul>
 
   <div class="tab-content">
-    <div id="tab-1" class="active">
+    <div id="tab-1" tal:attributes="class view/tab1">
       <table class="form-table">
       <tbody>
@@ -41,5 +41,5 @@
     </div>
 
-    <div id="tab-2">
+    <div id="tab-2" tal:attributes="class view/tab2">
       <h3>Beds</h3>
       <table class="display dataTableManage">
Index: main/waeup.sirp/trunk/src/waeup/sirp/hostels/tests.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/hostels/tests.py	(revision 7467)
+++ main/waeup.sirp/trunk/src/waeup/sirp/hostels/tests.py	(revision 7484)
@@ -310,5 +310,5 @@
         self.browser.open(self.container_path + '/hall-1/hall-1_A_101_A')
         self.assertEqual(self.browser.url,
-            self.container_path + '/hall-1/@@manage#tab-2')
+            self.container_path + '/hall-1/@@manage?tab2')
         # Updating the beds again will not affect the allocation and also
         # the bed numbering remains the same
