var supported = (document.all || (document.getElementById && !window.opera));
function hide(){
	var subNav = document.getElementById('menu');
	for (var i=0;i<subNav.getElementsByTagName('span').length;i++){
	if(subNav.getElementsByTagName('span')[i].id != '')
		subNav.getElementsByTagName('span')[i].style.display='none';
	}
}

function block(i){
	if(!supported)return;
	var x = document.getElementById(i);
	with(x.style)
	{
	display == 'none' ? display = 'block' : display = 'none';
	}
	getIt();
}

function getIt()
{
	var status = new Object;
	var menu = document.getElementById('menu');	
	var spans = menu.getElementsByTagName('span');
	for(i=0;i<spans.length;i++){
	var allids = spans[i].id;
	if(allids){
	status[allids] = spans[i].style.display;
	document.cookie = allids+'='+status[allids];
		}
	}
}

function setProp(id,value) 
{
	var styleObj = document.getElementById(id); 
	if(styleObj != null)
	{
	styleObj.style.display = value;
	}
}

function assignCookie()
{
	if(!document.cookie || document.cookie == ' ')
	{
	var menu = document.getElementById('menu');
	var span = menu.getElementsByTagName('span');
	for(i=0;i<span.length;i++)
	{
		var ids = span[i].id;
		if(ids)
		{
			var styles = span[i].style.display;
			setProp(ids,styles);
			}
		}
	}else if(document.cookie && document.cookie != ' ')
	{
		var allCookies = document.cookie;
		var cookies = allCookies.split('; ');
		for(var j=0;j<cookies.length;j++)					
	{
		var values = cookies[j].split('=');
		var idc = values[0];
		var stl = values[1];
		setProp(idc,stl);
		}
	}
}
window.onload = function(){hide();assignCookie();}