<!--
function cust_check_submit()
{
  if(!custwrite.fname.value) {alert("Please input your First Name");custwrite.fname.focus(); return false;}
  if(!custwrite.lname.value) {alert("Please input your Last Name");custwrite.lname.focus(); return false;}
  if(!custwrite.phone.value) {alert("Please input your Phone Number");custwrite.phone.focus(); return false;}
  if(!custwrite.email.value) {alert("Please input your Email Address");custwrite.email.focus(); return false;}

  // -----------------------------
  // Information Validation Check
  // -----------------------------
    
  // Name Check
  if(custwrite.fname.value.length<2||custwrite.fname.value.length>30) {
    alert("Your First Name should be more than 2, less than 30 characters.");
    custwrite.fname.focus();
    return false;
  }
  if(custwrite.lname.value.length<2||custwrite.lname.value.length>30) {
    alert("Your Last Name should be more than 2, less than 30 characters.");
    custwrite.lname.focus();
    return false;
  }  
  var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
  var temp; 
  temp = custwrite.fname.value.substring(0,1); 

// First name check
  for (var i=0; i<custwrite.fname.value.length; i++) { 
    temp = "" + custwrite.fname.value.substring(i, i+1); 
    if (valid.indexOf(temp) == "-1") { 
      alert("Your fist name cannot include other than English characters");
      custwrite.fname.value = ""; 
      custwrite.fname.focus(); 
      return false;
    }
  } 
//  Last name check
  var temp2;
  for (var i=0; i<custwrite.lname.value.length; i++) { 
    temp2 = "" + custwrite.lname.value.substring(i, i+1); 
    if (valid.indexOf(temp2) == "-1") { 
      alert("Your last name cannot include other than English characters");
      custwrite.lname.value = ""; 
      custwrite.lname.focus(); 
      return false;
    }
  } 
  
  // Phone# Check
  if(custwrite.phone.value.length<10||custwrite.phone.value.length>13) {
    alert("Please follow the phone number input format (ex.519-258-9321)");
    custwrite.phone.focus();
    return false;
  }
  var pvalid = "0123456789-"; 
  var temp3; 
  temp3 = custwrite.phone.value.substring(0,1); 

  for (var i=0; i<custwrite.phone.value.length; i++) { 
    temp3 = "" + custwrite.phone.value.substring(i, i+1); 
    if (pvalid.indexOf(temp3) == "-1") { 
      alert("Please follow the phone number input format (ex.604-123-4567)");
      custwrite.phone.value = ""; 
      custwrite.phone.focus(); 
      return false;
    }
  } 

  // Determines if string is a valid looking Email Address. This is comprised
  // of looking for the "@" and "." characters...

  if(custwrite.email.value.indexOf('@') == "-1" || custwrite.email.value.indexOf('.') == "-1") // || 
//		spaceInField(custwrite.email.value) || chkInvalidEmailFormat(custwrite.email.value) || 
//		CheckForDupChar('@',custwrite.email.value)	)
	{
        alert("Please input your email address correctly");
        custwrite.email.value = ""; 
        custwrite.email.focus(); 
		return false;
	}

  // No error detected  
  return true;
}

function league_check_submit()
{
  if(!league.fname.value) {alert("Please input your First Name");league.fname.focus(); return false;}
  if(!league.lname.value) {alert("Please input your Last Name");league.lname.focus(); return false;}
  if(!league.phone.value) {alert("Please input your Phone Number");league.phone.focus(); return false;}
  if(!league.email.value) {alert("Please input your Email Address");league.email.focus(); return false;}
  if(!league.day.value) {alert("Please select your Day preferred");league.day.focus(); return false;}
  if(!league.type.value) {alert("Please select your Type of league");league.type.focus(); return false;}

  // -----------------------------
  // Information Validation Check
  // -----------------------------
    
  // Name Check
  if(league.fname.value.length<2||league.fname.value.length>30) {
    alert("Your First Name should be more than 2, less than 30 characters.");
    league.fname.focus();
    return false;
  }
  if(league.lname.value.length<2||league.lname.value.length>30) {
    alert("Your Last Name should be more than 2, less than 30 characters.");
    league.lname.focus();
    return false;
  }  
  var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
  var temp; 
  temp = league.fname.value.substring(0,1); 

// First name check
  for (var i=0; i<league.fname.value.length; i++) { 
    temp = "" + league.fname.value.substring(i, i+1); 
    if (valid.indexOf(temp) == "-1") { 
      alert("Your fist name cannot include other than English characters");
      league.fname.value = ""; 
      league.fname.focus(); 
      return false;
    }
  } 
//  Last name check
  var temp2;
  for (var i=0; i<league.lname.value.length; i++) { 
    temp2 = "" + league.lname.value.substring(i, i+1); 
    if (valid.indexOf(temp2) == "-1") { 
      alert("Your last name cannot include other than English characters");
      league.lname.value = ""; 
      league.lname.focus(); 
      return false;
    }
  } 
  
  // Phone# Check
  if(league.phone.value.length<10||league.phone.value.length>13) {
    alert("Please follow the phone number input format (ex.519-258-9321)");
    league.phone.focus();
    return false;
  }
  var pvalid = "0123456789-"; 
  var temp3; 
  temp3 = league.phone.value.substring(0,1); 

  for (var i=0; i<league.phone.value.length; i++) { 
    temp3 = "" + league.phone.value.substring(i, i+1); 
    if (pvalid.indexOf(temp3) == "-1") { 
      alert("Please follow the phone number input format (ex.604-123-4567)");
      league.phone.value = ""; 
      league.phone.focus(); 
      return false;
    }
  } 

  // Determines if string is a valid looking Email Address. This is comprised
  // of looking for the "@" and "." characters...

  if(league.email.value.indexOf('@') == "-1" || league.email.value.indexOf('.') == "-1") // || 
//		spaceInField(custwrite.email.value) || chkInvalidEmailFormat(custwrite.email.value) || 
//		CheckForDupChar('@',custwrite.email.value)	)
	{
        alert("Please input your email address correctly");
        league.email.value = ""; 
        league.email.focus(); 
		return false;
	}

  // No error detected  
  return true;
}

function ErrHandler(ErrDesc)
    {
        alert(ErrDesc);
        return false;   
    }

function hasValue(obj,type)
    {
    if (type == "TEXT" || type == "PASSWORD")
        {
        if (obj.value.length == 0) 
                return false;
        else 
                return true;
        }
    else if (type == "SELECT")
        {
        for (i=0; i < obj.length; i++)
                {
                if (obj.options[i].selected && obj.options[i].value != "")
                        return true;
                }
        return false;   
        }
    else if (type == "SINGLE_VALUE_RADIO" || type == "SINGLE_VALUE_CHECKBOX")
        {
                if (obj.checked)
                        return true;
                else
                return false;   
        }
    else if (type == "RADIO" || type == "CHECKBOX")
        {

        for (i=0; i < obj.length; i++)
                {
                if (obj[i].checked)
                        return true;
                }

        return false;   
        }
        }

function  ValidateForm(frm)
{
    if  (!hasValue(frm.Subsubject, "SELECT" )) 
        {
              if  (!ErrHandler("Subject is a required field."))
              {
              frm.Subsubject.focus();
              return false; 
              }
        }
   if  (!hasValue(frm.FirstName, "TEXT" )) 
           {
        if  (!ErrHandler("First name is a required field."))
               {
               frm.FirstName.focus();
            return false; 
            }

        }


    if  (!hasValue(frm.LastName, "TEXT" )) 

        {
        if  (!ErrHandler("Last name is a required field."))
            {
                        frm.LastName.focus();
            return false; 
            }
        }

    if  (!hasValue(frm.Email, "TEXT" )) 
        {
        if  (!ErrHandler("E-mail is a required field."))
            {
            frm.Email.focus();
            return false; 
            }
        }
        if  (!hasValue(frm.StreetAddress, "TEXT" )) 
        {
        if  (!ErrHandler("StreetAddress is a required field."))
            {
                        frm.StreetAddress.focus();
            return false; 
            }
        }
    if  (!hasValue(frm.City, "TEXT" )) 
        {
        if  (!ErrHandler("City is a required field."))
            {
                        frm.City.focus();
            return false; 
            }
        }

    if  (!hasValue(frm.Zip, "TEXT" )) 
        {
        if  (!ErrHandler("Zip/Postal Code is a required field."))
            {
                        frm.Zip.focus();
            return false; 
            }
        }
		
    if  (!hasValue(frm.Phone, "TEXT" )) 
    {
	    if  (!ErrHandler("Phone is a required field."))
        {
            frm.Phone.focus();
    	    return false; 
        }
    }

    if  (!hasValue(frm.comments, "TEXT" )) 
    {
	    if  (!ErrHandler("Comments is a required field."))
        {
            frm.comments.focus();
    	    return false; 
        }
    }

	 return true;
    }

	// VARIABLE DECLARATIONS
	var digits				  = new String("0123456789");
	var phoneNumberDelimiters = new String("()-+ ");	// non-digit characters which are allowed in phone numbers
	var digitsInNAPhoneNumber = 10;						// North American Phone Number is 10 digits
	var today				  = new Date();
	var day					  = today.getDate()
	var month				  = today.getMonth()
	var year				  = y2k(today.getYear())
	var whichOne			  = 0;
	var browser				  = navigator.appName;
			
	function CheckPhoneNumber(sPhone)
	{
		if (!isPhoneNumber(sPhone.value) && sPhone.value != "")
		{
			sPhone.value = "";
			sPhone.focus();
			alert("Please enter a valid Phone Number.");
			return false;
		}	
	if (sPhone.value.length < 10 && sPhone.value != "")
		{
			sPhone.value = "";
			sPhone.focus();
			alert("Please enter a 10 Digit Phone Number.");
		}
		return true;
	}
		
	function isPhoneNumber(sfield)
	{  
		var inputStr = sfield.toString();
		var bErr	 = true;
					
		if (sfield != "")
		{
			for (var i = 0; i < inputStr.length; i++)
			{
				var oneChar = inputStr.charAt(i)			
					
				//If the character doesn't exist in the numeric string or the accepted characters.
				if (digits.indexOf(oneChar) == -1 &&
					phoneNumberDelimiters.indexOf(oneChar) == -1)
					bErr = false;
			}
		}
					
		return bErr;
	}

	function trim(strText) 
	{ 
		// this will get rid of leading spaces 
		//alert("This is trim");
		while (strText.substring(0,1) == ' ') 
			strText = strText.substring(1, strText.length);

		// this will get rid of trailing spaces 
		while (strText.substring(strText.length-1,strText.length) == ' ')
			strText = strText.substring(0, strText.length-1);

		return strText;
	} 

	function y2k(number)    { return (number < 1000) ? number + 1900 : number; }
	function padout(number) { return (number < 10) ? '0' + number : number; }

	function restart() 
	{
		if (browser == "Netscape")
			document.Content.document.frmMain.elements["txtDate" + whichOne].value = '' + padout(month - 0 + 1) + '/' + padout(day) + '/' + year;
		else
		    document.frmMain.elements["txtDate" + whichOne].value = '' + padout(month - 0 + 1) + '/' + padout(day) + '/' + year;
	    
	    mywindow.close();
	}

	function ShowCalendar(sfield) 
	{ 
		whichOne			   = sfield;
	    mywindow			   = open('PopupCalendar.htm','Calendar','resizable=no,width=350,height=270');
	    mywindow.location.href = '../Includes/PopupCalendar.htm';
				    
	    if (mywindow.opener == null) 
			mywindow.opener = self;
	}	

	function CheckEmail(sEmail)
	{
		if (!isEmail(sEmail.value) && sEmail.value != "")
		{
			sEmail.value = "";
			sEmail.focus();
			
			alert("Please enter a valid email address.");
		}
	}
		
	function isEmail(sEmail)
	{   var i		= 1;
		var j		= 0;
	    var sLength = sEmail.length;

		for(j=0; j< sLength; j++)
		{	
			if (sEmail.charAt(j) == " ")
				return false;
		}

	    while ((i < sLength) && (sEmail.charAt(i) != "@"))
			i++
					

	    if ((i >= sLength) || (sEmail.charAt(i) != "@")) 
			return false;
	    else 
			i += 2;

	    while ((i < sLength) && (sEmail.charAt(i) != "."))
			i++
			    
	    if ((i >= sLength - 1) || (sEmail.charAt(i) != ".")) 
			return false;
	    else 
			return true;
	}

	function IsNum(sfield)
	{
		//Checks if value enter is Numeric.  If not it clears the field.
				
		if (trim(sfield.value) != "" && isNaN(sfield.value))
		{
			sfield.value = 1;
			sfield.focus();
			alert("Please enter a numeric value.");	
			return false;
		}
		
		return true;
	}
			
	function isSSN(sField) 
	{
		var strMsg1 = "Please enter valid SSN Number."
		var re	  = /^[0-9]{3}-[0-9]{2}-[0-9]{4}$/
		
		if (sField.value != "")
		{
			if (!re.test(sField.value))
			{  
				alert(strMsg1);
				sField.focus();
				return false;
			}	
		}
				
		return true;	
	}

	function IsBlank(field)
	{
		if (field.value == "")
		{
			field.focus();
			alert("Please enter a value.");
		}
	}	
		
	function CheckDate(sField) 
	{
		if (sField.value == "")
			return true;

		if (IsDate(sField) == false)
		{
			sField.value = "";
			alert("Please enter a valid date.");
			sField.focus();
			return false;
		}
		else 
			return true;
	}
		
	function IsDate(sField)
	{
		var strDate  = sField.value;
		var intDay   = "";
		var intMonth = "";
		var intYear  = "";
		var pos;
		
		pos		 = strDate.indexOf("/");
		strMonth = strDate.substr(0, pos);
		strDate  = strDate.slice(pos + 1, strDate.length)
		pos		 = strDate.indexOf("/");
		strDay	 = strDate.substr(0, pos);
		strDate  = strDate.slice(pos + 1, strDate.length)
		strYear  = strDate;
		intDay	 = parseInt(strDay, 10);
		intMonth = parseInt(strMonth, 10);
		intYear  = parseInt(strYear, 10);		

		if (isNaN(intDay)) 
			return false;

		if (isNaN(intMonth)) 
			return false;

		if (isNaN(intYear)) 
			return false;

		if (intMonth > 12 || intMonth < 1) 
			return false;		
			
		if ((intMonth == 1 || intMonth == 3 || intMonth == 5 || intMonth == 7 || intMonth == 8 || 
			intMonth == 10 || intMonth == 12) && (intDay > 31 || intDay < 1)) 
			return false;
			
		if ((intMonth == 4 || intMonth == 6 || intMonth == 9 || intMonth == 11) && (intDay > 30 || intDay < 1)) 
			return false;

		if (intMonth == 2) 
		{
			if (intDay < 1) 
				return false;
			
			if (LeapYear(intYear) == true) 
			{
				if (intDay > 29) 
					return false;
			}
			else 
			{
				if (intDay > 28) 
					return false;
			}
		}
		
		return true;
	}

	function LeapYear(intYear) 
	{
		if (intYear % 100 == 0) 
		{
			if (intYear % 400 == 0) 
				return true; 
		}
		else 
		{
			if ((intYear % 4) == 0)
				return true; 
		}
			
		return false;
	}
		
	function DateCheck(from, to) 
	{
		if (Date.parse(from) > Date.parse(to)) 
			return true;
		else 
			return false;
	}

//-->