
var seasonPrice = 0;
var theTotal = 0;


function changeIt(textHere)
  {
  var seasonSection = textHere;
  window.document.seasonForm.perSeason.value = seasonSection;
  }

function totalIt()
 {
 window.document.seasonForm.x_Amount.value = window.document.seasonForm.Extra_Bach.value * window.document.seasonForm.BachTicket.value + (window.document.seasonForm.vipupgrades.value * 49);
 // window.document.seasonForm.AmtLeftToPay.value = (window.document.seasonForm.grandTotal.value - 0) - (window.document.seasonForm.x_Amount.value - 0);
 }

function multIt(Quantity,Price,Result)
{
  Result = (Quantity - 0) * (Price - 0);
  totalIt();
}

function payPlan(FullAmount,PaymentPlan)
{
  window.document.seasonForm.x_amount.value = (FullAmount - 0) / (PaymentPlan - 0);
}

function setPrice(Season,Price5,NAT,check,Shows,Nutcracker, extraticket)
{
	window.document.seasonForm.ExtraPriceBach.value = Price5;
	window.document.seasonForm.ExtraTicket.value = extraticket;
	totalIt();
}

function submitForm()
{
	 
	if (window.document.seasonForm.x_first_name.value == "")
	{
	  alert("Please enter your first name.");
	  window.document.seasonForm.x_first_name.focus();
	  return false;
	}

	if (window.document.seasonForm.x_last_name.value == "")
	{
	  alert("Please enter your last name.");
	  window.document.seasonForm.x_last_name.focus();
	  return false;
	}

	if (window.document.seasonForm.x_address.value == "")
	{
	  alert("Please enter your address.");
	  window.document.seasonForm.x_address.focus();
	  return false;
	}

	if (window.document.seasonForm.x_city.value == "")
	{
	  alert("Please enter your city.");
	  window.document.seasonForm.x_city.focus();
	  return false;
	}

	if (window.document.seasonForm.x_state.value == "")
	{
	  alert("Please enter your state.");
	  window.document.seasonForm.x_state.focus();
	  return false;
	}

	if (window.document.seasonForm.x_zip.value == "")
	{
	  alert("Please enter your zip code.");
	  window.document.seasonForm.x_zip.focus();
	  return false;
	}

	if (window.document.seasonForm.x_phone.value == "(512)")
	{
	  alert("Please enter your evening phone number.");
	  window.document.seasonForm.x_phone.focus();
	  return false;
	}

	if (window.document.seasonForm.DayPhone.value == "(512)")
	{
	  alert("Please enter your daytime phone number.");
	  window.document.seasonForm.DayPhone.focus();
	  return false;
	}

	if (window.document.seasonForm.x_email.value == "")
	{
	  alert("Please enter your email address.");
	  window.document.seasonForm.x_email.focus();
	  return false;
	}

	if (window.document.seasonForm.security_code.value == "")
	{
	  alert("Please enter the 5 digit security code before proceeding!");
	  window.document.seasonForm.security_code.focus();
	  return false;
	}
}

//function not used
function submitIt(seasonForm) 
{	
	if (window.document.seasonForm.DaySelection.value == "")
	 {
	  alert("Please choose a day.");
	  window.document.seasonForm.DaySelection.focus();
	  return false;
	 }
	
	if (window.document.seasonForm.seatingSelection.value == "")
	 {
	  alert("Please choose a section.");
	  window.document.seasonForm.seatingSelection.focus();
	  return false;
	 }

	if (window.document.seasonForm.Extra_Bach.value < 1)
	 {
	  alert("Please enter a valid number of tickets.");
	  window.document.seasonForm.ticketQuantity.focus();
	  return false;
	 }

	if (window.document.seasonForm.x_first_name.value == "")
	 {
	  alert("Please enter your first name");
	  window.document.seasonForm.x_first_name.focus();
	  return false;
	 }

	if (window.document.seasonForm.x_last_name.value == "")
	 {
	  alert("Please enter your last name.");
	  window.document.seasonForm.x_last_name.focus();
	  return false;
	 }

	if (window.document.seasonForm.x_address.value == "")
	 {
	  alert("Please enter your address.");
	  window.document.seasonForm.x_address.focus();
	  return false;
	 }

	if (window.document.seasonForm.x_city.value == "")
	 {
	  alert("Please enter your city.");
	  window.document.seasonForm.x_city.focus();
	  return false;
	 }

	if (window.document.seasonForm.x_state.value == "")
	 {
	  alert("Please enter your state.");
	  window.document.seasonForm.x_state.focus();
	  return false;
	 }

	if (window.document.seasonForm.x_zip.value == "")
	 {
	  alert("Please enter your zip code.");
	  window.document.seasonForm.x_zip.focus();
	  return false;
	 }

	if (window.document.seasonForm.x_phone.value == "")
	 {
	  alert("Please enter your evening phone number.");
	  window.document.seasonForm.x_phone.focus();
	  return false;
	 }

	if (window.document.seasonForm.x_email.value == "")
	 {
	  alert("An email address is required to receive a receipt.");
	  window.document.seasonForm.x_email.focus();
	  return false;
	 }
	
	if (window.document.seasonForm.security_code.value == "")
	{
	  alert("Enter the 5 digit security code before proceeding!");
	  window.document.seasonForm.security_code.focus();
	  return false;
	}

	return true;
}
