unable to hide image on load ..while navigating

unable to hide image on load ..while navigating

Hi,
I have a file called store.htm and it has a href which points to another page called mobile.html.
 
when i click in the Href whihc point to the mobile.html,i am navigated to the mobile page but , (the javascript is not firing)(logoff button is not hidden),but when I refresh the mobile page , I see the javascript alerts firing but not when I redirect from  store.htm page.
 
here is what i ahve in store.htm
        <li><a href="Mobile.html" data-transition="slide"> 
     <img src="test.png" class="ui-li-thumb" /> 
       
      <p class="ui-li-desc">trunk_mSwat-Chase-iPhone</p>
       <!-- <span class="ui-li-count">12 </span>--></a></li> 




 
Although on store.htm javascript is fired - (I am able to hide the logoff button on Nav=m query string parameter.)
 
please help
 
here is the code for mobile page and Js file which has the hide functionality.
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>mytheme  Appstore</title>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
 <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1"/>
<link rel="stylesheet" href="http://appstore.com/mobiledist/mobile/jquery/css/jquery-ui-1.7.2.custom.min.css" />
<link rel="stylesheet" href="http://appstore.com/mobiledist/mobile/css/jquery.mobile-1.2.0.min.css" />
<link rel="stylesheet" href="http://appstore.com/mobiledist/mobile/css/mythemeappstore.min.css" />
<script src="js/mythemeappstore.js"></script>
<script src="http://appstore.com/mobiledist/mobile/js/jquery-1.8.2.min.js"></script>
<script src="http://appstore.com/mobiledist/mobile/js/jquery.mobile-1.2.0.min.js"></script>
<script src="http://appstore.com/mobiledist/mobile/jquery/js/jquery-1.3.2.min.js"></script>
<script src="http://appstore.com/mobiledist/mobile/jquery/js/jquery-ui-1.7.2.custom.min.js"></script>
<script src="http://appstore.com/mobiledist/mobile/jquery/js/jquery-idleTimeout.min.js"></script>
<script>
$(document).bind("mobileinit", function () {
 $.support.touchOverflow = true;
$.mobile.touchOverflowEnabled = true;
});




















$(document).bind("pageinit",function() {
$("#iOSsubLatest").bind("tap",function(event) {
parent.postMessage("alive message","*");
});
$("#iOSsubLatest").bind("swipe",function(event) {
parent.postMessage("alive message","*");
});
$("#iOSsubLatest").bind("touchmove",function(event) {
parent.postMessage("alive message","*");
});
 });
$(document).ready(function () {
$(document).idleTimeout();
 });
</script>
</head>
<body class="body">
<div id="iOSsubLatest" data-role="page" data-transition="slide"  data-cache="never" data-theme="mytheme">
<div data-role="header" class="mFuturePageHeader chromeBar acb" data-id="header" data-tap-toggle="false" data-position="fixed">
<table><tbody><tr><td class="left">
<div class="hidden" ><a  href="https://appstore.com/mobiledist/mobile/options.htm" data-rel="dialog" data-transition="slidedown">
<img  src="http://appstore.com/mobiledist/mobile/images/logout_60x60_tp.png"  class="hidden logoutButtonA"/></a></div>
<div class="hiddenshow" ><a  href="javascript:ref()" data-rel="dialog" data-transition="slidedown">
<img  src="http://appstore.com/mobiledist/mobile/images/Home.png"  class="hiddenshow logoutButtonA"/></a></div>
</td><td class="center mFuturePageHeaderTitle">branch_jot2.0_iOS</td><td class="right"><div class="logoutButton">
<a  href="javascript:void(0);" data-transition="slide" data-rel="back" class="logoutButtonA"></a></div></td></tr></tbody></table></div>
<div data-role="content" class="ui-scrolllistview">
<div data-role="collapsible" data-theme="a" data-collapsed="false" data-content-theme="d">
<h2> Revision Number: 823</h2>
<ul data-role="listview"  data-divider-theme="d" data-inset="false">




























 </ul>
</div>
<div data-role="footer" data-id="footer" data-theme="a"  data-position="fixed">
<div data-role="navbar">
<ul>
<li><a href="https://appstore.com/mobiledist/mobile/mythemeappstore.htm#LatestBuildsTSS"
rel="external" >TSS/WSS</a></li>
<li><a href="https://appstore.com/mobiledist/mobile/mythemeappstore.htm#LatestBuildsUR"
 rel="external" class="ui-btn-active ui-state-persist" >CARD</a></li>
<li><a href="https://appstore.com/mobiledist/mobile/mythemeappstore.htm#LatestBuilds"
 rel="external" >CIG/MEP</a></li>
<li><a href="https://appstore.com/mobiledist/mobile/mythemeappstore.htm#AllBuilds"
 rel="external" >All Builds</a></li>
 </ul>
</div>
</div>
</div>
</body>
</html>


















 
JS file -  mythemeappstore.js whihc has hide functionality (even alerts(.js) are not firing when we navigate fron other page to this page. but alerts are fired when refresh the mobile page)
 

      function qs(search_for) {
  var query = window.location.search.substring(1);
  var parms = query.split('&');
  for (var i=0; i<parms.length; i++) {
   var pos = parms[i].indexOf('=');
   if (pos > 0  && search_for == parms[i].substring(0,pos)) {
    return parms[i].substring(pos+1);;
   }
  }
  return "";
 }
 var a=(qs("Nav"));
 alert(a);
 if(a!="")
 {
 alert(a);
  document.write('