// JavaScript Document
//the "dynamic" menus are managed by 2 javascript arrays - sub1, sub2
//onclick the values are checkd against the arrays and the appropriate menuitems are hid/unhid(css)
function openSub(sub1){	
	var x;
	for(x in subs1){
		var switch_id = document.getElementById(subs1[x]);
			//if the one i clicked on
			if(subs1[x]==sub1)
				{
						if(switch_id.className == 'show' || switch_id.className == 'static')
						{
							//switch_id.className = 'hide';
						}
						else if(switch_id.className !='static')
						{
							switch_id.className = 'show';

						}
				}
			else //close the rest
				{
					if(switch_id.className != 'static')
					{
						switch_id.className = 'hide';
					}
				}//end if
	}//end for
	/*var y
	for(y in subs2){
		switch_id = document.getElementById(subs2[y]);
		if(switch_id.className != 'static'){
			switch_id.className = 'hide';
		}
	}*/
}//end function

//adds item to array(s)
function addMenuItem(itemId, level)
{
	if(level==1){subs1.push(itemId);}
	else{
		subs2.push(itemId);
	}
}

