home *** CD-ROM | disk | FTP | other *** search
/ Thomson (Residential) / TGSTPv7203.iso / mac / Documentation / HTML / TG780-BUS_de / wwhdata / common / wwhpagef.js < prev   
Text File  |  2001-08-03  |  5KB  |  207 lines

  1. // Copyright (c) 2000-2001 Quadralay Corporation.  All rights reserved.
  2. //
  3.  
  4. function  WWHGetWWHFrame(ParamToBookDir)
  5. {
  6.   var  Frame = null;
  7.  
  8.  
  9.   // Set reference to top level help frame
  10.   //
  11.   if ((typeof parent.WWHHelp != "undefined") &&
  12.       (parent.WWHHelp != null))
  13.   {
  14.     Frame = eval("parent");
  15.   }
  16.   else if ((typeof parent.parent.WWHHelp != "undefined") &&
  17.            (parent.parent.WWHHelp != null))
  18.   {
  19.     Frame = eval("parent.parent");
  20.   }
  21.  
  22.   // Redirect if Frame is null
  23.   //
  24.   if (Frame == null)
  25.   {
  26.     var  bPerformRedirect = true;
  27.     var  Agent;
  28.  
  29.  
  30.     // No redirect if running Netscape 4.x
  31.     //
  32.     Agent = navigator.userAgent.toLowerCase();
  33.     if ((Agent.indexOf("mozilla") != -1) &&
  34.         (Agent.indexOf("spoofer") == -1) &&
  35.         (Agent.indexOf("compatible") == -1))
  36.     {
  37.       var  MajorVersion;
  38.  
  39.  
  40.       MajorVersion = parseInt(navigator.appVersion)
  41.       if (MajorVersion < 5)
  42.       {
  43.         bPerformRedirect = false;  // Skip redirect for Netscape 4.x
  44.       }
  45.     }
  46.  
  47.     if (bPerformRedirect)
  48.     {
  49.       var  BaseFilename;
  50.  
  51.  
  52.       BaseFilename = location.href.substring(location.href.lastIndexOf("/") + 1, location.href.length);
  53.  
  54.       if (ParamToBookDir.length > 0)
  55.       {
  56.         var  RelativePathList = ParamToBookDir.split("/");
  57.         var  PathList         = location.href.split("/");
  58.         var  BaseList = new Array();
  59.         var  MaxIndex;
  60.         var  Index;
  61.  
  62.  
  63.         PathList.length--;
  64.         for (MaxIndex = RelativePathList.length, Index = 0 ; Index < MaxIndex ; Index++)
  65.         {
  66.           if (RelativePathList[Index] == ".")
  67.           {
  68.             ;  // Do nothing!
  69.           }
  70.           else if (RelativePathList[Index] == "..")
  71.           {
  72.             if (BaseList.length == 0)
  73.             {
  74.               BaseList[BaseList.length] = PathList[PathList.length - 1];
  75.               PathList.length = PathList.length - 1;
  76.             }
  77.             else
  78.             {
  79.               BaseList.length--;
  80.             }
  81.           }
  82.           else
  83.           {
  84.             BaseList[BaseList.length] = RelativePathList[Index];
  85.           }
  86.         }
  87.  
  88.         BaseFilename = BaseList.join("/") + BaseFilename;
  89.       }
  90.  
  91.       location.replace(WWHToWWHelpDirectory() + ParamToBookDir + "wwhelp/wwhimpl/common/html/wwhelp.htm?context=" + WWHBookData_Context() + "&file=" + BaseFilename);
  92.     }
  93.   }
  94.  
  95.   return Frame;
  96. }
  97.  
  98. function  WWHShowPopup(ParamContext,
  99.                        ParamLink,
  100.                        ParamEvent)
  101. {
  102.   if (WWHFrame != null)
  103.   {
  104.     if ((ParamEvent == null) &&
  105.         (typeof window.event != "undefined"))
  106.     {
  107.       ParamEvent = window.event;  // Older IE browsers only store event in window.event
  108.     }
  109.  
  110.     WWHFrame.WWHHelp.fShowPopup(ParamContext, ParamLink, ParamEvent);
  111.   }
  112. }
  113.  
  114. function  WWHHidePopup()
  115. {
  116.   if (WWHFrame != null)
  117.   {
  118.     WWHFrame.WWHHelp.fHidePopup();
  119.   }
  120. }
  121.  
  122. function  WWHClickedPopup(ParamContext,
  123.                           ParamLink)
  124. {
  125.   if (WWHFrame != null)
  126.   {
  127.     WWHFrame.WWHHelp.fClickedPopup(ParamContext, ParamLink);
  128.   }
  129. }
  130.  
  131. function  WWHUpdate()
  132. {
  133.   if (WWHFrame != null)
  134.   {
  135.     WWHFrame.WWHHelp.fUpdate(location.href);
  136.   }
  137. }
  138.  
  139. function  WWHAddRelatedTopic(ParamText,
  140.                              ParamContext,
  141.                              ParamFileURL)
  142. {
  143.   if (WWHFrame != null)
  144.   {
  145.     WWHFrame.WWHRelatedTopics.fAdd(ParamText, ParamContext, ParamFileURL);
  146.   }
  147. }
  148.  
  149. function  WWHRelatedTopicsInlineHTML()
  150. {
  151.   var  HTML = "";
  152.  
  153.  
  154.   if (WWHFrame != null)
  155.   {
  156.     HTML = WWHFrame.WWHRelatedTopics.fInlineHTML();
  157.   }
  158.  
  159.   return HTML;
  160. }
  161.  
  162. function  WWHShowRelatedTopicsHREF()
  163. {
  164.   // Nothing to do.
  165.   //
  166. }
  167.  
  168. function  WWHShowRelatedTopicsPopup(ParamEvent)
  169. {
  170.   if (WWHFrame != null)
  171.   {
  172.     if ((ParamEvent == null) &&
  173.         (typeof window.event != "undefined"))
  174.     {
  175.       ParamEvent = window.event;  // Older IE browsers only store event in window.event
  176.     }
  177.  
  178.     WWHFrame.WWHRelatedTopics.fShowAtEvent(ParamEvent);
  179.   }
  180. }
  181.  
  182. function  WWHRelatedTopicsDivTag()
  183. {
  184.   var  RelatedTopicsDivTag = "";
  185.  
  186.  
  187.   if (WWHFrame != null)
  188.   {
  189.     RelatedTopicsDivTag = WWHFrame.WWHRelatedTopics.mPopup.fDivTagText();
  190.   }
  191.  
  192.   return RelatedTopicsDivTag;
  193. }
  194.  
  195. function  WWHPopupDivTag()
  196. {
  197.   var  PopupDivTag = "";
  198.  
  199.  
  200.   if (WWHFrame != null)
  201.   {
  202.     PopupDivTag = WWHFrame.WWHHelp.mPopup.fDivTagText();
  203.   }
  204.  
  205.   return PopupDivTag;
  206. }
  207.