function VideoController()
{
	var _div_id = 'video_category_content_';
	var _active = null;
	var _running = false;
	var _categoryDivId = 'category_';
	
	/**
	 * Sets the running status of the effect
	 */
	this.setRunning = function(_val)
	{
		_running = _val;
	};
	
	/**
	 * Gets the running statud of the effect
	 */
	this.getRunning = function()
	{
		return _running;
	};
	
	/**
	 * Sets the active category
	 */
	this.setActive = function(id)
	{
		if( _active == null )
		{
			_active = id;
			var link = document.getElementById('category_link_' + _active);
				link.className = 'category_active';
			var movies = document.getElementById(_div_id+_active);
				movies.style.display = 'block';
			// there are no selected so far, so just fade in new one
		}
		else
		{
			// there is one active. Fade it out first
			this.fadeOut();
			_active = id;
		}
	};
	
	this.displayVideoCategory = function(id)
	{
		if( _active == id )
		{
			return;
		}
		
		this.fadeOut();
		var link = document.getElementById('category_link_'+_active);
			link.className = 'category_inactive';
		
			_active = id;
	};
	
	this.fadeOut = function()
	{
		new Effect.Fade(_div_id+_active, { duration: .25, from: 1, to: 0, queue:{position: 'end', scope: 'menuxscope', limit: 1}, beforeStart: function(){ Controller.setRunning(true); }, afterFinish: function(){ Controller.fadeIn();}  });
	};
	
	this.fadeIn = function()
	{
		//TODO: turn on the active part of the li
		var link = document.getElementById('category_link_' + _active);
			link.className = 'category_active';
		
		new Effect.Appear(_div_id+_active, { duration: .25, from: 0, to: 1, queue:{position: 'end', scope: 'menuxscope', limit: 1}, beforeStart: function(){ Controller.setRunning(true); }, afterFinish: function(){ Controller.setRunning(false);}  });
	};
}