/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("button1up.png","button2up.png","button3up.png","button4up.png","button5up.png","button6up.png","button7up.png","button8up.png","button9up.png","button10up.png","button11up.png","button12up.png","button13up.png","button14up.png","button15up.png","button16up.png");

overSources = new Array("button1over.png","button2over.png","button3over.png","button4over.png","button5over.png","button6over.png","button7over.png","button8over.png","button9over.png","button10over.png","button11over.png","button12over.png","button13over.png","button14over.png","button15over.png","button16over.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
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();
subInfo[11] = new Array();
subInfo[12] = new Array();
subInfo[13] = new Array();
subInfo[14] = new Array();
subInfo[15] = new Array();
subInfo[16] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//

subInfo[2][1] = new Array("Accommodatie","http://www.nec92.com/NEC92/clubinfo/clubinfo-accommodatie.html","main");
subInfo[2][2] = new Array("Bestuur","http://www.nec92.com/NEC92/clubinfo/clubinfo-bestuur.html","main");
subInfo[2][3] = new Array("Historie","http://www.nec92.com/NEC92/historie.html","main");
subInfo[2][4] = new Array("Clublied","http://www.nec92.com/NEC92/clubinfo/clubinfo-clublied.html","main");
subInfo[2][5] = new Array("Contributie","http://www.nec92.com/NEC92/clubinfo/clubinfo-contributie.html","main");
subInfo[2][6] = new Array("Statuten","http://www.nec92.com/NEC92/statuten.html","main");
subInfo[2][7] = new Array("Routebeschrijving","http://www.nec92.com/NEC92/clubinfo/clubinfo-wegwijs.html","main");
subInfo[2][8] = new Array("Kantine","http://www.nec92.com/NEC92/kantine.htm","main");
subInfo[2][9] = new Array("Contact","mailto:info@nec92.com","main");


subInfo[3][1] = new Array("N.E.C.92 1","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0512%20Mannen%20%20Zondag%20standaard&LevelDescription=4e%20klasse&CompetitionType=0512&ClassLevel=14&RegionCode=KNVB-DISTRICT-ZUID2&Pool=4B&TeamDescription=1","main");
subInfo[3][2] = new Array("N.E.C.92 2","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0518%20Mannen%20%20Zondag%20reserve&LevelDescription=4e%20klasse&CompetitionType=0518&ClassLevel=14&RegionCode=KNVB-DISTRICT-ZUID2&Pool=4C&TeamDescription=2","main");
subInfo[3][3] = new Array("N.E.C.92 3","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0518%20Mannen%20%20Zondag%20reserve&LevelDescription=4e%20klasse&CompetitionType=0518&ClassLevel=14&RegionCode=KNVB-DISTRICT-ZUID2&Pool=4B&TeamDescription=3","main");
subInfo[3][4] = new Array("N.E.C.92 4","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0519%20Mannen%20%20Zondag%20reserve&LevelDescription=6e%20klasse&CompetitionType=0519&ClassLevel=16&RegionCode=KNVB-DISTRICT-ZUID2&Pool=608&TeamDescription=4","main");
subInfo[3][5] = new Array("N.E.C.92 5","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0519%20Mannen%20%20Zondag%20reserve&LevelDescription=6e%20klasse&CompetitionType=0519&ClassLevel=16&RegionCode=KNVB-DISTRICT-ZUID2&Pool=609&TeamDescription=5","main");
subInfo[3][6] = new Array("Alle uitslagen","http://www.nec92.com/NEC92/competitie-uitslagen0607.html","main");
subInfo[3][7] = new Array("N.E.C.92 B1","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0235%20B-Junioren%20(najaar)&LevelDescription=3e%20klasse&CompetitionType=0235&ClassLevel=13&RegionCode=KNVB-DISTRICT-ZUID2&Pool=B21&TeamDescription=B1","main");
subInfo[3][8] = new Array("N.E.C.92 C1","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0245%20C-Junioren%20(najaar)&LevelDescription=3e%20klasse&CompetitionType=0245&ClassLevel=13&RegionCode=KNVB-DISTRICT-ZUID2&Pool=C29&TeamDescription=C1","main");
subInfo[3][9] = new Array("N.E.C.92 D1","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0255%20D-Pupillen%20(najaar)&LevelDescription=2e%20klasse&CompetitionType=0255&ClassLevel=12&RegionCode=KNVB-DISTRICT-ZUID2&Pool=502&TeamDescription=D1","main");
subInfo[3][10] = new Array("N.E.C.92 E1","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0265%20E-Pupillen%20(najaar)&LevelDescription=2e%20klasse&CompetitionType=0265&ClassLevel=12&RegionCode=KNVB-DISTRICT-ZUID2&Pool=503&TeamDescription=E1","main");
subInfo[3][11] = new Array("N.E.C.92 E2","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0265%20E-Pupillen%20(najaar)&LevelDescription=2e%20klasse&CompetitionType=0265&ClassLevel=12&RegionCode=KNVB-DISTRICT-ZUID2&Pool=506&TeamDescription=E2","main");
subInfo[3][12] = new Array("N.E.C.92 F1","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0275%20F-Pupillen%20(najaar)&LevelDescription=2e%20klasse&CompetitionType=0275&ClassLevel=12&RegionCode=KNVB-DISTRICT-ZUID2&Pool=502&TeamDescription=F1","main");
subInfo[3][13] = new Array("N.E.C.92 F2","http://www.knvb.nl/clubs_comp/?action=teamDetails&ClubName=NECī92&NotationDescription=0275%20F-Pupillen%20(najaar)&LevelDescription=2e%20klasse&CompetitionType=0275&ClassLevel=12&RegionCode=KNVB-DISTRICT-ZUID2&Pool=504&TeamDescription=F2","main");


subInfo[4][1] = new Array("N.E.C.92 1","http://www.nec92.com/NEC92/elftal-1.html","main");
subInfo[4][2] = new Array("N.E.C.92 2","http://www.nec92.com/NEC92/elftal-2.html","main");
subInfo[4][3] = new Array("N.E.C.92 3","http://www.nec92.com/NEC92/elftal-3.html","main");
subInfo[4][4] = new Array("N.E.C.92 4","http://www.nec92.com/NEC92/elftal-4.html","main");
subInfo[4][5] = new Array("N.E.C.92 5","http://www.nec92.com/NEC92/elftal-5.html","main");


subInfo[6][1] = new Array("Deze week","http://www.knvb.nl/clubs_comp/?action=clubWeekProgram&ClubName=NECī92&AccommodationName=HEERLEN&ClubIdentifier=BBJV16A","main");
subInfo[6][2] = new Array("Volgende week","http://www.knvb.nl/clubs_comp/?action=clubWeekProgram&ClubName=NECī92&AccommodationName=HEERLEN&ClubIdentifier=BBJV16A&nextWeek=1","main");
subInfo[6][3] = new Array("Afgelasting","http://www.nec92.com/NEC92/afgelastingen.htm","main");
subInfo[6][4] = new Array("Oefenwedstrijden","http://www.nec92.com/NEC92/programma3.html","main");




subInfo[8][1] = new Array("Kalender","http://www.nec92.com/NEC92/activiteiten-kalender.html","main");
subInfo[8][2] = new Array("Verslagen 03/04","http://www.nec92.com/NEC92/activiteiten-verslagen2004.html","main");
subInfo[8][3] = new Array("Verslagen 04/05","http://www.nec92.com/NEC92/activiteiten-verslagen2005.html","main");
subInfo[8][4] = new Array("Verslagen 05/06","http://www.nec92.com/NEC92/activiteiten-verslagen2006.html","main");
subInfo[8][5] = new Array("Verslagen 06/07","http://www.nec92.com/NEC92/activiteiten-verslagen2007.html","main");


subInfo[9][1] = new Array("NEC92","http://www.nec92.com/NEC92/nieuws.html","main");
subInfo[9][2] = new Array("Spelerspas","http://www.nec92.com/NEC92/spelerspas.html","main");
subInfo[9][3] = new Array("Teletekst","http://teletekst.nos.nl/?818-01","main");
subInfo[9][4] = new Array("Het weer","http://users.pandora.be/peterulenaers/WEERLIMBURG.htm","main");
subInfo[9][5] = new Array("Webmasters","http://www.nec92.com/NEC92/website.html","main");
subInfo[9][6] = new Array("Who is Who?","http://www.nec92.com/NEC92/whoiswho.html","main");

subInfo[10][1] = new Array("Stand","http://www.voetbalpoules.nl/poules.asp?id=947&amp;ctype=20&amp;week=&amp;type=4","main");
subInfo[10][2] = new Array("Nieuws","http://www.nec92.com/NEC92/voetbalpoule0607.html","main");
subInfo[10][3] = new Array("Prijzen","http://www.nec92.com/NEC92/voetbalpoule-prijzen.html","main");
subInfo[10][4] = new Array("Puntentelling","http://www.nec92.com/NEC92/voetbalpoule-punten.html","main");
subInfo[10][5] = new Array("Spelregels","http://www.nec92.com/NEC92/voetbalpoule-spelregels.html","main");
subInfo[10][6] = new Array("Hall of Fame","http://www.nec92.com/NEC92/voetbalpoule-halloffame.html","main");
subInfo[10][7] = new Array("Historie","http://www.nec92.com/NEC92/voetbalpoule-historie.html","main");
subInfo[10][8] = new Array("Voetbalpoules.nl","http://www.voetbalpoules.nl","_blank");





subInfo[15][1] = new Array("Hoofd sponsors","http://www.nec92.com/NEC92/sponsors-hoofd.html","main");
subInfo[15][2] = new Array("Website sponsor","http://www.nec92.com/NEC92/sponsors-website.html","main");
subInfo[15][3] = new Array("Kleding sponsors","http://www.nec92.com/NEC92/sponsors-kleding.html","main");
subInfo[15][4] = new Array("Bord sponsors","http://www.nec92.com/NEC92/sponsors-bord.html","main");
subInfo[15][5] = new Array("Vrienden van NEC92","http://www.nec92.com/NEC92/sponsors-vrienden.html","main");
subInfo[15][6] = new Array("Wedstrijdbal van de week","http://www.nec92.com/NEC92/sponsors-wedstrijdbal.html","main");


subInfo[16][1] = new Array("Algemeen","http://www.nec92.com/NEC92/Dartclub/Dartclub.htm","main");
subInfo[16][2] = new Array("Standen","http://www.sldl.nl/content/competitie/competitie.aspx?type=3eklassea","main");
subInfo[16][3] = new Array("Fotoīs","http://www.nec92.com/NEC92/Dartclub/Dartclubfotos.htm","main");
subInfo[16][4] = new Array("Nieuws","http://www.nec92.com/NEC92/dartclub-nieuws.html","main");
subInfo[16][5] = new Array("Historie","http://www.nec92.com/NEC92/Dartclub-0506.html","main");
subInfo[16][6] = new Array("Site SLDL","http://www.sldl.nl/content/startpagina/startpagina.aspx","_blank");





//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset = 117;
var ySubOffset = 3;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub = false;
var delay = 1000;
totalButtons = upSources.length;

// 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('setOverImg(\'' + (x+1) + '\',\'\');"');
		document.write('onMouseOut="overSub=false;');
		document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);');
		document.write('setOutImg(\'' + (x+1) + '\',\'\');">');


		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>');
}





//*** MAIN BUTTONS FUNCTIONS ***//
// PRELOAD MAIN MENU BUTTON IMAGES
function preload() {
	for ( x=0; x<totalButtons; x++ ) {
		buttonUp = new Image();
		buttonUp.src = buttonFolder + upSources[x];
		buttonOver = new Image();
		buttonOver.src = buttonFolder + overSources[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1];
}



//*** 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();

