home *** CD-ROM | disk | FTP | other *** search
/ Organic Chemistry (8th Edition) / Image.iso / pc / data1.cab / Media_Files / js / misc.js < prev    next >
Encoding:
JavaScript  |  2003-05-14  |  891 b   |  49 lines

  1. // Edugen JavaScripts Library V1.0 =========================================
  2. //
  3. //     File misc.js
  4. //     
  5. //     This file is part of the Edugen JavaScripts Library.
  6. //     Copyright (c) 2002 WWL Corp. - A Subsidiary of John Wiley & Sons, Inc.
  7. // =========================================================================
  8.  
  9. function goTo(where)
  10. {
  11.     document.location.replace(where);
  12.     return false;
  13. }
  14.  
  15. function escapez(str)
  16. {
  17.     var ch;
  18.     var result = "";
  19.     for (var i=0; i<str.length; i++)
  20.     {
  21.         ch = str.substring(i, i+1);
  22.         switch(ch)
  23.         {
  24.             case " ": ch=escape(ch);break;
  25.             case "%": ch=escape(ch);break;
  26.             case "#": ch=escape(ch);break;
  27.             case "&": ch=escape(ch);break;
  28.             case "|": ch=escape(ch);break;
  29.             default:break;
  30.         }
  31.         result += ch;
  32.     }
  33.     return result;
  34. }
  35.  
  36.  
  37. var ns = false;
  38. var ie = false;
  39.  
  40. if (document.all)
  41. {
  42.     ie = true;
  43. }
  44. else
  45. {
  46.     ns = true;
  47. }
  48.  
  49.