﻿// JScript File

function ToggleMenu(itemName,itemDataMe)
{
	var elm = document.getElementById(itemName);
	//document.getElementById(this).bgColor='#FFFF00';
	var i,others = document.getElementById('SectionMenu');
	
	for(i=0; i < others.childNodes.length; i++)
	{
		var other = others.childNodes[i];
		
		for(j=0; j < other.childNodes.length; j++)
		{
		//if ((other.className == 'MenuGroup') && (other != elm)) other.style.Color='#000000';
		    var other1=other.childNodes[j];
		    if (other1.className == 'MenuSubCat')
		        //other1.style.backgroundColor='#f8f48b';
		        other1.style.backgroundImage='url('+'Images/SUBCATX.GIF'+')';
		        
		    if ((other1.className == 'MenuGroup') && (other1 != elm)) 
		        {
		            other1.style.display='none';
		         //   other1.style.bgColor='#f8f48b';
		            
		            other1.style.backgroundImage ='url('+'Images/SUBCATX.GIF'+')';
		         }
		//alert other.others.childNodes[i].Id
		//if ((other.className == 'MenuSubCat' || other.className == 'MenuSubCatSum') && (other != document.getElementById(itemDataMe))) other.style.backgroundColor='#1780BD';
		}
	}
	if (elm.style.display == 'block') elm.style.display='none';
	else elm.style.display='block';
	document.getElementById(itemDataMe).style.backgroundImage ='url('+'Images/SUBCAT1X.GIF'+')';
	//document.getElementById(itemDataMe).style.bgColor='#000000'
	//window.location.href=linkID;
	//return false;
}
function ToggleTitleMenu(itemName,itemDataMe)
{
	var elm = document.getElementById(itemName);
	var elm1 = document.getElementById(itemDataMe);
	//document.getElementById(this).bgColor='#FFFF00';
	var i,others = document.getElementById('SectionMenu');
	//elm1.style.backgroundColor='#FF0000';
	
	for(i=0; i < others.childNodes.length; i++)
	{
		var other = others.childNodes[i];
		if ((other.className == 'TitleMenuGroup') && (other != elm)) other.style.display='none';
		if ((other.className == 'MenuCat') && (other != elm1)) 
		{
		    other.style.backgroundColor='#0A2975';
		   // other.style.color='#ffffff';
		 }
		//if ((other.className == 'MenuCat') && (other != document.getElementById(itemDataMe))) other.style.backgroundColor='#1780BD';
	}
	ToggleMenuTC(itemName,itemDataMe);
	if (elm.style.display == 'block') elm.style.display='none';
	else elm.style.display='block';
	
	//window.location.href=linkID;
	//return false;
}
function ToggleMenuTC(itemName,itemDataMe)
{
	var elm = document.getElementById(itemName);
	var elm1 = document.getElementById(itemDataMe);
	//document.getElementById(this).bgColor='#FFFF00';
	var i,others = document.getElementById('SectionMenu1');
	//elm1.style.backgroundColor='#FF0000';
	
	for(i=0; i < others.childNodes.length; i++)
	{
		var other = others.childNodes[i];
		if ((other.className == 'TitleMenuGroup') && (other != elm)) other.style.display='none';
		if ((other.className == 'MenuCat') && (other != elm1)) 
		{
		    other.style.backgroundColor='#0A2975';
		   // other.style.color='#ffffff';
		 }
		//if ((other.className == 'MenuCat') && (other != document.getElementById(itemDataMe))) other.style.backgroundColor='#1780BD';
	}
	
}
function OpenMenuItem(subCat,section)
{
	var i,menuelms = document.getElementBy
	Id('SectionMenu');
	for(i=0; i < menuelms.childNodes.length; i++)
	{
		var menuelm = menuelms.childNodes[i];
		if ((menuelm.className == 'MenuGroup') && (menuelm.id == 'SubCat'+subCat.toString()))
		{
			menuelm.style.display = 'block';
			for(j=0; j < menuelm.childNodes.length; j++)
			{
				var subelm = menuelm.childNodes[j];
				if ((subelm.className == 'MI') && (subelm.id == 'Section'+section.toString()))
				{
					subelm.style.backgroundColor='#BBEEFB';
					subelm.firstChild.style.backgroundColor='#BBEEFB';
					break;
				}
			}
			break;
		}
	}
	//return false;
}
