﻿var Timer;
var LastShowed;
var LastMain;

function getObject( obj ) {

  // step 1
  if ( document.getElementById ) {
    obj = document.getElementById( obj );

  // step 2
  } else if ( document.all ) {
    obj = document.all.item( obj );

  //step 3
  } else {
    obj = null;
  }

  //step 4
  return obj;
  }
  
  ////////////////////////////////////////////////////////////
  
  function displayObject( obj, show ) {

  // step 1
  obj = getObject( obj );
  if (obj==null) return;

  // step 2
  obj.style.display = show ? 'block' : 'none';
  obj.style.visibility = show ? 'visible' : 'hidden';
  
  }
  
function ShowMain( obj ) {

if (LastMain !=null) displayObject(LastMain,false);

displayObject( obj, true );
LastMain=obj;
LastShowed=obj;
window.clearTimeout(Timer);
}//function
  
function Show( obj,Container ) {

if ( obj==Container ) {
    window.clearTimeout(Timer);
    return;
    }
    
if (Container==LastShowed)
    {
    displayObject( obj, true );
    LastShowed=obj;
    window.clearTimeout(Timer);
    //alert(obj+' '+Container+' '+LastShowed);
    } else
    {
    //alert(obj+' '+Container+' '+LastShowed);
    window.clearTimeout(Timer);
    displayObject( LastShowed, false );
    LastShowed=obj;
    displayObject( obj, true );
    }    

}//function

function Hide( obj ) {
//if (obj!=LastShowed)return;
Timer=window.setTimeout('displayObject(\''+ obj+'\' )',1000); 

}//function
