function validate_usbc_form2 ( ) {
    valid = true;
    if (document.usbcbowl.startdate.value == "0")
    {
    alert("You did not select your scheduled arrival date.")
    document.usbcbowl.startdate.focus();
    return false;
    }
    if (document.usbcbowl.enddate.value == "0")
    {
    alert("You did not select your scheduled departure date.")
    document.usbcbowl.enddate.focus();
    return false;
    }
   if (document.usbcbowl.numberofpasses.value == "0")
    {
    alert("You did not select the number of passes you need.")
    document.usbcbowl.numberofpasses.focus();
    return false;
    }
   if (document.usbcbowl.hotel.value == "0")
    {
    alert("You did not select the USBC Sponsored Hotel that you are staying at.")
    document.usbcbowl.hotel.focus();
    return false;
    }
}

function show_hide(ISID){
      // Toggle visibility between none and inline
      if ((document.getElementById(ISID).style.display == 'none'))
      {
        document.getElementById(ISID).style.display = 'inline';
      } else {
        document.getElementById(ISID).style.display = 'none';
      }
  }


function validate_form ( )
{
    valid = true;

    if ( document.form.qty.value == "")
    {
        alert ( "Please Choose the number of seats you wish to purchase." );
        valid = false;
    }

    return valid;
}

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail Address Format")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail Address Format")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail Address Format")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail Address Format")
		    return false
		 }

 		 return true
	}

function ValidateForm(){
	var emailID=document.Form1.email

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }


function ValidateUSBCemail(){
	var emailID=document.usbcform.email

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }


 function ValidateMail(){
	var emailID=document.FormMail.Email

	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email Address")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	return true
 }


function clearDefaultandCSS(el) {
	if (el.defaultValue==el.value) el.value = ""
	// If Dynamic Style is supported, clear the style
	if (el.style) el.style.cssText = ""
}



function validate_usbc ( )
{
    valid = true;
    if ( document.usbcform.first_name.value == "" )
    {
        alert ( "Please fill in your First Name." );
        document.usbcform.first_name.focus();
        return false;
    }
    if ( document.usbcform.last_name.value == "" )
    {
        alert ( "Please fill in your Last Name." );
        document.usbcform.last_name.focus();
        return false;
    }
    if ( document.usbcform.address.value == "" )
    {
        alert ( "Please fill in your Address." );
        document.usbcform.address.focus();
        return false;
    }
    if ( document.usbcform.city.value == "" )
    {
        alert ( "Please fill in your City." );
        document.usbcform.city.focus();
        return false;
    }
    if ( document.usbcform.state.value == "0" )
    {
        alert ( "Please fill in your State." );
        document.usbcform.state.focus();
        return false;
    }
    if ( document.usbcform.zip.value == "" )
    {
        alert ( "Please fill in your Zip Code." );
        document.usbcform.zip.focus();
        return false;
    }
    if ( document.usbcform.phone.value == "" )
    {
        alert ( "Please fill in the Phone field." );
        document.usbcform.phone.focus();
        return false;
    }
    if ( document.usbcform.email.value == "" )
    {
        alert ( "Please fill in your Email Address." );
        document.usbcform.email.focus();
        return false;
    }
    if (document.usbcform.c1.checked == 0)
    {
    alert("You did not check the check one of the boxes Terms & Conditions checkboxes.")
    return false;
    }
    if (document.usbcform.c2.checked == 0)
    {
    alert("You did not check the check one of the boxes Terms & Conditions checkboxes.")
    return false;
    }
}



function validate_usbc_hotel ( )
{
    valid = true;
    if ( document.usbcform.first_name.value == "" )
    {
        alert ( "Please fill in your First Name." );
        document.usbcform.first_name.focus();
        return false;
    }
    if ( document.usbcform.last_name.value == "" )
    {
        alert ( "Please fill in your Last Name." );
        document.usbcform.last_name.focus();
        return false;
    }
    if ( document.usbcform.phone.value == "" )
    {
        alert ( "Please fill in the Phone field." );
        document.usbcform.phone.focus();
        return false;
    }
    if ( document.usbcform.email.value == "" )
    {
        alert ( "Please fill in your Email Address." );
        document.usbcform.email.focus();
        return false;
    }
    if (document.usbcform.c1.checked == 0)
    {
    alert("You did not check the check one of the boxes Terms & Conditions checkboxes.")
    return false;
    }
    if (document.usbcform.c2.checked == 0)
    {
    alert("You did not check the check one of the boxes Terms & Conditions checkboxes.")
    return false;
    }
    if (document.usbcform.c3.checked == 0)
    {
    alert("You did not check the check one of the boxes Terms & Conditions checkboxes.")
    return false;
    }
    if (document.usbcform.c4.checked == 0)
    {
    alert("You did not check the check one of the boxes Terms & Conditions checkboxes.")
    return false;
    }
}




function pass_form ( )
{
    valid = true;
    if ( document.myform.customer.value == "" )
    {
        alert ( "Please fill in your Name." );
        document.myform.customer.focus();
        return false;
    }
    if ( document.myform.email.value == "" )
    {
        alert ( "Please fill in your Email Address." );
        document.myform.email.focus();
        return false;
    }
    if ( document.myform.comments.value == "" )
    {
        alert ( "Please fill in the Comments field." );
        document.myform.comments.focus();
        return false;
    }
    if ( document.myform.cap.value == "" )
    {
        alert ( "Please fill in the SPAM Guard." );
        document.myform.cap.focus();
        return false;
    }

}

  function show_hide(ISID){
      // Toggle visibility between none and inline
      if ((document.getElementById(ISID).style.display == 'none'))
      {
        document.getElementById(ISID).style.display = 'inline';
      } else {
        document.getElementById(ISID).style.display = 'none';
      }
  }


function validate(chk){
  if (chk.checked == 1)
    return True;
  else
    alert("You did not check the check box agreeing to our reservation policies.")
    return false;
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=450,left = 187,top = 59');");
}


function validate_rate ( )
{
    valid = true;
    if ( document.RateForm.Customer_Name.value == "" )
    {
        alert ( "Please fill in your Full Name." );
        document.RateForm.Customer_Name.focus();
        return false;
    }
    if ( document.RateForm.Customer_Phone.value == "" )
    {
        alert ( "Your Phone Number is required." );
        document.RateForm.Customer_Phone.focus();
        return false;
    }
    if ( document.RateForm.Customer_Email.value == "" )
    {
        alert ( "An Email Address is required." );
        document.RateForm.Customer_Email.focus();
        return false;
    }
    if ( document.RateForm.Number_of_Passengers.value == "" )
    {
        alert ( "Please fill in the Number of Passengers." );
        document.RateForm.Number_of_Passengers.focus();
        return false;
    }
    if ( document.RateForm.Travel_Day.value == "" )
    {
        alert ( "Please fill in your Anticipated travel date." );
        document.RateForm.Travel_Day.focus();
        return false;
    }
    if ( document.RateForm.Pickup_Time.value == "" )
    {
        alert ( "Please fill in your Pickup Time." );
        document.RateForm.Pickup_Time.focus();
        return false;
    }
    if ( document.RateForm.Pickup_Location.value == "" )
    {
        alert ( "Please fill in your Pickup Location." );
        document.RateForm.Pickup_Location.focus();
        return false;
    }
    if ( document.RateForm.Destination.value == "" )
    {
        alert ( "Please fill in your trips Destination." );
        document.RateForm.Destination.focus();
        return false;
    }
    if ( document.RateForm.Arrival_Time.value == "" )
    {
        alert ( "Please fill in your Anticipated Arrival Time." );
        document.RateForm.Arrival_Time.focus();
        return false;
    }
    if ( document.RateForm.Return_Time.value == "" )
    {
        alert ( "Please fill in your Anticipated Return Time." );
        document.RateForm.Return_Time.focus();
        return false;
    }
    if ( document.RateForm.Return_Location.value == "" )
    {
        alert ( "Please fill in your Return Location." );
        document.RateForm.Return_Location.focus();
        return false;
    }
    if ( document.RateForm.Duration.value == "" )
    {
        alert ( "Please fill in your trips total anticipated Duration." );
        document.RateForm.Duration.focus();
        return false;
    }
    if ( document.RateForm.cap.value == "" )
    {
        alert ( "Please fill in the SPAM Guard." );
        document.RateForm.cap.focus();
        return false;
    }
}


function HotelPop() {
window.open( "usbc_hotels.asp", "myWindow",
"status = 1, height = 350, width = 350, resizable = 0" )
}

function paypal_form ( )
{
    valid = true;
    if (document.paypalform.agreerules.checked == "0")
      {
      alert("You did not check the checkbox labelled: I understand")
      return false;
      }

}

function popUpMovie(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=635,height=515');");
}


