home *** CD-ROM | disk | FTP | other *** search
/ World Book 2003 / WB03D2SE.iso / info_dat / SurfTheAges / wbSurf.js < prev   
Text File  |  2002-07-16  |  2KB  |  70 lines

  1. /*********************************************************************************
  2. ** wbSurf.js
  3. **
  4. ** Header file for "View from today" pages in Ancient, Middle and Modern Times.
  5. ** Contains functions used to display Surf/WBOL articles in the main window.
  6. **
  7. ** TATA INFOTECH LIMITED
  8. ** (C) COPYRIGHT TATA INFOTECH LIMITED
  9. ** Created:  Feb 8, 2002
  10. *********************************************************************************/
  11.  
  12. var d = document;
  13.  
  14. /* Function Name: displayArticle
  15. ** Accepts: url and target
  16. ** Returns: Nothing
  17. ** Purpose: Displays WB article for the respective edition in the main window.
  18. ** It calls the article directly.   
  19. */
  20. function displayArticle(url,tg)
  21. {
  22.     var furl="wb://articles/"+url;
  23.     if (tg) furl = furl + "#" + tg;
  24.     navigate (furl);
  25.     return false;      
  26. }
  27.  
  28. /* Function Name: showSurf
  29. ** Accepts: url and age
  30. ** Returns: Nothing
  31. ** Purpose: Displays Surf article for the respective age(times) in the main window.
  32. ** It submits to wbSurf.jsp after setting hidden variables url and navbar.
  33. */
  34. function showSurf(url,age)
  35. {
  36.     // var baseUrl = "/np/"+edition+"/surf/"; //Base Path to surf pages as /np/na/surf or /np/in/surf.
  37.     // var baseUrl = "file://W:/CDFILES/SURFTHEAGES/";
  38.     // var baseUrl = document.getProperty ("baseUrl");
  39.  
  40.     var baseUrl = "wb://surftheages/";
  41.  
  42.     //If age = 1, then it is ancient times.
  43.     //If age = 2, then it is middle times. 
  44.     //If age = 3, then it is modern times. 
  45.     // Append the respective navbar file for each age to variable navBarURl.
  46.     var ageUrl;
  47.     var navBarUrl;
  48.     if(age == 1)
  49.     {
  50.         ageUrl = baseUrl+"ancient/";
  51.         navBarUrl = baseUrl+"ancient/saanavba.htm";
  52.     }
  53.     else if(age == 2)     
  54.     {
  55.         ageUrl = baseUrl + "middle/";
  56.         navBarUrl = baseUrl+ "middle/sainavba.htm";
  57.     }
  58.     else if(age == 3) 
  59.     {
  60.         ageUrl = baseUrl+"modern/";
  61.         navBarUrl = baseUrl+"modern/saonavba.htm";
  62.     }
  63.     url = ageUrl + url;
  64.     // alert(url);
  65.     navigate (url);
  66.     return false;      
  67. }
  68.  
  69.  
  70.