<!--- This file includes all of the functions used on the various --->

<!--- web pages.  Each under it's own section.  Components can be --->

<!--- drawn using the appropriate functions, detailed below.      --->



<!--- Function Reference ------------------------------------------------->
<!---  Date:  DrawDate();                                              --->
<!---  Top Left Menu: DrawTopMenu();                                   --->
<!---  Gallery Panel -- DrawGalleryPanel(header, bullet);              --->
<!---  Sermon Panel -- DrawSermonPanel(TopImage, BulletImage);         --->
<!---  Announcements -- DrawAnnouncementsPanel(TopImage, BulletImage); --->
<!---  Image Fade: AddImage(src, lnk); to add images                   --->
<!---              BeginFade();  to draw and execute                   --->

<!---  Random Bible Verse:  BibleVerse(type);                          --->
<!------------------------------------------------------------------------>




<!--- Date Script for top right corner     --->
<!--- Outputs:  DayOfWeek, Month Day, Year --->

function DrawDate() {
  var day = "";
  var month = "";
  var ampm = "";

  var ampmhour = "";
  var myweekday = "";
  var year = "";

  mydate = new Date();
  myday = mydate.getDay();
  mymonth = mydate.getMonth();
  myweekday = mydate.getDate();
  weekday = myweekday;
  myyear = mydate.getFullYear();
  myhours = mydate.getHours();
  ampmhour = (myhours > 12) ? myhours - 12 : myhours;
  ampm = (myhours >= 12) ? 'PM' : 'AM';
  mytime = mydate.getMinutes();
  myminutes = ((mytime < 10) ? ':0' : ':') + mytime;
  year = (myyear > 100) ? myyear : 1900 + myyear;

  if(myday == 0)
    day = "Sunday";
  else if(myday == 1)
    day = "Monday";

  else if(myday == 2)
    day = "Tuesday";
  else if(myday == 3)
    day = "Wednesday";

  else if(myday == 4)
    day = "Thursday";

  else if(myday == 5)
    day = "Friday";
  else if(myday == 6)
    day = "Saturday";


  if(mymonth == 0)
    month = "January";
  else if(mymonth == 1)
    month = "February";
  else if(mymonth == 2)
    month = "March";
  else if(mymonth == 3)
    month = "April";
  else if(mymonth == 4)
    month = "May";
  else if(mymonth == 5)
    month = "June";
  else if(mymonth == 6)
    month = "July";
  else if(mymonth == 7)
    month = "August";
  else if(mymonth == 8)

    month = "September";
  else if(mymonth == 9)
    month = "October";
  else if(mymonth == 10)
    month = "November";
  else if(mymonth == 11)
    month = "December";

  document.write(day + ", " + month + " " + myweekday + ", " + year);

}

<!--- End Date Script --->





<!--- Top Left Menu Image Swap Scripts  --->
<!---   Use  DrawTopMenu();  to display --->

var NumTopImages;
var Imageson;
var Imagesoff;

function SwapTopImage(which, how) {
  eval("document.image" + which + ".src = Images" + how + "[" + which + "].src" );
}


function DrawTopMenu() {

  NumTopImages = 5;

  Imageson = new Array(NumTopImages);
  Imagesoff = new Array(NumTopImages);

  Imageson[0] = new Image();
  Imageson[0].src = "images/icons/home_on.gif";


  Imagesoff[0] = new Image();
  Imagesoff[0].src = "images/icons/home_off.gif";

  Imageson[1] = new Image();
  Imageson[1].src = "images/icons/email_on.gif";

  Imagesoff[1] = new Image();
  Imagesoff[1].src = "images/icons/email_off.gif";


  // Imageson[2] = new Image();
  // Imageson[2].src = "images/icons/forum_on.gif";

  // Imagesoff[2] = new Image();
  // Imagesoff[2].src = "images/icons/forum_off.gif"; 


  Imageson[3] = new Image();
  Imageson[3].src = "images/icons/help_on.gif";

  Imagesoff[3] = new Image();
  Imagesoff[3].src = "images/icons/help_off.gif";

  Imageson[4] = new Image();
  Imageson[4].src = "images/icons/news_on.gif";

  Imagesoff[4] = new Image();
  Imagesoff[4].src = "images/icons/news_off.gif";

  document.write('<a href="/" onMouseOver="SwapTopImage(0, \'on\');" onMouseOut="SwapTopImage(0, \'off\');"><img src="images/icons/home_off.gif" name="image0" border="0" alt="home"></a>');
  document.write(' &nbsp; ');
  // document.write('<a href="news.html" onMouseOver="SwapTopImage(4, \'on\');" onMouseOut="SwapTopImage(4, \'off\');"><img src="images/icons/news_off.gif" name="image4" border="0" alt="news"></a>');
  // document.write(' &nbsp; ');
  // document.write('<a href="forum.html" onMouseOver="SwapTopImage(2, \'on\');" onMouseOut="SwapTopImage(2, \'off\');"><img src="images/icons/forum_off.gif" name="image2" border="0" alt="message boards"></a>');
  // document.write(' &nbsp; ');
  document.write('<a href="contact.html" onMouseOver="SwapTopImage(1, \'on\');" onMouseOut="SwapTopImage(1, \'off\');"><img src="images/icons/email_off.gif" name="image1" border="0" alt="contact us"></a>');
  document.write(' &nbsp; ');
  document.write('<a href="help.html" onMouseOver="SwapTopImage(3, \'on\');" onMouseOut="SwapTopImage(3, \'off\');"><img src="images/icons/help_off.gif" name="image3" border="0" alt="help"></a>');
  document.write(' &nbsp; ');
}

<!--- End Top Left Menu --->





<!--- Recent Sermons Panel Script          --->
<!---   Specify Top Image and Bullet Image --->
<!---   Sermon Title can be no more than   --->
<!---   22 characters, including ellipses  --->

function DrawSermonPanel(TopImage, BulletImage) {
  if (!TopImage)
    TopImage = "images/sidebar/sermons.jpg";
  if (!BulletImage)
    BulletImage = "images/sidebar/arrow.gif";

  document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
  document.write('  <tr>');
  document.write('    <td>');
  document.write('      <img src="' + TopImage + '" height="24" width="135">');
  document.write('    </td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="PanelLink">');
  document.write('      <a href="sermons.html" class="PanelLink">Click here to see other sermons</a>');
  document.write('    </td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="PanelBody" style="text-align: left;">');
  document.write('      <br>');
  document.write('      &nbsp;<img src="' + BulletImage + '">&nbsp;<a href="/imported_docs/Sermons/10-03-07.pdf">God\'s Timetable for ...</a><br>');
  document.write('      &nbsp;<img src="' + BulletImage + '">&nbsp;<a href="/imported_docs/Sermons/10-02-28.pdf">The Fox and the Hen</a><br>');
  document.write('      &nbsp;<img src="' + BulletImage + '">&nbsp;<a href="/imported_docs/Sermons/10-02-21.pdf">Is There a Satan, ...</a><br>');
  document.write('      &nbsp;<img src="' + BulletImage + '">&nbsp;<a href="/imported_docs/Sermons/10-02-14.pdf">Love: You Can\'t ...</a><br>');
  document.write('      <br>');
  document.write('    </td>');
  document.write('  </tr>');
  document.write('</table>');
}

<!--- End Recent Sermons Panel --->





<!--- Announcements Panel  --->


function DrawAnnouncementsPanel(TopImage, BulletImage) {
  if (!TopImage)
    TopImage = "images/sidebar/worship.jpg";
  if (!BulletImage)
    BulletImage = "images/sidebar/arrow.gif";

  document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
  document.write('  <tr>');
  document.write('    <td>');
  document.write('      <img src="' + TopImage + '" height="24" width="135">');
  document.write('    </td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="PanelLink">');
  document.write('      Guests are always welcome!');
  document.write('    </td>');
  document.write('  </tr>');
  document.write('  <tr>');
  document.write('    <td class="PanelBody">');
	document.write('      <img src="images/sidebar/FrontSign.jpg" height="194" width="130" border="0">');
//  document.write('      Services at<br>8:45 a.m. and 11:00 a.m.<br><br>');
//  document.write('      Dr. W. Glenn Doak<br>');
//  document.write('      Senior Pastor<br><br>');
//  document.write('      <b><i>Come Join Us For Worship!</i></b><br>');
	document.write('      <br>');
  document.write('    </td>');
  document.write('  </tr>');
  document.write('</table>');
}

<!--- End Draw Announcements --->

function DrawGuestPanel() {
  document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
//  document.write('  <tr>');
//  document.write('    <td class="PanelBody">');
//  document.write('      <a href="pictures.html"><img src="images/olanmills2.jpg" height="91" width="130" alt="Click here for information on the new photo directory." border="0"></a>');
//  document.write('    </td>');
//  document.write('  </tr>');
//  document.write('  <tr><td>&nbsp;</tr></td>');
  document.write('  <tr>');
  document.write('    <td class="PanelBody">');
  document.write('      <a href="guests.html"><img src="images/sidebar/guests.jpg" height="185" width="130" border="0"></a>');
  document.write('    </td>');
  document.write('  </tr>');
  document.write('</table>');
}


<!--- Draw Ministry Panel --->

function DrawMinistryPanel(TopImage) {
  if (!TopImage)
    TopImage = "images/sidebar/featuredministry.jpg";

//  document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
//  document.write('  <tr>');
//  document.write('    <td>');
//  document.write('      <img src="' + TopImage +'" height="24" width="135">');
//  document.write('    </td>');
//  document.write('  </tr>');
//  document.write('  <tr>');
//  document.write('    <td class="PanelLink">');
//  document.write('      <a href="http://www.athensfirstpresyouth.com" class="PanelLink">Spotlighting Our Youth Ministry</a>' );
//  document.write('    </td>');
//  document.write('  </tr>');
//  document.write('  <tr>');
//  document.write('    <td class="PanelBody">');
//  document.write('      <a href="http://www.athensfirstpresyouth.com" class="PanelLink"><img src="images/sidebar/youthlogo.jpg" width="130" height="102" border="0">');
//  document.write('    </td>');
//  document.write('  </tr>');
//  document.write('</table>');
//	document.write('<br>');
	document.write('<a href="http://www.cokesbury.com/home.aspx?vsl=2303" target="_blank"><img src="images/misc/VSL.gif" width="135" height="50" border="0"></a>');

}

<!--- End Ministry Panel --->




<!--- Draw Gallery Panel --->


function DrawGalleryPanel(TopImage) {
  if (!TopImage)
    TopImage = "images/sidebar/featuredministry.jpg";

//  document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%">');
//  document.write('  <tr>');
//  document.write('    <td>');
//  document.write('      <img src="' + TopImage +'" height="24" width="135">');
//  document.write('    </td>');
//  document.write('  </tr>');
//  document.write('  <tr>');
//  document.write('    <td class="PanelLink">');
//  document.write('      <a href="http://www.athensfirstpresyouth.com" class="PanelLink">Spotlighting Our Youth Ministry</a>' );
//  document.write('    </td>');
//  document.write('  </tr>');
//  document.write('  <tr>');
//  document.write('    <td class="PanelBody">');
//  document.write('      <a href="http://www.athensfirstpresyouth.com" class="PanelLink"><img src="images/sidebar/youthlogo.jpg" width="130" height="102" border="0">');
//  document.write('    </td>');
//  document.write('  </tr>');
//  document.write('</table>');
//	document.write('<br>');
	document.write('<a href="http://www.cokesbury.com/home.aspx?vsl=2303" target="_blank"><img src="images/misc/VSL.gif" width="135" height="50" border="0"></a>');

}

<!--- End Gallery Panel --->



<!--- Image Fade Script --->
<!---   Call AddImage(src, lnk); to add images --->
<!---   Call BeginFade(); to draw and execute --->

var imageholder = new Array();
var imagelinks = new Array();
var numimages = 0;
var ie = document.all;
var slidespeed = 4000;
var whichlink = 0;
var whichimage = 0;

function AddImage(imgsrc, imglink) {
  imageholder[numimages] = new Image();
  imageholder[numimages].src = imgsrc;
  imagelinks[numimages] = imglink;
  numimages++;
}

function gotoshow() {
  var newwindow = 1; //open links in new window? 1=yes, 0=no

  if (newwindow)
    window.open(imagelinks[whichlink]);
  else
    window.location = imagelinks[whichlink];
}

function BeginFade() {
  if (!document.images)
    return;

  if (ie)
    document.images.slide.filters[0].apply();

  document.images.slide.src = imageholder[whichimage].src;

  if (ie)
    document.images.slide.filters[0].play();

  whichlink = whichimage;
  whichimage = (whichimage < imageholder.length - 1) ? whichimage + 1 : 0;

  setTimeout("BeginFade()", slidespeed + ((ie) ? document.images.slide.filters[0].duration * 1000 : 0));
}

<!--- End Slide Image Script --->



<!--- (Pseudo-) Random Bible Verse --->

var GlobalVerses = new Array();
GlobalVerses[0] = '"Grace unto you and peace, from God our Father and the Lord Jesus Christ"<br> -- Galatians 1:3';
GlobalVerses[1] = '"In the beginning God created the heaven and the earth."<br> -- Genesis 1:1';
GlobalVerses[2] = '"Then Job answered the Lord, and said, I know that thou canst do every thing, and that no thought can be withholden from thee."<br> -- Job 42:1-2';
GlobalVerses[3] = '"Yea, though I walk through the valley of the shadow of death, I will fear no evil: for thou art with me; thy rod and thy staff they comfort me."<br> -- Psalms 23:4';
GlobalVerses[4] = '"Blessed is the man that walketh not in the counsel of the ungodly, nor standeth in the way of sinners, nor sitteth in the seat of the scornful. But his delight is in the law of the Lord; and in his law doth he meditate day and night."<br> -- Psalms 1:1-2';
GlobalVerses[5] = '"As the hart panteth after the water brooks, so panteth my soul after thee, O God."<br> -- Psalms 42:1';
GlobalVerses[6] = '"And we know that all things work together for good to them that love God, to them who are called according to his purpose."<br> -- Romans 8:28';
GlobalVerses[7] = '"Be kind to one another, tender-hearted, forgiving one another as God in Christ has forgiven you. Therefore be imitators of God, as beloved children, and live in love..."<br> -- Ephesians 4:32 - 5:2';
GlobalVerses[8] = '"If any want to become my followers, let them deny themselves and take up their cross daily and follow me."<br> -- Luke 9:23';
GlobalVerses[9] = '"Blessed are the merciful: for they shall obtain mercy."<br> -- Matthew 5:7';
GlobalVerses[10] = '"Blessed are the peacemakers: for they shall be called the children of God."<br> -- Matthew 5:9';
GlobalVerses[11] = '"In the beginning was the Word, and the Word was with God, and the Word was God."<br> -- John 1:1';
GlobalVerses[12] = '"For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life."<br> -- John 3:16';
GlobalVerses[13] = '"For I reckon that the sufferings of this present time are not worthy to be compared with the glory which shall be revealed in us."<br> -- Romans 8:18';
GlobalVerses[14] = '"But thanks be to God, which giveth us the victory through our Lord Jesus Christ."<br> -- 1 Corinthians 15:57';

var ChildrensVerses = new Array();
ChildrensVerses[0] = '"But Jesus said, suffer the little children, and forbid them not, to come unto me: for of such is the kingdom of heaven."<br> -- Matthew 19:14';
ChildrensVerses[1] = '"Train up a child in the way he should go: and when he is old, he will not depart from it."<br> -- Proverbs 22:6';
ChildrensVerses[2] = '"Even a child is known by his doings, whether his work be pure, and whether it be right."<br> -- Proverbs 20:11';
ChildrensVerses[3] = '"Children obey your parents in the Lord: for this is right.  Honour thy father and they mother; which is the first commandment with promise.  That it may be well with thee, and thou mayest live long on the earth."<br> -- Ephesians 6:1-3';

var MensVerses = new Array();
MensVerses[0] = '"Husbands love your wives, even as Christ also loved the church, and gave himself for it."<br> -- Ephesians 5:25';
MensVerses[1] = '"And, ye fathers, provoke not your children to wrath: but bring them up in the nurture and admonition of the Lord."<br> -- Ephesians 6:4';
MensVerses[2] = '"Therefore shall a man leave his father and his mother, and shall cleave unto his wife: and they shall be one flesh."<br> -- Genesis 2:24';
MensVerses[3] = '"When I was a child, I spake as a child, I understood as a child, I thought as a child: but when I became a man, I put away childish things."<br> -- 1 Corinthians 13:11';

var WomensVerses = new Array();
WomensVerses[0] = '"Who can find a virtuous women? For her price is above the rubies."<br> -- Proverbs 31:10';


function BibleVerse(type) {
	return;
	
  var whichtype = 0;
  var whichverse;

  if (!type || type == "all")
    whichtype = Math.floor(Math.random() * 4);
	else if (type == "global")
	  whichtype = 0;
  else if (type == "children")
    whichtype = 1;
  else if (type == "men")
    whichtype = 2;
  else if (type == "women")
    whichtype = 3;

  if (whichtype == 0)
    document.write(GlobalVerses[Math.floor(Math.random() * GlobalVerses.length)]);
  else if (whichtype == 1)
    document.write(ChildrensVerses[Math.floor(Math.random() * ChildrensVerses.length)]);
  else if (whichtype == 2)
    document.write(MensVerses[Math.floor(Math.random() * MensVerses.length)]);
  else if (whichtype == 3)
    document.write(WomensVerses[Math.floor(Math.random() * WomensVerses.length)]);
  else
    document.write('"And the Lord God formed a man of the dust of the ground, and breathed into his nostrils the breath of life; and man became a living soul." --Genesis 2:7');

}

<!--- End Random Bible Verse --->
