Index: main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py	(revision 7484)
@@ -116,5 +116,5 @@
         if len(deleted):
             self.flash('Successfully removed: %s' % ', '.join(deleted))
-        self.redirect(self.url(self.context, '@@manage')+'#tab-1')
+        self.redirect(self.url(self.context, '@@manage'))
         return
 
@@ -131,9 +131,9 @@
     @action('Add local role', validator=NullValidator)
     def addLocalRole(self, **data):
-        return add_local_role(self,2, **data)
+        return add_local_role(self,3, **data)
 
     @action('Remove selected local roles')
     def delLocalRoles(self, **data):
-        return del_local_roles(self,2,**data)
+        return del_local_roles(self,3,**data)
 
 class ApplicantsContainerAddFormPage(SIRPAddFormPage):
@@ -173,10 +173,10 @@
         self.context[code] = container
         self.flash('Added: "%s".' % code)
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-1')
+        self.redirect(self.url(self.context, u'@@manage'))
         return
 
     @action('Cancel', validator=NullValidator)
     def cancel(self, **data):
-        self.redirect(self.url(self.context, '@@manage') + '#tab-1')
+        self.redirect(self.url(self.context, '@@manage'))
 
 class ApplicantsRootBreadcrumb(Breadcrumb):
@@ -252,4 +252,9 @@
         datepicker.need() # Enable jQuery datepicker in date fields.
         tabs.need()
+        self.tab1 = self.tab2 = self.tab3 = ''
+        qs = self.request.get('QUERY_STRING', '')
+        if not qs:
+            qs = 'tab1'
+        setattr(self, qs, 'active')
         warning.need()
         datatable.need()  # Enable jQurey datatables for contents listing
@@ -283,5 +288,5 @@
         else:
             self.flash('No applicant 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):
@@ -297,5 +302,5 @@
         if len(deleted):
             self.flash('Successfully removed: %s' % ', '.join(deleted))
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
         return
 
Index: main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainermanagepage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainermanagepage.pt	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantscontainermanagepage.pt	(revision 7484)
@@ -2,15 +2,15 @@
 
   <ul class="tabs" data-tabs="tabs">
-    <li class="active">
+    <li tal:attributes="class view/tab1">
     <a href="#tab-1">
       <span>Settings
       </span></a>
     </li>
-    <li>
+    <li tal:attributes="class view/tab2">
     <a href="#tab-2">
       <span>Applicants
       </span></a>
     </li>
-    <li>
+    <li tal:attributes="class view/tab3">
     <a href="#tab-3">
       <span>Local Roles
@@ -19,5 +19,5 @@
   </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>
@@ -53,5 +53,5 @@
       </div>
     </div>
-    <div id="tab-2"> <h3>Applicants</h3>
+    <div id="tab-2" tal:attributes="class view/tab2"> <h3>Applicants</h3>
       <table class="display dataTableManage">
         <thead>
@@ -100,5 +100,5 @@
       </div>
     </div>
-    <div id="tab-3"> <br />
+    <div id="tab-3" tal:attributes="class view/tab3"> <br />
       <table class="display dataTableManage">
         <thead>
Index: main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/applicants/tests/test_browser.py	(revision 7484)
@@ -254,5 +254,5 @@
         self.browser.open(self.add_container_path)
         self.browser.getControl("Cancel").click()
-        self.assertEqual(self.browser.url, self.manage_root_path + '#tab-1')
+        self.assertEqual(self.browser.url, self.manage_root_path)
         self.browser.open(self.add_container_path)
         self.browser.getControl(name="form.prefix").value = ['app']
Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/pages.py	(revision 7484)
@@ -69,10 +69,10 @@
     if user is None or localrole is None:
         view.flash('No user selected.')
-        view.redirect(view.url(view.context, '@@manage')+'#tab-%s' % tab)
+        view.redirect(view.url(view.context, '@@manage')+'?tab%s' % tab)
         return
     role_manager = IPrincipalRoleManager(view.context)
     role_manager.assignRoleToPrincipal(localrole, user)
     notify(LocalRoleSetEvent(view.context, localrole, user, granted=True))
-    view.redirect(view.url(view.context, u'@@manage')+'#tab-%s' % tab)
+    view.redirect(view.url(view.context, u'@@manage')+'?tab%s' % tab)
     return
 
@@ -81,5 +81,5 @@
     if child_ids is None:
         view.flash('No local role selected.')
-        view.redirect(view.url(view.context, '@@manage')+'#tab-%s' % tab)
+        view.redirect(view.url(view.context, '@@manage')+'?tab%s' % tab)
         return
     if not isinstance(child_ids, list):
@@ -100,5 +100,5 @@
     if len(deleted):
         view.flash('Successfully removed: %s' % ', '.join(deleted))
-    view.redirect(view.url(view.context, u'@@manage')+'#tab-%s' % tab)
+    view.redirect(view.url(view.context, u'@@manage')+'?tab%s' % tab)
     return
 
@@ -110,5 +110,5 @@
         view.flash('No item selected.')
         if tab:
-            view.redirect(view.url(view.context, redirect)+'#tab-%s' % tab)
+            view.redirect(view.url(view.context, redirect)+'?tab%s' % tab)
         else:
             view.redirect(view.url(view.context, redirect))
@@ -131,5 +131,5 @@
         view.flash('Successfully removed: %s' % ', '.join(deleted))
     if tab:
-        view.redirect(view.url(view.context, redirect)+'#tab-%s' % tab)
+        view.redirect(view.url(view.context, redirect)+'?tab%s' % tab)
     else:
         view.redirect(view.url(view.context, redirect))
@@ -570,4 +570,9 @@
     def update(self):
         tabs.need()
+        self.tab1 = self.tab2 = ''
+        qs = self.request.get('QUERY_STRING', '')
+        if not qs:
+            qs = 'tab1'
+        setattr(self, qs, 'active')
         datatable.need()
         warning.need()
@@ -624,10 +629,10 @@
             self.flash('The session chosen already exists ')
             return
-        self.redirect(self.url(self.context, '@@index')+'#tab-2')
+        self.redirect(self.url(self.context, '@@index')+'?tab2')
         return
 
     @action('Cancel', validator=NullValidator)
     def cancel(self):
-        self.redirect(self.url(self.context, '@@index')+'#tab-2')
+        self.redirect(self.url(self.context, '@@index')+'?tab2')
         return
 
@@ -650,10 +655,10 @@
         self.applyData(self.context, **data)
         self.flash('Settings have been saved.')
-        self.redirect(self.url(self.context.__parent__, '@@index')+'#tab-2')
+        self.redirect(self.url(self.context.__parent__, '@@index')+'?tab2')
         return
 
     @action('Cancel', validator=NullValidator)
     def cancel(self):
-        self.redirect(self.url(self.context.__parent__, '@@index')+'#tab-2')
+        self.redirect(self.url(self.context.__parent__, '@@index')+'?tab2')
         return
 
@@ -1167,5 +1172,4 @@
 
     def update(self):
-        tabs.need()
         warning.need()
         return super(FacultiesContainerManageFormPage, self).update()
@@ -1206,5 +1210,5 @@
             self.flash('The faculty code chosen already exists.')
             return
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-1')
+        self.redirect(self.url(self.context, u'@@manage')+'?tab1')
 
     @action('Cancel')
@@ -1249,4 +1253,9 @@
     def update(self):
         tabs.need()
+        self.tab1 = self.tab2 = self.tab3 = ''
+        qs = self.request.get('QUERY_STRING', '')
+        if not qs:
+            qs = 'tab1'
+        setattr(self, qs, 'active')
         warning.need()
         datatable.need()
@@ -1315,5 +1324,7 @@
                                   'in this faculty.')
             return
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        self.status = self.flash(
+            "Department %s added." % data['code'])
+        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
 
     @action('Cancel')
@@ -1425,4 +1436,9 @@
     def update(self):
         tabs.need()
+        self.tab1 = self.tab2 = self.tab3 = self.tab4 = ''
+        qs = self.request.get('QUERY_STRING', '')
+        if not qs:
+            qs = 'tab1'
+        setattr(self, qs, 'active')
         warning.need()
         datatable.need()
@@ -1514,5 +1530,5 @@
         message = u'Course %s successfully created.' % (course.code)
         self.flash(message)
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
 
     @action('Cancel', validator=NullValidator)
@@ -1551,5 +1567,5 @@
         message = u'Certificate %s successfully created.' % (certificate.code)
         self.flash(message)
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-3')
+        self.redirect(self.url(self.context, u'@@manage')+'?tab3')
         return
 
@@ -1620,6 +1636,4 @@
 
     def update(self):
-        tabs.need()
-        #warning.need()
         datatable.need()
         return super(CertificatePage, self).update()
@@ -1650,4 +1664,9 @@
     def update(self):
         tabs.need()
+        self.tab1 = self.tab2 = self.tab3 = ''
+        qs = self.request.get('QUERY_STRING', '')
+        if not qs:
+            qs = 'tab1'
+        setattr(self, qs, 'active')
         warning.need()
         datatable.need()
@@ -1717,5 +1736,7 @@
                                   'part of this certificate.')
             return
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        self.status = self.flash(
+            "Course referrer %s_%s added." % (data['course'].code,data['level']))
+        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
 
     @action('Cancel', validator=NullValidator)
Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/resources.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/resources.py	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/resources.py	(revision 7484)
@@ -147,5 +147,6 @@
 #:
 #: * In the `update()` method of the responsible view/page/form
-#:   require the JavaScript code to be rendered into the page::
+#:   require the JavaScript code to be rendered into the page and set
+#    tab for redirection::
 #:
 #:     from waeup.sirp.browser.resources import tabs
@@ -155,4 +156,9 @@
 #:       def update(self):
 #:         tabs.need()
+#:         self.tab1 = self.tab2 = self.tab3 = ''
+#:         qs = self.request.get('QUERY_STRING', '')
+#:         if not qs:
+#:             qs = 'tab1'
+#:         setattr(self, qs, 'active')
 #:
 #:   This way all required JavaScripts will be rendered correctly
@@ -164,13 +170,13 @@
 
 #:     <ul class="tabs" data-tabs="tabs" >
-#:       <li class="active"><a href="#tab-1">Tab 1 Heading</a></li>
-#:       <li><a href="#tab-2">Tab 2 Heading</a></li>
-#:       <li><a href="#tab-3">Tab 3 Heading</a></li>
+#:       <li tal:attributes="class view/tab1"><a href="#tab-1">Tab 1 Heading</a></li>
+#:       <li tal:attributes="class view/tab2"><a href="#tab-2">Tab 2 Heading</a></li>
+#:       <li tal:attributes="class view/tab3"><a href="#tab-3">Tab 3 Heading</a></li>
 #:     </ul>
 
 #:     <div class="tab-content">
-#:       <div id="tab-1" class="active">...</div>
-#:       <div id="tab-2">...</div>
-#:       <div id="tab-3">...</div>
+#:       <div id="tab-1" tal:attributes="class view/tab1">...</div>
+#:       <div id="tab-2" tal:attributes="class view/tab2">...</div>
+#:       <div id="tab-3" tal:attributes="class view/tab3">...</div>
 #:     </div>
 #:
Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/certificatemanagepage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/certificatemanagepage.pt	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/certificatemanagepage.pt	(revision 7484)
@@ -3,11 +3,11 @@
 
   <ul class="tabs" data-tabs="tabs">
-    <li class="active"><a href="#tab-1"><span>Settings</span></a></li>
-    <li><a href="#tab-2"><span>Course Referrers</span></a></li>
-    <li><a href="#tab-3"><span>Local Roles</span></a></li>
+    <li tal:attributes="class view/tab1"><a href="#tab-1"><span>Settings</span></a></li>
+    <li tal:attributes="class view/tab2"><a href="#tab-2"><span>Course Referrers</span></a></li>
+    <li tal:attributes="class view/tab3"><a href="#tab-3"><span>Local Roles</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>
-    <div id="tab-2">
+    <div id="tab-2" tal:attributes="class view/tab2">
       <h3>Course Referrers</h3>
       <table class="display dataTableManage">
@@ -96,5 +96,5 @@
       </div>
     </div>
-    <div id="tab-3"> <br />
+    <div id="tab-3" tal:attributes="class view/tab3"> <br />
       <table class="display dataTableManage">
         <thead>
Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/configurationmanagepage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/configurationmanagepage.pt	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/configurationmanagepage.pt	(revision 7484)
@@ -1,15 +1,15 @@
 <form action="." tal:attributes="action request/URL" method="POST" enctype="multipart/form-data">
     <ul class="tabs" data-tabs="tabs">
-      <li class="active">
+      <li tal:attributes="class view/tab1">
       <a href="#tab-1">
         <span>Site Settings
         </span></a>
       </li>
-      <li>
+      <li tal:attributes="class view/tab2">
       <a href="#tab-2">Session Configurations</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>
@@ -45,5 +45,5 @@
       </div>
     </div>
-    <div id="tab-2"> <br />
+    <div id="tab-2" tal:attributes="class view/tab2"> <br />
       <table class="display dataTableManage">
         <thead>
Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentmanagepage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentmanagepage.pt	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/departmentmanagepage.pt	(revision 7484)
@@ -1,21 +1,21 @@
 <form action="." tal:attributes="action request/URL" method="POST" enctype="multipart/form-data">
   <ul class="tabs" data-tabs="tabs">
-    <li class="active">
+    <li tal:attributes="class view/tab1">
     <a href="#tab-1">
       <span>Settings
       </span></a>
     </li>
-    <li>
+    <li tal:attributes="class view/tab2">
     <a href="#tab-2">Courses</a>
     </li>
-    <li>
+    <li tal:attributes="class view/tab3">
     <a href="#tab-3">Certificates</a>
     </li>
-    <li>
+    <li tal:attributes="class view/tab4">
     <a href="#tab-4">Local Roles</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>
@@ -50,5 +50,5 @@
       </div>
     </div>
-    <div id="tab-2"> <br />
+    <div id="tab-2" tal:attributes="class view/tab2"> <br />
       <table class="display dataTableManage">
         <thead>
@@ -76,5 +76,5 @@
       </div>
     </div>
-    <div id="tab-3"> <br />
+    <div id="tab-3" tal:attributes="class view/tab3"> <br />
       <table class="display dataTableManage">
         <thead>
@@ -102,5 +102,5 @@
       </div>
     </div>
-    <div id="tab-4"> <br />
+    <div id="tab-4" tal:attributes="class view/tab4"> <br />
       <table class="display dataTableManage">
         <thead>
Index: main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/facultymanagepage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/facultymanagepage.pt	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/browser/templates/facultymanagepage.pt	(revision 7484)
@@ -1,15 +1,15 @@
 <form action="." tal:attributes="action request/URL" method="POST" enctype="multipart/form-data">
   <ul class="tabs" data-tabs="tabs">
-    <li class="active">
+    <li tal:attributes="class view/tab1">
     <a href="#tab-1">
       <span>Settings
       </span></a>
     </li>
-    <li>
+    <li tal:attributes="class view/tab2">
     <a href="#tab-2">
       <span tal:content="view/subunits">Contents
       </span> </a>
     </li>
-    <li>
+    <li tal:attributes="class view/tab3">
     <a href="#tab-3">
       <span>Local Roles
@@ -18,5 +18,5 @@
   </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>
@@ -52,5 +52,5 @@
       </div>
     </div>
-    <div id="tab-2">
+    <div id="tab-2" tal:attributes="class view/tab2">
       <h3 tal:content="view/subunits">Departments</h3>
       <table>
@@ -83,5 +83,5 @@
       </div>
     </div>
-    <div id="tab-3"> <br />
+    <div id="tab-3" tal:attributes="class view/tab3"> <br />
       <table class="display dataTableManage">
         <thead>
Index: main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/hostels/browser.py	(revision 7483)
+++ 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 7483)
+++ 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 7483)
+++ 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
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser.py	(revision 7484)
@@ -716,4 +716,9 @@
         warning.need()
         datatable.need()
+        self.tab1 = self.tab2 = ''
+        qs = self.request.get('QUERY_STRING', '')
+        if not qs:
+            qs = 'tab1'
+        setattr(self, qs, 'active')
         return 
 
@@ -738,8 +743,8 @@
             self.context.addStudentStudyLevel(
                 self.context.certificate,studylevel)
+            self.flash('Study level has been added.')
         except KeyError:
             self.flash('This level exists.')
-        self.flash('Study level has been added.')
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
         return
 
@@ -751,5 +756,5 @@
         else:
             self.flash('No study level 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):
@@ -765,5 +770,5 @@
         if len(deleted):
             self.flash('Successfully removed: %s' % ', '.join(deleted))
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
         return
 
@@ -894,4 +899,9 @@
         warning.need()
         datatable.need()
+        self.tab1 = self.tab2 = ''
+        qs = self.request.get('QUERY_STRING', '')
+        if not qs:
+            qs = 'tab1'
+        setattr(self, qs, 'active')
         return
 
@@ -916,5 +926,5 @@
         else:
             self.flash('No ticket 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):
@@ -930,5 +940,5 @@
         if len(deleted):
             self.flash('Successfully removed: %s' % ', '.join(deleted))
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
         return
 
@@ -1018,5 +1028,5 @@
             return
         self.flash('Successfully added %s.' % ticket.code)
-        self.redirect(self.url(self.context, u'@@manage')+'#tab-2')
+        self.redirect(self.url(self.context, u'@@manage')+'?tab2')
         return
 
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studycoursemanagepage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studycoursemanagepage.pt	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studycoursemanagepage.pt	(revision 7484)
@@ -3,10 +3,10 @@
 
   <ul class="tabs" data-tabs="tabs">
-    <li class="active"><a href="#tab-1"><span>Study Course Data</span></a></li>
-    <li><a href="#tab-2"><span>Study Levels</span></a></li>
+    <li tal:attributes="class view/tab1"><a href="#tab-1"><span>Study Course Data</span></a></li>
+    <li tal:attributes="class view/tab2"><a href="#tab-2"><span>Study Levels</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>Study Levels (Course Lists)</h3>
       <table class="display dataTableManage">
Index: main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelmanagepage.pt
===================================================================
--- main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelmanagepage.pt	(revision 7483)
+++ main/waeup.sirp/trunk/src/waeup/sirp/students/browser_templates/studylevelmanagepage.pt	(revision 7484)
@@ -3,10 +3,10 @@
 
   <ul class="tabs" data-tabs="tabs">
-    <li class="active"><a href="#tab-1"><span>Study Level Data</span></a></li>
-    <li><a href="#tab-2"><span>Course Tickets</span></a></li>
+    <li tal:attributes="class view/tab1"><a href="#tab-1"><span>Study Level Data</span></a></li>
+    <li tal:attributes="class view/tab2"><a href="#tab-2"><span>Course Tickets</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>Course Tickets</h3>
       <table class="display dataTableManage">
