var RESIZE_TYPE =
   {
    LTOR : 1,
    RTOL : 2
   };

popOverWin.prototype.build =

function ()
        {
         WriteDebugMsg("CALL", 100, "popOverWin.build()");

         var oThis = this;

         if (null != oThis.bgIframe)
           {
            return;
           }

         oThis.bgIframe = document.createElement("iframe");

         oThis.bgIframe.name              = "_popover." + Math.round((Math.random() * 99999) + 1);
         oThis.bgIframe.id                = oThis.bgIframe.name;
         oThis.bgIframe.src               = "about:blank";
         oThis.bgIframe.width             = oThis.mainW;
         oThis.bgIframe.height            = oThis.mainH;
         oThis.bgIframe.frameBorder       = "0";
         oThis.bgIframe.style.border      = "none";
         oThis.bgIframe.style.zIndex      = "99";
         oThis.bgIframe.style.position    = "absolute";
         oThis.bgIframe.style.left        = oThis.mainX + "px";
         oThis.bgIframe.style.top         = oThis.mainY + "px";

         oThis.bgDiv = document.createElement("div");

         oThis.bgDiv.style.height     = oThis.mainH + "px";
         oThis.bgDiv.style.width      = oThis.mainW + "px";
         oThis.bgDiv.style.position   = "absolute";
         oThis.bgDiv.style.left       = oThis.mainX + "px";
         oThis.bgDiv.style.top        = oThis.mainY + "px";
         oThis.bgDiv.style.background = "#000000";
         oThis.bgDiv.style.border     = "1px solid black";
         oThis.bgDiv.style.zIndex     = "100";

         if (!oThis.defaultShow)
           {
            oThis.hide();
           }

         oThis.titleBarDiv = document.createElement("div");

         oThis.titleBarDiv.style.height       = "20px";
         oThis.titleBarDiv.style.margin       = "0px";
         oThis.titleBarDiv.style.padding      = "0px";
         oThis.titleBarDiv.style.width        = oThis.mainW + "px";
         oThis.titleBarDiv.style.background   = "#0000ff";
         oThis.titleBarDiv.style.cursor       = "move";
         oThis.titleBarDiv.style.overflow     = "hidden";
         oThis.titleBarDiv.style.borderBottom = "1px solid black";


         oThis.titleBarDiv.onmousedown = function (downEvent)
                                                 {
                                                  if (oThis.resizeMode != RESIZE_TYPE.LTOR)
                                                    {
                                                     oThis.resizeMode = RESIZE_TYPE.LTOR;

                                                     // anchor the main div to the left:

                                                     oThis.anchor(RESIZE_TYPE.LTOR);
                                                    }

                                                  if (!downEvent)
                                                    {
                                                     downEvent = window.event;
                                                    }

                                                  var iXOff = (downEvent.clientX - oThis.mainX);
                                                  var iYOff = (downEvent.clientY - oThis.mainY);

                                                  document.onmousemove = function (moveEvent)
                                                                                 {
                                                                                  if (!moveEvent)
                                                                                    {
                                                                                     moveEvent = window.event;
                                                                                    }

                                                                                  oThis.moveTo(
                                                                                               (moveEvent.clientX - iXOff),
                                                                                               (moveEvent.clientY - iYOff)
                                                                                              );
                                                                                 };

                                                  document.onmouseup = function (event)
                                                                               {
                                                                                document.onmouseup   = oThis.origMUp;
                                                                                document.onmousemove = oThis.origMMove;
                                                                               };
                                                 };

         oThis.titleDiv = document.createElement("div");

         oThis.titleDiv.style.cssFloat      = "left";
         oThis.titleDiv.style.styleFloat    = "left";
         oThis.titleDiv.style.height        = "20px";
         oThis.titleDiv.style.lineHeight    = "20px";
         oThis.titleDiv.style.fontSize      = "14px";
         oThis.titleDiv.style.textIndent    = "4px";
         oThis.titleDiv.style.verticalAlign = "middle";
         oThis.titleDiv.style.color         = "#ffffff";
         oThis.titleDiv.style.fontWeight    = "bold";
         oThis.titleDiv.style.overflow      = "hidden";
         oThis.titleDiv.innerHTML           = oThis.titleText;

         oThis.titleBarDiv.appendChild(oThis.titleDiv);

         oThis.closeImage = document.createElement("img");

         oThis.closeImage.src              = "../../images/close.gif";
         oThis.closeImage.alt              = "Close";
         oThis.closeImage.title            = "Close";
         oThis.closeImage.style.cssFloat   = "right";
         oThis.closeImage.style.styleFloat = "right";
         oThis.closeImage.style.margin     = "2px";
         oThis.closeImage.style.cursor     = "default";

         oThis.closeImage.onclick = function ()
                                            {
                                             oThis.hide();
                                            };

         oThis.titleBarDiv.appendChild(oThis.closeImage);

         oThis.bgDiv.appendChild(oThis.titleBarDiv);

         oThis.contentDiv = document.createElement("div");

         oThis.contentDiv.style.height     = (oThis.mainH - 32) + "px";
         oThis.contentDiv.style.width      = oThis.mainW + "px";
         oThis.contentDiv.style.background = "#ffffff";
         oThis.contentDiv.style.overflow   = "scroll";

         oThis.bgDiv.appendChild(oThis.contentDiv);

         oThis.bottomDiv = document.createElement("div");

         oThis.bottomDiv.style.height     = "10px";
         oThis.bottomDiv.style.margin     = "0px";
         oThis.bottomDiv.style.padding    = "0px";
         oThis.bottomDiv.style.width      = oThis.mainW + "px";
         oThis.bottomDiv.style.background = "#cccccc";
         oThis.bottomDiv.style.borderTop  = "1px solid black";

         oThis.brsizeDiv = document.createElement("div");

         oThis.brsizeDiv.style.height     = "10px";
         oThis.brsizeDiv.style.width      = "10px";
         oThis.brsizeDiv.style.overflow   = "hidden";
         oThis.brsizeDiv.style.background = "url(../../images/brsize.gif) 0 0 no-repeat";
         oThis.brsizeDiv.style.cssFloat   = "right";
         oThis.brsizeDiv.style.styleFloat = "right";

         if (!oThis.noResize)
           {
            oThis.brsizeDiv.style.cursor = "se-resize";

            oThis.brsizeDiv.onmousedown = function (downEvent)
                                                  {
                                                   if (oThis.resizeMode != RESIZE_TYPE.LTOR)
                                                     {
                                                      // Adjust the main X coord to the TOP LEFT corner:

                                                      // oThis.mainX  = oThis.mainX - oThis.mainW;

                                                      oThis.resizeMode = RESIZE_TYPE.LTOR;

                                                      // Anchor the main div to the left:

                                                      oThis.anchor(RESIZE_TYPE.LTOR);
                                                     }

                                                   if (!downEvent)
                                                     {
                                                      downEvent = window.event;
                                                     }

                                                   // save the initial coords:

                                                   var iOrigX = downEvent.clientX + getScrollX();
                                                   var iOrigY = downEvent.clientY + getScrollY();
                                                   var iOrigW = oThis.mainW;
                                                   var iOrigH = oThis.mainH;

                                                   document.onmousemove = function (moveEvent)
                                                                                  {
                                                                                   if (!moveEvent)
                                                                                     {
                                                                                      moveEvent = window.event;
                                                                                     }

                                                                                   var iNewW = ((moveEvent.clientX + getScrollX())
                                                                                             - iOrigX) + iOrigW;
                                                                                   var iNewH = ((moveEvent.clientY + getScrollY())
                                                                                             - iOrigY) + iOrigH;

                                                                                   oThis.resizeTo(iNewW, iNewH);
                                                                                  };

                                                   document.onmouseup = function (upEvent)
                                                                                {
                                                                                 if (!upEvent)
                                                                                   {
                                                                                    upEvent = window.event;
                                                                                   }

                                                                                 document.onmousemove = oThis.origMMove;
                                                                                 document.onmouseup   = oThis.origMUp;
                                                                                };
                                                  };
           }

         oThis.bottomDiv.appendChild(oThis.brsizeDiv);

         oThis.bgDiv.appendChild(oThis.bottomDiv);

         document.getElementsByTagName("body")[0].appendChild(oThis.bgIframe);
         document.getElementsByTagName("body")[0].appendChild(oThis.bgDiv);

         WriteDebugMsg("EXIT", 100, "popOverWin.build()");
        };



popOverWin.prototype.show = function (iNewX, iNewY, iNewW, iNewH)
                                    {
                                     WriteDebugMsg(
                                                   "CALL",
                                                   100,
                                                   "popOver.show(" + iNewX + ", "
                                                                   + iNewY + ", "
                                                                   + iNewW + ", "
                                                                   + iNewH + ")"
                                                  );

                                     var oThis = this;


                                     // First, anchor the popover to the top and left:

                                     oThis.anchor(RESIZE_TYPE.LTOR)


                                     // If the caller provided a new X and/or Y, call moveTo

                                     if ('number' == typeof(iNewX) || 'number' == typeof(iNewY))
                                       {
                                        oThis.moveTo(iNewX, iNewY);
                                       }


                                     // If the caller provided new dimensions, call resize

                                     if ('number' == typeof(iNewW) || 'number' == typeof(iNewH))
                                       {
                                        oThis.resizeTo(iNewW, iNewH);
                                       }

                                     oThis.bgIframe.style.visibility = "visible";
                                     oThis.bgIframe.style.display    = "block";
                                     oThis.bgDiv.style.visibility    = "visible";
                                     oThis.bgDiv.style.display       = "block";

                                     WriteDebugMsg("EXIT", 100, "popOver.show()");
                                    };



popOverWin.prototype.hide = function ()
                                    {
                                     var oThis = this;

                                     oThis.bgIframe.style.visibility = "hidden";
                                     oThis.bgIframe.style.display    = "none";
                                     oThis.bgDiv.style.visibility    = "hidden";
                                     oThis.bgDiv.style.display       = "none";
                                    };



popOverWin.prototype.resizeTo = function (iNewW, iNewH)
                                        {
                                         var oThis = this;

                                         // FIXME: Implement a MINIMUM and MAXIMUM height/width!!!
                                         // if no width or height are passed, use object's current properties.

                                         if ('number' == typeof(iNewW))
                                           {
                                            oThis.mainW = iNewW;
                                           }

                                         if ('number' == typeof(iNewH))
                                           {
                                            oThis.mainH = iNewH;
                                           }


                                         // otherwise, update object's properties AND style.

                                         if (oThis.resizeMode == RESIZE_TYPE.RTOL)
                                           {
                                            oThis.bgIframe.style.width    = oThis.mainW + "px";
                                            oThis.bgDiv.style.width       = oThis.mainW + "px";
                                            oThis.titleBarDiv.style.width = oThis.mainW + "px";
                                            oThis.contentDiv.style.width  = oThis.mainW + "px";
                                            oThis.bottomDiv.style.width   = oThis.mainW + "px";
                                            oThis.bgIframe.style.height   = oThis.mainH + "px";
                                            oThis.bgDiv.style.height      = oThis.mainH + "px";
                                            oThis.contentDiv.style.height = (oThis.mainH - 32) + "px";
                                           }
                                          else
                                              {
                                               oThis.bgIframe.style.width    = oThis.mainW + "px";
                                               oThis.bgDiv.style.width       = oThis.mainW + "px";
                                               oThis.titleBarDiv.style.width = oThis.mainW + "px";
                                               oThis.contentDiv.style.width  = oThis.mainW + "px";
                                               oThis.bottomDiv.style.width   = oThis.mainW + "px";
                                               oThis.bgIframe.style.height   = oThis.mainH + "px";
                                               oThis.bgDiv.style.height      = oThis.mainH + "px";
                                               oThis.contentDiv.style.height = (oThis.mainH - 32) + "px";
                                              }
                                        };



popOverWin.prototype.anchor = function (iResizeMode)
                                      {
                                       var oThis = this;


                                       // if no resize-mode passed, use object's current property.

                                       if (iResizeMode && (RESIZE_TYPE.LTOR == iResizeMode || RESIZE_TYPE.RTOL == iResizeMode))
                                         {
                                          oThis.resizeMode = iResizeMode;
                                         }


                                       // otherwise, update object's property AND style.

                                       if (RESIZE_TYPE.RTOL == oThis.resizeMode)
                                         {
                                          oThis.bgIframe.style.right = (Math.floor(getDocumentWidth())
                                                                     - (oThis.mainX + oThis.mainW)) + "px";
                                          oThis.bgIframe.style.left  = "";
                                          oThis.bgDiv.style.right    = (Math.floor(getDocumentWidth())
                                                                     - (oThis.mainX + oThis.mainW)) + "px";
                                          oThis.bgDiv.style.left     = "";
                                         }
                                        else
                                            {
                                             oThis.bgIframe.style.right = "";
                                             oThis.bgIframe.style.left  = oThis.mainX + "px";
                                             oThis.bgDiv.style.right    = "";
                                             oThis.bgDiv.style.left     = oThis.mainX + "px";
                                           }
                                      };



popOverWin.prototype.moveTo = function (iNewX, iNewY)
                                      {
                                       var oThis = this;

                                       // if no X or Y are passed, use object's current properties.

                                       if ('number' == typeof(iNewX))
                                         {
                                          oThis.mainX = iNewX;
                                         }

                                       if ('number' == typeof(iNewY))
                                         {
                                          oThis.mainY = iNewY;
                                         }

                                       // otherwise, update object's properties AND style.

                                       oThis.bgIframe.style.left = oThis.mainX + "px";
                                       oThis.bgIframe.style.top  = oThis.mainY + "px";
                                       oThis.bgDiv.style.left    = oThis.mainX + "px";
                                       oThis.bgDiv.style.top     = oThis.mainY + "px";
                                      };



popOverWin.prototype.setContent = function (sContent)
                                          {
                                           WriteDebugMsg(
                                                         "CALL",
                                                         100,
                                                         "setContent(" + sContent + ")"
                                                        );

                                           var oThis = this;

                                           oThis.contentDiv.innerHTML = sContent;

                                           WriteDebugMsg("EXIT", 100, "setContent()");
                                          };



popOverWin.prototype.setTitle = function (sTitle)
                                        {
                                         var oThis = this;

                                         oThis.titleText          = sTitle;
                                         oThis.titleDiv.innerHTML = oThis.titleText;
                                        };



popOverWin.prototype.remove = function (sTitle)
                                      {
                                       var oThis = this;

                                       oThis.hide();

                                       document.getElementsByTagName("body")[0].removeChild(oThis.bgDiv);
                                       document.getElementsByTagName("body")[0].removeChild(oThis.bgIframe);

                                       delete(oThis.bgDiv);
                                       delete(oThis.bgIframe);
                                       delete(oThis.titleDiv);
                                       delete(oThis.closeImage);
                                       delete(oThis.titleBarDiv);
                                       delete(oThis.contentDiv);
                                       delete(oThis.bottomDiv);
                                       delete(oThis.blsizeDiv);
                                       delete(oThis.brsizeDiv);
                                      };



function popOverWin(sTitle, iWidth, iHeight, iXPos, iYPos, bDefaultShow, bNoResize)
        {
         WriteDebugMsg(
                       "CALL",
                       100,
                       "popOverWin(" + sTitle  + ", "
                                     + iWidth  + ", "
                                     + iHeight + ", "
                                     + iXPos   + ", "
                                     + iYPos   + ")"
                      );

         var oThis = this;

         oThis.mainW       = iWidth;
         oThis.mainH       = iHeight;
         oThis.mainX       = iXPos;
         oThis.mainY       = iYPos;

         oThis.bgIframe    = null;
         oThis.bgDiv       = null;

         oThis.titleText   = sTitle;
         oThis.titleDiv    = null;
         oThis.closeImage  = null;
         oThis.titleBarDiv = null;

         oThis.contentDiv  = null;

         oThis.bottomDiv   = null;
         oThis.blsizeDiv   = null;
         oThis.brsizeDiv   = null;

         oThis.resizeMode  = RESIZE_TYPE.LTOR;

         oThis.defaultShow = bDefaultShow;
         oThis.noResize    = bNoResize;

         oThis.origMMove   = (typeof(document.onmousemove) == 'function' ? document.onmousemove : function(){return(true)});
         oThis.origMUp     = (typeof(document.onmouseup)   == 'function' ? document.onmouseup   : function(){return(true)});

         oThis.build();

         WriteDebugMsg("EXIT" , 100, "popOverWin()");
        };

//--------------------------------------------------------------------------------------------------------------------------------

Vignette.prototype.build =

function ()
        {
         WriteDebugMsg("CALL", 100, "Vignette.build()");

         var oThis = this;

         if (null != oThis.bgIframe)
           {
            return;
           }

         oThis.bgIframe = document.createElement("iframe");

         oThis.bgIframe.allowTransparency     = true;
         oThis.bgIframe.name                  = "_popover." + Math.round((Math.random() * 99999) + 1);
         oThis.bgIframe.id                    = oThis.bgIframe.name;
         oThis.bgIframe.src                   = "/blank.htm";
         oThis.bgIframe.width                 = 0; // Fixes IE trasnparency issue.
         oThis.bgIframe.height                = oThis.mainH + "px"; // Fixes IE transparency issue.
         oThis.bgIframe.frameBorder           = "0";
         oThis.bgIframe.style.backgroundColor = "transparent";
         oThis.bgIframe.style.border          = "none";
         oThis.bgIframe.style.zIndex          = "99";
         oThis.bgIframe.style.position        = "absolute";
         oThis.bgIframe.style.left            = oThis.mainX + "px";
         oThis.bgIframe.style.top             = oThis.mainY + "px";

         oThis.bgDiv = document.createElement("div");

         oThis.bgDiv.style.height     = oThis.mainH + "px";
         oThis.bgDiv.style.width      = oThis.mainW + "px";
         oThis.bgDiv.style.position   = "absolute";
         oThis.bgDiv.style.left       = oThis.mainX + "px";
         oThis.bgDiv.style.top        = oThis.mainY + "px";
         oThis.bgDiv.style.background = "transparent";
         oThis.bgDiv.style.backgroundColor = "transparent";
         oThis.bgDiv.style.border     = "none";
         oThis.bgDiv.style.zIndex     = "100";

         if (!oThis.defaultShow)
           {
            oThis.hide();
           }

         oThis.contentDiv = document.createElement("div");

         oThis.contentDiv.style.backgroundColor = "transparent";
         oThis.contentDiv.style.margin     = "1em";

         oThis.topBorder = document.createElement("b");

         oThis.topBorder.style.background = "transparent";
         oThis.topBorder.style.display    = "block";
         oThis.topBorder.style.fontSize   = "1px";


         oThis.topEdge = document.createElement("b");

         oThis.topEdge.style.background = oThis.sBorderColor;
         oThis.topEdge.style.display    = "block";
         oThis.topEdge.style.height     = "1px";
         oThis.topEdge.style.margin     = "0 5px";
         oThis.topEdge.style.overflow   = "hidden";


         oThis.topMargin = document.createElement("b");

         oThis.topMargin.style.background  = oThis.sBorderColor;
         oThis.topMargin.style.borderLeft  = "1px solid " + oThis.sBorderColor;
         oThis.topMargin.style.borderRight = "1px solid " + oThis.sBorderColor;
         oThis.topMargin.style.borderWidth = "0 2px";
         oThis.topMargin.style.display     = "block";
         oThis.topMargin.style.height      = "1px";
         oThis.topMargin.style.margin      = "0 3px";
         oThis.topMargin.style.overflow    = "hidden";


         oThis.topBegCurve = document.createElement("b");

         oThis.topBegCurve.style.background  = oThis.sBorderColor;
         oThis.topBegCurve.style.borderLeft  = "1px solid " + oThis.sBorderColor;
         oThis.topBegCurve.style.borderRight = "1px solid " + oThis.sBorderColor;
         oThis.topBegCurve.style.borderWidth = "0 2px";
         oThis.topBegCurve.style.display     = "block";
         oThis.topBegCurve.style.height      = "1px";
         oThis.topBegCurve.style.margin      = "0 2px";
         oThis.topBegCurve.style.overflow    = "hidden";


         oThis.topEndCurve = document.createElement("b");

         oThis.topEndCurve.style.background  = oThis.sBorderColor;
         oThis.topEndCurve.style.borderLeft  = "1px solid " + oThis.sBorderColor;
         oThis.topEndCurve.style.borderRight = "1px solid " + oThis.sBorderColor;
         oThis.topEndCurve.style.borderWidth = "0 2px";
         oThis.topEndCurve.style.display     = "block";
         oThis.topEndCurve.style.height      = "2px";
         oThis.topEndCurve.style.margin      = "0 1px";
         oThis.topEndCurve.style.overflow    = "hidden";


         oThis.bottomBorder = document.createElement("b");

         oThis.topBorder.style.background = "transparent";
         oThis.topBorder.style.display    = "block";
         oThis.topBorder.style.fontSize   = "1px";


         oThis.bottomEdge = document.createElement("b");

         oThis.bottomEdge.style.background = oThis.sBorderColor;
         oThis.bottomEdge.style.display    = "block";
         oThis.bottomEdge.style.height     = "1px";
         oThis.bottomEdge.style.margin     = "0 5px";
         oThis.bottomEdge.style.overflow   = "hidden";


         oThis.bottomMargin = document.createElement("b");

         oThis.bottomMargin.style.background  = oThis.sBorderColor;
         oThis.bottomMargin.style.borderLeft  = "1px solid " + oThis.sBorderColor;
         oThis.bottomMargin.style.borderRight = "1px solid " + oThis.sBorderColor;
         oThis.bottomMargin.style.borderWidth = "0 2px";
         oThis.bottomMargin.style.display     = "block";
         oThis.bottomMargin.style.height      = "1px";
         oThis.bottomMargin.style.margin      = "0 3px";
         oThis.bottomMargin.style.overflow    = "hidden";


         oThis.bottomBegCurve = document.createElement("b");

         oThis.bottomBegCurve.style.background  = oThis.sBgColor;
         oThis.bottomBegCurve.style.borderLeft  = "1px solid " + oThis.sBorderColor;
         oThis.bottomBegCurve.style.borderRight = "1px solid " + oThis.sBorderColor;
         oThis.bottomBegCurve.style.borderWidth = "0 2px";
         oThis.bottomBegCurve.style.display     = "block";
         oThis.bottomBegCurve.style.height      = "1px";
         oThis.bottomBegCurve.style.margin      = "0 2px";
         oThis.bottomBegCurve.style.overflow    = "hidden";


         oThis.bottomEndCurve = document.createElement("b");

         oThis.bottomEndCurve.style.background  = oThis.sBgColor;
         oThis.bottomEndCurve.style.borderLeft  = "1px solid " + oThis.sBorderColor;
         oThis.bottomEndCurve.style.borderRight = "1px solid " + oThis.sBorderColor;
         oThis.bottomEndCurve.style.borderWidth = "0 2px";
         oThis.bottomEndCurve.style.display     = "block";
         oThis.bottomEndCurve.style.height      = "2px";
         oThis.bottomEndCurve.style.margin      = "0 1px";
         oThis.bottomEndCurve.style.overflow    = "hidden";


         oThis.topBorder.appendChild(oThis.topEdge);
         oThis.topBorder.appendChild(oThis.topMargin);
         oThis.topBorder.appendChild(oThis.topBegCurve);
         oThis.topBorder.appendChild(oThis.topEndCurve);

         oThis.bottomBorder.appendChild(oThis.bottomEndCurve);
         oThis.bottomBorder.appendChild(oThis.bottomBegCurve);
         oThis.bottomBorder.appendChild(oThis.bottomMargin);
         oThis.bottomBorder.appendChild(oThis.bottomEdge);

         oThis.dispDiv = document.createElement("div");

         oThis.dispDiv.style.background  = oThis.sBgColor;
         oThis.dispDiv.style.border      = "0 solid " + oThis.sBorderColor;
         oThis.dispDiv.style.borderWidth = "0 2px";
         oThis.dispDiv.style.display     = "block";

         oThis.contentDiv.appendChild(oThis.topBorder);
         oThis.contentDiv.appendChild(oThis.dispDiv);
         oThis.contentDiv.appendChild(oThis.bottomBorder);

         oThis.bgDiv.appendChild(oThis.contentDiv);

         document.getElementsByTagName("body")[0].appendChild(oThis.bgIframe);
         document.getElementsByTagName("body")[0].appendChild(oThis.bgDiv);

         WriteDebugMsg("EXIT", 100, "Vignette.build()");
        };



Vignette.prototype.show = function (iNewX, iNewY, iNewW, iNewH)
                                  {
                                   WriteDebugMsg(
                                                 "CALL",
                                                 100,
                                                 "Vignette.show(" + iNewX + ", "
                                                                  + iNewY + ", "
                                                                  + iNewW + ", "
                                                                  + iNewH + ")"
                                                );

                                   var oThis = this;


                                   // First, anchor the popover to the top and left:

                                   oThis.anchor(RESIZE_TYPE.LTOR)


                                   // If the caller provided a new X and/or Y, call moveTo

                                   if ('number' == typeof(iNewX) || 'number' == typeof(iNewY))
                                     {
                                      oThis.moveTo(iNewX, iNewY);
                                     }


                                   // If the caller provided new dimensions, call resize

                                   if ('number' == typeof(iNewW) || 'number' == typeof(iNewH))
                                     {
                                      oThis.resizeTo(iNewW, iNewH);
                                     }

                                   oThis.bgIframe.style.visibility = "visible";
                                   oThis.bgIframe.style.display    = "block";
                                   oThis.bgDiv.style.visibility    = "visible";
                                   oThis.bgDiv.style.display       = "block";

                                   WriteDebugMsg("EXIT", 100, "Vignette.show()");
                                  };



Vignette.prototype.hide = function ()
                                  {
                                   var oThis = this;

                                   oThis.bgIframe.style.visibility = "hidden";
                                   oThis.bgIframe.style.display    = "none";
                                   oThis.bgDiv.style.visibility    = "hidden";
                                   oThis.bgDiv.style.display       = "none";
                                  };



Vignette.prototype.anchor = function (iResizeMode)
                                    {
                                     var oThis = this;


                                     // if no resize-mode passed, use object's current property.

                                     if (iResizeMode && (RESIZE_TYPE.LTOR == iResizeMode || RESIZE_TYPE.RTOL == iResizeMode))
                                       {
                                        oThis.resizeMode = iResizeMode;
                                       }


                                     // otherwise, update object's property AND style.

                                     if (RESIZE_TYPE.RTOL == oThis.resizeMode)
                                       {
                                        oThis.bgIframe.style.right = (Math.floor(getDocumentWidth())
                                                                   - (oThis.mainX + oThis.mainW)) + "px";
                                        oThis.bgIframe.style.left  = "";
                                        oThis.bgDiv.style.right    = (Math.floor(getDocumentWidth())
                                                                   - (oThis.mainX + oThis.mainW)) + "px";
                                        oThis.bgDiv.style.left     = "";
                                       }
                                      else
                                          {
                                           oThis.bgIframe.style.right = "";
                                           oThis.bgIframe.style.left  = oThis.mainX + "px";
                                           oThis.bgDiv.style.right    = "";
                                           oThis.bgDiv.style.left     = oThis.mainX + "px";
                                         }
                                    };



Vignette.prototype.moveTo = function (iNewX, iNewY)
                                    {
                                     var oThis = this;

                                     // if no X or Y are passed, use object's current properties.

                                     if ('number' == typeof(iNewX))
                                       {
                                        oThis.mainX = iNewX;
                                       }

                                     if ('number' == typeof(iNewY))
                                       {
                                        oThis.mainY = iNewY;
                                       }

                                     // otherwise, update object's properties AND style.

                                     oThis.bgIframe.style.left = oThis.mainX + "px";
                                     oThis.bgIframe.style.top  = oThis.mainY + "px";
                                     oThis.bgDiv.style.left    = oThis.mainX + "px";
                                     oThis.bgDiv.style.top     = oThis.mainY + "px";
                                    };



Vignette.prototype.setContent = function (sContent)
                                        {
                                         WriteDebugMsg(
                                                       "CALL",
                                                       100,
                                                       "setContent(" + sContent + ")"
                                                      );

                                         var oThis = this;

                                         oThis.dispDiv.innerHTML = sContent;

                                         WriteDebugMsg("EXIT", 100, "setContent()");
                                        };



Vignette.prototype.remove = function ()
                                    {
                                     var oThis = this;

                                     document.getElementsByTagName("body")[0].removeChild(oThis.bgDiv);
                                     document.getElementsByTagName("body")[0].removeChild(oThis.bgIframe);

                                     delete(oThis.topBorder);
                                     delete(oThis.topEdge);
                                     delete(oThis.topMargin);
                                     delete(oThis.topBegCurve);
                                     delete(oThis.topEndCurve);
                                     delete(oThis.bottomBorder);
                                     delete(oThis.bottomEdge);
                                     delete(oThis.bottomMargin);
                                     delete(oThis.bottomBegCurve);
                                     delete(oThis.bottomEndCurve);

                                     delete(oThis.dispDiv);
                                     delete(oThis.bgDiv);
                                     delete(oThis.bgIframe);
                                     delete(oThis.contentDiv);
                                    };



function Vignette(sBgColor, sBorderColor, iWidth, iHeight, iXPos, iYPos, bDefaultShow)
        {
         WriteDebugMsg(
                       "CALL",
                       100,
                       "Vignette("  +
                       sBgColor     + ", " +
                       sBorderColor + ", " +
                       iWidth       + ", " +
                       iHeight      + ", " +
                       iXPos        + ", " +
                       iYPos        + ")"
                      );

         var oThis = this;


         if ("default" == sBgColor)
           {
            sBgColor = sDfltBgColor;

           }

         if ("default" == sBorderColor)
           {
            sBorderColor = sDfltBorderColor;
           }

         oThis.sBgColor       = sBgColor;
         oThis.sBorderColor   = sBorderColor;

         oThis.mainW          = iWidth;
         oThis.mainH          = iHeight;
         oThis.mainX          = iXPos;
         oThis.mainY          = iYPos;

         oThis.bgIframe       = null;
         oThis.bgDiv          = null;

         oThis.topBorder      = null;
         oThis.topEdge        = null;
         oThis.topMargin      = null;
         oThis.topBegCurve    = null;
         oThis.topEndCurve    = null;

         oThis.bottomBorder   = null;
         oThis.bottomEdge     = null;
         oThis.bottomMargin   = null;
         oThis.bottomBegCurve = null;
         oThis.bottomEndCurve = null;

         oThis.contentDiv     = null;

         oThis.dispDiv        = null;

         oThis.defaultShow    = bDefaultShow;

         oThis.build();

         WriteDebugMsg("EXIT", 100, "Vignette()");
        };

