var ministers = Array ("MarkBoucher", "FinneyKuruvilla", "MikeAndMariaWulin", "MandiSpears", "BeckyRobbins", "ChastityArmola", "OtisAFortenberry", "CandaceWegner");
 var numberOfMinisters = ministers.length;
 var MarkBoucherTitle = "Pastor";
 var StevenRoserTitle = "Pastor, Resurrection Life Church";
var RachelHartnettTitle = "Worship/Choir Director";
var MikeAndMariaWulinTitle  = "Youth Ministries Coordinator";
var OtisAFortenberryTitle = "Care Groups Coordinator";
var CandaceWegnerTitle  = "Christian Education Coordinator";
var ChastityArmolaTitle = "Senior Adult Outreach Coordinator";
var MandiSpearsTitle   = "Missions Secretary";
var BeckyRobbinsTitle   = "Missionary Associate";
var FinneyKuruvillaTitle = "Worship/Music Director"
 var MarkBoucherBio = 'Pastor Mark Boucher was called by God at the age of seventeen to serve as a pastor. He and his wife, Terry,'
                     +' pioneered an Assembly of God church in New Jersey (1986 to 1995) and pastored in MA for fifteen years'
                     +' (1995 to 2010). The Bouchers live to exalt Jesus and deeply desire others to come to know Christ and'
                     +' grow to become mature followers of Him. They have one daughter, Nicole, who loves Jesus and just graduated from VFCC.';
 var FinneyKuruvillaBio = 'Finney Kuruvilla has been a member of the ministry team since 1999 when he began serving the church'
                     +' as an intern. Finney now serves as worship leader and deacon. He and Liza are parents of Mark, Andrew and David.';
 var MikeAndMariaWulinBio = 'Mike and Maria Wulin lead Bible studies and coordinate activities for youth. Both work in medicine'
                     +' and are gifted in hospitality. Grace and Gabriel are their children.';
 var OtisAFortenberryBio = 'Otis A. Fortenberry, along with his wife, Candace, coordinates the Care Group. Otis has been a member of Highway since he moved '
                          +'to Philadelphia, in 1989.';
 var ChastityArmolaBio = '';
 var CandaceWegnerBio  = 'Candace Wegner is the director of Spring Garden Academy and coordinates all Christian Education.'
                         +' She and her husband, Otis, coordinate the Care Group ministry.';
 var MandiSpearsBio = 'Mandi Spears is leading an emerging university student - young adult ministry. A 2009 graduate of Drexel University,'
                     +' Mandi is working in Philadelphia and pursuing graduate studies. Mandi also communicates the progress of the church\'s missions outreach.';
var BeckyRobbinsBio = 'Becky Robbins joined the Ministry Team in 2009. A veteran of 7 years of missionary service in Indonesia,  Becky assists by teaching and' 
                      +'coordinating evangelism-discipleship-assimilation ministries.';
 var firstMinister = ministers[0];
var previousMinister = firstMinister;
 //load all of the images into cache
if (location.search.indexOf("Ministries")+1) {
   var ministerImageArray = Array (numberOfMinisters);
   for (imageIndex = 0; imageIndex < numberOfMinisters; imageIndex++) {
     ministerImageArray [imageIndex] = new Image();
    ministerImageArray[imageIndex].src = "Photos/" + ministers[imageIndex] + ".gif";
   }
 }
 function expanded () {
   var tempString = "";
   for (stringIndex = 0; stringIndex < this.length; stringIndex++) {
      if (stringIndex > 0 && this.charAt(stringIndex).toUpperCase() == this.charAt(stringIndex))
        tempString += " ";
      tempString += this.charAt(stringIndex);
   }
  return (tempString);
 }
 String.prototype.expanded = expanded;
 function yearsSince (theYear) {
   return (currentYear - theYear);
 }
 function tellMeAbout (theMinister) {
  var thePic = "Photos/" + theMinister + ".gif";
 document.SplashImage.src = thePic;
 document.Biosphere.MinisterTitle.value = theMinister.expanded() + ", " + eval (theMinister + "Title");
 document.Biosphere.MinisterAddress.value = theMinister + "@HighwayTabernacle.org";
 document.Biosphere.MinisterBio.value = eval (theMinister + "Bio");
  if (previousMinister != theMinister && !oldJavaVersion) {
    var theElement = document.getElementById(theMinister); 
   theElement.className = "Highlighted";
    theElement = document.getElementById(previousMinister); 
   theElement.className = previousMinister;
    theElement = document.getElementById("HREF" + theMinister);
   theElement.className = "Highlighted";
    theElement = document.getElementById("HREF" + previousMinister); 
   theElement.className = previousMinister;
    theElement = document.getElementById("IMG" + theMinister);
   theElement.className = "Highlighted";
    theElement = document.getElementById("IMG" + previousMinister); 
   theElement.className = previousMinister;
    previousMinister = theMinister;
  }
 }
 var ministersText = '<Form Name="Biosphere">'
                   +'<Table><TR>'
                   +'<TD Class="Highlighted">'
                   +'<IMG Name="SplashImage" Src="Photos/' + firstMinister + '.gif" onError="this.src=\'Photos/PhotoUnavailable.gif\'">'
                   +'</TD><TD Align="Center" Class="Highlighted">'
                   +'<Input Type="Text" Name="MinisterTitle" Size="70"  Style="Background:Transparent; Border:None; Text-Align:Center; Cursor:Default;'
                   +' Font-Family:Arial; Font-Weight=Bold; Font-Size:13"'
                   +' Value="' + firstMinister.expanded() + ', ' + eval (firstMinister + "Title") + '" ReadOnly><BR>'
                   +'<A Name="MinisterMail" Href="javascript:void(0);" onClick="this.href= \'mailto:\'+document.Biosphere.MinisterAddress.value;">'
                   +'<Input Type="Text" Name="MinisterAddress" Size="70"  Style="Background:Transparent; Border:None; Text-Align:Center;'
                   +' Font-Family:Arial; Font-Weight=Normal; Font-Size:11; Color:Red; Text-Decoration=Underline; Cursor:Hand;"'
                   +' Value="' + firstMinister + '@HighwayTabernacle.org" ReadOnly></A><BR>'
                   +'<Textarea Name="MinisterBio" Rows="11" Cols="70" Style="Background:Transparent; Border:None; Text-Align:Justify;'
                   +' Font-Family:Arial; Font-Size:12; Cursor:Default;" ReadOnly>'
                   + eval (firstMinister + "Bio")
                   +'</Textarea>'
                   +'</TD></TR>'
                   +'</Table>'
                   +'</Form>'
                   +'<Table style="font-size:\'10\'" Cellpadding="6"><TR>';
var midPoint       = Math.round(numberOfMinisters/2);
 for (ministerIndex = 0; ministerIndex <numberOfMinisters; ministerIndex++) {
   var alignDirection = (ministerIndex % 2) ? "Left" : "Right";
  var ministerName = ministers[ministerIndex];
  var ministerClass = (ministerIndex) ? ministerName : "Highlighted";
  var theHref       = (oldJavaVersion) ? "javascript:tellMeAbout('" + ministerName + "');" :
                                         'javascript:void(0);" '
                                        +'onClick="if (this.className == \'Highlighted\') this.href= \'mailto:\'+document.Biosphere.MinisterAddress.value; '
                                        +' else { tellMeAbout(\'' + ministerName + '\'); return(false);}';
  ministersText += '<TD Align="Center" Valign="Top"  Class="' + ministerClass + '" ID="' + ministerName + '">'
                  +'<A  Class="' + ministerClass + '" ID="IMG' + ministerName + '"'
                  +' Href="' + theHref + '"'
                  +'><B>'
                  +'<IMG Name="' + ministerName + '" SRC="Photos/' + ministerName + 'Thumb.gif" '
                  +'onError="this.src=\'Photos/PhotoUnavailableThumb.gif\';" Border="0"></A><BR>'
                  +'<A Class="' + ministerClass + '" ID="HREF' + ministerName + '"'
                  +' Href="' + theHref + '"';
   if (!oldJavaVersion)
      ministersText+= ' Style="text-decoration:None; font-size:10;"';
   ministersText += '>' + ministerName.expanded() + ' '
                  + eval(ministerName + "Title") + '</A></TD>';
  if (ministerIndex == midPoint-1)  ministersText += '</TR><TR>';
  }
  ministersText += '</TR></Table>'

