if( ! csw )
{
  var csw = new Object();
}

csw.TopMenuClass = function()
{
  this.m_LastDisplayedItemId = null;
  this.showItem = function( id )
  {
    if( this.m_LastDisplayedItemId )
    {
      this.hideItem( this.m_LastDisplayedItemId );
    }

    var div;
    
    div = $(id);
    if( div )
    {
      var leftPosition;
      
      this.m_LastDisplayedItemId = id;
      div.absolutize();
      //alert( $( id + '_LeftPosition' ).getWidth() );
      div.style.width = 'auto';
      div.style.height='auto';

      leftPosition = $( id + '_LeftPosition' ).cumulativeOffset();
      //if( $( id + '_LeftPosition' ).getWidth() > div.getWidth() )
      //{
      //	div.style.width = $( id + '_LeftPosition' ).getWidth() + 'px';
      //}
      div.style.left = leftPosition[0] + 'px';
      div.style.top = ( leftPosition[1] + $( id + '_LeftPosition' ).getHeight() ) + 'px';
    }
  }

  this.hideItem = function( id )
  {
    var div;

    div = $(id);
    if( div )
    {
      div.style.width='0px';
      div.style.height='0px';
    }
  }
}

csw.TopMenu = new csw.TopMenuClass();


