// Version : 1.0.0.0
//
// 2006/07/17  檔案初建立, 相容 FireFox 及 Safari 

///////////////////////////////////////////////////////////
// FireFox Compatible
function EinsTooltip_Find_Object_By_ID(pDocument,tagName,theID)
{
   var bIsIE=true;
   var RetObj=null;
   var oObject=null;
   if (document.all!=null)// is IE
   {
      oObject=pDocument.all.tags(tagName);
   }
   else
   {
      if (document.getElementsByTagName!=null) // is FireFox
      {
         oObject=pDocument.getElementsByTagName(tagName);
         bIsIE=false;
      }
   }
   if (oObject!=null)
   {
      var bFind=false;
      for (var i = 0; (i < oObject.length)&&(!bFind); i++)
      {
         if (bIsIE) // for ID
         {
            if (oObject(i).id==theID)
            {
               bFind=true;
               RetObj=oObject(i);
            }
         }
         else // for FireFox 
         {
            if (oObject[i].id==theID)
            {
               bFind=true;
               RetObj=oObject[i];
            }
         }
      }
   }
   return RetObj;
}


function EinsShowtip(current,e,text)
{
   // position of the tooltip relative to the mouse in pixel //
   var offsetx = 12;
   var offsety =  8;
   var theTipDiv=EinsTooltip_Find_Object_By_ID(document,"DIV","EintandTooltipDIV");
   if (theTipDiv==null)
   {
      theTipDiv=document.createElement('div');
      theTipDiv.setAttribute('id', 'EintandTooltipDIV');
      theTipDiv.style.display='none';
      theTipDiv.style.position='absolute';
      if (document.all!=null)// is IE
      {
         theTipDiv.style.backgroundColor='infobackground';
      }
      else
      {
         theTipDiv.style.backgroundColor='#f9f9f9';
      }
      theTipDiv.style.border='1px solid #eee';
      theTipDiv.style.fontSize="smaller";
      theTipDiv.innerHTML = '&nbsp;';
      document.body.appendChild(theTipDiv);
   }
   var x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
   var y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
   theTipDiv.innerHTML=text;
   theTipDiv.style.display = 'block';
   theTipDiv.style.left = x+offsetx+'px';
   theTipDiv.style.top 	= y+offsety+'px';
}

function EinsHidetip()
{
   var theTipDiv=EinsTooltip_Find_Object_By_ID(document,"DIV","EintandTooltipDIV");
   if (theTipDiv!=null)
   {
      theTipDiv.style.display = "none";
   }
}

