var ff_who = new Array(
["ourvision.html","Our Vision"],
["ourworship.html","Our Worship"],
["chapel_milestones.html","Chapel Milestones"],
["photogallery.html","Picture Album"],
["chapel_windows.html","Chapel Windows"],
["donate.html","Donations"]
);
var ff_minist = new Array(
["music.html","Music and Drama"],
["youth.html","Youth Ministries"],
["heal.html","Healing Ministry"],
["faith.html","Faith Seeking"],
["christianformation.html","Christian Formation"],
["alpha.html","Alpha"],
["missions.html","Missions"],
["cursillo.html","Cursillo Ministry"]
);
var ff_mission = new Array(
["madagascar.html","Madagascar & Kenya"],
["olr_home.html","Our Little Roses - Honduras"],
["donate.html","Donations"]
);
var ff_news = new Array(
["chron.html","Chapel Chronicles"],
["http://thechapelofstandrew.org/MinistryBulletin/MinistryBulletin.pdf","Bulletin"],
["haiti.html","Help for Haiti"],
["issues.html","Issues of Today"],
["http://sites.google.com/site/thechapelofsaintandrew/sermons","Audio Sermons"],
["bulletins/Facts_about_the_Diocese_of_Haiti_&_update_for_Jan._16.pdf","Haiti Update"],
["pressreleases.html","Press Releases"]
);
var ff_staff = new Array(
["deborahself.html","Rev. Deborah D. Self"],
["maryellencassini.html","Rev. Mary Ellen Cassini"],
["maintform.html","Maintenance Form"]
);
var ff_prod = new Array(
["bookstore.html","Beacon Bookstore"]
);
var tt = new Array(
['','',''],
['Who We Are','who','who'],
['Ministries','minist','minist'],
['Missions','mission','mission'],
['News','news','news'],
['Staff','staff','staff'],
['Products','prod','prod']
);
var dd_ns4 = (document.layers) ? 1 : 0;
var dd_ie4 = (document.all) ? 1 : 0;
var dd_dom = ((document.getElementById) && (!dd_ie4)) ? 1 : 0; // ns6
var isOver = false;
var timer = null;
var cmTop = 0;
var cmLeft = 0;
// dd_ns4 redraw on resize
if (dd_ns4) {
origWidth = innerWidth;
origHeight = innerHeight;
}
function reDo() {
if (innerWidth != origWidth || innerHeight != origHeight) {location.reload();}
}
if (dd_ns4) onresize = reDo;
if (dd_dom) onload = InitObj;
document.write("<div id=\"gnddhome\"></div>");
//build dropdowns
for ( i = 1 ; i < tt.length ; i++ ) {  // runs it threw the loop
var ff = eval("ff_" + tt[i][1]);       // runs threw and sets the ff_ array # and the first variable in the array.
var divNum = "gndd" + tt[i][2];        // runs threw and sets the ff_ array # and the Second variable in the array.
var strDiv = "<div class=\"cm\" id=\"" + divNum + "\" onMouseOver=\"OverLayer();\" onMouseOut=\"OutLayer('"+ divNum + "');\">";
strDiv = strDiv + "<table cellspacing=1 cellpadding=1 bgcolor=Black width=225 border=0><tr valign=top><td nowrap class=cmLff width=225>";
for ( j = 0 ; j < ff.length ; j++ ) {   // runs it threw the loop
var linkString = new String(ff[j][0]);  // Url String going threw the loop starting at 0
if (linkString.indexOf('http:') == -1) ff[j][0] = "" + ff[j][0];		//******
strDiv = strDiv + "&nbsp\;&nbsp\;&nbsp\;&#183\;&nbsp\;<a  href='" + ff[j][0] + "'>" + ff[j][1] + "</a><br>"; // writes out the actual links.
}
strDiv = strDiv + "<br></td></tr></table></div>\n";    // makes the ending of the table.
document.write(strDiv);  // tells it to write it.
}
//End of dropdowns
function InitObj() {
for (i = 1; i < tt.length; i++) {
whichEl = "gndd" + tt[i][2];
if (dd_dom) {
whichEl = document.getElementById(whichEl);
}
else {
whichEl = (dd_ns4) ? document.layers[whichEl] : document.all[whichEl].style;
}
whichEl.onmouseover = OverLayer;
whichEl.onmouseout = OutLayer;
}
}
InitObj();
function ShowLayer(showEl,event) {
if (showEl == "gnddhome") return;
clearTimeout(timer);
HideAllLayers();
if (dd_dom) {
var whichEl = document.getElementById(showEl);
}
else {
var whichEl = (dd_ns4) ? document.layers[showEl] : document.all[showEl].style;
}
//POSITIONING OF DIVS
whichAnchor = showEl + "A";      //this area set the div into position.  showEl is the name ex. gnddnfl + A =  gnddnflA
if (dd_ie4) {										// if you are IE the do this
if (document.all[whichAnchor]){    // is whichAnchor, which is showEl at the point of show
cmTop = findy(document.all[whichAnchor]) + 20;   //then go ahead and set it 20 from top
cmLeft = findx(document.all[whichAnchor]) - 20;
}
}
if (dd_ns4) {
if (document.anchors[whichAnchor]) {
cmTop = document.anchors[whichAnchor].y + 20;
cmLeft = document.anchors[whichAnchor].x - 20;
}
}
if (dd_dom){
if (document.anchors[whichAnchor]){
var myObject = document.anchors[whichAnchor];
while (myObject.offsetParent) {
cmTop  = cmTop  + myObject.offsetTop;
cmLeft = cmLeft + myObject.offsetLeft;
myObject = myObject.offsetParent
}
}
}
if (dd_dom) {
whichEl.style.visibility = "visible";
whichEl.style.top = cmTop + 20;
if (showEl != 'gnddmore' && showEl) {
if (cmLeft > 640) cmLeft = 592;
}
whichEl.style.left = cmLeft;
}
else {
whichEl.visibility = "visible";
whichEl.top = cmTop;
if (showEl != 'gnddmore' && showEl) {
if (cmLeft > 640) cmLeft = 592;
}
whichEl.left = cmLeft;
}
cmTop = 0; cmLeft = 0;
}
function findy(item) {
if (item.offsetParent) {
return item.offsetTop + findy(item.offsetParent);
}
else {
return item.offsetTop;
}
}
function findx(item) {
if (item.offsetParent) {
return item.offsetLeft + findx(item.offsetParent);
}
else {
return item.offsetLeft;
}
}
//End of POSITIONING
function HideAllLayers() {
if (dd_dom) {
var divTemp = document.getElementsByTagName('div');
for (i = 0; i < divTemp.length; i++) {
var divString = new String(divTemp[i].id);
if (divString.indexOf('gndd') != -1) divTemp[i].style.visibility = "hidden";
}
}
if (dd_ie4) {
var divTemp = document.all.tags("div");
for (i = 0; i < divTemp.length; i++) {
var divString = new String(divTemp[i].id);
if (divString.indexOf('gndd') != -1) divTemp[i].style.visibility = "hidden";
}
}
if (dd_ns4) {
for (i = 0; i < document.layers.length; i++) {
var divString = new String(document.layers[i].name);
if (divString.indexOf('gndd') != -1) document.layers[i].visibility = "hidden";
}
}
}
function OverLayer() { clearTimeout(timer); isOver = true; }
function OutLayer() {  // so  when the mouse is off the SPOT, then set time out make variable isOver set False and set time to execute
clearTimeout(timer);   //function HideAllLayers  in 300 microseconds.
isOver = false;
timer = setTimeout("HideAllLayers()",300);
}
