// JavaScript Document
function setsound(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toUTCString());
}

function leaveheader()
{
setTimeout(removeheader,1000);
}

function removeheader()
{
var thePlayer = document.getElementById("thePlayer");
thePlayer.subnavout(1);
}



//------------------------------------------------------------------------------------
<!--
	// This file contains the data validation JavaScript functions
	// It is included in the HTML pages with forms that need these
	// data validation routines.


// DEFINE VARIABLES

// whitespace characters
var whitespace = " \t\n\r";



/****************************************************************/

// PURPOSE:  Check to see if the string passed in is a valid time.
//	A valid time is defined as a string which is postfixed with either
//  "PM" or "AM".  Next it checks to see if there is a colon in the
//  string.  If there is, it makes sure that at least one digit preceeds
//  it and two proceed it.

	function IsTime(strTime)
	{
		var strTestTime = new String(strTime);
		strTestTime.toUpperCase();

		var bolTime = false;

		if (strTestTime.indexOf("PM",1) != -1 || strTestTime.indexOf("AM",1))
			bolTime = true;

		if (bolTime && strTestTime.indexOf(":",0) == 0)
			bolTime = false;

		var nColonPlace = strTestTime.indexOf(":",1);
		if (bolTime && ((parseInt(nColonPlace) + 5) < (strTestTime.length - 1) || (parseInt(nColonPlace) + 4) > (strTestTime.length - 1)))
			bolTime = false;


		return bolTime;
	}

/****************************************************************/

function replaceAll (s, fromStr, toStr)
{
	var new_s = s;
	for (i = 0; i < 100 && new_s.indexOf (fromStr) != -1; i++)
	{
		new_s = new_s.replace (fromStr, toStr);
	}
	return new_s;
}

/****************************************************************/

/* PURPOSE:  Since we are using the single tick mark as the
	string delimiter to construct our SQL queries, a string with
	a tick mark in it will cause a SQL error.  Therefore we replace
	all "'" with "''", which eliminates the possibility of a SQL error.
*/

function sqlSafe (s)
{
	var new_s = s;
	new_s = replaceAll (new_s, "'", "|");
	new_s = replaceAll (new_s, "|", "''");
	new_s = replaceAll (new_s, "\"", "|");
	new_s = replaceAll (new_s, "|", "''");
	return new_s;
}

/****************************************************************/

function makeSafe (i)
{
	i.value = sqlSafe (i.value);
}

/****************************************************************/

// Check whether string s is empty.

function isEmpty(s)
{   return ((s == null) || (s.length == 0))
}

/****************************************************************/

// Returns true if string s is empty or 
// whitespace characters only.

function isWhitespace (s)

{   var i;

    // Is s empty?
    if (isEmpty(s)) return true;

    // Search through string's characters one by one
    // until we find a non-whitespace character.
    // When we do, return false; if we don't, return true.

    for (i = 0; i < s.length; i++)
    {   
	// Check that current character isn't whitespace.
	var c = s.charAt(i);

	if (whitespace.indexOf(c) == -1) return false;
    }

    // All characters are whitespace.
    return true;
}

/****************************************************************/

// isEmail (STRING s [, BOOLEAN emptyOK])
// 
// Email address must be of form a@b.c ... in other words:
// * there must be at least one character before the @
// * there must be at least one character before and after the .
// * the characters @ and . are both required
//
// For explanation of optional argument emptyOK,
// see comments of function isInteger.

function isEmail (s)
{   if (isEmpty(s)) 
       if (isEmail.arguments.length == 1) return defaultEmptyOK;
       else return (isEmail.arguments[1] == true);
   
    // is s whitespace?
    if (isWhitespace(s)) return false;
    
    // there must be >= 1 character before @, so we
    // start looking at character position 1 
    // (i.e. second character)
    var i = 1;
    var sLength = s.length;

    // look for @
    while ((i < sLength) && (s.charAt(i) != "@"))
    { i++
    }

    if ((i >= sLength) || (s.charAt(i) != "@")) return false;
    else i += 2;

    // look for .
    while ((i < sLength) && (s.charAt(i) != "."))


    { i++
    }

    // there must be at least one character after the .
    if ((i >= sLength - 1) || (s.charAt(i) != ".")) return false;
    else return true;
}
function isPhone(s)
{
  var phoneNum = new String(s);
   
  var regExpObj = /\d\d\d-\d\d\d-\d\d\d\d/;
   
  if(regExpObj.exec(phoneNum) == null)
  {
    return false;
  }
  else
  {
    return true;
  }
}

function isDate(s)
{
  var datenum = new String(s);
   
  var regExpObj = /\d\d\/\d\d\/\d\d\d\d/;
   
  if(regExpObj.exec(datenum) == null)
  {
    return false;
  }
  else
  {
    return true;
  }
}



function validatecontact()
{
	if(isEmpty(document.TheForm.FirstName.value))
	{
		alert("Please fill out required field: First Name");
		document.TheForm.FirstName.focus();
		return false;
	}
	if(isEmpty(document.TheForm.LastName.value))
	{
		alert("Please fill out the required field: Last Name");
		document.TheForm.LastName.focus();
		return false;
	}
	if(isEmpty(document.TheForm.EmailFrom.value))
	{
		alert("Please fill out required field: Email");
		document.TheForm.EmailFrom.focus();
		return false;
	}
	return true;
}

function validatemailinglist()
{
	if(isEmpty(document.TheForm.FirstName.value))
	{
		alert("Please fill out required field: First Name");
		document.TheForm.FirstName.focus();
		return false;
	}
	if(isEmpty(document.TheForm.LastName.value))
	{
		alert("Please fill out the required field: Last Name");
		document.TheForm.LastName.focus();
		return false;
	}
	if(isEmpty(document.TheForm.EmailFrom.value))
	{
		alert("Please fill out required field: Email");
		document.TheForm.EmailFrom.focus();
		return false;
	}
	if(isEmpty(document.TheForm.Birthday.value))
	{
		alert("Please fill out required field: Birthday in format MM/DD/YYYY");
		document.TheForm.Birthday.focus();
		return false;
	}
	if(!isDate(document.TheForm.Birthday.value))
	{
		alert("Please fill out required field: Birthday in format MM/DD/YYYY");
		document.TheForm.Birthday.focus();
		return false;
	}
}
function validatepcjoin()
{
	if(isEmpty(document.TheForm.FirstName.value))
	{
		alert("Please fill out required field: First Name");
		document.TheForm.FirstName.focus();
		return false;
	}
	if(isEmpty(document.TheForm.LastName.value))
	{
		alert("Please fill out the required field: Last Name");
		document.TheForm.LastName.focus();
		return false;
	}
	if(isEmpty(document.TheForm.Address.value))
	{
		alert("Please fill out required field: Address");
		document.TheForm.Address.focus();
		return false;
	}
	if(isEmpty(document.TheForm.City.value))
	{
		alert("Please fill out required field: City");
		document.TheForm.City.focus();
		return false;
	}
	if(isEmpty(document.TheForm.State.value))
	{
		alert("Please fill out required field: State");
		document.TheForm.State.focus();
		return false;
	}
	if(isEmpty(document.TheForm.Zip.value))
	{
		alert("Please fill out required field: Zip");
		document.TheForm.Zip.focus();
		return false;
	}
	if(isEmpty(document.TheForm.Phone.value))
	{
		alert("Please fill out required field: Phone (###-###-####)");
		document.TheForm.Phone.focus();
		return false;
	}
	if(!isPhone(document.TheForm.Phone.value))
	{
		alert("Please fill out the required field: Phone (###-###-####)");
		document.TheForm.Phone.focus();
		return false;
	}
	if(!isEmpty(document.TheForm.Fax.value))
	{
		if(!isPhone(document.TheForm.Fax.value))
		{
			alert("Please fill out field Fax in format (###-###-####)");
			document.TheForm.Fax.focus();
			return false;
		}
	}
	if(isEmpty(document.TheForm.Birthday.value))
	{
		alert("Please fill out required field: Birthday");
		document.TheForm.Birthday.focus();
		return false;
	}
	if(!isDate(document.TheForm.Birthday.value))
	{
		alert("Please fill out required field: Birthday (MM-DD-YYYY)");
		document.TheForm.Birthday.focus();
		return false;
	}
	if(!isEmpty(document.TheForm.SecondBirthday.value))
	{
		if(!isDate(document.TheForm.SecondBirthday.value))
		{
			alert("Please fill out field Second Birthday with format (MM-DD-YYYY)");
			document.TheForm.SecondBirthday.focus();
			return false;
		}
	}
	if(!isEmpty(document.TheForm.Anniversary.value))
	{
		if(!isDate(document.TheForm.Anniversary.value))
		{
			alert("Please fill out field Anniversary with format (MM-DD-YYYY)");
			document.TheForm.Anniversary.focus();
			return false;
		}
	}
	if(isEmpty(document.TheForm.EmailFrom.value))
	{
		alert("Please fill out required field: Email");
		document.TheForm.EmailFrom.focus();
		return false;
	}

	return true;
}

function validategroup()
{
	if(isEmpty(document.TheForm.FirstName.value))
	{
		alert("Please fill out required field: First Name");
		document.TheForm.FirstName.focus();
		return false;
	}
	if(isEmpty(document.TheForm.LastName.value))
	{
		alert("Please fill out the required field: Last Name");
		document.TheForm.LastName.focus();
		return false;
	}
	if(isEmpty(document.TheForm.EmailFrom.value))
	{
		alert("Please fill out required field: Email");
		document.TheForm.EmailFrom.focus();
		return false;
	}
	return true;
}
// -->

