//===========================================================================================/*	ADD A NEW BUTTON TO THE ARRAY	If the array is empty, create it.	If there is indeed an item... (safety precaution)		If there is no link, make it a void so no strange HTML actions appear		Push the item and the link in the array	Note: this function lets you comment-out unused buttons without breaking the array*/function Button(item,link) {	if ( item != undefined | item != "" ) {		if ( link == undefined | link == "" ) { link = "javascript:void()" }		buttonItem.push(item);		buttonLink.push(link);		}	}// ===========================================================================================/* DISPLAY THE TOP MENU BAR	Set the width of the total bar and each link	Define the buttonbar in an array	Create buttons using a function	Give width of bar and width of buttons	Check if all the buttons fit in the given width, otherwise change button size	Set variable to alternate button colours, first button is light blue	Make some HTML code to open the table	Make a loop with as much instances as there are items in the array of buttons		Display the first button with the appropriate class and define the link		Alternate colour variables		Loop untill all buttons are placed	Place the last button to fill the remaining width of the screen and close the table	Note: if you want the barwidth to be set by this script, make sure it isn't set in CSS*/var buttonItem = new Array();var buttonLink = new Array();// DEFINE BUTTONS HERE =============================================Button("HOME","index.html");Button("STORE","http://www.earthacademy.org/store.html");Button("BLOG","http://www.earthacademy.org/blog");Button("FORUMS","http://www.earthacademy.org/forum");Button("ACADEMY","http://www.earthacademy.org/academy.html");Button("DOWNLOADS","http://www.earthacademy.org/downloads.html");Button("CONTACT","http://www.earthacademy.org/contact.html");// =================================================================var totalWidth = 715;var buttonWidth = 99;var checkWidth = (totalWidth - (buttonItem.length * buttonWidth))if (checkWidth < 0) { buttonWidth = totalWidth / buttonItem.length }var darkLight = 0var tdClass = "topdark"document.write("<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr>");for (var tel=0; tel<buttonItem.length; tel++) {	document.write("<td align=center width=",buttonWidth," class=",tdClass," nowrap>")	document.write("<a href=",buttonLink[tel]," class=top target=_parent>",buttonItem[tel],"</a></td>")	if (darkLight==0) { darkLight=1; tdClass="toplight" }	else { darkLight=0; tdClass="topdark" }	}document.write("<td width=",(totalWidth - (buttonItem.length * buttonWidth) - 5)," class=",tdClass," nowrap>&nbsp;</td></tr></table>")	// ===========================================================================================
