pageroot = ""							// root directory for pages

imgroot = pageroot + "images/Buttons/";	// root directory for menu images

opened = new Array();

allowclose = new Array();

	

function init() {

	collapse = new CollapseMenu(0,0,229,6)

	collapse.openStyle = 'glide'

	collapse.speed = 5

	collapse.inc = 10

	collapse.bgColor="#fffdf2"

	//this.x = document.getElementById("menu").posX

	//this.y = document.getElementById("menu").posY

	collapse.build()

	//writeCSS(collapse.css)

	

	for(x = 1; x <= 3; x++)

		allowclose[x] = true;

	for(x = 0; x < 5; x++)

		opened[x] = false;





	// Preload images

	section1over = new Image()

	section1over.src = imgroot + "section1over.gif"

	section2over = new Image()

	section2over.src = imgroot + "section2over.gif"

	section3over = new Image()

	section3over.src = imgroot + "section3over.gif"

	section4over = new Image()

	section4over.src = imgroot + "section4over.gif"

	section5over = new Image()

	section5over.src = imgroot + "section5over.gif"

	section6over = new Image()

	section6over.src = imgroot + "section6over.gif"

	

	collapse.activate()



	// set the height of the document based on the height of the menu

  //bc:if (is.ns) document.height = collapse.lyr.y + collapse.h

	if (is.ns4) {

		document.height = collapse.lyr.y + collapse.h

	}

	// Open Menus

	for(x = 1; x < 6; x++) {

		if(Request.QueryString(""+x).Count > 0)

			opened[x] = true;

		else opened[x] = false;

		if(opened[x]) {

			collapse.speed = 1;

			collapse.inc = 200;

			collapse.open(x-1);

			collapse.speed = 5;

			collapse.inc = 10;

		}

	}

}





function over(num)

{

	element = document.getElementById('section'+num);

	element.src = imgroot + "section" + num + "over.gif";

	if(num <= 3) {

		allowclose[num] = false;

		openCollapse(num);

	}

}



function openCollapse(num)

{

	collapse.open(num-1);

	opened[num] = true;

}





function out(num)

{

	element = document.getElementById('section'+num);

	element.src = imgroot + "section" + num +  ".gif";

}



function click(num)

{

	if(opened[num]) {

		opened[num] = false;

	}

	else {

		opened[num] = true;

	}

	collapse.toggle(num-1);

}



function close(num)

{

	if(allowclose[num]) {

		collapse.close(num-1);

		opened[num] = false;

	}

}





function subOver(num)

{

	allowclose[num] = false;

}



function subOut(num)

{

	allowclose[num] = true;

	setTimeout("close(" + num +")",500);

}	



function go(page)

{

	string = "";

	for(x = 0; x < 5; x++) {

		if (string == "") and = "?";

		else and = "&";

		if(opened[x])

			string += and + x + "="

	}

	document.location = pageroot + page + string;

}