/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder_nlarchives = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources_nlarchives = new Array("button1up_nlarchives.png","button2up_nlarchives.png","button3up_nlarchives.png","button4up_nlarchives.png");

overSources_nlarchives = new Array("button1over_nlarchives.png","button2over_nlarchives.png","button3over_nlarchives.png","button4over_nlarchives.png");

// SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
subInfo_nlarchives = new Array();
subInfo_nlarchives[1] = new Array();
subInfo_nlarchives[2] = new Array();
subInfo_nlarchives[3] = new Array();
subInfo_nlarchives[4] = new Array();


//*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
subInfo_nlarchives[1][1] = new Array("June","http://www.highergroundaustralia2.org/HGA_newsletterJune2004.pdf","");
subInfo_nlarchives[1][2] = new Array("July","http://www.highergroundaustralia2.com/HGA_newsletterJuly2004.pdf","");
subInfo_nlarchives[1][3] = new Array("August","http://www.highergroundaustralia2.com/HGA_newsletterAugust2004_2.pdf","");
subInfo_nlarchives[1][4] = new Array("September","http://www.highergroundaustralia2.com/HGA_newsletterSeptember2004.pdf","");
subInfo_nlarchives[1][5] = new Array("October","http://www.highergroundaustralia2.com/HGA_newsletterOctober2004.pdf","");
subInfo_nlarchives[1][6] = new Array("November","http://www.highergroundaustralia2.com/HGA_newsletterNovember2004.pdf","");
subInfo_nlarchives[1][7] = new Array("December","http://www.highergroundaustralia2.com/HGAnewsletterDecember2004.pdf","");

subInfo_nlarchives[2][1] = new Array("January","http://www.highergroundaustralia2.org/001_HGA_newsletterJanuary2005.pdf","");
subInfo_nlarchives[2][2] = new Array("February","http://www.highergroundaustralia2.com/002_HGA_newsletterFeb2005.pdf","");
subInfo_nlarchives[2][3] = new Array("March","http://www.highergroundaustralia2.com/002_HGA_newsletterMar2005.pdf","");
subInfo_nlarchives[2][4] = new Array("April","http://www.highergroundaustralia2.com/004_HGA_newsletterApr2005.pdf","");
subInfo_nlarchives[2][5] = new Array("May","http://www.highergroundaustralia2.com/005_HGA_newsletterMay2005.pdf","");
subInfo_nlarchives[2][6] = new Array("June","http://www.highergroundaustralia2.com/006_HGA_newsletterJune2005.pdf","");
subInfo_nlarchives[2][7] = new Array("July","http://www.highergroundaustralia2.com/007_HGA_newsletterJuly2005.pdf","");
subInfo_nlarchives[2][8] = new Array("August","http://www.highergroundaustralia2.com/008_HGA_newsletterAug2005.pdf","");
subInfo_nlarchives[2][9] = new Array("September","http://www.highergroundaustralia2.com/009_HGA_newsletterSep2005.pdf","");
subInfo_nlarchives[2][10] = new Array("October","http://www.highergroundaustralia2.com/010_HGA_newsletterOct2005.pdf","");
subInfo_nlarchives[2][11] = new Array("November","http://www.highergroundaustralia2.com/011_HGA_newsletterNov2005.pdf","");
subInfo_nlarchives[2][12] = new Array("December","http://www.highergroundaustralia2.com/012_HGA_newsletterDec2005.pdf","");

subInfo_nlarchives[3][1] = new Array("January","http://www.highergroundaustralia2.com/001_HGA_Newsletter_Jan2006.pdf","");
subInfo_nlarchives[3][2] = new Array("February","http://www.highergroundaustralia2.com/002_HGA_Newsletter_Feb2006.pdf","");
subInfo_nlarchives[3][3] = new Array("March","http://www.highergroundaustralia2.com/003_HGA_Newsletter_Mar2006.pdf","");
subInfo_nlarchives[3][4] = new Array("April","http://www.highergroundaustralia2.com/004_HGA_Newsletter_Apr2006.pdf","");
subInfo_nlarchives[3][5] = new Array("May","http://www.highergroundaustralia2.com/005_HGA_Newsletter_May2006.pdf","");
subInfo_nlarchives[3][6] = new Array("June","http://www.highergroundaustralia2.com/006_HGA_Newsletter_June2006.pdf","");
subInfo_nlarchives[3][7] = new Array("July","http://www.highergroundaustralia2.com/007_HGA_Newsletter_July2006.pdf","");
subInfo_nlarchives[3][8] = new Array("August","http://www.highergroundaustralia2.com/008_HGA_Newsletter_Aug2006.pdf","");
subInfo_nlarchives[3][9] = new Array("September","http://www.highergroundaustralia2.com/009_HGA_Newsletter_Sep2006.pdf","");
subInfo_nlarchives[3][10] = new Array("October","http://www.highergroundaustralia2.com/octnewsletter.html","");
subInfo_nlarchives[3][11] = new Array("November-December","http://www.highergroundaustralia2.com/ndecnewsletter.html","");

subInfo_nlarchives[4][1] = new Array("January-February","http://www.highergroundaustralia2.com/newsletter1.html","");
subInfo_nlarchives[4][2] = new Array("March","http://www.highergroundaustralia2.com/newsletter2.html","");
subInfo_nlarchives[4][3] = new Array("April","http://www.highergroundaustralia2.com/newsletter3.html","");
subInfo_nlarchives[4][4] = new Array("May","http://www.highergroundaustralia2.com/newsletter4.html","");
subInfo_nlarchives[4][5] = new Array("June","http://www.highergroundaustralia2.com/newsletter5.html","");
subInfo_nlarchives[4][6] = new Array("July","http://www.highergroundaustralia2.com/newsletter6.html","");
subInfo_nlarchives[4][7] = new Array("August","http://www.highergroundaustralia2.com/newsletter7.html","");
subInfo_nlarchives[4][8] = new Array("September","http://www.highergroundaustralia2.com/newsletter8.html","");
subInfo_nlarchives[4][9] = new Array("October","http://www.highergroundaustralia2.com/newsletter9.html","");
subInfo_nlarchives[4][10] = new Array("November","http://www.highergroundaustralia2.com/newsletter10.html","");
subInfo_nlarchives[4][11] = new Array("December","http://www.highergroundaustralia2.com/newsletter11.html","");


//*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
var xSubOffset_nlarchives = 116;
var ySubOffset_nlarchives = 7;



//*** NO MORE SETTINGS BEYOND THIS POINT ***//
var overSub_nlarchives = false;
var delay_nlarchives = 1000;
totalButtons_nlarchives = upSources_nlarchives.length;

// GENERATE SUB MENUS
for ( x=0; x<totalButtons_nlarchives; x++) {
	// SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
	if ( subInfo_nlarchives[x+1].length < 1 ) { 
		document.write('<div id="submenu' + (x+1) + '_nlarchives">');
	// SET DIV FOR BUTTONS WITH SUBMENU
	} else {
		document.write('<div id="submenu' + (x+1) + '_nlarchives" class="dropmenu_nlarchives" ');
		document.write('onMouseOver="overSub_nlarchives=true;');
		document.write('setOverImg_nlarchives(\'' + (x+1) + '\',\'_nlarchives\');"');
		document.write('onMouseOut="overSub_nlarchives=false;');
		document.write('setTimeout(\'hideSubMenu_nlarchives(\\\'submenu' + (x+1) + '_nlarchives\\\')\',delay_nlarchives);');
		document.write('setOutImg_nlarchives(\'' + (x+1) + '\',\'_nlarchives\');">');


		document.write('<ul>');
		for ( k=0; k<subInfo_nlarchives[x+1].length-1; k++ ) {
			document.write('<li>');
			document.write('<a href="' + subInfo_nlarchives[x+1][k+1][1] + '" ');
			document.write('target="' + subInfo_nlarchives[x+1][k+1][2] + '">');
			document.write( subInfo_nlarchives[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_nlarchives() {
	for ( x=0; x<totalButtons_nlarchives; x++ ) {
		buttonUp_nlarchives = new Image();
		buttonUp_nlarchives.src = buttonFolder_nlarchives + upSources_nlarchives[x];
		buttonOver_nlarchives = new Image();
		buttonOver_nlarchives.src = buttonFolder_nlarchives + overSources_nlarchives[x];
	}
}

// SET MOUSEOVER BUTTON
function setOverImg_nlarchives(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_nlarchives + overSources_nlarchives[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg_nlarchives(But, ID) {
	document.getElementById('button' + But + ID).src = buttonFolder_nlarchives + upSources_nlarchives[But-1];
}



//*** SUB MENU FUNCTIONS ***//
// GET ELEMENT ID MULTI BROWSER
function getElement_nlarchives(id) {
	return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null; 
}

// GET X COORDINATE
function getRealLeft_nlarchives(id) { 
	var el = getElement_nlarchives(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_nlarchives(id) {
	var el = getElement_nlarchives(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_nlarchives(objectID,x,y) {
	var el = getElement_nlarchives(objectID);
	el.style.left = x;
	el.style.top = y;
}

// MOVE SUBMENU TO CORRESPONDING BUTTON
function showSubMenu_nlarchives(subID, buttonID) {
	hideAllSubMenus_nlarchives();
	butX = getRealLeft_nlarchives(buttonID);
	butY = getRealTop_nlarchives(buttonID);
	moveObjectTo_nlarchives(subID,butX+xSubOffset_nlarchives, butY+ySubOffset_nlarchives);
}

// HIDE ALL SUB MENUS
function hideAllSubMenus_nlarchives() {
	for ( x=0; x<totalButtons_nlarchives; x++) {
		moveObjectTo_nlarchives("submenu" + (x+1) + "_nlarchives",-500, -500 );
	}
}

// HIDE ONE SUB MENU
function hideSubMenu_nlarchives(subID) {
	if ( overSub_nlarchives == false ) {
		moveObjectTo_nlarchives(subID,-500, -500);
	}
}



//preload_nlarchives();

