var sections = new Array('1960', '1970', '1980', '1990', '2000', '2016');
var navitems = new Array();
var activeSection = "";

function initHistory()
{
	for(i = 0; i < sections.length; i++)
	{
			
		navitems[sections[i]] = new Object({
			nav : document.getElementById('nav'+sections[i]),
			text : document.getElementById('text'+sections[i]),
			image : document.getElementById('image'+sections[i])
		});
		
		
	}
}

function showHistory(id)
{
	if(id != activeSection)
	{	
		for(i = 0; i < sections.length; i++)
		{
			var section = sections[i];
			if(section == id)
			{
				switchOn(this.navitems[section]);
				
			}
			else if(section == activeSection)
			{
				switchOff(this.navitems[activeSection]);
			}
		}
		activeSection = id;
	}
}

function switchOn(obj)
{
	obj.nav.className += "_on";
	obj.text.style.display = "block";
	obj.image.style.display = "block";
	
	
}


function switchOff(obj)
{
	var clsName = obj.nav.className;
	clsName = clsName.substr(0, clsName.length - 3);
	//alert(clsName);
	obj.nav.className = clsName;
	obj.text.style.display = "none";
	obj.image.style.display = "none";
	
}
