
/*********************************
 * author@TechSystems.com        *
 * http://www.portaldepot.net    *
 * management@portaldepot.net    *
 * (c)TechSystems.com 2005       *
 * All Rights Reserved.          *
 *********************************
 */

var menuwidth='165px'; //Default menu width
var menubgcolor='#efefee';  //Change menu bgcolor to your specifications.
var hideMenuDelay=300; //Menu disappear speed onMouseout (in miliseconds)

//Contents for menu1. Change contents to your hyperlinks.
var menu1=new Array();
menu1[0]='<a href="about.htm" target="_top">St Britius Roof Project</a>';
menu1[1]='<a href="mission.htm" target="_top">Mission</a>';
menu1[2]='<a href="contacts.htm" target="_top">Contacts</a>';

//Contents for menu2. Change contents to your hyperlinks.
var menu2=new Array();
menu2[0]='<a href="gallery_st_britius.htm" target="_top">Photos</a>';


////Contents for menu3. Change contents to your hyperlinks.
var menu3=new Array();
menu3[0]='<a href="events_dairy.htm" target="_top">Diary Dates</a>';
menu3[1]='<a href="http://www.brizenorton.org.uk/cgi-bin/davcal/calendar.pl?dept=CS" target="_top">Church Diary</a>';


//You can add any number of menues you just have to follow the schema above and
//add a coordinated menue item in the main HTML menue bar for each new menue.
//Also in the "function populateMenu(menu)" below, you have to add,
//else if (menu == "menu4"){dropMenuObj.innerHTML = menu4.join("");} statements,
//for each additional popUp menue.
//Also in the "function hideMenu()" below you have to add the
//menuItem4 = document.getElementById("m4"); and the
//menuItem4.style.color="#000080"; statements, for each additional popUp menue.


var dropMenuObj = document.getElementById("popUpMenu"); 
document.write('<div id="popUpMenu" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearHideMenu()" onMouseout="delayHideMenu()"></div>');

function dropMenu(offsetX, offsetY,obj, menu, width){
dropMenuObj = document.getElementById("popUpMenu");

populateMenu(menu);
viewMenu(width);

if (menu){

//You can change the number 12 below to fine tune your x position, if you have to.
popUpMenu.style.left = getPos(obj,'Left') - 12;

//You can change the number 6 below to fine tune your y position, if you have to.
popUpMenu.style.top = getPos(obj,'Top') + obj.offsetHeight + 6;
popUpMenu.style.textAlign = "left"}
}

function populateMenu(menu){
if (menu == "menu1"){
dropMenuObj.innerHTML = menu1.join("");}
else if (menu == "menu2"){
dropMenuObj.innerHTML = menu2.join("");}
else if (menu == "menu3"){
dropMenuObj.innerHTML = menu3.join("");}
}

function viewMenu(width){
dropMenuObj = document.getElementById("popUpMenu");
dropMenuObj.style.width=width;
dropMenuObj.style.visibility="visible";
}

function getPos(obj,sPos){
var iPos = 0;
while (obj != null) {
iPos += obj["offset" + sPos];
obj = obj.offsetParent;}
return iPos;
}

function delayHideMenu(){
delayhide=setTimeout("hideMenu()",hideMenuDelay)
}

function hideMenu(){
dropMenuObj = document.getElementById("popUpMenu");
dropMenuObj.style.visibility="hidden";
menuItem1 = document.getElementById("m1");
menuItem1.style.color="#000080";
menuItem2 = document.getElementById("m2");
menuItem2.style.color="#000080";
menuItem3 = document.getElementById("m3");
menuItem3.style.color="#000080";
}

function clearHideMenu(){
if (typeof delayhide!="undefined"){
clearTimeout(delayhide);}
}


