var div_Item='main';
var old_Item='main';
var old_sub='';
var NULL=-1;

function SetLine(id){document.getElementById(id+'_img').src = '../images/Line.jpg';}

function ClrLine(id){document.getElementById(id+'_img').src = '../images/noLine.gif';}

function HideMenue(id){
document.getElementById(id+'_img').src = '../images/closed.gif';
document.getElementById(id).style.display = 'none';}

function SelItem(id)
{
	var i=0;
	var img = id + '_img';

	if ((document.getElementById(img).src.search('noLine')!=NULL) | (document.getElementById(img).src.search('closed')!=NULL))
	{
		ClrLine(old_Item);
		SetLine(id);
				
		switch (id.substr(0,4))
		{
			case 'sub_':
			{
				if (old_sub)HideMenue(old_sub);
				parent['main'].location.href = id+".htm";
				document.getElementById(id).style.display = 'inline';
				SetLine(id);
				old_sub=id;
				old_Item=id;
			}
			break;
			case 'ite_':
			{
				parent['main'].location.href = id.replace('ite_','')+".htm";
				old_Item=id;
			}
			break;
			default:
			{
				if (old_sub)HideMenue(old_sub);
				parent['main'].location.href = id+".htm";
				old_sub='';
				old_Item=id;
			}
			break;
		}
	}
	else
	{		
		switch (id.substr(0,4))	
		{
			case 'sub_': 
			{
				if (document.getElementById(img).src.search('open')!=NULL) 
				{
					HideMenue(id);
					old_sub='';
				}
			}
			break;
		}
	}
	i++;
}
