home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2004 July / APC0407D1.iso / powerkit / firewall / files / NPF2004.exe / Setup / ISCommon / APP / AlertAst.exe / HTML / KNOWNAPPLICATIONS.JS < prev    next >
Encoding:
JavaScript  |  2003-09-06  |  949 b   |  39 lines

  1. //Save off the initial hRef before we redirect to the anchor.
  2. var strOriginalURL = location.href;
  3. //function onLoad()
  4. {
  5.    //Find the anchor in the URL and redirect to it.  This does not cause the page
  6.    //to load again, just scrolls the page until the anchor is visible.
  7.    var temp = location.href;
  8.    var index = temp.indexOf("#");
  9.    if (index != -1)
  10.    {
  11.       temp = temp.substring(index + 1, temp.length);
  12.       
  13.       index = temp.indexOf("#");
  14.       if (index != -1)
  15.       {
  16.          temp = temp.substring(0, index);
  17.          location.href = "#" + temp;
  18.       }
  19.    }
  20. }
  21.  
  22. function BackToAlert()
  23. {
  24.    //history.go(-1);
  25.    var temp = strOriginalURL;
  26.    var index = temp.indexOf("#");
  27.    if (index != -1)
  28.    {
  29.       temp = temp.substring(index + 1, temp.length);
  30.       
  31.       index = temp.indexOf("#");
  32.       if (index != -1)
  33.       {
  34.          temp = temp.substring(index + 1, temp.length);
  35.          location.href = temp;
  36.       }
  37.    }
  38. }
  39.