// Standard Error Messages
function genericAlert(str)
{
var sp=" ";
  if ("aeiouAEIOU".indexOf(str[0])!=-1)
    sp = "n ";  
  alert("Please enter a"+sp+str+".");
}

function noFirstAlert(str)
{
  alert("The first option is not a valid selection. Please choose one of the other options from "+str+".");
}

// return true if e-mail parses something reasonable
// this is pretty good
function emailtest(str)
{
  // regular expression shorthand:
  //  ^ = start of string
  //  $ = end of string
  //  \w = word (alphanuimeric + _)
  //  . = any character except a line break
  //  \. = a literal . character
  // ? = previous token is optional
  // * = repeat previous item 0 or more times
  // * = repeat previous item 1 or more times
  // So /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)* means
  //   something.something2@something3.something4,
  // where something2 and something4 are optional but could themselves
  // be made of words separated by dots.
  // And (\.\w{2,4})+$/ matches a string ending
  //  .word
  // where word has 2, 3, or 4 letters, as in .ca, .com, .bbbb
  
  // the final .test() invokes the test method of javascript's RegExp
  // object, which searches for given string and returns boolean.
  // the opening and closing / construct a literal RegExp.   
  return (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(str));
}

// return true if zip # is xxxxx
// return false otherwise.
function zip_xxxxx(str)
{
  return (/^\d{5}/.test(str));
}

// return true if phone # is xxx-xxx-xxxx
// return false otherwise.
function phone_xxx_xxx_xxxx(str)
{
  return (/^\d{3}\-\d{3}\-\d{4}/.test(str));
}

//  Script to get today's date in text form (client side)
// =======================================================

// This script and many more are available free online at
// The JavaScript Source!! http://javascript.internet.com
//- Original:  Andy Angrick/Mike Barone
// Web Site:  http://www.cgiscript.net/datetoday.htm
// Get today's current date.
var now = new Date();

// Array list of days.
var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

// Array list of months.
var months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

// Calculate four digit year.
function fourdigits(number)	{
	return (number < 1000) ? number + 1900 : number;
								}

// Join it all together
today =  days[now.getDay()] + ", " +
              months[now.getMonth()] + " " +
               date + ", " +
                (fourdigits(now.getYear())) ;

// Print out the data.
function printDate() {document.write("" +today+ ".");}
//  End -->

