/*
*****************************************************************************  
* File Name        : rockchurch.js
* Solution         : RockChurch
*
* Author           : W.Phillips
* Creation Date    : 01/30/07
* Original Release : 1.0
*
* Notice           : Copyright © 2007 The Rock Church Ministries Int'l, 
*                    All rights reserved
*
* Description      : JavaScript file for The Rock Church web-site
*
****************************************************************************
*******************************  History  **********************************
**************************************************************************** 
*/

/*
****************************************************************************
* Function Name    : ChangeImage()
* Parameters       : imageName
*                    newImageFile
* Inputs / Outputs : None
* Scope            : Public
* Returns          : Nothing
*                  
* Description      : Changes the image file to be displayed 
*
***************************************************************************
*/

function ChangeImage(imageName, newImageFile) 
{
  // Find the object that represents the <img> tag.

  var image = document.getElementById(imageName)

  // Change the picture.

  image.src = newImageFile
}

/*
****************************************************************************
* Function Name    : ValidatePrayerRequestForm()
* Parameters       : theForm
* Inputs / Outputs : None
* Scope            : Public
* Returns          : true  (if validation is ok)
*                    false (if validation fails)
*                  
* Description      : Validates the required fields on prayer request form
*
***************************************************************************
*/

function ValidatePrayerRequestForm(theForm)
{

  if (theForm.Name.value == "")
  {
    alert("Please enter a value for the \"Name\" field.");
    theForm.FirstName.focus();
    return (false);
  }

  if (theForm.Email.value == "")
  {
    alert("Please enter a value for the \"Email\" field.");
    theForm.LastName.focus();
    return (false);
  }
 
  return (true);
}
 

