//SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
//Actually, it lies.  You do need to edit this if you want to add more buttons, one entry per.  It should make sense without further explanation.
subInfo = new Array();
subInfo[1] = new Array();
subInfo[2] = new Array();
subInfo[3] = new Array();
subInfo[4] = new Array();
subInfo[5] = new Array();
subInfo[6] = new Array();
subInfo[7] = new Array();
subInfo[8] = new Array();
subInfo[9] = new Array();
subInfo[10] = new Array();

//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
//Basically, these set the submenus.  The first number after subInfo is the button it goes with; the second is the entry number.
//After that, it's text to be displayed, the page it links to (full url or relative linking both okay), and lastly, the target (leave blank without frames)
//subInfo[X][X] = new Array("name on menu","link.shtml","");
//subInfo[][] = new Array("","","");


subInfo[1][1] = new Array("Starting a world","start.shtml","");
subInfo[1][2] = new Array("Cookies","cookies.shtml","");
subInfo[1][3] = new Array("Shops","shops.shtml","");
subInfo[1][4] = new Array("Classes","classes.shtml","");
subInfo[1][5] = new Array("Security","security.shtml","");
subInfo[1][6] = new Array("Music","music.shtml","");
subInfo[1][7] = new Array("Maps","maps.shtml","");
subInfo[1][8] = new Array("Actors","actors.shtml","");
subInfo[1][9] = new Array("Other","other.shtml","");
subInfo[1][10] = new Array("FAQ","faq.shtml","");
subInfo[1][11] = new Array("<b>Command List</b>","http://www.synthetic-reality.com/wosquest.htm","");
subInfo[1][12] = new Array("Samsyn's advice","http://www.synthetic-reality.com/wosDev0.htm","");
subInfo[1][13] = new Array("Stock Cookie List","http://www.synthetic-reality.com/wosCookies.htm","");
subInfo[1][14] = new Array("Turnabout (from Arcadia)","turnabout.shtml","");


subInfo[2][1] = new Array("SoV WoS","wos.shtml","");
subInfo[2][2] = new Array("WoS Review","review.shtml","");
subInfo[2][3] = new Array("WoS FAQ","faq2.shtml","");
subInfo[2][4] = new Array("Other Worlds","worlds.shtml","");
subInfo[2][5] = new Array("Pking Guide","pk.shtml","");
subInfo[2][6] = new Array("Skinning Tutorials","skins.shtml","");
subInfo[2][7] = new Array("Evergreen Walkthrough","evergreen.shtml","");
subInfo[2][8] = new Array("Evergreen Secrets","secrets.shtml","");
subInfo[2][9] = new Array("World Development","world.shtml","");


subInfo[3][1] = new Array("Empyrion","empyrion.shtml","");
subInfo[3][2] = new Array("TurnAbout","turnabout.shtml","");
subInfo[3][3] = new Array("Collaboration","collaboration.shtml","");


subInfo[4][1] = new Array("SoV Gunz","gunz.shtml","");
subInfo[4][2] = new Array("E-Style Guide","e-style.shtml","");
subInfo[4][3] = new Array("K-Style Guide","k-style.shtml","");
subInfo[4][4] = new Array("D-Style Guide","d-style.shtml","");
subInfo[4][5] = new Array("T-Style Guide","t-style.shtml","");
subInfo[4][6] = new Array("Gladiator Guide","gladiator.shtml","");
subInfo[4][7] = new Array("Quest Guide","quest.shtml","");


subInfo[5][1] = new Array("SoV Gunbound","gunbound.shtml","");
subInfo[5][2] = new Array("Mobile Guide","mobiles.shtml","");
subInfo[5][3] = new Array("Tactics Guide","tactics.shtml","");


subInfo[6][1] = new Array("F'Nok Art Gallery","nok.shtml","");
subInfo[6][2] = new Array("Cards Gallery","cards.shtml","");
subInfo[6][3] = new Array("Gnosis Gallery","gnosis.shtml","");
subInfo[6][4] = new Array("Cosmos Gallery","cosmos.shtml","");
subInfo[6][5] = new Array("Insomnia Gallery","insomnia.shtml","");
subInfo[6][6] = new Array("Collaboration","collaboration.shtml","");


subInfo[7][1] = new Array("Book of F'Nok","book_nok.shtml","");
subInfo[7][2] = new Array("Book of K.A.I.N","book_kain.shtml","");
subInfo[7][3] = new Array("Book of Ian","book_ian.shtml","");
subInfo[7][4] = new Array("Book of Zao","book_zao.shtml","");
subInfo[7][5] = new Array("Book of Pelsaert","book_pelsaert.shtml","");
subInfo[7][6] = new Array("Book of Coeus","book_coeus.shtml","");
subInfo[7][7] = new Array("Book of Ivy","book_ivy.shtml","");
subInfo[7][8] = new Array("Book of Sekuna","book_sekuna.shtml","");
subInfo[7][9] = new Array("Book of Minkor","book_minkor.shtml","");
subInfo[7][10] = new Array("Book of SirMj","book_sirmj.shtml","");
subInfo[7][11] = new Array("Book of Charon","book_charon.shtml","");
subInfo[7][12] = new Array("Book of Flamelord","book_flamelord.shtml","");
subInfo[7][13] = new Array("Book of Kione","book_kione.shtml","");


subInfo[8][1] = new Array("SoV Guild Wars","guildwars.shtml","");
subInfo[8][2] = new Array("Beginner's Guide","gw_beginners.shtml","");
subInfo[8][3] = new Array("Titles Guide","titles.shtml","");


subInfo[9][1] = new Array("SoV XBox Live","xboxlive.shtml","");
subInfo[9][2] = new Array("Call of Duty 4 Kit Guide","cod4.shtml","");

subInfo[10][1] = new Array("Panda Cake","panda.shtml","");




//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = 128;
var ySubOffset = -3;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub = false;
var delay = 1300;
totalButtons = 10;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '" class="dropmenu" ');
		document.write('onMouseOver="overSub=true;"');
		document.write('onMouseOut="overSub=false;"');
		document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);');


		document.write('<ul>');
		for ( k=0; k<subInfo[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo[x+1][k+1][2] + '">');
			document.write( subInfo[x+1][k+1][0] + '</a>');
			document.write('</li>');
		}
		document.write('</ul>');
	}
	document.write('</div>');
}


//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft(id) { 
	var el = getElement(id);
	if (el) { 
		xPos = el.offsetLeft;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
			tempEl = tempEl.offsetParent;
		} 
		return xPos;
	} 
} 

// GET Y COORDINATE
function getRealTop(id) {
	var el = getElement(id);
	if (el) { 
		yPos = el.offsetTop;
		tempEl = el.offsetParent;
		while (tempEl != null) {
			yPos += tempEl.offsetTop;
			tempEl = tempEl.offsetParent;
		}
		return yPos;
	}
}

// MOVE OBJECT TO COORDINATE
function moveObjectTo(objectID,x,y) {
	var el = getElement(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu(subID, buttonID) {
	hideAllSubMenus();
	butX = getRealLeft(buttonID);
	butY = getRealTop(buttonID);
	moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus() {
	for ( x=0; x<totalButtons; x++) {
		moveObjectTo("submenu" + (x+1) + "",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu(subID) {
	if ( overSub == false ) {
		moveObjectTo(subID,-500, -500);
	}
}



//preload();

