
var activeElement = 0;
var activePage = 0;

function _rolloverIn(id)
{
	document.getElementById('roll_'+id).src = img_rollIn.src;
}

function _rolloverOut(id)
{
	document.getElementById('roll_'+id).src = img_rollOut.src;
}

function showSubMenu(id)
{
	//document.getElementById('menu1_'+id).style.backgroundColor = "#E1F0FB";
	//document.getElementById('menu2_'+id).style.backgroundColor = "#E1F0FB";	
	if (document.getElementById('subMenu_'+id))
		document.getElementById('subMenu_'+id).style.display = 'block';
	activeElement = id;
}

function hideSubMenu(id)
{
	//if (activeElement == id || activePage == id ) 
	//	return;
	//document.getElementById('menu1_'+id).style.backgroundColor = "#FFFFFF";
	//document.getElementById('menu2_'+id).style.backgroundColor = "#FFFFFF";

	if (document.getElementById('subMenu_'+id))
		document.getElementById('subMenu_'+id).style.display = 'none';

	activeElement = 0;
}

function goLocation(loc, id, target)
{
	
	if (loc != '')
	{
		if (target == "_blank")
		{
			window.open(loc, "mywindow") 
		}else
		{
			location.href = loc;
			//window.location.replace(location);
		}
		return;
	}
	if (activeElement == 0) 
	{
		showSubMenu(id); 
		return;
	}
		
	if (activeElement == id)
	{
	 	hideSubMenu(id);
		return;
	}
	
	if (activeElement != 0 && activeElement != id)
	{
		hideSubMenu(activeElement);
		showSubMenu(id);
	}
		
}

function SetCurrentPage(id)
{
	activeElement = id;
	activePage = id;
	showSubMenu(id);
	return;
}

function openWindow(url, title)
{
	clientWindow = window.open(url,title,"left=20,top=20,width=450,height=500,toolbar=0,resizable=0");
}
