function WM_imageSwap(daImage, daSrc){
  var objStr,obj;
  /*
    WM_imageSwap()
    Changes the source of an image.

    Source: Webmonkey Code Library
    (http://www.hotwired.com/webmonkey/javascript/code_library/)

    Author: Shvatz
    Author Email: shvatz@wired.com

    Usage: WM_imageSwap(originalImage, 'newSourceUrl');

    Requires: WM_preloadImages() (optional, but recommended)
    Thanks to Ken Sundermeyer (ksundermeyer@macromedia.com) for his help
    with variables in ie3 for the mac. 
    */

  // Check to make sure that images are supported in the DOM.
  if(document.images){
    // Check to see whether you are using a name, number, or object
    if (typeof(daImage) == 'string') {
      // This whole objStr nonesense is here solely to gain compatability
      // with ie3 for the mac.
      objStr = 'document.' + daImage;
      obj = eval(objStr);
      obj.src = daSrc;
    } else if ((typeof(daImage) == 'object') && daImage && daImage.src) {
      daImage.src = daSrc;
    }
  }
}

function WM_preloadImages() {

/*
WM_preloadImages()
Loads images into the browser's cache for later use.

Source: Webmonkey Code Library
(http://www.hotwired.com/webmonkey/javascript/code_library/)

Author: Nadav Savio
Author Email: nadav@wired.com

Usage: WM_preloadImages('image 1 URL', 'image 2 URL', 'image 3 URL', ...);
*/

  // Don't bother if there's no document.images
  if (document.images) {
    if (typeof(document.WM) == 'undefined'){
      document.WM = new Object();
    }
    document.WM.loadedImages = new Array();
    // Loop through all the arguments.
    var argLength = WM_preloadImages.arguments.length;
    for(arg=0;arg<argLength;arg++) {
      // For each arg, create a new image.
      document.WM.loadedImages[arg] = new Image();
      // Then set the source of that image to the current argument.
      document.WM.loadedImages[arg].src = WM_preloadImages.arguments[arg];
    }
  }
}


/* All Functions and code below Copyright SportSites Inc.
   Do not use without explicit permission from SportSites Inc
   
   Version 1.0 - DAP - 07/31/2002
*/
function validateEmailForm()
{
	var formIsValid = true;
	var alertText = "There are problems with your submission:\n\n";
	var count = 0;
	
	if(document.add.name.value == "")
	{
		count++;
		alertText = alertText + count + ") You did not enter a name.\n";
		formIsValid = false;
	} // end if
	if(document.add.phone.value == "")
	{
		count++;
		alertText = alertText + count + ") You did not enter a phone number.\n";
		formIsValid = false;
	} // end if
	else
	{
		if(!isValidPhone(document.add.phone.value))
		{
			if(formIsValid)
			{
				count++;
				alertText = alertText + count + ") Phone number format is invalid.\n";
				formIsValid = false;
			} // end if
			else
			{
				count++;
				alertText = alertText + "\n" + count + ") Phone number format is invalid.\n";
				formIsValid = false;
			} // end else
		} // end if
	} // end else
	if(document.add.email.value == "")
	{
		count++;
		alertText = alertText + count + ") You did not enter an email address.\n";
		formIsValid = false;
	} // end if
	else
	{
		if(!isValidEmail(document.add.email.value))
		{
			if(formIsValid)
			{
				count++;
				alertText = alertText + count + ") Email address format is invalid.\n";
				formIsValid = false;
			} // end if
			else
			{
				count++;
				alertText = alertText + "\n" + count + ") Email address format is invalid.\n";
				formIsValid = false;
			} // end else
		} // end if
	} // end else
			
	
	if(formIsValid == false)
	{
		alert(alertText);
	} // end if
	return formIsValid;
} // end validateEmailForm()

function isValidEmail(emailText)
{
	var emailRegEx = /^\w(\.?\w)*@\w(\.?[-\w])*\.([a-z]{3,4}(\.[a-z]{2})?|[a-z]{2}(\.[a-z]{2})?)$/i;
	
	if(emailRegEx.test(emailText))
	{
		return true;
	} // end if
	else
	{
		return false;
	} // end else
} // end isValidEmail()

function isValidPhone(phoneText)
{
	var phoneRegEx = /\d\d\d-\d\d\d-\d\d\d\d/i;
	var phoneRegEx2 = /\d-\d\d\d-\d\d\d-\d\d\d\d/i;
	if(phoneRegEx.test(phoneText))
	{
		return true;
	} // end if
	else
	{
		if(phoneRegEx2.test(phoneText))
		{
			return true;
		} // end if
		else
		{
			return false;
		} // end else
	} // end else
} // end isValidPhone()


function openPicWindow(imageName, windowWidth, windowHeight)
{
	windowW = parseInt(windowWidth) + 25;
	windowH = parseInt(windowHeight) + 25;
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(imageName, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width="+windowW+",height="+windowH+",left=20,top=20');");
} // end openPicWindow()
