


window.onload = function(){

showOrHide("guild rules"); /*shows or hides content*/
setUpNav();
setHeight();

/* in case javascript fails, css within the document will correct the height so that the lengthy amount of information can still be accessed. If javascript does work, it will set the height of the window to accomadate the content shown by the show and hide feature*/

function setHeight(){
	var content= document.getElementById("content");
content.style.height = "800px";

var left= document.getElementById("left");
left.style.height = "800px";

var right= document.getElementById("right");
right.style.height = "800px";

var footer= document.getElementById("footer");
footer.style.top = "800px";
}
	


/*gathers the names of the divs to coordinate with the vale in the a tags*/
function showOrHide(divToShow){
	
	var divName=divToShow.toLowerCase();
	var main=document.getElementById("text");
	var divs=main.getElementsByTagName("div");
	for(var i=0; i<divs.length; i++){
	divs[i].className="hide";
	}
	document.getElementById(divName).className="show";
}



function setUpNav(){
var nav=document.getElementById("subnav");
var links=nav.getElementsByTagName("a");
for(var i=0; i<links.length; i++){
links[i].onclick=function(){
var name=this.firstChild.nodeValue;
showOrHide(name);
return false;
	};
	}
}

}

