menuList = new Array();
var isovermenu = false;
menuList[0] = new Array(
"Community Building Program","communityprogram.php",
"Youth Program","youthprogram.php",
"Women's Program","womenprogram.php",
"Clergy Program","clergyprogram.php",
"Study Circle","studycircle.php");

menuList[1] = new Array(
"Introduction","isrintro.php",
"Community Building Program","isrcommunity.php",
"Youth Program","isryouth.php",
"Women's Program","isrwomen.php");

menuList[2] = new Array(
"Witness visit","witnessvisit.php",
"International Conferences","intconferences.php",
"Youth conferences","youthconferences.php");

menuList[3] = new Array(
"Volunteering / Internships","volunteers.php",
"Jobs","jobs.php");

menuList[4] = new Array(
"Group Visits","groupvisits.php",
"Contemporary Way of the Cross","wayofthecross.php",
"Thursday Service", "thursdayservice.php");

menuList[5] = new Array(
"Cornerstone Issues","cornerstone.php",
"Newsletter Subscribe / Unsubscribe","newsletter-subscription.php");

/*menuList[5] = new Array(
"Press releases","pressreleases.php",
"Media Contacts","mediacontacts.php",
"Video Library","videolibrary.php",
"Photo Gallery","photogallery.php");
"Links","links.php",
"Recommended books", "recomm_books.php",

*/

menuList[6] = new Array(
"International Friends of Sabeel","ifos.php",
"Americas","friends-americas.php",
"Europe","friends-europe.php",
"Oceana","friends-australia.php");

menuList[7] = new Array(
"Articles","articles.php",
"Statements","statements.php",
"Photo Gallery","photogallery.php",
"Video Library","videolibrary.php",
"Archives", "res-archives.php");

menuList[9] = new Array(
"Contacts","contacts.php");

menuList[10] = new Array(
"Books","books.php",
"Archives", "pub-archives.php");

document.write('<div id=magMenu class=\"menuDiv\" onMouseOver=\"keepMenu();\" onMouseOut=\"wipeMenu();\" style=\"position:absolute;display:none;z-index:10000; width: 200px;\">FireFox</div>');
var myDiv = document.getElementById("magMenu");
myDiv.innerHTML = "<a href=\"testing.html\">This is just a test...</a>";
nameOfBut = "mytd1";

function changeDiv(myButId,menuNum) {
	hideMenu();
	isovermenu = true;
	var myBut = document.getElementById(myButId);
	var myDiv = document.getElementById("magMenu");
	myBut.style.background = "#7075B8";
	myBut.style.color = "#EFDD10";
	var eALL = document.getElementById("containerall");
	var eTR = myBut.parentNode;
	var eTABLE = myBut.parentNode.parentNode;
	var eContainer = eTR.parentNode.parentNode;
	myDiv.style.top = parseInt(eTR.offsetTop) + 204 + "px";
	myDiv.style.left = (parseInt(eALL.offsetLeft ) + 355 - 192) + "px";

	myDiv.style.display = "";
	myDiv.style.visibility = "visible";
	nameOfBut = myButId;
	changeMenu(menuNum-1);
}

function changeMenu(myMenuId)
{

	var i = myMenuId;
		oTable = document.createElement('table'); 
		oTable.setAttribute('id','floatable'); 
		for(j=0; j< menuList[i].length;j++)
		{
			oRow = oTable.insertRow(-1);
			oCell = oRow.insertCell(-1);
			oCell.setAttribute('class','lmenusubitem');
			oCell.innerHTML = "<a href=\""+menuList[i][j+1]+"\" title=\""+menuList[i][j]+"\">"+menuList[i][j]+"</a>";
			//if(menuList[i][j] == '<hr>') myDiv.innerHTML = myDiv.innerHTML + "<hr>";
			//else 
			//myDiv.innerHTML = myDiv.innerHTML + '<tr><td class="lmenuitem">' + "<a href=\""+menuList[i][j+1]+"\">"+menuList[i][j]+"</a></td></tr>\n";
			j++;
		}
		myDiv.innerHTML = '<table cellspacing="0" cellpadding="0" border="0" width="100%">' + oTable.innerHTML + "</table>\n";
		//myDiv.innerHTML = myDiv.innerHTML + "</table>\n";
}

function hideMenu()
{
	if(isovermenu == false) {
		myDiv.style.visibility = "hidden";
		var myBut = document.getElementById(nameOfBut);
		myBut.style.background = "#BEC1E4";
		myBut.style.color = "#4D5185";
	}
}

function wipeMenu()
{
	isovermenu = false;
	setTimeout("hideMenu()",500);
}
function keepMenu()
{
	isovermenu = true;
	myDiv.style.visibility = "visible";
}

function colorMenu(myButId) {
	hideMenu();
	var myBut = document.getElementById(myButId);
	myBut.style.background = "#7075B8";
	myBut.style.color = "#EFDD10";
	myBut.getElementsByTagName('a')[0].style.color="#EFDD10";
}

function uncolorMenu(myButId) {
	var myBut = document.getElementById(myButId);
	myBut.style.background = "#BEC1E4";
	myBut.style.color = "#4D5185";
	myBut.getElementsByTagName('a')[0].style.color="#4D5185";
}
