
var PopUp,PopPic,PopText,PopFrame,TimeOut ;
var FrameBuffer = new Array() ;

function showPopUpPic( element,TheURL,TheText,ID )
{
  if( PopUp  = document.getElementById( 'PicPopUp'+ID ) )
  {
    if( TheURL )
    {
      PopPic  = document.getElementById( 'PopUpPic'+ID ) ;
      if( PopPic ) PopPic.src = TheURL ;
      else if( PopFrame = document.getElementById( 'FramePopUp'+ID ) )
      {
        PopFrame.innerHTML = 0 ;
        PopFrame.src = TheURL ;
      }
    }
    if( TheText )
    {
      PopText = document.getElementById( 'PopUpText'+ID ) ;
      if( PopText )
      {
        if( PopText.innerHTML ) PopText.innerHTML = TheText ;
        else PopText.firstChild.nodeValue = TheText ;
      }
    }
    element.style.position = 'relative' ;
    element.appendChild( PopUp ) ;
    PopUp.style.position = 'absolute' ;
    window.clearTimeout( TimeOut ) ;
    TimeOut = window.setTimeout( "showPopUp()",300 ) ;
  }
}

function showPopUp()
{
  if( (PopPic && PopPic.complete) || (PopFrame && PopFrame.innerHTML) )
  {
    PopUp.style.display = 'block' ;
    
  }
  else TimeOut = window.setTimeout( "showPopUp()",200 ) ;
}

function hidePopUpPic( ID )
{
  window.clearTimeout( TimeOut ) ;
  if( PopPic = document.getElementById('PicPopUp'+ID) ) PopPic.style.display = 'none';
}