Having issues with Navigation and BASE HREF....

Having issues with Navigation and BASE HREF....

The general structure of the site is

OUI/
      index.php
      js/
      pages/
      images/



So with that being said..on the index page I have a simple login form.


At this point the base URl for the page 
  1. <base href="http://localhost/~me/OUI/">


When I click on the login button it calls..

  1. function doLogin(){
  2. $.ajax({
  3.   type: "POST",
  4.   url: "functions/checklogin.php",
  5.   data: {
  6.  usrnm: $('#username').val() , passwd: $('#password').val()
  7.    }
  8. })
  9.   .done(function( msg ) {
  10.     if(msg.match(/YES/)){
  11. $('#username').val('');
  12.  $('#password').val('');
  13. $("body").pagecontainer("change","pages/options.php",{ });
  14. }
  15. else
  16.    {
  17. alert(msg);
  18. }
  19.   });
  20. }
And it bring me to the options page of the application....all successful.

The base URL is now:
  1. <base href="http://localhost/~me/OUI/pages/options.php">
And again everyhting is working grand...can navigate all over the application etc etc. 

here is where the problem happens. 
On the options page...I have a signout button in the header.

  1. <div data-role="page" id="optionspage">
  2. <div data-role="header">
  3. <a href="#" onclick="doSignout();" data-role="button" data-mini="true"  class="ui-btn-right" style="padding:5px">Sign Out</a>
  4. <h1>MAIN</h1>
  5. </div>
  6. <div data-role="content" id="options1">
  7.     <? if($_SESSION['role']=='A'){?>
  8.       <a href="admin.php" data-role="button"  data-mini="true">ADMIN PAGE</a> 
  9.       <a href="ordersetup.php" data-role="button"  data-mini="true">ORDER SETUP PAGE</a> 
  10.       <? } ?>
  11.        <a href="production.php" data-role="button"  data-mini="true">PRODUCTION</a>
  12.         <a href="menurecipe.php" data-role="button" data-mini="true">MENU / RECIPE PAGE</a>
  13. </div><!-- /content -->
  14. </div>
It calls the function do Signout...

  1. function doSignout(){
  2. $.ajax({
  3.   type: "POST",
  4.   url: "../functions/signout.php",
  5.   data: {    }
  6. })
  7.   .done(function( msg ) {
  8.  alert('inhere');
  9.        $('body').pagecontainer( "change", "../",{reload:true});
  10.   });
  11. }
It does the signout however the new base URL is:

  1. <base href="http://localhost/~me/">
thus none of the scripts in the site now work since it shaved off the OUI part of the base URL. 

Any ideas for this. I've been banging my head against this for a day. 

Thanks
ROb