function ScrollDownMenuController()
{

	// boolean flag to determine whether or not to process next command
	this.enabled = 0;

	// attributes
	this.menu_array = new Array;
	this.selected_item = undefined;
	this.speed = 300;

	// attach methods

	this.toggle = VPSLINKMENUtoggle;
	this.addMenu = VPSLINKMENUaddToArray;
	this.isInArray = VPSLINKMENUisInArray;
	this.selectItem = VPSLINKMENUselectItem;
	this.clearSelection = VPSLINKMENUclearSelection;
	this.display = VPSLINKMENUdisplay;
}

// implementation of controller methods

function VPSLINKMENUtoggle()
{
	if ( this.enabled == 1 ) {
		this.enabled = 0;
	} else {
		this.enabled = 1;
	}
}

function VPSLINKMENUaddToArray(id)
{
	var obj = this;
	obj.menu_array.push(id);
	$("#"+id).hover(
	function()
	{
		obj.selectItem(id);
		obj.display();
	}
	,
	function()
	{
		obj.clearSelection();
		setTimeout("menu_controller.display();", obj.speed+20);
	}
	);
}

function VPSLINKMENUisInArray(id)
{
	for(i in this.menu_array)
	{
		if(this.menu_array[i]==id)
		{
			return true;
		}
	}
	return false;
}
	
function VPSLINKMENUselectItem(id)
{
	if(this.isInArray(id))
	{
		this.selected_item = id;
	}
}

function VPSLINKMENUclearSelection()
{
	this.selected_item = undefined;
}

function VPSLINKMENUdisplay()
{
	if ( this.enabled == 1 ) {
		for(i in this.menu_array)
		{
			$("#"+this.menu_array[i]+"_Content").hide();
		}
		if(typeof this.selected_item != typeof never_ever_defined_var)
		{
			this.toggle();
			$("#"+this.selected_item+"_Content").css("position","absolute");
			$("#"+this.selected_item+"_Content").slideDown(this.speed);
			setTimeout('menu_controller.toggle()', 500);
		}
	}
}