﻿function addLoadEvent(func){
	var oldonload = window.onload;
	if(typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}


function initialhide(){
	hide("startup");
	hide("thinking");
	hide("already");
}

function hide(section){

	var sectionText = section + "-text";
	
	if (!document.getElementById) return false;
	if (section!="initial") {if (!document.getElementById(section)) return false;}
	if (!document.getElementById(sectionText)) return false;

	if (section!="initial") {document.getElementById(section).className="normal";}
	document.getElementById(sectionText).style.display="none";

}

function show(section){

	var sectionText = section + "-text";
	
	if (!document.getElementById) return false;
	if (section!="initial") {if (!document.getElementById(section)) return false;}
	if (!document.getElementById(sectionText)) return false;

	if (section!="initial") {document.getElementById(section).className="selected";}
	document.getElementById(sectionText).style.display="block";
}

addLoadEvent(initialhide);