var SliderOut = {

  init: function( contentId ) 
  {
    this.slideoutActive = 0;

    this.slideoutShown = $( contentId ).style;
    this.slideoutShown.xpos = 0;
    this.slideoutShown.left = 0;
    this.show( this.slideoutShown );

    this.slideoutNew = "none";
    this.slideoutNew.xpos = -420;

    this.inited = true;
  },


  slideout: function( whichId ) 
  {
    if( !this.inited ) 
    {
      return;
    }

    var which = $( whichId );
    if( which != null ) 
    {
      which = which.style;
      if ( !this.slideoutActive && this.slideoutShown != which ) 
      {
        this.slideoutActive = 1;
        this.slideoutNew = which;
        this.slideoutNew.xpos = -420;
        this.slideoutLeft();
      }
    }
  },


  slideoutLeft: function() 
  {
    if ( this.slideoutShown.xpos > -420 ) 
    {
      this.slideoutShown.xpos -= 15;
      this.slideoutShown.left = this.slideoutShown.xpos;
      setTimeout( "SliderOut.slideoutLeft()", 30 );
    }
    else 
    {
      this.hide( this.slideoutShown );
      this.show( this.slideoutNew );
      setTimeout( "SliderOut.slideoutRight()", 50 );
    }
  },


  slideoutRight: function() 
  {
    if ( this.slideoutNew.xpos < 0 ) 
    {
      this.slideoutNew.xpos += 15;
      this.slideoutNew.left = this.slideoutNew.xpos;
      setTimeout( "SliderOut.slideoutRight()", 30 );
    }
    else 
    {
      this.slideoutShown = this.slideoutNew;
      this.slideoutActive = 0; // stops the sequence
    }
  },


  show: function( showobj )
  {
    if ( Browser.n ) 
    {
      showobj.visibility = "show";
    }
    else
    if ( Browser.ie ) 
    {
      showobj.visibility = "visible";
    }
  },


  hide: function( hideobj ) 
  {
    if ( Browser.n )
    {
      hideobj.visibility = "hide";
    }
    else
    if ( Browser.ie )
    {
      hideobj.visibility = "hidden";
    }
  }

}
