<!--
/********************************************************************************************************
Pop window Script file: popscript.js
********************************************************************************************************/
var popText = "";
var popPosition = "center";

skn=eval(document.getElementById("topdeck").style);
document.onmousemove = get_mouse;

/*************************************************************************************************
 Function pop:
    popMsg         : Message to be displayed in pop window
    popTitle       : Title of pop window. If popTitle = "" : no title displayed
    popWidth       : Width of pop window in px. If popWidth = "" : Width is automatically adjusted
    popBorderSize  : Size of the pop window border. Default is 1.
    popBorderMargin: Margin size of the pop window. Default is 1.
    popBorderColor : Color of the pop border window. If popBorderColor = '0' then no border. Default
                     is #000000 (black).
    popBack        : color of the pop window background. Default is #FFFFC0 (yellow).
    align          : position of the pop window. could be: left, right, center, left_up, right_up,
                     center_up. Default is center.
**************************************************************************************************/

function pop(popMsg,popTitle,popWidth,popBorderSize,popBorderMargin,popBorderColor,popBack,align) 
  {
   if (align == "") align = "center";
   if (popBack == "") popBack = "FFFFC0";
   if (popBorderColor == "") popBorderColor = "000000";
   if (popBorderMargin == "") popBorderMargin = "1";
   if (popBorderSize == "") popBorderSize = "1";

   popText = popMsg
   popPosition = align
   popTitleHtml = "";
   popWidthHtml = "";
   popBorderColorHtml = "";
   
   if (popBorderColor !="0") popBorderColorHtml = "BGCOLOR=#" + popBorderColor;
   if (popWidth !="") popWidthHtml = "WIDTH=" + popWidth;
   if (popTitle !="") popTitleHtml = '<TR><TD CLASS="popTitleFont"><CENTER><B>'+ popTitle +'</B></CENTER></TD></TR>';
   var popContent ='<TABLE ' +popWidthHtml+' BORDER=0 CELLPADDING=' + popBorderSize + ' CELLSPACING=0 '+ popBorderColorHtml+'><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0>'+ popTitleHtml +'</TABLE><TABLE WIDTH=100% BORDER=0 CELLPADDING=' + popBorderMargin +' CELLSPACING=0 BGCOLOR=#'+popBack+'><TR><TD CLASS="popMsgFont"><CENTER>'+popMsg+'</CENTER></TD></TR></TABLE></TD></TR></TABLE>';
 
   document.getElementById("topdeck").innerHTML = popContent;
   skn.visibility = "visible";
  }

function get_mouse(e) 
  {
   switch(popPosition)
     {
      case "center":
        offsetLeft = 4 * popText.length/2;
        if (popText.length > 30) offsetLeft = 5 * popText.length/2;
        offsetTop = 0;        
        break;
      case "center_up":
        offsetLeft = 4 * popText.length/2;
        if (popText.length > 30) offsetLeft = 6 * popText.length/2;
        offsetTop = 50;
        break;
      case "left":
        offsetLeft = 6 * popText.length;
        offsetTop = 0;        
        break;
      case "left_up":
        offsetLeft = 6 * popText.length;
        offsetTop = 50;
        break;        
      case "right":
        offsetLeft = 0;
        offsetTop = 0;        
        break;
      case "right_up":
        offsetLeft = 0;
        offsetTop = 50;        
        break;
     }

  var posx = 0; var posy = 0;
  if (!e) var e = window.event;
  if (e.pageX || e.pageY)
    {
     posx = e.pageX; posy = e.pageY;
    }
  else if (e.clientX || e.clientY)
    {
     posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
     posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
    }

   skn.left = posx - offsetLeft +  "px";
   skn.top  = posy + 20 - offsetTop + "px";
  }

function kill() 
  {
   if (skn) skn.visibility = "hidden";
  }
//-->