home *** CD-ROM | disk | FTP | other *** search
/ Chip 1999 September / CHIPCD_9_99.iso / software / testsoft / pcanywhere / DATA1.CAB / MMC / immc.exe / w95mmc.exe / HTML / JSTSKPAD.JS < prev    next >
Encoding:
Text File  |  1998-11-04  |  24.1 KB  |  711 lines

  1. function DoNothing()
  2. {
  3.     // Stub
  4. }
  5.  
  6. //*************************************
  7. //GET DYNAMIC BODY AND WATERMARK STYLES
  8. //*************************************
  9.  
  10. function GetBodyAndWatermarkStyles()
  11. {
  12.     var szBodyBgColor;
  13.     var szWatermarkColor;
  14.     
  15.     // Set body and watermark depending on color depth
  16.     if (screen.colorDepth <= 8) {
  17.         szBodyBgColor = "background-color:window;\n";
  18.         szWatermarkColor = "color:threedlightshadow;\n";
  19.     }
  20.     else {
  21.         szBodyBgColor = "background-color:threedhighlight;\n";
  22.         szWatermarkColor = "color:threedshadow;filter:alpha(opacity=15);\n";
  23.     }
  24.  
  25.     var szStyle = "<style>\n";
  26.     szStyle += "Body\n";
  27.     szStyle += "  {\n";
  28.     szStyle += "  font-family:Verdana;\n";
  29.     szStyle += "  font-weight:normal;\n";
  30.     szStyle += "  cursor:default;\n";
  31.     szStyle += "  " + szBodyBgColor;
  32.     szStyle += "  }\n\n";
  33.  
  34.     szStyle += ".tdWatermark\n";
  35.     szStyle += "  {\n";
  36.     szStyle += "  text-align:center;\n";
  37.     szStyle += "  cursor:default;\n";
  38.     szStyle += "  " + szWatermarkColor;
  39.     szStyle += "  }\n";
  40.     szStyle += "</style>\n";
  41.     
  42.     return szStyle;
  43. }
  44.  
  45. //******************************
  46. // BUILD TASKPAD BUTTON FUNCTION
  47. //******************************
  48.  
  49. function BuildTaskpadButtons(iPageStyle)
  50. {
  51.     var szNextButton;
  52.  
  53.     for (var i = 0; i <= giTotalButtons; i++) {
  54.         szNextButton = GetNextButton (iPageStyle, i);
  55.           divSymbolContainer.insertAdjacentHTML ("BeforeEnd", szNextButton);
  56.     }
  57. }
  58.  
  59. //**************************
  60. // GET NEXT BUTTON FUNCTIONS
  61. //**************************
  62.  
  63. function GetNextButton(iPageStyle, theIndex)
  64. {
  65.     // Calculate the column & row placement of the button
  66.     // based on its index
  67.     var theColumn    = theIndex % giTotalColumns;                            // mod returns column
  68.     var theRow = Math.floor (theIndex / giTotalColumns);        // division returns row
  69.     
  70.     // Multiply row & column by offset base to determine relative placement
  71.     // of button in percentage terms.
  72.     switch (iPageStyle)
  73.     {
  74.         case CON_TASKPAD_STYLE_VERTICAL1:
  75.             // Vertical layout with 2 listviews
  76.             var iLeftLoc = theColumn * 52;            // columns are 52% apart in this layout
  77.             var iTopLoc = theRow * 25;                    // rows are 25% apart in this layout        
  78.             break;
  79.             
  80.         case CON_TASKPAD_STYLE_HORIZONTAL1:
  81.             // Horizontal layout with 1 listview
  82.             var iLeftLoc = theColumn * 25;            // columns are 25% apart in this layout
  83.             var iTopLoc = theRow * 52;                    // rows are 52% apart in this layout
  84.             break;
  85.             
  86.         case CON_TASKPAD_STYLE_NOLISTVIEW:
  87.             // Buttons-only layout (no listview)
  88.             var iLeftLoc = theColumn * 25;            // columns are 25% apart in this layout
  89.             var iTopLoc = theRow * 25;                    // rows are 25% apart in this layout
  90.             break;            
  91.     }
  92.     
  93.     // Get the HTML for the button
  94.     var szFormattedBtn;
  95.     szFormattedBtn = GetButtonHTML (gaiBtnObjectType[theIndex], theIndex, iLeftLoc, iTopLoc)
  96.     return szFormattedBtn;
  97. }
  98.  
  99. //*************************
  100. // GET BUTTON HTML FUNCTION
  101. //*************************
  102.  
  103. // Bill (and Rano) was here
  104. function EndHREFIfNecessary (theIndex, bWantAnchor)
  105. {
  106.     var szHREF = "";
  107.     if (gaiBtnActionType[theIndex] == 1) {
  108.         if (bWantAnchor == true)
  109.             szHREF += "</A>";
  110.     }
  111.     return szHREF;
  112. }
  113. function StartHREFIfNecessary (theIndex, bWantAnchor)
  114. {
  115.     var szHREF = "";
  116.     if (gaiBtnActionType[theIndex] == 1) {
  117.         // if it's a link, we CAN'T use script to redirect,
  118.         // because this screws up MMC's history list!!!!!!! !
  119.         if (bWantAnchor == true)
  120.             szHREF += "<A HREF=\"";
  121.         szHREF += gaszBtnActionURL[theIndex];
  122.         if (bWantAnchor == true)
  123.             szHREF += "\" STYLE=\"textdecoration\">";
  124.     }
  125.     return szHREF;
  126. }
  127. function GetButtonHTML(iBtnType, theIndex, iLeftLoc, iTopLoc)
  128. {
  129.     // Build up the HTML for the button
  130.     var szBtnHTML = "";
  131.     
  132.     switch (iBtnType)
  133.     {
  134.         case CON_TASK_DISPLAY_TYPE_SYMBOL:             // EOT-based symbol | font
  135.             szBtnHTML += "<DIV class=divSymbol id=divSymbol_" + theIndex + " style=\"LEFT: " + iLeftLoc + "%; TOP: " + iTopLoc + "%\">\n";
  136.             szBtnHTML += "<TABLE id=tblSymbol_" + theIndex + " border=0 cellPadding=0 cellSpacing=0 frame=none rules=none width=100%>\n";
  137.             szBtnHTML += "<TBODY>\n";
  138.             szBtnHTML += "<TR>\n";
  139.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdSymbol_" + theIndex + " noWrap vAlign=top>";
  140.             szBtnHTML += StartHREFIfNecessary (theIndex, true);
  141.             szBtnHTML += "<SPAN class=clsSymbolBtn id=spanSymbol_" + theIndex + " ";
  142.             szBtnHTML += "style=\"COLOR: \"threedhighlight\"; FONT-FAMILY: Webdings; FONT-SIZE: 68px; FONT-WEIGHT: normal\" TaskpadButton>";
  143.             szBtnHTML += "test<!--Insert here-->";
  144.             szBtnHTML += "</SPAN>";
  145.             szBtnHTML += EndHREFIfNecessary (theIndex, true);
  146.             szBtnHTML += "</TD></TR>\n";
  147.             szBtnHTML += "<TR>\n";
  148.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdSymbol_" + theIndex + " vAlign=top width=100%>";
  149.             szBtnHTML += "<A class=clsSymbolBtn href=\"";
  150.             szBtnHTML += StartHREFIfNecessary (theIndex, false);
  151.             szBtnHTML += "\" id=anchorCaption_" + theIndex + " ";
  152.             szBtnHTML += "style=\"COLOR: \"threedhighlight\"; FONT-SIZE: 18px; TEXT-DECORATION: none\" TaskpadButton>";
  153.             szBtnHTML += "<!--Insert here--></A></TD></TR></TBODY></TABLE></DIV><!--divSymbol_" + theIndex + "-->\n";
  154.             break;
  155.             
  156.         case CON_TASK_DISPLAY_TYPE_VANILLA_GIF:        // (GIF) index 0 is transparent
  157.         case CON_TASK_DISPLAY_TYPE_CHOCOLATE_GIF:      // (GIF) index 1 is transparent
  158.             // First get the Hex value of the CSS threedhighlight constant
  159.             var szMaskColor = SysColorX.HEXthreedshadow;
  160.     
  161.             szBtnHTML += "<DIV class=divSymbol id=divSymbol_" + theIndex + " style=\"LEFT: " + iLeftLoc + "%; TOP: " + iTopLoc + "%\">\n";
  162.             szBtnHTML += "<TABLE id=tblSymbol_" + theIndex + " border=0 cellPadding=0 cellSpacing=0 frame=none rules=none width=100%>\n";
  163.             szBtnHTML += "<TBODY>\n";
  164.             szBtnHTML += "<TR>\n";
  165.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdSymbol_" + theIndex + " noWrap vAlign=top>";
  166.             szBtnHTML += StartHREFIfNecessary (theIndex, true);
  167.             szBtnHTML += "<IMG class=clsTaskBtn height=250 id=imgTaskBtn_" + theIndex + " src=\"\" ";
  168.             szBtnHTML += "style=\"FILTER: mask(color=" + szMaskColor + "); HEIGHT: 66px; WIDTH: 66px\" width=250 TaskpadButton>";
  169.             szBtnHTML += EndHREFIfNecessary (theIndex, true);
  170.             szBtnHTML += "</TD></TR>\n";
  171.             szBtnHTML += "<TR>\n";
  172.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdAnchor_" + theIndex + " vAlign=top width=100% TaskpadButton>";
  173.             szBtnHTML += "<A class=clsSymbolBtn href=\"";
  174.             szBtnHTML += StartHREFIfNecessary (theIndex, false);
  175.             szBtnHTML += "\" id=anchorCaption_" + theIndex + " ";
  176.             szBtnHTML += "style=\"FONT-SIZE: 18px\" TaskpadButton>";
  177.             szBtnHTML += "<!--Insert Here--></A></TD></TR></TBODY></TABLE></DIV><!--divSymbol_" + theIndex + "-->\n";
  178.  
  179.             break;
  180.         
  181.         case CON_TASK_DISPLAY_TYPE_BITMAP:             // non-transparent raster image
  182.             szBtnHTML += "<DIV class=divSymbol id=divSymbol_" + theIndex + " style=\"LEFT: " + iLeftLoc + "%; TOP: " + iTopLoc + "%\">\n";
  183.             szBtnHTML += "<TABLE id=tblSymbol_" + theIndex + " border=0 cellPadding=0 cellSpacing=0 frame=none rules=none width=100%>\n";
  184.             szBtnHTML += "<TBODY>\n";
  185.             szBtnHTML += "<TR>\n";
  186.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdSymbol_" + theIndex + " noWrap vAlign=top>";
  187.             szBtnHTML += StartHREFIfNecessary (theIndex, true);
  188.             szBtnHTML += "<IMG class=clsTaskBtn height=250 id=imgTaskBtn_" + theIndex + " src=\"\" ";
  189.             szBtnHTML += "style=\"HEIGHT: 66px; WIDTH: 66px\" width=250 border=0 TaskpadButton>";
  190.             szBtnHTML += EndHREFIfNecessary (theIndex, true);
  191.             szBtnHTML += "</TD></TR>\n";
  192.             szBtnHTML += "<TR>\n";
  193.             szBtnHTML += "<TD align=middle class=tdSymbol id=tdSymbol_" + theIndex + " vAlign=top width=100%>";
  194.             szBtnHTML += "<A class=clsSymbolBtn href=\"";
  195.             szBtnHTML += StartHREFIfNecessary (theIndex, false);
  196.             szBtnHTML += "\" id=anchorCaption_" + theIndex + " ";
  197.             szBtnHTML += "style=\"FONT-SIZE: 18px\" TaskpadButton>";
  198.             szBtnHTML += "<!--Insert Here--></A></TD></TR></TBODY></TABLE></DIV><!--divSymbol_" + theIndex + "-->\n";            
  199.  
  200.             break;
  201.     }    
  202.     return szBtnHTML;
  203. }
  204.  
  205. //*********************************
  206. // COMMON BUTTON BUILDING FUNCTIONS
  207. //*********************************
  208.  
  209. function InsertButtonBitmaps()
  210. {
  211.     for (var i = 0; i <= giTotalButtons; i++) {
  212.         switch (gaiBtnObjectType[i])
  213.         {
  214.             case CON_TASK_DISPLAY_TYPE_VANILLA_GIF:        // (GIF) index 0 is transparent
  215.             case CON_TASK_DISPLAY_TYPE_CHOCOLATE_GIF:      // (GIF) index 1 is transparent
  216.             case CON_TASK_DISPLAY_TYPE_BITMAP:             // non-transparent raster image
  217.                 document.all("imgTaskBtn_" + i).src = gaszBtnOffBitmap[i];
  218.                 break;
  219.         }
  220.     }
  221. }
  222.  
  223. function InsertFontFamilyAndString()
  224. {
  225.     for (var i = 0; i <= giTotalButtons; i++) {
  226.         if (typeof(gaszFontFamilyName[i]) == "string") {
  227.             document.all("spanSymbol_" + i).style.fontFamily = gaszFontFamilyName[i];
  228.             document.all("spanSymbol_" + i).innerHTML = gaszSymbolString[i];
  229.         }
  230.     }
  231. }
  232.  
  233. function InsertCaptionText()
  234. {
  235.     // Insert caption text for each taskpad button
  236.     for (var i = 0; i <= giTotalButtons; i++) {
  237.         document.all("anchorCaption_" + i).innerHTML = gaszBtnCaptions[i];
  238.     }
  239. }
  240.  
  241. function EnableGrayscaleFilter()
  242. {
  243.     for (var i = 0; i <= giTotalButtons; i++) {
  244.         // Grayscale filter only applies to raster-based images
  245.         if (gaiBtnObjectType[i] == CON_TASK_DISPLAY_TYPE_BITMAP) {
  246.             // Grayscale filter only applies if gaszBtnOverBitmap[i] is undefined
  247.             if (typeof(gaszBtnOverBitmap[i]) == "undefined") {
  248.                 document.all("imgTaskBtn_" + i).style.filter = "gray";
  249.             }
  250.         }
  251.     }
  252. }
  253.  
  254. function InsertTaskpadText()
  255. {
  256.     // Insert text for taskpad title, description, and watermark
  257.     
  258.     // Use insertAdjacentText("AfterBegin") for divTitle so that we
  259.     // don't blow out the contained divAbout element
  260.     divTitle.insertAdjacentText("AfterBegin", gszTaskpadTitle);
  261.  
  262.     // Use innerHTML for elements below to support formatting (e.g. <br>)
  263.     divDescription.innerHTML = gszTaskpadDescription;
  264.     
  265.     // Use innerText for stand-alone elements
  266.  
  267.     // Watermark (e.g. Background) - uses inner HTML
  268.     
  269.     var objWatermark = MMCCtrl.GetBackground (szHash);
  270.  
  271.     // RETROFIT BELOW...
  272.  
  273.     if (objWatermark != null) {
  274.         // Keep track of the watermark display object type
  275.         giWatermarkObjectType = objWatermark.DisplayObjectType;
  276.  
  277.         switch (giWatermarkObjectType) {
  278.  
  279.             default:
  280.                 // optional      alert ("skipping due to background.DisplayObjectType == " + objWatermark.DisplayObjectType);
  281.                 // skip
  282.                 break;                                           
  283.  
  284.             case 1:
  285.                 // MMC_TASK_DISPLAY_TYPE_SYMBOL
  286.                 str = "";
  287.                 str += "<SPAN STYLE=\"position:absolute; top:5%; left:0; z-index:-20; font-size:300pt; font-family:";
  288.                 str += objWatermark.FontFamilyName;
  289.                 str += "; \">";
  290.                 str += objWatermark.SymbolString;
  291.                 str += "</SPAN>";
  292.                 tdWatermark.innerHTML = str;
  293.                 break;
  294.  
  295.             case 2:
  296.                 // MMC_TASK_DISPLAY_TYPE_VANILLA_GIF, index 0 is transparent
  297.                 tdWatermark.innerHTML = "<IMG SRC=\"" +
  298.                 objWatermark.MouseOffBitmap + 
  299.                 "\" STYLE=\"position:absolute; filter:alpha(opacity=20); left:0%; top:75%; overflow:hidden;\">";
  300.                 break;
  301.  
  302.             case 3:
  303.                 // MMC_TASK_DISPLAY_TYPE_CHOCOLATE_GIF, index 1 is transparent
  304.                 tdWatermark.innerHTML = "<IMG SRC=\"" +
  305.                 objWatermark.MouseOffBitmap + 
  306.                 "\" STYLE=\"position:absolute; filter:alpha(opacity=20); left:0%; top:75%; overflow:hidden;\">";
  307.                 break;
  308.  
  309.             case 4:
  310.                 // MMC_TASK_DISPLAY_TYPE_BITMAP, non-transparent raster
  311.                 tdWatermark.innerHTML = "<IMG SRC=\"" +
  312.                 objWatermark.MouseOffBitmap + 
  313.                 "\" STYLE=\"position:absolute; filter:alpha(opacity=20); left:0%; top:80%; overflow:hidden;\">";
  314.                 break;
  315.         }
  316.     }
  317. }
  318.  
  319. function SetupListview()
  320. {
  321.     if (gbShowLVTitle == true) {        
  322.         // if gbShowLVTitle is true, add strings to listview
  323.         tdLVTitle.innerText = gszLVTitle;
  324.  
  325.         // Determine if author really wants to show the listview button
  326.         if (gbHasLVButton == true) {        
  327.             anchorLVButton_0.innerText = gszLVBtnCaption;
  328.         }
  329.         // If not, hide it
  330.         else {
  331.             divLVButton_0.style.visibility = "hidden";
  332.         }
  333.     }
  334.     else {
  335.         // gbShowLVTitle is false, so nothing has been specified for a listview header or button;
  336.         // hide these elements and let the listview occupy 100% of its parent"s height
  337.         divLVTitle.style.visibility= "hidden";
  338.         divLV.style.top = "0%";
  339.         divLV.style.height = "100%";
  340.     }
  341. }
  342.  
  343. //***************************************
  344. // BUTTON HIGHLIGHT/UNHIGHLIGHT FUNCTIONS
  345. //***************************************
  346.  
  347. function HighlightButton(szBtnIndex)
  348. {
  349.   // Determine button type
  350.   switch (gaiBtnObjectType[szBtnIndex])
  351.   {
  352.     case 1:     // Symbol
  353.       //document.all("spanSymbol_" + szBtnIndex).style.color = "highlight";
  354.             document.all("spanSymbol_" + szBtnIndex).style.color = "threeddarkshadow";
  355.       break;
  356.  
  357.     case 2:     // GIF Vanilla
  358.     case 3:     // GIF Chocolate
  359.             document.all("imgTaskBtn_" + szBtnIndex).filters.mask.color = SysColorX.RGBthreeddarkshadow;
  360.       break;
  361.  
  362.     case 4:     // Raster
  363.       if (typeof(gaszBtnOverBitmap[szBtnIndex]) == "string") {
  364.             // Use SRC swapping if an "OverBitmap" is specified
  365.           document.all("imgTaskBtn_" + szBtnIndex).src = gaszBtnOverBitmap[szBtnIndex];
  366.         }
  367.         else {
  368.             // Otherwise, toggle from grayscale to color for single bitmap
  369.           document.all("imgTaskBtn_" + szBtnIndex).filters[0].enabled = 0;
  370.         }
  371.         break;
  372.         
  373.     default:
  374.       alert ("Unrecognized image format for button index " + szBtnIndex);
  375.       break;        
  376.   }
  377.  
  378.     document.all("anchorCaption_" + szBtnIndex).style.color = "threeddarkshadow";
  379.     document.all("anchorCaption_" + szBtnIndex).style.textDecoration = "underline";
  380.  
  381.     // Keep track of tooltip index and display tooltip
  382.     giTooltipIndex = szBtnIndex;
  383.  
  384.     // Show the tooltip after latency period specified by giTooltipLatency
  385.     gTooltipTimer = window.setTimeout("TaskpadTooltipShow()", giTooltipLatency, "jscript");
  386. }
  387.  
  388.  
  389. function UnhighlightButton()
  390. {
  391.   if (typeof(gszLastBtn) != "undefined") {
  392.  
  393.     // Determine button type
  394.     switch (gaiBtnObjectType[gszLastBtn])
  395.     {
  396.       case 1:     // Symbol                
  397.                 document.all("spanSymbol_" + gszLastBtn).style.color = "threedshadow";
  398.         break;
  399.  
  400.       case 2:     // GIF Vanilla
  401.       case 3:     // GIF Chocolate
  402.                 document.all("imgTaskBtn_" + gszLastBtn).filters.mask.color = SysColorX.RGBthreedshadow;
  403.         break;
  404.  
  405.       case 4:     // Raster
  406.         if (typeof(gaszBtnOverBitmap[gszLastBtn]) == "string") {
  407.               // Use SRC swapping if an "OverBitmap" is specified
  408.             document.all("imgTaskBtn_" + gszLastBtn).src = gaszBtnOffBitmap[gszLastBtn];
  409.           }
  410.           else {
  411.               // Otherwise, toggle from color to grayscale for single bitmap
  412.             document.all("imgTaskBtn_" + gszLastBtn).filters[0].enabled = 1;
  413.           }
  414.           break;
  415.           
  416.       default:
  417.         alert("Unrecognized image format for index " + gszLastBtn);
  418.         break;        
  419.     }  
  420.  
  421.         document.all("anchorCaption_" + gszLastBtn).style.color = "threedshadow";
  422.         document.all("anchorCaption_" + gszLastBtn).style.textDecoration = "none";
  423.  
  424.         TaskpadTooltipHide();
  425.     }
  426. }
  427.  
  428. function IsStillOverButton()
  429. {
  430.     //  Purpose: Determines if a mouseover or mouseout event
  431.     //  was fired over the same button (indicating that the pointer
  432.     //  is still over the button and that highlighting/unhighlighting
  433.     //  should be ignored.
  434.     // 
  435.     //  Returns true if and only if:
  436.     //    * both fromElement and toElement are not null;
  437.     //    * both elements contain a user-defined "TaskpadButton" attribute;
  438.     //    * both element IDs match.
  439.     
  440.     var fromX = window.event.fromElement;
  441.     var toX = window.event.toElement;
  442.  
  443.     // Trap case where mouse pointer appeared over a button out of nowhere,
  444.     // (e.g. as a result of switching focus from another app).
  445.     if ((fromX != null) && (toX != null)) {
  446.         // return true if moving within elements of a single button
  447.         if ((fromX.getAttribute("TaskpadButton") != null) == (toX.getAttribute("TaskpadButton") != null)) {
  448.             if (GetElementIndex(fromX.id) == GetElementIndex(toX.id)) {
  449.                 return true;
  450.             }
  451.         }
  452.     }
  453.     return false;
  454. }
  455.  
  456. //*****************
  457. //TOOLTIP FUNCTIONS
  458. //*****************
  459.  
  460. function LoadTooltipPointer()
  461. {
  462.     divTooltipPointer.innerHTML = L_gszTooltipPointer_StaticText;
  463. }
  464.  
  465. function TaskpadTooltipShow()
  466. {
  467.     // Load in appropriate tooltip text from the module-level string array
  468.     tdTooltip.innerHTML = gaszBtnTooltips[giTooltipIndex];
  469.     
  470.     // Position the tooltip vertically
  471.   SetTooltipVertical();
  472.  
  473.     // Position the tooltip horizontally
  474.   SetTooltipHorizontal();
  475.   
  476.     // Show the tooltip & pointer
  477.     divTooltip.style.visibility = "visible";
  478.     divTooltipPointer.style.visibility = "visible";
  479. }
  480.  
  481. function SetTooltipVertical()
  482. {
  483.     // Get offset and scroll values for containing div and symbol
  484.     var divScrollTop = divSymbolContainer.scrollTop;
  485.     var divOffsetHeight = divSymbolContainer.offsetHeight
  486.     var elOffsetTop = document.all("divSymbol_" + gszLastBtn).offsetTop;
  487.  
  488.     // Calculate the relative position of the top of the
  489.     // selected button within the divSymbolContainer
  490.     var iBtnLoc = Math.floor(((elOffsetTop - divScrollTop) / divOffsetHeight) * 100);
  491.             
  492.     // If the button location is <= 52
  493.     if (iBtnLoc <= 52) {
  494.         // Position the tooltip below the button
  495.         SetTooltipVerticalBelow();
  496.     }
  497.     else {
  498.         // Otherwise, position the tooltip above the button
  499.         SetTooltipVerticalAbove();
  500.     }
  501. }
  502.  
  503. function SetTooltipVerticalAbove()
  504. {
  505.     var iYLoc = document.all("divSymbol_" + giTooltipIndex).offsetTop;
  506.     iYLoc += divSymbolContainer.offsetTop;
  507.     iYLoc -= tblTooltip.offsetHeight;
  508.     
  509.     // Subtract scrollTop to account for container div scrolling
  510.     iYLoc -= divSymbolContainer.scrollTop;
  511.     
  512.     // Offset the tooltip by an additional fixed-constant size of the symbol fontSize
  513.     switch (gaiBtnObjectType[giTooltipIndex])
  514.     {
  515.         // Offset the top by an additional fixed-constant size
  516.         case 1:     // Symbol
  517.             iYLoc -= (GetPixelSize(document.all("spanSymbol_" + giTooltipIndex).style.fontSize) * L_ConstTooltipOffsetBottom_Number);
  518.             break;
  519.  
  520.         case 2:     // GIF Vanilla
  521.         case 3:     // GIF Chocolate
  522.         case 4:     // Raster
  523.             iYLoc -= ((document.all("imgTaskBtn_" + giTooltipIndex).offsetHeight) * L_ConstTooltipOffsetBottom_Number);
  524.             break;
  525.               
  526.         default:
  527.             // Stub
  528.             break;
  529.     }    
  530.  
  531.     // Position the tooltip vertically
  532.     divTooltip.style.pixelTop = iYLoc;
  533.     
  534.     // Position the tooltip pointer vertically
  535.     divTooltipPointer.style.pixelTop = iYLoc + tblTooltip.offsetHeight - (GetPixelSize(divTooltipPointer.style.fontSize) / L_ConstTooltipPointerOffsetBottom_Number);
  536. }
  537.  
  538. function SetTooltipVerticalBelow()
  539. {
  540.     var iYLoc = document.all("divSymbol_" + giTooltipIndex).offsetTop;
  541.     iYLoc += document.all("tblSymbol_" + giTooltipIndex).offsetHeight;
  542.     iYLoc += divSymbolContainer.offsetTop;
  543.     
  544.     // Subtract scrollTop to account for container div scrolling
  545.     iYLoc -= divSymbolContainer.scrollTop;
  546.     
  547.     // Offset the tooltip by an additional fixed-constant size of the symbol fontSize
  548.     switch (gaiBtnObjectType[giTooltipIndex])
  549.     {
  550.         // Offset the top by an additional fixed-constant size
  551.         case 1:     // Symbol
  552.             iYLoc += (GetPixelSize(document.all("spanSymbol_" + giTooltipIndex).style.fontSize) * L_ConstTooltipOffsetBottom_Number);
  553.             break;
  554.  
  555.         case 2:     // GIF Vanilla
  556.         case 3:     // GIF Chocolate
  557.         case 4:     // Raster
  558.             iYLoc += ((document.all("imgTaskBtn_" + giTooltipIndex).offsetHeight) * L_ConstTooltipOffsetBottom_Number);
  559.             break;
  560.               
  561.         default:
  562.             // Stub
  563.             break;
  564.     }    
  565.  
  566.     // Position the tooltip vertically
  567.     divTooltip.style.pixelTop = iYLoc;
  568.     
  569.     // Position the tooltip pointer vertically
  570.     //divTooltipPointer.style.pixelTop = iYLoc - tblTooltip.offsetHeight - (GetPixelSize(divTooltipPointer.style.fontSize) / L_ConstTooltipPointerOffsetBottom_Number);
  571.     divTooltipPointer.style.pixelTop = iYLoc - (GetPixelSize(divTooltipPointer.style.fontSize) / L_ConstTooltipPointerOffsetTop_Number);
  572. }
  573.  
  574. function SetTooltipHorizontal()
  575. {
  576.     var iSymbolLeft = document.all("divSymbol_" + giTooltipIndex).offsetLeft;
  577.     var iSymbolWidth = document.all("divSymbol_" + giTooltipIndex).offsetWidth;
  578.     var iTooltipWidth = document.all("divTooltip").offsetWidth;
  579.  
  580.     // Center the tooltip horizontally w/ respect to its symbol
  581.     var iXLoc;
  582.     if (iSymbolWidth >= iTooltipWidth) {
  583.         // Symbol is wider than tooltip
  584.         iXLoc = ( (iSymbolWidth - iTooltipWidth) / 2) + iSymbolLeft;
  585.     }
  586.     else {
  587.         // Tooltip is wider than symbol
  588.         iXLoc = ( (iTooltipWidth - iSymbolWidth) / 2) + iSymbolLeft;
  589.     }
  590.  
  591.     iXLoc += divSymbolContainer.style.pixelLeft;
  592.  
  593.     // Position the tooltip horizontally
  594.     divTooltip.style.left = iXLoc;
  595.     
  596.     // Position the tooltip pointer horizontally
  597.     divTooltipPointer.style.pixelLeft = iXLoc + (iTooltipWidth / 2) - ( GetPixelSize(divTooltipPointer.style.fontSize) / 2 );
  598. }
  599.  
  600. function TaskpadTooltipHide()
  601. {
  602.     divTooltip.style.visibility = "hidden";
  603.     divTooltipPointer.style.visibility = "hidden";
  604.     window.clearTimeout(gTooltipTimer);
  605.     //Empty the innerHTML, which causes the height to collapse
  606.     tdTooltip.innerHTML = "";
  607. }
  608.  
  609. //****************
  610. // RESIZE FUNCTION
  611. //****************
  612.  
  613. function ResizeTaskpadElements(iTaskpadStyle)
  614. {
  615.   var iSmallerDimension = GetSmallerDimension();
  616.     
  617.     // Bail out if iSmallerDimension < 1
  618.     if (iSmallerDimension <= 0) {
  619.         return;
  620.     }
  621.   
  622.     // Title & description
  623.     divTitle.style.fontSize = iSmallerDimension * L_ConstTitleText_Number;
  624.     divDescription.style.fontSize = iSmallerDimension * L_ConstDescriptionText_Number;
  625.  
  626.     // Watermark
  627.     // TODO: NEED TO IMPLEMENT FULL SUPPORT FOR WATERMARK IN ALL ITS FLAVORS
  628.     switch (iTaskpadStyle)
  629.     {
  630.         case CON_TASKPAD_STYLE_VERTICAL1:
  631.             tdWatermark.style.fontSize = iSmallerDimension * L_ConstWatermarkVerticalText_Number;
  632.             break;
  633.             
  634.         case CON_TASKPAD_STYLE_HORIZONTAL1:
  635.             tdWatermark.style.fontSize = iSmallerDimension * L_ConstWatermarkHorizontalText_Number;
  636.             break;
  637.             
  638.         case CON_TASKPAD_STYLE_NOLISTVIEW:
  639.             tdWatermark.style.fontSize = iSmallerDimension * L_ConstWatermarkNoListviewText_Number;
  640.             break;
  641.     }
  642.  
  643.     // Tooltips
  644.     tblTooltip.style.fontSize = iSmallerDimension * L_ConstTooltipText_Number;
  645.     divTooltipPointer.style.fontSize = iSmallerDimension * L_ConstTooltipPointerText_Number;    
  646.  
  647.     // Listview elements
  648.     if (iTaskpadStyle != CON_TASKPAD_STYLE_NOLISTVIEW) {
  649.         tdLVButton_0.style.fontSize = iSmallerDimension * L_ConstLVButtonText_Number;
  650.         tdLVTitle.style.fontSize = iSmallerDimension * L_ConstLVTitleText_Number;
  651.     }
  652.   
  653.   // Apply multipliers to symbol text
  654.   for (var i = 0; i <= giTotalButtons; i++) {
  655.   
  656.     // All buttons have an anchor caption
  657.     document.all("anchorCaption_" + i).style.fontSize = iSmallerDimension * L_ConstSpanAnchorText_Number;
  658.   
  659.     // Determine button type (either symbol- or image-based)
  660.     switch (gaiBtnObjectType[i])
  661.     {
  662.       case 1:     // Symbol
  663.         document.all("spanSymbol_" + i).style.fontSize = iSmallerDimension * L_ConstSpanSymbolText_Number;
  664.         break;
  665.         
  666.       case 2:     // GIF Vanilla
  667.       case 3:     // GIF Chocolate
  668.       case 4:     // Raster
  669.         document.all("imgTaskBtn_" + i).style.width = iSmallerDimension * L_ConstTaskButtonBitmapSize_Number;
  670.         document.all("imgTaskBtn_" + i).style.height = iSmallerDimension * L_ConstTaskButtonBitmapSize_Number;
  671.         break;
  672.         
  673.       default:
  674.         alert("Unrecognized image format for index " + i);        
  675.     }
  676.   }
  677. }
  678.  
  679. //******************
  680. // UTILITY FUNCTIONS
  681. //******************
  682.  
  683. function SynchColorsToSystem(iType)
  684. {
  685.     // TODO NOTE: Why are you doing this? Can"t most of these be set directly
  686.     // from CSS style sheets? Investigate!
  687.     
  688.     // Use CSS system constants
  689.     divTitle.style.color = "threeddarkshadow";
  690.     divTitle.style.borderColor = "threeddarkshadow";
  691.  
  692.     divDescription.style.color = "threeddarkshadow";
  693.             
  694.     tblTooltip.style.backgroundColor = "infobackground";
  695.     tblTooltip.style.color = "infotext";
  696.     divTooltipPointer.style.color = "windowframe";
  697.     
  698.     // Special case the taskpad type
  699.     switch (iType) {
  700.         case CON_TASKPAD_STYLE_VERTICAL1:
  701.         case CON_TASKPAD_STYLE_HORIZONTAL1:
  702.             divLVContainerTop.style.backgroundColor = "buttonface";
  703.             divLVButton_0.style.backgroundColor = "threedshadow";
  704.             break;
  705.             
  706.         case CON_TASKPAD_STYLE_NOLISTVIEW:
  707.             // Stub
  708.             break;
  709.     }
  710. }
  711.