function showPageNav() {
	new Effect.Appear('page_nav', { duration:0.3, queue: { position: 'end', scope: 'pageNav', limit: 2 } });
}
function hidePageNav() {
	new Effect.Fade('page_nav', { duration:0.3, queue: { position: 'end', scope: 'pageNav', limit: 1 } });
}

function showComment() {
	new Effect.BlindDown('commentWindow', { duration:0.3, queue: { position: 'end', scope: 'commentWindow', limit: 1 } });
}
function hideComment() {
	new Effect.BlindUp('commentWindow', { duration:0.3, queue: { position: 'end', scope: 'commentWindow', limit: 1 } });
}


function showDiv(id,animLength) {
	new Effect.Appear(id, { duration:animLength, queue: { position: 'end', scope: id, limit: 1 } });
}
function hideDiv(id,animLength) {
	new Effect.Fade(id, { duration:animLength, queue: { position: 'end', scope: id, limit: 1 } });
}



function creditsSelect(id,animLength){
	new Effect.BlindDown(id, { duration:animLength } );
	
	if(id=='crew'){
		new Effect.BlindUp('cast', { duration:animLength } );
		new Effect.BlindUp('extras', { duration:animLength } );
		new Effect.BlindUp('thanks', { duration:animLength } );
	}
	if(id=='cast'){
		new Effect.BlindUp('crew', { duration:animLength } );
		new Effect.BlindUp('extras', { duration:animLength } );
		new Effect.BlindUp('thanks', { duration:animLength } );
	}
	if(id=='extras'){
		new Effect.BlindUp('crew', { duration:animLength } );
		new Effect.BlindUp('cast', { duration:animLength } );
		new Effect.BlindUp('thanks', { duration:animLength } );
	}
	if(id=='thanks'){
		new Effect.BlindUp('crew', { duration:animLength } );
		new Effect.BlindUp('cast', { duration:animLength } );
		new Effect.BlindUp('extras', { duration:animLength } );
	}
	
}





var TextAreaResize = Class.create();
TextAreaResize.prototype = {
  initialize: function( element, options ) {
    element = $( element );
    this.element = element;

    this.options = Object.extend(
      {},
      options || {} );

    Event.observe( this.element, 'keyup',
      this.onKeyUp.bindAsEventListener( this ) );
    this.onKeyUp();
  },

  onKeyUp: function() {
    // We need this variable because "this" changes in the scope of the
    // function below.
    var cols = this.element.cols;

    var linecount = 0;
    $A( this.element.value.split( "\n" ) ).each( function( l ) {
      // We take long lines into account via the cols divide.
      linecount += 1 + Math.floor( l.length / cols );
    } )

    this.element.rows = linecount;
  }
}

