Attachment 'help.js'
Download 1 // Copyright (c) 2000-2005 Quadralay Corporation. All rights reserved.
2 //
3
4 function WWHHelp_Object(ParamURL)
5 {
6 var URLParams;
7
8
9 this.mbInitialized = false;
10 this.mbAccessible = false;
11 this.mInitialTabName = null;
12 this.mNewTabName = null;
13 this.mInitStage = 0;
14 this.mSettings = new WWHCommonSettings_Object();
15 this.mMessages = new WWHCommonMessages_Object();
16 this.mDocumentLoaded = null;
17 this.mLocationURL = WWHFrame.WWHBrowser.fNormalizeURL(ParamURL);
18 this.mBaseURL = WWHStringUtilities_GetBaseURL(this.mLocationURL);
19 this.mHelpURLPrefix = this.mBaseURL;
20 this.mContextDir = null;
21 this.mTopicTag = null;
22 this.mDocumentURL = "";
23 this.mPopup = null;
24 this.mPopupContext = "";
25 this.mPopupLink = "";
26 this.mPopupLoaded = false;
27 this.mPopupHideDisabled = false;
28 this.mBookGroups = new WWHBookGroups_Object();
29 this.mBooks = new WWHBookList_Object();
30 this.mFavoritesCookie = "WWH" + this.mSettings.mCookiesID + "_Favs";
31 this.mbIgnoreNextKeyPress = false;
32 this.mbAltKeyDown = false;
33 this.mAccessKey = -1;
34 this.mbAutoSyncTOC = false;
35 this.mbAlwaysSyncTOC = true;
36 this.mCollapsingTOCEntry = false;
37 this.mImages = new Array();
38
39 this.fSingleTopic = WWHHelp_SingleTopic;
40 this.fGetFrameReference = WWHHelp_GetFrameReference;
41 this.fSetLocation = WWHHelp_SetLocation;
42 this.fReplaceLocation = WWHHelp_ReplaceLocation;
43 this.fReloadLocation = WWHHelp_ReloadLocation;
44 this.fGetURLParameters = WWHHelp_GetURLParameters;
45 this.fCookiesEnabled = WWHHelp_CookiesEnabled;
46 this.fInitStage = WWHHelp_InitStage;
47 this.fHandlerInitialized = WWHHelp_HandlerInitialized;
48 this.fGetFrameName = WWHHelp_GetFrameName;
49 this.fSetFrameName = WWHHelp_SetFrameName;
50 this.fSetDocumentFrameWithURL = WWHHelp_SetDocumentFrameWithURL;
51 this.fSetDocumentFrame = WWHHelp_SetDocumentFrame;
52 this.fSetDocumentHREF = WWHHelp_SetDocumentHREF;
53 this.fGetBookIndexFileIndexURL = WWHHelp_GetBookIndexFileIndexURL;
54 this.fDetermineContextDocument = WWHHelp_DetermineContextDocument;
55 this.fLoadTopicData = WWHHelp_LoadTopicData;
56 this.fProcessTopicResult = WWHHelp_ProcessTopicResult;
57 this.fDisplayContextDocument = WWHHelp_DisplayContextDocument;
58 this.fSetContextDocument = WWHHelp_SetContextDocument;
59 this.fGetBookFileHREF = WWHHelp_GetBookFileHREF;
60 this.fHREFToBookIndexFileIndexAnchor = WWHHelp_HREFToBookIndexFileIndexAnchor;
61 this.fGetSyncPrevNext = WWHHelp_GetSyncPrevNext;
62 this.fHREFToTitle = WWHHelp_HREFToTitle;
63 this.fEscapeHTML = WWHHelp_EscapeHTML;
64 this.fPopupHTML = WWHHelp_PopupHTML;
65 this.fShowPopup = WWHHelp_ShowPopup;
66 this.fPopupAdjustSize = WWHHelp_PopupAdjustSize;
67 this.fPopupLoaded = WWHHelp_PopupLoaded;
68 this.fRevealPopup = WWHHelp_RevealPopup;
69 this.fResetPopupHideDisabled = WWHHelp_ResetPopupHideDisabled;
70 this.fHidePopup = WWHHelp_HidePopup;
71 this.fClickedPopup = WWHHelp_ClickedPopup;
72 this.fDisplayFile = WWHHelp_DisplayFile;
73 this.fDisplayFirst = WWHHelp_DisplayFirst;
74 this.fShowTopic = WWHHelp_ShowTopic;
75 this.fUpdate = WWHHelp_Update;
76 this.fUpdateHash = WWHHelp_UpdateHash;
77 this.fSyncTOC = WWHHelp_SyncTOC;
78 this.fFavoritesCurrent = WWHHelp_FavoritesCurrent;
79 this.fDocumentBookkeeping = WWHHelp_DocumentBookkeeping;
80 this.fAutoSyncTOC = WWHHelp_AutoSyncTOC;
81 this.fUnload = WWHHelp_Unload;
82 this.fIgnoreNextKeyPress = WWHHelp_IgnoreNextKeyPress;
83 this.fHandleKeyDown = WWHHelp_HandleKeyDown;
84 this.fHandleKeyPress = WWHHelp_HandleKeyPress;
85 this.fHandleKeyUp = WWHHelp_HandleKeyUp;
86 this.fProcessAccessKey = WWHHelp_ProcessAccessKey;
87 this.fFocus = WWHHelp_Focus;
88
89 // Load up messages
90 //
91 this.mMessages.fSetByLocale(WWHFrame.WWHBrowser.mLocale);
92
93 // Set cookie path
94 //
95 WWHFrame.WWHBrowser.fSetCookiePath(WWHStringUtilities_GetBaseURL(ParamURL));
96
97 // Check URL parameters
98 //
99 URLParams = this.fGetURLParameters(this.mLocationURL);
100
101 // Set accessibility flag
102 //
103 if (this.mSettings.mAccessible == "true")
104 {
105 this.mbAccessible = true;
106 }
107 else
108 {
109 if (URLParams[4] != null)
110 {
111 if (URLParams[4] == "true")
112 {
113 this.mbAccessible = true;
114 }
115 }
116 }
117
118 // Determine initial tab
119 //
120 if (URLParams[5] != null)
121 {
122 this.mInitialTabName = URLParams[5];
123 }
124
125 // Set popup capabilities
126 //
127 if (this.mbAccessible)
128 {
129 WWHFrame.WWHBrowser.mbSupportsPopups = false;
130 WWHFrame.WWHBrowser.mbSupportsIFrames = false;
131 }
132
133 // Create popup
134 //
135 this.mPopup = new WWHPopup_Object("WWHFrame.WWHHelp.mPopup",
136 this.fGetFrameReference("WWHDocumentFrame"),
137 WWHPopupFormat_Translate,
138 WWHPopupFormat_Format,
139 "WWHPopupDIV", "WWHPopupText", 500, 12, 20,
140 this.mSettings.mPopup.mWidth);
141 }
142
143 function WWHHelp_SingleTopic()
144 {
145 var bVarSingleTopic = false;
146
147
148 if (this.mLocationURL.indexOf("wwhelp/wwhimpl/common/html/wwhelp.htm") != -1)
149 {
150 bVarSingleTopic = true;
151 }
152
153 return bVarSingleTopic;
154 }
155
156 function WWHHelp_GetFrameReference(ParamFrameName)
157 {
158 var VarFrameReference;
159
160
161 switch (ParamFrameName)
162 {
163 case "WWHFrame":
164 // WWHFrame
165 //
166 VarFrameReference = "WWHFrame";
167 break;
168
169 case "WWHNavigationFrame":
170 // WWHFrame.WWHNavigationFrame
171 //
172 VarFrameReference = "WWHFrame.frames[0]";
173 break;
174
175 case "WWHTabsFrame":
176 case "WWHPanelFrame":
177 case "WWHPanelNavigationFrame":
178 case "WWHPanelViewFrame":
179 // WWHFrame.WWHNavigationFrame.WWHTabsFrame
180 //
181 // WWHFrame.WWHNavigationFrame.WWHPanelFrame
182 //
183 // WWHFrame.WWHNavigationFrame.WWHPanelFrame.WWHPanelNavigationFrame
184 //
185 // WWHFrame.WWHNavigationFrame.WWHPanelFrame.WWHPanelViewFrame
186 //
187 VarFrameReference = WWHFrame.WWHHandler.fGetFrameReference(ParamFrameName);
188 break;
189
190 case "WWHContentFrame":
191 // WWHFrame.WWHContentFrame
192 //
193 if (this.fSingleTopic())
194 {
195 VarFrameReference = "WWHFrame";
196 }
197 else
198 {
199 VarFrameReference = "WWHFrame.frames[1]";
200 }
201 break;
202
203 case "WWHPageNavFrame":
204 // WWHFrame.WWHContentFrame.WWHPageNavFrame
205 //
206 VarFrameReference = this.fGetFrameReference("WWHContentFrame") + ".frames[0]";
207 break;
208
209 case "WWHControlsLeftFrame":
210 // WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHControlsLeftFrame
211 //
212 VarFrameReference = this.fGetFrameReference("WWHPageNavFrame") + ".frames[0]";
213 break;
214
215 case "WWHTitleFrame":
216 // WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHTitleFrame
217 //
218 VarFrameReference = this.fGetFrameReference("WWHPageNavFrame") + ".frames[1]";
219 break;
220
221 case "WWHControlsRightFrame":
222 // WWHFrame.WWHContentFrame.WWHPageNavFrame.WWHControlsRightFrame
223 //
224 VarFrameReference = this.fGetFrameReference("WWHPageNavFrame") + ".frames[2]";
225 break;
226
227 case "WWHDocumentFrame":
228 // WWHFrame.WWHContentFrame.WWHDocumentFrame
229 //
230 VarFrameReference = this.fGetFrameReference("WWHContentFrame") + ".frames[1]";
231 break;
232
233 default:
234 VarFrameReference = null;
235 break;
236 }
237
238 return VarFrameReference;
239 }
240
241 function WWHHelp_SetLocation(ParamFrame,
242 ParamURL)
243 {
244 var VarFrameReference;
245
246
247 VarFrameReference = this.fGetFrameReference(ParamFrame);
248 WWHFrame.WWHBrowser.fSetLocation(VarFrameReference, ParamURL);
249 }
250
251 function WWHHelp_ReplaceLocation(ParamFrame,
252 ParamURL)
253 {
254 var VarFrameReference;
255
256
257 VarFrameReference = this.fGetFrameReference(ParamFrame);
258 WWHFrame.WWHBrowser.fReplaceLocation(VarFrameReference, ParamURL);
259 }
260
261 function WWHHelp_ReloadLocation(ParamFrame)
262 {
263 var VarFrameReference;
264
265
266 VarFrameReference = this.fGetFrameReference(ParamFrame);
267 WWHFrame.WWHBrowser.fReloadLocation(VarFrameReference);
268 }
269
270 function WWHHelp_GetURLParameters(ParamURL)
271 {
272 var URLParams = new Array(null, null, null, null, null, null);
273 var Parts;
274 var ContextMarker = "context=";
275 var TopicMarker = "topic=";
276 var FileMarker = "file=";
277 var HREFMarker = "href=";
278 var AccessibleMarker = "accessible=";
279 var TabMarker = "tab=";
280 var MaxIndex;
281 var Index;
282
283 // Using a closure for this function. It is copied in switch.js as well
284 //
285 function GetDelimitedArguments(ParamURL)
286 {
287 var Parts = [];
288 var Parameters;
289
290 // Process URL parameters
291 //
292 if (ParamURL.indexOf("?") != -1)
293 {
294 Parts = ParamURL.split("?");
295 }
296 else if (ParamURL.indexOf("#") != -1)
297 {
298 Parts = ParamURL.split("#");
299 Parameters = Parts.slice(1).join("#");
300 Parts.length = 2;
301 Parts[1] = Parameters;
302 }
303
304 return Parts;
305 }
306
307 // Check for possible context specification
308 //
309 Parts = GetDelimitedArguments(ParamURL);
310 if (Parts.length > 1)
311 {
312 // Get parameters
313 //
314 Parts[0] = Parts[1];
315 Parts.length = 1;
316 if (Parts[0].indexOf("&") != -1)
317 {
318 Parts = Parts[0].split("&");
319 }
320
321 // Process parameters
322 //
323 for (MaxIndex = Parts.length, Index = 0 ; Index < MaxIndex ; Index++)
324 {
325 if (Parts[Index].indexOf(ContextMarker) == 0)
326 {
327 URLParams[0] = Parts[Index].substring(ContextMarker.length, Parts[Index].length);
328 }
329 if (Parts[Index].indexOf(TopicMarker) == 0)
330 {
331 URLParams[1] = Parts[Index].substring(TopicMarker.length, Parts[Index].length);
332 }
333 if (Parts[Index].indexOf(FileMarker) == 0)
334 {
335 URLParams[2] = Parts[Index].substring(FileMarker.length, Parts[Index].length);
336 }
337 if (Parts[Index].indexOf(HREFMarker) == 0)
338 {
339 URLParams[3] = Parts[Index].substring(HREFMarker.length, Parts[Index].length);
340 }
341 if (Parts[Index].indexOf(AccessibleMarker) == 0)
342 {
343 URLParams[4] = Parts[Index].substring(AccessibleMarker.length, Parts[Index].length);
344 }
345 if (Parts[Index].indexOf(TabMarker) == 0)
346 {
347 URLParams[5] = Parts[Index].substring(TabMarker.length, Parts[Index].length);
348 }
349 }
350
351 // Make certain we have both a ContextTag and either a TopicTag or FileTag
352 // Otherwise, reset them
353 //
354 if ((URLParams[0] == null) ||
355 ((URLParams[1] == null) &&
356 (URLParams[2] == null)))
357 {
358 URLParams[0] = null;
359 URLParams[1] = null;
360 URLParams[2] = null;
361 }
362 }
363
364 return URLParams;
365 }
366
367 function WWHHelp_CookiesEnabled()
368 {
369 var bVarEnabled;
370
371
372 bVarEnabled = false;
373 if ((WWHFrame.WWHHelp.mSettings.mbCookies) &&
374 (WWHFrame.WWHBrowser.fCookiesEnabled()))
375 {
376 bVarEnabled = true;
377 }
378
379 return bVarEnabled;
380 }
381
382 function WWHHelp_InitStage(ParamStage)
383 {
384 if (( ! this.mbInitialized) &&
385 (ParamStage == this.mInitStage))
386 {
387 // Perform actions for current init stage
388 //
389 switch (this.mInitStage)
390 {
391 case 0: // Start initialization process
392 // Alert the user if this browser is unsupported
393 //
394 if (WWHFrame.WWHBrowser.mbUnsupported)
395 {
396 alert(WWHFrame.WWHHelp.mMessages.mBrowserNotSupported);
397 }
398
399 this.fReplaceLocation("WWHControlsLeftFrame", this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init0.htm");
400 break;
401
402 case 1: // Prep book data
403 this.fReplaceLocation("WWHControlsLeftFrame", this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init1.htm");
404 break;
405
406 case 2: // Load book data
407 this.fReplaceLocation("WWHControlsLeftFrame", this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init2.htm");
408 break;
409
410 case 3: // Handler setup
411 // Initialize handler
412 //
413 WWHFrame.WWHHandler.fInit();
414 break;
415
416 case 4: // Display controls
417 // Preload graphics
418 //
419 WWHHelpUtilities_PreloadGraphics();
420
421 // Initialize controls
422 //
423 WWHFrame.WWHControls.fInitialize();
424 break;
425
426 case 5: // Display document
427 this.fSetDocumentFrame();
428 this.mbInitialized = true;
429
430 // Set frame names for accessibility
431 //
432 if (this.mbAccessible)
433 {
434 WWHFrame.WWHHelp.fSetFrameName("WWHControlsLeftFrame");
435 WWHFrame.WWHHelp.fSetFrameName("WWHTitleFrame");
436 WWHFrame.WWHHelp.fSetFrameName("WWHControlsRightFrame");
437 WWHFrame.WWHHelp.fSetFrameName("WWHDocumentFrame");
438 }
439
440 // Finalize hander
441 //
442 WWHFrame.WWHHandler.fFinalize();
443 break;
444 }
445
446 // Increment stage
447 //
448 this.mInitStage++;
449 }
450
451 return 0;
452 }
453
454 function WWHHelp_HandlerInitialized()
455 {
456 if (WWHFrame.WWHHelp.mInitStage > 0)
457 {
458 if (WWHFrame.WWHHandler.mbInitialized)
459 {
460 this.fReplaceLocation("WWHControlsRightFrame", this.mHelpURLPrefix + "wwhelp/wwhimpl/common/html/init3.htm");
461 }
462 }
463 }
464
465 function WWHHelp_GetFrameName(ParamFrameName)
466 {
467 var VarName;
468
469
470 // Determine name for this frame
471 //
472 VarName = null;
473 switch (ParamFrameName)
474 {
475 case "WWHFrame":
476 // Nothing to do
477 //
478 break;
479
480 case "WWHNavigationFrame":
481 // Nothing to do
482 //
483 break;
484
485 case "WWHTabsFrame":
486 case "WWHPanelFrame":
487 case "WWHPanelNavigationFrame":
488 case "WWHPanelViewFrame":
489 VarName = WWHFrame.WWHHandler.fGetFrameName(ParamFrameName);
490 break;
491
492 case "WWHContentFrame":
493 // Nothing to do
494 //
495 break;
496
497 case "WWHPageNavFrame":
498 // Nothing to do
499 //
500 break;
501
502 case "WWHControlsLeftFrame":
503 VarName = WWHStringUtilities_EscapeHTML(WWHFrame.WWHControls.fLeftFrameTitle());
504 break;
505
506 case "WWHTitleFrame":
507 VarName = "";
508 break;
509
510 case "WWHControlsRightFrame":
511 VarName = WWHStringUtilities_EscapeHTML(WWHFrame.WWHControls.fRightFrameTitle());
512 break;
513
514 case "WWHDocumentFrame":
515 VarName = WWHStringUtilities_EscapeHTML(WWHFrame.WWHHelp.mMessages.mAccessibilityDocumentFrameName);
516 break;
517 }
518 }
519
520 function WWHHelp_SetFrameName(ParamFrameName)
521 {
522 var VarName;
523 var VarFrame;
524
525
526 if (WWHFrame.WWHBrowser.mbSupportsFrameRenaming)
527 {
528 // Get frame name
529 //
530 VarName = this.fGetFrameName(ParamFrameName);
531 if (VarName != null)
532 {
533 // Set frame name
534 //
535 VarFrame = eval(this.fGetFrameReference(ParamFrameName));
536 VarFrame.name = VarName;
537 }
538 }
539 }
540
541 function WWHHelp_SetDocumentFrameWithURL(ParamURL)
542 {
543 var VarURLParameters;
544 var VarParts;
545 var VarLocationURLNoParams;
546 var VarNewLocationURL;
547
548
549 // Determine location URL
550 //
551 VarLocationURLNoParams = "";
552 if (this.mLocationURL.indexOf("?") != -1)
553 {
554 VarParts = this.mLocationURL.split("?");
555 VarLocationURLNoParams = VarParts[0];
556 }
557 else if (this.mLocationURL.indexOf("#") != -1)
558 {
559 VarParts = this.mLocationURL.split("#");
560 VarLocationURLNoParams = VarParts[0];
561 }
562 if (VarLocationURLNoParams.length == 0)
563 {
564 VarLocationURLNoParams = this.mLocationURL;
565 }
566
567 // Preserve URL parameter info
568 //
569 VarURLParameters = "";
570 if (ParamURL.indexOf("?") != -1)
571 {
572 VarParts = ParamURL.split("?");
573 if ((VarParts.length > 1) &&
574 (VarParts[1].length > 0))
575 {
576 VarURLParameters = VarParts[1];
577 }
578 }
579 else if (ParamURL.indexOf("#") != -1)
580 {
581 VarParts = ParamURL.split("#");
582 if ((VarParts.length > 1) &&
583 (VarParts[1].length > 0))
584 {
585 // Ensure trailing anchor hashes are preserved
586 //
587 VarURLParameters = VarParts.slice(1).join("#");
588 }
589 }
590
591 // Build new location URL
592 //
593 VarNewLocationURL = VarLocationURLNoParams + "?" + VarURLParameters;
594
595 // Update location and redirect
596 //
597 this.mLocationURL = VarNewLocationURL;
598 this.fSetDocumentFrame();
599 }
600
601 function WWHHelp_SetDocumentFrame()
602 {
603 var DocumentLoaded;
604 var ContextDocumentURL;
605 var bVarReplace;
606 var VarDocumentFrame;
607
608
609 // Preserve current document if user clicked forward or back to see it
610 //
611 if (this.mDocumentLoaded != null)
612 {
613 DocumentLoaded = this.mDocumentLoaded;
614
615 this.mDocumentLoaded = null;
616 this.fUpdate(DocumentLoaded);
617 }
618 else
619 {
620 // Replace document frame if "about:blank" or "blank.htm" currently displayed
621 //
622 bVarReplace = false;
623 VarDocumentFrame = eval(this.fGetFrameReference("WWHDocumentFrame"));
624 if ((VarDocumentFrame.location.href.indexOf("about:blank") != -1) ||
625 (VarDocumentFrame.location.href.indexOf("wwhelp/wwhimpl/common/html/blank.htm") != -1))
626 {
627 bVarReplace = true;
628 }
629
630 // Display document or determine correct document to display
631 //
632 ContextDocumentURL = this.fDetermineContextDocument();
633 if (ContextDocumentURL != null)
634 {
635 this.fSetDocumentHREF(ContextDocumentURL, bVarReplace);
636 }
637 else // Load topic data to determine document to display
638 {
639 this.fSetDocumentHREF(this.mBaseURL + "wwhelp/wwhimpl/common/html/document.htm", bVarReplace);
640 }
641 }
642 }
643
644 function WWHHelp_SetDocumentHREF(ParamURL,
645 bParamReplace)
646 {
647 if (ParamURL.length > 0)
648 {
649 if (bParamReplace)
650 {
651 this.fReplaceLocation("WWHDocumentFrame", ParamURL);
652 }
653 else
654 {
655 this.fSetLocation("WWHDocumentFrame", ParamURL);
656 }
657 }
658 }
659
660 function WWHHelp_GetBookIndexFileIndexURL(ParamBookIndex,
661 ParamFileIndex,
662 ParamAnchor)
663 {
664 var URL = "";
665 var BookListEntry;
666
667
668 if ((ParamBookIndex >= 0) &&
669 (ParamFileIndex >= 0))
670 {
671 BookListEntry = this.mBooks.mBookList[ParamBookIndex];
672
673 URL = this.mBaseURL + BookListEntry.mDirectory + BookListEntry.mFiles.fFileIndexToHREF(ParamFileIndex);
674 if ((typeof(ParamAnchor) != "undefined") &&
675 (ParamAnchor != null) &&
676 (ParamAnchor.length > 0))
677 {
678 URL += "#" + ParamAnchor;
679 }
680 }
681
682 return URL;
683 }
684
685 function WWHHelp_DetermineContextDocument()
686 {
687 var ContextDocumentURL = null;
688 var URLParams = this.fGetURLParameters(this.mLocationURL);
689 var ContextBook;
690
691
692 // Automatically synchronize TOC
693 //
694 this.mbAutoSyncTOC = true;
695
696 // Check for context specification
697 //
698 if (URLParams[3] != null) // href specified
699 {
700 ContextDocumentURL = this.mBaseURL + URLParams[3];
701 }
702 else if (URLParams[0] != null) // context specified
703 {
704 // Determine book directory
705 //
706 ContextBook = this.mBooks.fGetContextBook(URLParams[0]);
707 if (ContextBook != null)
708 {
709 if (URLParams[2] != null) // file specified
710 {
711 ContextDocumentURL = this.mBaseURL + ContextBook.mDirectory + URLParams[2];
712 }
713 else if (URLParams[1] != null) // topic specified
714 {
715 // Setup for a topic search
716 //
717 this.mContextDir = ContextBook.mDirectory;
718 this.mTopicTag = URLParams[1];
719
720 this.mDocumentURL = "";
721 }
722 }
723 else // Display splash page if nothing else found
724 {
725 ContextDocumentURL = this.mBaseURL + "wwhelp/wwhimpl/common/html/default.htm";
726 }
727 }
728 else // Display splash page if nothing else found
729 {
730 ContextDocumentURL = this.mBaseURL + "wwhelp/wwhimpl/common/html/default.htm";
731 }
732
733 return ContextDocumentURL;
734 }
735
736 function WWHHelp_LoadTopicData()
737 {
738 var LoadTopicDataHTML = "";
739 var VarParameters;
740
741
742 // Workaround Safari reload bug
743 //
744 VarParameters = "";
745 if (WWHFrame.WWHBrowser.mBrowser == 5) // Shorthhand for Safari
746 {
747 VarParameters = "?" + (new Date() * 1);
748 }
749
750 LoadTopicDataHTML += "<script type=\"text/javascript\" language=\"JavaScript1.2\" src=\"" + this.mHelpURLPrefix + this.mContextDir + "wwhdata/common/topics.js" + VarParameters + "\"></script>";
751 LoadTopicDataHTML += "<script type=\"text/javascript\" language=\"JavaScript1.2\" src=\"" + this.mHelpURLPrefix + "wwhelp/wwhimpl/common/scripts/documt1s.js" + VarParameters + "\"></script>";
752
753 return LoadTopicDataHTML;
754 }
755
756 // This is WebWorks original code, but I edited it to redirect "Page Not Found" to splash page, or to another page if desired.
757 //
758 // function WWHHelp_ProcessTopicResult(ParamTopicURL)
759 // {
760 // if (ParamTopicURL != null)
761 // {
762 // this.mDocumentURL = this.mBaseURL + this.mContextDir + ParamTopicURL;
763 // }
764 // }
765
766 function WWHHelp_ProcessTopicResult(ParamTopicURL)
767 {
768 if (ParamTopicURL != null)
769 {
770 this.mDocumentURL = this.mBaseURL + this.mContextDir + ParamTopicURL;
771 }
772 else
773 {
774 this.mDocumentURL = this.mBaseURL + this.mContextDir + "Welcome_To_Pano_VDS_Online_Help.html";
775 }
776 }
777
778 function WWHHelp_DisplayContextDocument()
779 {
780 WWHFrame.WWHHelp.fSetDocumentHREF(this.mDocumentURL, true);
781 }
782
783 function WWHHelp_GetURLPrefix(ParamURL)
784 {
785 var URLPrefix = null;
786 var WorkingURL = "";
787 var Parts;
788 var Index;
789
790
791 // Standardize URL for processing
792 //
793 WorkingURL = ParamURL;
794
795 // Strip any URL parameters
796 //
797 if (WorkingURL.indexOf("?") != -1)
798 {
799 Parts = WorkingURL.split("?");
800 WorkingURL = Parts[0];
801 }
802 else if (WorkingURL.indexOf("#") != -1)
803 {
804 Parts = WorkingURL.split("#");
805 WorkingURL = Parts[0];
806 }
807
808 // Confirm URL in wwhelp hierarchy
809 //
810 if (((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/api.htm")) != -1) ||
811 ((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/common/html/switch.htm")) != -1) ||
812 ((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/common/html/wwhelp.htm")) != -1) ||
813 ((Index = WorkingURL.indexOf("/wwhelp/wwhimpl/js/html/wwhelp.htm")) != -1))
814 {
815 URLPrefix = WorkingURL.substring(0, Index);
816 }
817 else
818 {
819 // Look for match on top level "wwhelp.htm" file
820 //
821 Index = WorkingURL.lastIndexOf("/");
822 if ((Index != -1) &&
823 (Index == WorkingURL.indexOf("/wwhelp.htm")))
824 {
825 URLPrefix = WorkingURL.substring(0, Index);
826 }
827 }
828
829 return URLPrefix;
830 }
831
832 function WWHHelp_SetContextDocument(ParamURL)
833 {
834 var URL = WWHFrame.WWHBrowser.fNormalizeURL(ParamURL);
835 var CurrentURLPrefix;
836 var NewURLPrefix;
837 var VarDocumentFrame;
838 var VarDocumentURL;
839 var VarURLParameters;
840
841
842 // Confirm URL under same hierarchy
843 //
844 CurrentURLPrefix = WWHHelp_GetURLPrefix(this.mLocationURL);
845 NewURLPrefix = WWHHelp_GetURLPrefix(URL);
846 if ((CurrentURLPrefix != null) &&
847 (NewURLPrefix != null) &&
848 (CurrentURLPrefix == NewURLPrefix))
849 {
850 // Automatically synchornize TOC
851 //
852 this.mbAutoSyncTOC = true;
853
854 // Check if in single topic mode
855 //
856 if (this.fSingleTopic())
857 {
858 // Check for required switch to frameset with navigation
859 //
860 WWHFrame.WWHSwitch.fProcessURL(ParamURL);
861 if (WWHFrame.WWHSwitch.mImplementation != "single")
862 {
863 // Switch to frameset with navigation
864 //
865 if (WWHFrame.WWHSwitch.mParameters.length > 0)
866 {
867 // Context and topic supplied, use them
868 //
869 this.fSetLocation("WWHFrame", ParamURL);
870 }
871 else
872 {
873 // Just switch to frameset with navigation and preserve the current document
874 //
875 VarDocumentFrame = eval(this.fGetFrameReference("WWHDocumentFrame"));
876
877 VarDocumentURL = WWHFrame.WWHBrowser.fNormalizeURL(VarDocumentFrame.location.href);
878 VarDocumentURL = WWHFrame.WWHHelp.fGetBookFileHREF(VarDocumentURL);
879 WWHFrame.WWHSwitch.fExec(false, WWHFrame.WWHHelp.mHelpURLPrefix + "/wwhelp/wwhimpl/api.htm?href=" + VarDocumentURL);
880 }
881 }
882 else
883 {
884 // Update document frame
885 //
886 this.fSetDocumentFrameWithURL(URL);
887 }
888 }
889 else
890 {
891 VarURLParameters = this.fGetURLParameters(URL);
892
893 // Specifies a document to display?
894 //
895 if ((VarURLParameters[0] != null) ||
896 (VarURLParameters[1] != null) ||
897 (VarURLParameters[2] != null) ||
898 (VarURLParameters[3] != null))
899 {
900 // Update document frame
901 //
902 this.fSetDocumentFrameWithURL(URL);
903
904 // Set navigation tab to display
905 //
906 this.mNewTabName = VarURLParameters[5];
907 }
908 else
909 {
910 // Switch tabs
911 //
912 WWHFrame.WWHHandler.fSetCurrentTab(VarURLParameters[5]);
913 }
914 }
915 }
916 else
917 {
918 // Some other help system requested, redirect to it
919 //
920 this.fSetLocation("WWHFrame", ParamURL);
921 }
922 }
923
924 function WWHHelp_GetBookFileHREF(ParamHREF)
925 {
926 var BookFileHREF = null;
927 var Prefix;
928 var Suffix;
929
930
931 // Confirm HREF can be in same hierarchy as BaseURL
932 //
933 if ((this.mBaseURL.length > 0) &&
934 (ParamHREF.length > this.mBaseURL.length))
935 {
936 Prefix = ParamHREF.substring(0, this.mBaseURL.length);
937 Suffix = ParamHREF.substring(this.mBaseURL.length, ParamHREF.length);
938
939 // Confirm HREF definitely is in same hierarchy as BaseURL
940 //
941 if (Prefix == this.mBaseURL)
942 {
943 BookFileHREF = Suffix;
944 }
945 }
946
947 return BookFileHREF;
948 }
949
950 function WWHHelp_HREFToBookIndexFileIndexAnchor(ParamHREF)
951 {
952 var ResultArray = new Array(-1, -1, "");
953 var BookFileHREF;
954
955
956 BookFileHREF = this.fGetBookFileHREF(ParamHREF);
957 if (BookFileHREF != null)
958 {
959 ResultArray = this.mBooks.fHREFToBookIndexFileIndexAnchor(BookFileHREF);
960 }
961
962 return ResultArray;
963 }
964
965 function WWHHelp_GetSyncPrevNext(ParamHREF)
966 {
967 var ResultArray = new Array(null, null, null);
968 var Parts;
969 var AbsoluteHREF;
970 var VarAnchor;
971 var BookFileHREF;
972
973
974 // Trim named anchor entries
975 //
976 Parts = ParamHREF.split("#");
977 AbsoluteHREF = Parts[0];
978 VarAnchor = "";
979 if (Parts.length > 1)
980 {
981 if (Parts[1].length > 0)
982 {
983 VarAnchor = "#" + Parts[1];
984 }
985 }
986
987 BookFileHREF = this.fGetBookFileHREF(AbsoluteHREF);
988 if (BookFileHREF != null)
989 {
990 if (BookFileHREF == "wwhelp/wwhimpl/common/html/default.htm")
991 {
992 ResultArray[2] = this.mBooks.fBookFileIndiciesToHREF(0, 0);
993 }
994 else
995 {
996 ResultArray = this.mBooks.fGetSyncPrevNext(BookFileHREF);
997 }
998
999 // Prefix with BaseURL if defined
1000 //
1001
1002 // Current
1003 //
1004 if (ResultArray[0] != null)
1005 {
1006 ResultArray[0] = this.mBaseURL + ResultArray[0] + VarAnchor;
1007 }
1008
1009 // Previous
1010 //
1011 if (ResultArray[1] != null)
1012 {
1013 ResultArray[1] = this.mBaseURL + ResultArray[1];
1014 }
1015
1016 // Next
1017 //
1018 if (ResultArray[2] != null)
1019 {
1020 ResultArray[2] = this.mBaseURL + ResultArray[2];
1021 }
1022 }
1023 else
1024 {
1025 // Unknown document, enable next button to go to first known page
1026 //
1027 ResultArray[2] = this.mBaseURL + this.mBooks.fBookFileIndiciesToHREF(0, 0);
1028 }
1029
1030 return ResultArray;
1031 }
1032
1033 function WWHHelp_HREFToTitle(ParamHREF)
1034 {
1035 var Title;
1036 var Parts;
1037 var AbsoluteHREF;
1038
1039
1040 // Try to find book and file
1041 //
1042 Parts = this.fHREFToBookIndexFileIndexAnchor(ParamHREF);
1043 if ((Parts[0] >= 0) &&
1044 (Parts[1] >= 0))
1045 {
1046 Title = this.mBooks.fBookIndexFileIndexToTitle(Parts[0], Parts[1]);
1047 }
1048 else
1049 {
1050 // Use basename for title
1051 //
1052 Parts = ParamHREF.split("#");
1053 AbsoluteHREF = Parts[0];
1054 Parts = AbsoluteHREF.split("/");
1055 Title = Parts[Parts.length - 1];
1056 }
1057
1058 return Title;
1059 }
1060
1061 function WWHHelp_EscapeHTML(ParamText)
1062 {
1063 return WWHStringUtilities_EscapeHTML(ParamText);
1064 }
1065
1066 function WWHHelp_PopupHTML()
1067 {
1068 var VarHTML = "";
1069
1070
1071 if ((WWHFrame.WWHBrowser.mbSupportsPopups) &&
1072 (WWHFrame.WWHBrowser.mbSupportsIFrames))
1073 {
1074 VarHTML = this.mPopup.fDivTagText();
1075 }
1076
1077 return VarHTML;
1078 }
1079
1080 function WWHHelp_ShowPopup(ParamContext,
1081 ParamLink,
1082 ParamEvent)
1083 {
1084 var Book;
1085 var Link;
1086 var Src;
1087 var PopupHTML;
1088
1089 if ((WWHFrame.WWHBrowser.mbSupportsPopups) &&
1090 (WWHFrame.WWHBrowser.mbSupportsIFrames))
1091 {
1092 Book = this.mBooks.fGetContextBook(ParamContext);
1093 if (Book != null)
1094 {
1095 Link = WWHFrame.WWHBrowser.fNormalizeURL(ParamLink);
1096 Src = this.mBaseURL + Book.mDirectory + Link;
1097 PopupHTML = "<div onmouseout=\"WWHHidePopup();\"><iframe id=\"WWHPopupIFrame\" frameborder=\"0\" scrolling=\"no\" width=\"" + this.mPopup.mWidth + "\" src=\"" + Src + "\" onload=\"javascript:WWHPopupLoaded()\"></iframe></div>";
1098 this.mPopup.fShow(PopupHTML, ParamEvent);
1099
1100 // WORKAROUND: Need to size popup after IFrame has loaded
1101 //
1102 if (this.mPopup.mSetTimeoutID != null)
1103 {
1104 clearTimeout(this.mPopup.mSetTimeoutID);
1105 this.mPopup.mSetTimeoutID = null;
1106
1107 this.mPopupLoaded = false;
1108 this.mPopup.mSetTimeoutID = setTimeout("WWHFrame.WWHHelp.fRevealPopup()", this.mPopup.mTimeout);
1109 }
1110 }
1111 }
1112 }
1113
1114 function WWHHelp_PopupAdjustSize()
1115 {
1116 var VarPopupWindow = eval(this.mPopup.mWindowRef);
1117 var VarPopupDocument = VarPopupWindow.document;
1118 var VarDocumentElement;
1119 var VarMaxHeight;
1120 var VarIFrame;
1121 var VarElement;
1122 var VarWidth;
1123 var VarHeight;
1124 var VarDistanceToRightEdge;
1125
1126 // Access popup iframe
1127 //
1128 if (WWHFrame.WWHBrowser.mBrowser == 2) // Shorthand for Internet Explorer
1129 {
1130 // Access popup iframe
1131 //
1132 VarIFrame = VarPopupDocument.all['WWHPopupIFrame'];
1133
1134 // Access document elements
1135 //
1136 if ((typeof(VarPopupDocument.documentElement) != "undefined") &&
1137 (typeof(VarPopupDocument.documentElement.clientWidth) != "undefined") &&
1138 (typeof(VarPopupDocument.documentElement.clientHeight) != "undefined") &&
1139 ((VarPopupDocument.documentElement.clientWidth != 0) ||
1140 (VarPopupDocument.documentElement.clientHeight != 0)))
1141 {
1142 VarDocumentElement = VarPopupDocument.documentElement;
1143 VarElement = VarIFrame.contentWindow.document.documentElement;
1144 }
1145 else
1146 {
1147 VarDocumentElement = VarPopupDocument.body;
1148 VarElement = VarIFrame.contentWindow.document.body;
1149 }
1150
1151 // Determine maximum height
1152 //
1153 VarMaxHeight = VarDocumentElement.clientHeight - 16;
1154
1155 // Record width
1156 //
1157 VarWidth = (VarElement.scrollWidth > VarElement.offsetWidth) ? VarElement.scrollWidth : VarElement.offsetWidth;
1158
1159 // Determine height
1160 //
1161 VarHeight = (VarElement.scrollHeight > VarElement.offsetHeight) ? VarElement.scrollHeight : VarElement.offsetHeight;
1162 VarHeight += 4;
1163 if (VarHeight > VarMaxHeight)
1164 {
1165 VarHeight = VarMaxHeight;
1166
1167 // Find widest area to left or right of cursor position
1168 //
1169 VarDistanceToRightEdge = VarPopupDocument.documentElement.offsetWidth - this.mPopup.mPositionX;
1170 if (VarDistanceToRightEdge < this.mPopup.mPositionX)
1171 {
1172 VarWidth = this.mPopup.mPositionX;
1173 }
1174 else
1175 {
1176 VarWidth = VarDistanceToRightEdge;
1177 }
1178 }
1179
1180 // Update IFrame width/height
1181 //
1182 if (VarWidth > VarIFrame.style.width)
1183 {
1184 VarIFrame.style.width = VarWidth;
1185 }
1186 if (VarHeight > VarIFrame.style.height)
1187 {
1188 VarIFrame.style.height = VarHeight;
1189 }
1190 }
1191 else
1192 {
1193 // Determine maximum height
1194 //
1195 VarMaxHeight = VarPopupWindow.innerHeight - 16;
1196
1197 // Access popup iframe
1198 //
1199 VarIFrame = VarPopupDocument.getElementById('WWHPopupIFrame');
1200
1201 // Record width
1202 //
1203 VarWidth = VarIFrame.contentDocument.body.offsetWidth + 16;
1204
1205 // Determine height
1206 //
1207 VarHeight = VarIFrame.contentDocument.body.offsetHeight + 16;
1208 if (VarHeight > VarMaxHeight)
1209 {
1210 VarHeight = VarMaxHeight;
1211
1212 // Find widest area to left or right of cursor position
1213 //
1214 VarDistanceToRightEdge = VarPopupWindow.innerWidth - this.mPopup.mPositionX;
1215 if (VarDistanceToRightEdge < this.mPopup.mPositionX)
1216 {
1217 VarWidth = this.mPopup.mPositionX - 16 - 16;
1218 }
1219 else
1220 {
1221 VarWidth = VarDistanceToRightEdge - 16;
1222 }
1223 }
1224
1225 // Update IFrame width/height
1226 //
1227 if (VarWidth > VarIFrame.width)
1228 {
1229 VarIFrame.width = VarWidth;
1230 }
1231 if (VarHeight > VarIFrame.height)
1232 {
1233 VarIFrame.height = VarHeight;
1234 }
1235 }
1236 }
1237
1238 function WWHHelp_PopupLoaded()
1239 {
1240 this.fPopupAdjustSize();
1241
1242 this.mPopupLoaded = true;
1243 }
1244
1245 function WWHHelp_RevealPopup()
1246 {
1247 var VarPopupDocument;
1248 var VarIFrame;
1249 var VarElement;
1250
1251 if ((this.mPopup.mSetTimeoutID != null) &&
1252 (this.mPopupLoaded))
1253 {
1254 // Disable hide capability temporarily
1255 //
1256 this.mPopupHideDisabled = true;
1257
1258 // Reveal
1259 //
1260 this.mPopup.fReveal();
1261
1262 // Reset IFrame content if necessary
1263 //
1264 if (WWHFrame.WWHBrowser.mBrowser == 2) // Shorthand for Internet Explorer
1265 {
1266 // Access popup IFrame
1267 //
1268 VarPopupDocument = eval(this.mPopup.mWindowRef + ".document");
1269 VarIFrame = VarPopupDocument.all['WWHPopupIFrame'];
1270 VarElement = VarIFrame.contentWindow.document.body;
1271
1272 // "Toggle" IFrame content
1273 //
1274 VarElement.innerHTML = VarElement.innerHTML;
1275 }
1276
1277 // Enable hide capability in a bit
1278 //
1279 setTimeout("WWHFrame.WWHHelp.fResetPopupHideDisabled()", 100);
1280 }
1281 else
1282 {
1283 this.mPopup.mSetTimeoutID = setTimeout("WWHFrame.WWHHelp.fRevealPopup()", 10);
1284 }
1285 }
1286
1287 function WWHHelp_ResetPopupHideDisabled()
1288 {
1289 this.mPopupHideDisabled = false;
1290 }
1291
1292 function WWHHelp_HidePopup()
1293 {
1294 if ( ! this.mPopupHideDisabled)
1295 {
1296 this.mPopup.fHide();
1297 }
1298 }
1299
1300 function WWHHelp_ClickedPopup(ParamContext,
1301 ParamLink,
1302 ParamPopupLink)
1303 {
1304 var VarTargetLink;
1305
1306 if ((WWHFrame.WWHBrowser.mbSupportsPopups) &&
1307 (WWHFrame.WWHBrowser.mbSupportsIFrames))
1308 {
1309 // Show popup target
1310 //
1311 this.fHidePopup();
1312 VarTargetLink = ParamLink;
1313 }
1314 else
1315 {
1316 // Show popup, if defined
1317 //
1318 VarTargetLink = ParamPopupLink;
1319 if (VarTargetLink.length == 0)
1320 {
1321 VarTargetLink = ParamLink;
1322 }
1323 }
1324
1325 // Display target link
1326 //
1327 this.fDisplayFile(ParamContext, VarTargetLink);
1328 }
1329
1330 function WWHHelp_DisplayFile(ParamContext,
1331 ParamLink)
1332 {
1333 var Book;
1334 var Link;
1335
1336 // Link defined?
1337 //
1338 if (ParamLink.length > 0)
1339 {
1340 Book = this.mBooks.fGetContextBook(ParamContext);
1341 if (Book != null)
1342 {
1343 Link = WWHFrame.WWHBrowser.fNormalizeURL(ParamLink);
1344 WWHFrame.WWHHelp.fSetDocumentHREF(this.mBaseURL + Book.mDirectory + Link, false);
1345 }
1346 }
1347 }
1348
1349 function WWHHelp_DisplayFirst()
1350 {
1351 VarURL = WWHFrame.WWHHelp.fGetBookIndexFileIndexURL(0, 0, null);
1352 WWHFrame.WWHHelp.fSetDocumentHREF(VarURL, true);
1353
1354 // Automatically synchronize TOC
1355 //
1356 this.mbAutoSyncTOC = true;
1357 }
1358
1359 function WWHHelp_ShowTopic(ParamContext,
1360 ParamTopic)
1361 {
1362 var VarContextBook;
1363
1364
1365 // Determine book directory
1366 //
1367 VarContextBook = this.mBooks.fGetContextBook(ParamContext);
1368 if (VarContextBook != null)
1369 {
1370 // Setup for a topic search
1371 //
1372 this.mContextDir = VarContextBook.mDirectory;
1373 this.mTopicTag = ParamTopic;
1374
1375 this.mDocumentURL = "";
1376
1377 // Load topic data to determine document to display
1378 //
1379 this.fSetDocumentHREF(this.mBaseURL + "wwhelp/wwhimpl/common/html/document.htm", false);
1380 }
1381 }
1382
1383 function WWHHelp_Update(ParamURL)
1384 {
1385 var URL;
1386 var Parts;
1387
1388
1389 if (this.mbInitialized)
1390 {
1391 URL = WWHFrame.WWHBrowser.fNormalizeURL(ParamURL);
1392
1393 if (WWHFrame.WWHHandler.fIsReady())
1394 {
1395 Parts = this.fHREFToBookIndexFileIndexAnchor(URL);
1396 if ((Parts[0] >= 0) &&
1397 (Parts[1] >= 0))
1398 {
1399 WWHFrame.WWHHandler.fUpdate(Parts[0], Parts[1], Parts[2]);
1400 }
1401
1402 this.fDocumentBookkeeping(URL);
1403
1404 // Switch tabs, if necessary
1405 //
1406 if (this.mNewTabName != null)
1407 {
1408 WWHFrame.WWHHandler.fSetCurrentTab(this.mNewTabName);
1409
1410 this.mNewTabName = null;
1411 }
1412 }
1413 else
1414 {
1415 // Try again in a bit
1416 //
1417 setTimeout("WWHFrame.WWHHelp.fUpdate(\"" + WWHStringUtilities_EscapeForJavaScript(ParamURL) + "\");", 100);
1418 }
1419 }
1420 else if (ParamURL.indexOf("wwhelp/wwhimpl/common/html/default.htm") == -1)
1421 {
1422 // Try again in a bit
1423 //
1424 this.mDocumentLoaded = ParamURL;
1425 setTimeout("WWHFrame.WWHHelp.fUpdate(\"" + WWHStringUtilities_EscapeForJavaScript(ParamURL) + "\");", 100);
1426 }
1427 }
1428
1429 function WWHHelp_SyncTOC(ParamURL,
1430 bParamReportError)
1431 {
1432 var Parts;
1433
1434 if (WWHFrame.WWHHandler.fIsReady())
1435 {
1436 Parts = this.fHREFToBookIndexFileIndexAnchor(ParamURL);
1437 if ((Parts[0] >= 0) &&
1438 (Parts[1] >= 0))
1439 {
1440 WWHFrame.WWHHandler.fSyncTOC(Parts[0], Parts[1], Parts[2], bParamReportError);
1441 }
1442 }
1443 else
1444 {
1445 // Try again in a bit
1446 //
1447 setTimeout("WWHFrame.WWHHelp.fSyncTOC(\"" + WWHStringUtilities_EscapeForJavaScript(ParamURL) + "\", " + bParamReportError + ");", 100);
1448 }
1449 }
1450
1451 function WWHHelp_FavoritesCurrent(ParamURL)
1452 {
1453 var Parts;
1454
1455 if (WWHFrame.WWHHandler.fIsReady())
1456 {
1457 Parts = this.fHREFToBookIndexFileIndexAnchor(ParamURL);
1458 if ((Parts[0] >= 0) &&
1459 (Parts[1] >= 0))
1460 {
1461 WWHFrame.WWHHandler.fFavoritesCurrent(Parts[0], Parts[1]);
1462 }
1463 else
1464 {
1465 WWHFrame.WWHHandler.fFavoritesCurrent(-1, -1);
1466 }
1467 }
1468 else
1469 {
1470 // Try again in a bit
1471 //
1472 setTimeout("WWHFrame.WWHHelp.fFavoritesCurrent(\"" + WWHStringUtilities_EscapeForJavaScript(ParamURL) + "\");", 100);
1473 }
1474 }
1475
1476 function WWHHelp_DocumentBookkeeping(ParamURL)
1477 {
1478 var VarDocumentFrame;
1479 var VarURL;
1480
1481 // Highlight search words
1482 //
1483 if (typeof(WWHFrame.WWHHighlightWords) != "undefined")
1484 {
1485 WWHFrame.WWHHighlightWords.fExec();
1486 }
1487
1488 // Update controls
1489 //
1490 WWHFrame.WWHControls.fUpdateHREF(ParamURL);
1491
1492 // Update window title, if possible
1493 //
1494 if (ParamURL.indexOf("wwhelp/wwhimpl/common/html/default.htm") == -1)
1495 {
1496 if (WWHFrame.WWHBrowser.mBrowser != 1) // Shorthand for Netscape
1497 {
1498 WWHFrame.document.title = WWHStringUtilities_UnescapeHTML(this.fHREFToTitle(ParamURL));
1499 }
1500 }
1501
1502 // Automatically synchronize TOC, if requested
1503 //
1504 if ( ! this.mCollapsingTOCEntry)
1505 {
1506 this.fAutoSyncTOC();
1507 }
1508 this.mCollapsingTOCEntry = false;
1509
1510 // Update favorites
1511 //
1512 VarDocumentFrame = eval(this.fGetFrameReference("WWHDocumentFrame"));
1513 VarURL = WWHFrame.WWHBrowser.fNormalizeURL(VarDocumentFrame.location.href);
1514 this.fFavoritesCurrent(VarURL);
1515
1516 // Update hash
1517 //
1518 this.fUpdateHash(VarURL);
1519 }
1520
1521 function WWHHelp_UpdateHash(ParamURL)
1522 {
1523 var VarFileName;
1524 var VarHash;
1525
1526 // Only update if "?" is not present (and therefore has priority)
1527 //
1528 if (WWHFrame.location.href.indexOf("?") == -1)
1529 {
1530 // Update URL hash value
1531 //
1532 VarFileName = this.fGetBookFileHREF(ParamURL);
1533 if ((VarFileName != null) &&
1534 (VarFileName.length > 0) &&
1535 (VarFileName != "wwhelp/wwhimpl/common/html/default.htm"))
1536 {
1537 // Only update if different
1538 //
1539 VarHash = "#href=" + VarFileName;
1540 if (this.fSingleTopic())
1541 {
1542 VarHash += "&single=true";
1543 }
1544 if (WWHFrame.location.hash != VarHash)
1545 {
1546 // Only works well on certain browsers
1547 //
1548 if ((WWHFrame.WWHBrowser.mBrowser == 2) || // Shorthand for IE
1549 (WWHFrame.WWHBrowser.mBrowser == 4)) // Shorthand for Netscape 6.0 (Mozilla)
1550 {
1551 WWHFrame.location.hash = VarHash;
1552 }
1553 }
1554 }
1555 }
1556 }
1557
1558 function WWHHelp_AutoSyncTOC()
1559 {
1560 var VarDocumentFrame;
1561 var VarURL;
1562
1563 // Automatically synchronize TOC, if requested
1564 //
1565 if (this.mbAutoSyncTOC)
1566 {
1567 if (WWHFrame.WWHHandler.fGetCurrentTab() == "contents")
1568 {
1569 VarDocumentFrame = eval(this.fGetFrameReference("WWHDocumentFrame"));
1570 VarURL = WWHFrame.WWHBrowser.fNormalizeURL(VarDocumentFrame.location.href);
1571 this.fSyncTOC(VarURL, false);
1572 }
1573
1574 this.mbAutoSyncTOC = this.mbAlwaysSyncTOC;
1575 }
1576 }
1577
1578 function WWHHelp_Unload()
1579 {
1580 // Clear related topics list
1581 //
1582 WWHFrame.WWHRelatedTopics.fClear();
1583 }
1584
1585 function WWHHelp_IgnoreNextKeyPress(ParamEvent)
1586 {
1587 if (this.mbInitialized)
1588 {
1589 if ((ParamEvent != null) &&
1590 (typeof(ParamEvent.keyCode) != "undefined"))
1591 {
1592 this.mbIgnoreNextKeyPress = true;
1593 }
1594 }
1595
1596 return true;
1597 }
1598
1599 function WWHHelp_HandleKeyDown(ParamEvent)
1600 {
1601 if (this.mbInitialized)
1602 {
1603 if ((ParamEvent != null) &&
1604 (typeof(ParamEvent.keyCode) != "undefined"))
1605 {
1606 if (ParamEvent.keyCode == 18)
1607 {
1608 this.mbAltKeyDown = true;
1609 }
1610 else if ((ParamEvent.keyCode >= 48) &&
1611 (ParamEvent.keyCode <= 57))
1612 {
1613 this.mAccessKey = ParamEvent.keyCode - 48;
1614 }
1615 }
1616 }
1617
1618 return true;
1619 }
1620
1621 function WWHHelp_HandleKeyPress(ParamEvent)
1622 {
1623 if (this.mbInitialized)
1624 {
1625 if (ParamEvent != null)
1626 {
1627 if (this.mbIgnoreNextKeyPress)
1628 {
1629 // Ignore this key press event
1630 //
1631 }
1632 else
1633 {
1634 if (this.mAccessKey != null)
1635 {
1636 this.fProcessAccessKey(this.mAccessKey);
1637 }
1638 }
1639 }
1640
1641 // Reset to handle next access key
1642 //
1643 this.mbIgnoreNextKeyPress = false;
1644 this.mAccessKey = null;
1645 }
1646
1647 return true;
1648 }
1649
1650 function WWHHelp_HandleKeyUp(ParamEvent)
1651 {
1652 if (this.mbInitialized)
1653 {
1654 if ((ParamEvent != null) &&
1655 (typeof(ParamEvent.keyCode) != "undefined"))
1656 {
1657 if (ParamEvent.keyCode == 18)
1658 {
1659 this.mbAltKeyDown = false;
1660 }
1661 }
1662 }
1663
1664 return true;
1665 }
1666
1667 function WWHHelp_ProcessAccessKey(ParamAccessKey)
1668 {
1669 switch (ParamAccessKey)
1670 {
1671 case 1:
1672 case 2:
1673 case 3:
1674 WWHFrame.WWHHandler.fProcessAccessKey(ParamAccessKey);
1675 break;
1676
1677 case 4:
1678 case 5:
1679 case 6:
1680 case 7:
1681 case 8:
1682 case 9:
1683 WWHFrame.WWHControls.fProcessAccessKey(ParamAccessKey);
1684 break;
1685
1686 case 0:
1687 this.fFocus("WWHDocumentFrame");
1688 break;
1689 }
1690 }
1691
1692 function WWHHelp_Focus(ParamFrameName,
1693 ParamAnchorName)
1694 {
1695 WWHFrame.WWHBrowser.fFocus(this.fGetFrameReference(ParamFrameName), ParamAnchorName);
1696 }
1697
1698 function WWHHelpUtilities_PreloadGraphics()
1699 {
1700 var VarImageDirectory = WWHFrame.WWHHelp.mHelpURLPrefix + "wwhelp/wwhimpl/common/images";
1701
1702 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/bkmark.gif";
1703 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/bkmarkx.gif";
1704 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/close.gif";
1705 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/doc.gif";
1706 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/email.gif";
1707 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/emailx.gif";
1708 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/fc.gif";
1709 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/fo.gif";
1710 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/next.gif";
1711 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/nextx.gif";
1712 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/prev.gif";
1713 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/prevx.gif";
1714 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/print.gif";
1715 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/printx.gif";
1716 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/related.gif";
1717 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/relatedi.gif";
1718 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/relatedx.gif";
1719 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/shownav.gif";
1720 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spacer4.gif";
1721 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc1w2h.gif";
1722 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc1w7h.gif";
1723 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc2w1h.gif";
1724 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc5w1h.gif";
1725 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc_tb_l.gif";
1726 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc_tb_m.gif";
1727 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc_tb_r.gif";
1728 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/spc_tb_t.gif";
1729 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/sync.gif";
1730 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/syncx.gif";
1731 WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length] = new Image(); WWHFrame.WWHHelp.mImages[WWHFrame.WWHHelp.mImages.length - 1].src = VarImageDirectory + "/toolsbg.gif";
1732 }
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.