
window.onload = function(){
	setTabClick('nav1','lineup');
	setTabClick('nav2','category');
	setTabClick('nav3','alphabet');
	if(location.hash){
		switch(location.hash){
			case "#lineup":
				showContents('lineup');
				tabFocus('nav1');
				break;
			case "#category":
				showContents('category');
				tabFocus('nav2');
				break;
			case '#alphabet':
				showContents('alphabet');
				tabFocus('nav3');
				break;
			default:
				showContents('lineup');
				tabFocus('nav1');
				break;
		}
	}else {
		showContents('lineup');
		tabFocus('nav1');
	}
//	setTimeout("scrollTop()", 500);
}

function scrollTop(){
	window.scrollTo(0, 0);	
}

function showContents(contentName){
	hide('lineup');
	hide('category');
	hide('alphabet');
	show(contentName);
	chengeTabs(contentName);
}

function chengeTabs(contentName){
	var e = document.getElementById('nav');
	e.className = contentName;
}

function setTabClick(li,div) {
	var e = document.getElementById(li).getElementsByTagName('a')[0];
	
	e.contents = div;
	e.onclick = function(){
		showContents(this.contents);
		tabOutFocus('nav1');
		tabOutFocus('nav2');
		tabOutFocus('nav3');
		tabFocus(li);
		return false;
	};
}

function tabFocus(elementId) {
	var e = document.getElementById(elementId).getElementsByTagName('a')[0];
	e.style.color = "#000000";
	e.onmouseover = function(){
		e.style.color = "#000000";
	};
	e.onmouseout = function(){
		e.style.color = "#000000";
	};
}

function tabOutFocus(elementId) {
	var e = document.getElementById(elementId).getElementsByTagName('a')[0];
	e.style.color = "#B4B4B4";
	e.onmouseover = function(){
		e.style.color = "#000000";
	};
	e.onmouseout = function(){
		e.style.color = "#B4B4B4";
	};
}

function hide(elementId) {
	document.getElementById(elementId).style.display = "none";
}

function show(elementId) {
	document.getElementById(elementId).style.display = "";
}

