  var D_WIDTH = 250 ; //final width of frame
  //var COLLAPSE = 5; //column collapse rate
  var COLLAPSE = 250;
  var ELAPSE = 0; //elapse rate given by the timer
  var cWidth = 0 ;
  var dw = -1 ;
  var timerRunning = false ;
  var timerID ;

  var opened = false;

  function slide(forceClosed)
  {

	if ( !opened && !forceClosed )
	{
		if( timerRunning )
		  clearTimeout(timerID) ;
		timerRunning = false ;
		dw = -dw ;
		timerRunning = true ;
		timerID = self.setTimeout( "ping()", ELAPSE ) ;
		
		opened = true;
		
	}
	else if ( forceClosed && opened )
	{
		
		if( timerRunning )
		  clearTimeout(timerID) ;
		timerRunning = false ;
		dw = -dw ;
		timerRunning = true ;
		timerID = self.setTimeout( "ping()", ELAPSE ) ;
		
		opened = false;
	}
	
  }
/*
  function grow()
  {
    dw = 1 ;
    timerRunning = true ;
    timerID = self.setTimeout( "ping()", 10 ) ;
  }
*/

  function ping()
  {
    if( !timerRunning ) return ;
    if( dw < 0 )
    {
      cWidth -= COLLAPSE ;
      if( cWidth <= 0 )
      {
        cWidth = 0 ;
        if( timerRunning )
          clearTimeout(timerID) ;
        timerRunning = false ;
      }
      else
      {
        timerID = self.setTimeout( "ping()", ELAPSE ) ;
      }
      document.getElementById( 'mainSet' ).rows = cWidth + ', *' ;
    }
    else if( dw > 0 )
    {
      cWidth += COLLAPSE ;
      if( cWidth >= D_WIDTH )
      {
        cWidth = D_WIDTH ;
        if( timerRunning )
          clearTimeout(timerID) ;
        timerRunning = false ;
      }
      else
      {
        timerID = self.setTimeout( "ping()", ELAPSE ) ;
      }
      document.getElementById( 'mainSet' ).rows = cWidth + ', *' ;
    }
    else
    {
      if( timerRunning )
        clearTimeout(timerID) ;
      timerRunning = false ;
    }
  }

/*
  function ping()
  {
    if( !timerRunning ) return ;
    if( dw < 0 )
    {
      cWidth -= COLLAPSE ;
      if( cWidth <= 0 )
      {
        cWidth = 0 ;
        if( timerRunning )
          clearTimeout(timerID) ;
        timerRunning = false ;
      }
      else
      {
        timerID = self.setTimeout( "ping()", ELAPSE ) ;
      }
      document.getElementById( 'mainSet' ).cols = cWidth + ', *' ;
    }
    else if( dw > 0 )
    {
      cWidth += COLLAPSE ;
      if( cWidth >= D_WIDTH )
      {
        cWidth = D_WIDTH ;
        if( timerRunning )
          clearTimeout(timerID) ;
        timerRunning = false ;
      }
      else
      {
        timerID = self.setTimeout( "ping()", ELAPSE ) ;
      }
      document.getElementById( 'mainSet' ).cols = cWidth + ', *' ;
    }
    else
    {
      if( timerRunning )
        clearTimeout(timerID) ;
      timerRunning = false ;
    }
  }
*/