// JavaScript Document

//Set a global variable to store the current class of the button object.
var passed_class;

//Function that sets a new class on roll over.
function button_over(passed) {
	//alert(passed.className)
	if(passed.className == 'button_normal')
	{
		//window.passed_class = passed.className;				//Set the passed calls to the global variable.
		passed.className = 'button_over';				//Set the over class to the button to update its state.
	}
}

//Function that sets the old class back on rollout.
function button_out(passed)
{
	//alert(passed.className)
	if(passed.className == 'button_over')
	{
		passed.className = 'button_normal';
	}
	else if(passed.className != 'button_active')
	{
		
	}
	
	
	/*if (window.passed_class=='button_active') {			//Check what class was applied originally (set in global variable).
		passed.className = 'button_active';				//Apply it back again on rollout.
	}
	else if (window.passed_class=='button_normal') {	//Check what class was applied originally (set in global variable).
		passed.className = 'button_normal';				//Apply it back again on rollout.
	}
	else if (window.passed_class=='button_over') {	//Check what class was applied originally (set in global variable).
		passed.className = 'button_normal';				//Apply it back again on rollout.
	}*/
}

function change_me(passed)
{
	var menu = $('#menu_system').children();
	//alert(menu.length);
	for ( var i = 0; i < menu.length; i++ ) {
		
		if(menu[i].id == passed.id)
		{
			//$(menu[i]).addClass('button_active');
		}
		else
		{
			$(menu[i]).addClass('button_normal');
		}
	}
	
	//alert(passed.className)
}