<!--
// ----------------------------------------------------------------------------------------------------
// Dropdown Menu v2.1 modified for Liba 23/12/1999
// v2.1 Update includes changing main URL with the onclick event
// Author: Nick Fey, Xtranet
// ----------------------------------------------------------------------------------------------------

// ----------------------------------------------------------------------------------------------------
// constants,presets used thoughout the code

//number of buttons (-1 : an array starts at 0)
var buttons = 8;

// Position of the top button from top edge 
var menuTop = 150;

// Position of buttons from left edge
var stuffLeft = 5;

//Height of the buttons
var buttonHeight = 20;

//delay between clicking and menu's moving 1000 = 1 sec
var Delay = 20;

//define the height of each submenu
buttons = buttons +1;
var menuHeight = new Array(buttons);

menuHeight[1] = 24;    // 15.66 pixels per text line
menuHeight[2] = 0;	// must define for ALL menus
menuHeight[3] = 0;
menuHeight[4] = 60;
menuHeight[5] = 0;
menuHeight[6] = 0;
menuHeight[7] = 0;
menuHeight[8] = 0;
menuHeight[9] = 0;

//set the hrefs of the buttons
var buttonHref = new Array(9);
buttonHref[1] = 'about/default.htm';
buttonHref[2] = 'issues/default.htm';
buttonHref[3] = 'career/careersbrochure8.5.02.PDF';
buttonHref[4] = 'publications/default.htm';
buttonHref[5] = 'contact/default.htm';
buttonHref[6] = 'search/default.asp';
buttonHref[7] = 'members/default.htm';
buttonHref[8] = 'criteria/default.htm';
buttonHref[9] = 'membersonly/default.asp';

// preset roll-over images
buttonOverImage1 = new Image();
buttonOffImage1 = new Image();

buttonOverImage2 = new Image();
buttonOffImage2 = new Image();

buttonOverImage3 = new Image();
buttonOffImage3 = new Image();

buttonOverImage4 = new Image();
buttonOffImage4 = new Image();

buttonOverImage5 = new Image();
buttonOffImage5 = new Image();

buttonOverImage6 = new Image();
buttonOffImage6 = new Image();

buttonOverImage7 = new Image();
buttonOffImage7 = new Image();

buttonOverImage8 = new Image();
buttonOffImage8 = new Image();

buttonOverImage9 = new Image();
buttonOffImage9 = new Image();


// alter these lines to modify images. NB image tag inside DIV must also be changed. 

buttonOverImage1.src = "images/navigation/about_on.gif";
buttonOffImage1.src = "images/navigation/about_off.gif";

buttonOverImage2.src = "images/navigation/current_on.gif";
buttonOffImage2.src = "images/navigation/current_off.gif";

buttonOverImage3.src = "images/navigation/career_on.gif";
buttonOffImage3.src = "images/navigation/career_off.gif";

buttonOverImage4.src = "images/navigation/pub_on.gif";
buttonOffImage4.src = "images/navigation/pub_off.gif";

buttonOverImage5.src = "images/navigation/contact_on.gif";
buttonOffImage5.src = "images/navigation/contact_off.gif";

buttonOverImage6.src = "images/navigation/search_on.gif";
buttonOffImage6.src = "images/navigation/search_off.gif";

buttonOverImage7.src = "images/navigation/liba_on.gif";
buttonOffImage7.src = "images/navigation/liba_off.gif";

buttonOverImage8.src = "images/navigation/members_on.gif";
buttonOffImage8.src = "images/navigation/members_off.gif";

buttonOverImage9.src = "images/navigation/membersonly_on.gif";
buttonOffImage9.src = "images/navigation/membersonly_off.gif";

// Leave this set to zero
var Current = 0;

// ----------------------------------------------------------------------------------------------------
//function to create layers

function createIELayers()	{    
				//write each seperate layer|division as html
				// Four properties must be altered per layer 
				// the DIV ID, revealMenu(X), button image and image name
				// button #1
				// document.write('<DIV id="button1" style="width:104;height:13;position:absolute;left:10;" onClick="setTimeout(\'revealMenu(1)\', Delay);">');
				// document.write('<A HREF="#"><IMG SRC="images/navigation/about_off.gif" WIDTH=104 HEIGHT=13 BORDER=0 name="image1" alt="About LIBA"></A><BR>');
				// document.write('</DIV>');
				// button #2
				document.write('<DIV id="button2" style="width:104;height:13;position:absolute;left:10;" onClick="setTimeout(\'revealMenu(2)\', Delay);">');
				document.write('<A HREF="#"><IMG SRC="images/navigation/current_off.gif" WIDTH=104 HEIGHT=13 BORDER=0 name="image2" alt="Current Issues"></A><BR>');
				document.write('</DIV>');
				// button #3
				// document.write('<DIV id="button3" style="width:104;height:13;position:absolute;left:10;" onClick="setTimeout(\'revealMenu(3)\', Delay);">');
				// document.write('<A HREF="#"><IMG SRC="images/navigation/career_off.gif" WIDTH=104 HEIGHT=13 BORDER=0 name="image3" alt="Career Information"></A><BR>');
 				// document.write('</DIV>');
				// button #4
				document.write('<DIV id="button4" style="width:104;height:13;position:absolute;left:10;" onClick="setTimeout(\'revealMenu(4)\', Delay);">');
				document.write('<A HREF="#"><IMG SRC="images/navigation/pub_off.gif" WIDTH=104 HEIGHT=13 BORDER=0 name="image4" alt="Publications"></A><BR>');
				document.write('</DIV>');
				// button #5
				// document.write('<DIV id="button5" style="width:104;height:13;position:absolute;left:10;" onClick="setTimeout(\'revealMenu(5)\', Delay);">');
				// document.write('<A HREF="#"><IMG SRC="images/navigation/contact_off.gif" WIDTH=104 HEIGHT=13 BORDER=0 name="image5" alt="Contact LIBA"></A><BR>');
				// document.write('</DIV>');
				// button #6
				document.write('<DIV id="button6" style="width:104;height:13;position:absolute;left:10;" onClick="setTimeout(\'revealMenu(6)\', Delay);">');
				document.write('<A HREF="#"><IMG SRC="images/navigation/search_off.gif" WIDTH=104 HEIGHT=13 BORDER=0 name="image6" alt="Site Search"></A><BR>');
				document.write('</DIV>');
				// button #7
				// document.write('<DIV id="button7" style="width:104;height:13;position:absolute;left:10;" onClick="setTimeout(\'revealMenu(7)\', Delay);">');
				// document.write('<A HREF="#"><IMG SRC="images/navigation/liba_off.gif" WIDTH=104 HEIGHT=13 BORDER=0 name="image7" alt="LIBA Members"></A><BR>');
				// document.write('</DIV>');
				// button #8
				// document.write('<DIV id="button8" style="width:104;height:13;position:absolute;left:10;" onClick="setTimeout(\'revealMenu(8)\', Delay);">');
				// document.write('<A HREF="#"><IMG SRC="images/navigation/members_off.gif" WIDTH=104 HEIGHT=13 BORDER=0 name="image8" alt="Membership Information"></A><BR>');
				// document.write('</DIV>');
				// button #9
				document.write('<DIV id="button9" style="width:104;height:13;position:absolute;left:10;" onClick="setTimeout(\'revealMenu(9)\', Delay);">');
				document.write('<A HREF="#"><IMG SRC="images/navigation/membersonly_off.gif" WIDTH=104 HEIGHT=13 BORDER=0 name="image9" alt="Members Only"></A><BR>');
				document.write('</DIV>');

				// create each sub-menu
				// menu #1
				document.write('<DIV id="menu1" style="width:125;position:absolute;visibility:hidden;height:10;">');
				document.write('<TABLE CELLSPACING=0 WIDTH=100% HEIGHT=100% cellpadding=1 background="images/menu-spacer.gif"><TR>');
				document.write('<TD WIDTH="7"></TD>');
				document.write('<TD WIDTH="118">');
				document.write('<FONT SIZE=2 COLOR="#ffcc00" FACE="verdana">');
				document.write('<A HREF="membersonly/default.asp" class="item" target="main">Members Only</A><BR>&nbsp<br>');				
				document.write('</FONT>');
				document.write('</TD>');
				document.write('</TR></TABLE>');				
				document.write('</DIV>');
				// menu #2
				document.write('<DIV id="menu2" style="width:125;position:absolute;visibility:hidden">');
				document.write('</DIV>');
				// menu #3
				document.write('<DIV id="menu3" style="width:125;position:absolute;visibility:hidden">');
				document.write('</DIV>');
				// menu #4
				document.write('<DIV id="menu4" style="width:125;position:absolute;visibility:hidden">');
				document.write('<TABLE CELLSPACING=0 WIDTH=100% HEIGHT=100% cellpadding=1 background="images/menu-spacer.gif"><TR>');
				document.write('<TD WIDTH="7" ></TD>');
				document.write('<TD WIDTH="118" >');
				document.write('<FONT SIZE=2 COLOR="#ffcc00" FACE="verdana">');
				document.write('<A HREF="publications/annreport.htm" class="item" target="main">Annual Report</A><BR>');
				document.write('<A HREF="career/careersbrochure8.5.02.PDF" class="item" target="main">Careers Booklet</A><BR>');
				document.write('<A HREF="publications/releases.htm" class="item" target="main">Press Releases</A><BR>');
				document.write('<A HREF="publications/archive.htm" class="item" target="main">Publications Archive</A><BR>&nbsp<br>');								
				document.write('</FONT>');
				document.write('</TD>');
				document.write('</TR></TABLE>');
				document.write('</DIV>');
				// menu #5
				document.write('<DIV id="menu5" style="width:125;position:absolute;visibility:hidden">');				
				document.write('</DIV>');
				// menu #6
				document.write('<DIV id="menu6" style="width:125;position:absolute;visibility:hidden">');
				document.write('</DIV>');
				// menu #7
				document.write('<DIV id="menu7" style="width:125;position:absolute;visibility:hidden">');
				document.write('</DIV>');
				// menu #8
				document.write('<DIV id="menu8" style="width:125;position:absolute;visibility:hidden">');
				document.write('</DIV>');
				// menu #9
				document.write('<DIV id="menu9" style="width:125;position:absolute;visibility:hidden">');
				document.write('</DIV>');
				//call function to position layers
				createMenu();
} //End createIELayers

// ----------------------------------------------------------------------------------------------------
// This function sets the layers to their correct position, width, height, clip area etc
// called once on startup

function createMenu() {

	//hide the layers called Stanard. This is the layer that non-DHTML browsers will show. However if
	//you have got this far then you must be using a DHTML browser so hide it.
	hideLayer("standard");


	//Calculate the top of each button and store in buttonTop[]
	buttonTop = new Array(buttons);
		
	for  (j = 1; j <= buttons; j++) {
									buttonTop[j] = menuTop + (buttonHeight*(j-1));
									}

	//For each button set various properties
	for  (j = 1; j <= buttons; j++) {
									// assemble button layer name. eg button1, button2, etc
									layername = 'button' + j;
									// set button top to stored position
									layerPos(layername,buttonTop[j]);
									// set button left to standard position. stuffLeft defined at top
									layerLeft(layername,stuffLeft);
									// show the layer
									showLayer(layername);
									// assemble menu layer name. eg menu1, menu2, etc
					 				menuname = 'menu' + j;
									// set menu height to stored value
									layerHeight(menuname,menuHeight[j]);
									// set menu left to standard position
									layerLeft(menuname,stuffLeft);
									// set the clipping/overflow area of the menu
									// if this is not set, the menu will resize to the contained text 
									// and the buttons will not align correctly.
					 				clipit(menuname,menuHeight[j]);
									}

} //End createMenu



// ----------------------------------------------------------------------------------------------------
// This looks at what button has been clicked, calculates the new position for all the buttons, the
// position of the menu to show and changes the roll-overs
// The menuShow parameter indicates the button that was clicked. If this is the same as current then
// close instead
function revealMenu(menuShow) {
	parent.main.document.location.href=buttonHref[menuShow];
		if (Current == menuShow) {
				hideMenu();
			}
			else
			{
				dropMenu(menuShow);
			}
	return true;
		
} //End revealMenu


// ----------------------------------------------------------------------------------------------------
// This function changes the location on the main frame with the onclick event
function ChangePage(url)
{
    document.location.href=url; 
}

// ----------------------------------------------------------------------------------------------------
// This function opens a menu
function dropMenu(menuShow) {
		// buttons upto that clicked remain in the same position
		for  (j = 1; j <= menuShow; j++) {
								// reset to standard position calculated in the menuCreate function
								layername = 'button' + j;
								layerPos(layername,buttonTop[j]);
								// hide all menu for previous buttons 
								menuname = 'menu' + j;
								hideLayer(menuname);
						}		
		// Calc new top for menu. ie the top of the button plus the height of the button
		menuname = 'menu' + menuShow;
		showMenuTop = buttonTop[menuShow]+buttonHeight
		// move & show the layer to this new position
		layerPos(menuname,showMenuTop);
		showLayer(menuname);
		
		// buttons below that clicked. Alter their positions to include the height of the menu
		// hide all rest of the menus
		for  (j = menuShow+1; j <= buttons; j++) {
								layername = 'button' + j;
								layerPos(layername,buttonTop[j]+ menuHeight[menuShow]);
								menuname = 'menu' + j;
								hideLayer(menuname);
					}		

		// image roll-over section
		// filenames are stored in the variables buttonOffImage? and buttonOverImage?, as defined
		// at the top of this file
		if (document.all) {   //test for IE
					// set all images to normal image
 	 				document.all['button1'].document.images['image1'].src = buttonOffImage1.src;
			 	 	document.all['button2'].document.images['image2'].src = buttonOffImage2.src;
				 	document.all['button3'].document.images['image3'].src = buttonOffImage3.src;
				 	document.all['button4'].document.images['image4'].src = buttonOffImage4.src;
					document.all['button5'].document.images['image5'].src = buttonOffImage5.src;
 					document.all['button6'].document.images['image6'].src = buttonOffImage6.src;
 					document.all['button7'].document.images['image7'].src = buttonOffImage7.src;
 					document.all['button8'].document.images['image8'].src = buttonOffImage8.src;
					document.all['button9'].document.images['image9'].src = buttonOffImage9.src;
		// change the image for the correct button
					if (menuShow == 1) document.all['button1'].document.images['image1'].src = buttonOverImage1.src;
					if (menuShow == 2) document.all['button2'].document.images['image2'].src = buttonOverImage2.src;
					if (menuShow == 3) document.all['button3'].document.images['image3'].src = buttonOverImage3.src;
					if (menuShow == 4) document.all['button4'].document.images['image4'].src = buttonOverImage4.src;
					if (menuShow == 5) document.all['button5'].document.images['image5'].src = buttonOverImage5.src;
					if (menuShow == 6) document.all['button6'].document.images['image6'].src = buttonOverImage6.src;
					if (menuShow == 7) document.all['button7'].document.images['image7'].src = buttonOverImage7.src;
					if (menuShow == 8) document.all['button8'].document.images['image8'].src = buttonOverImage8.src;
					if (menuShow == 9) document.all['button9'].document.images['image9'].src = buttonOverImage9.src;
		}

		Current=menuShow;

} //End revealMenu


// ----------------------------------------------------------------------------------------------------
// This hides a menu

function hideMenu() {
		// buttons to normal positions
		for  (j = 1; j <= buttons; j++) {
								// reset to standard position calculated in the menuCreate function
								layername = 'button' + j;
								layerPos(layername,buttonTop[j]);
								// hide all menu for previous buttons 
								menuname = 'menu' + j;
								hideLayer(menuname);
						}		

		// retirn image roll-overs back to normal
		if (document.all) {   //test for IE
					// set all images to normal image
 	 				document.all['button1'].document.images['image1'].src = buttonOffImage1.src;
			 	 	document.all['button2'].document.images['image2'].src = buttonOffImage2.src;
				 	document.all['button3'].document.images['image3'].src = buttonOffImage3.src;
				 	document.all['button4'].document.images['image4'].src = buttonOffImage4.src;
					document.all['button5'].document.images['image5'].src = buttonOffImage5.src;
 					document.all['button6'].document.images['image6'].src = buttonOffImage6.src;
					document.all['button7'].document.images['image7'].src = buttonOffImage7.src;
					document.all['button8'].document.images['image8'].src = buttonOffImage8.src;
 					document.all['button9'].document.images['image9'].src = buttonOffImage9.src;
		}
	Current=0;
} //End hideMenu


// ----------------------------------------------------------------------------------------------------
// This function moves a layer vertically.
// Adjusts for difference between co-ordinates of NS & IE

function layerPos(layername,realpos) {
           document.all[layername].style.top=realpos;           
			} 



// ----------------------------------------------------------------------------------------------------
// This function moves a layer horizontally.
// Adjusts for difference between co-ordinates of NS & IE

function layerLeft(layername,realpos) {
           document.all[layername].style.left=realpos;           
		  }


// ----------------------------------------------------------------------------------------------------
// This changes the height of a layer.

function layerHeight(layername,height) {
           document.all[layername].style.height=height;           
			}



// ----------------------------------------------------------------------------------------------------
// This function sets a layer to hidden

function showLayer(layername) {
           document.all[layername].style.visibility='visible';
		}



// ----------------------------------------------------------------------------------------------------
// This function sets a layer to visible

function hideLayer(layername) {
           document.all[layername].style.visibility='hidden';
		}


// ----------------------------------------------------------------------------------------------------
// This function sets a layer to visible

function clipit(layername,clipheight) {
     (document.all)				
	document.all(layername).style.clip = 'rect(' + 0 + ' ' + 125 + ' ' + clipheight + ' ' + 0 + ')';
} 


//-->
 

