function resize_window() 
{ 
    window.open("","myNewWin","width=500,height=120,toolbar=0"); 
    var a = window.setTimeout("document.form1.submit();",500); 
}

function tryout_window() 
{ 
    window.open("","tryoutwindow","width=420,height=420,toolbar=0"); 
    var a = window.setTimeout("document.form1.submit();",500); 
}

function isEmpty(strfield1, strfield2, strfield3) {
//change "field1, field2 and field3" to your field names
strfield1 = document.forms[0].email.value 
	if (strfield1 == "" || strfield1 == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ')
    {
		alert("\"Email Address\" is blank.\n")
		return false;
    }
	return true;
}

//function to check valid email address
function isValidEmail(strEmail){
  validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
  strEmail = document.forms[0].email.value;

   // search email text for regular exp matches
    if (strEmail.search(validRegExp) == -1) 
   {
      alert('A valid e-mail address is required.\nPlease amend and retry');
      return false;
    } 
    return true; 
}

//function that performs all functions, defined in the onsubmit event handler

function check(form){
	if (isEmpty(form.field1)){
		if (isValidEmail(form.email)){
			window.location = "http://www.lacrossespartans.com/"
			resize_window();
			return true;
		}
	}
	return false;
}

function isMerchEmpty(strfield1, strfield2, strfield3) {


//change "field1, field2 and field3" to your field names
strfield1 = document.forms[0].fullname.value 
strfield2 = document.forms[0].streetaddress.value
strfield3 = document.forms[0].city.value
strfield4 = document.forms[0].state.value
strfield5 = document.forms[0].zipcode.value
strfield6 = document.forms[0].email.value
strfield7 = document.forms[0].phone.value

    if (strfield1 == "" || strfield1 == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ')
    {
    alert("\"Full Name\" is a mandatory field.\n")
    return false;
    }

    if (strfield2 == "" || strfield2 == null || strfield2.charAt(0) == ' ')
    {
    alert("\"Street Address\" is a mandatory field.\n")
    return false;
    }

    if (strfield3 == "" || strfield3 == null || strfield3.charAt(0) == ' ')
    {
    alert("\"City\" is a mandatory field.\n")
    return false;
    }

	if (strfield4 == "" || strfield4 == null || strfield4.charAt(0) == ' ')
    {
    alert("\"State\" is a mandatory field.\n")
    return false;
    }

	if (strfield5 == "" || strfield5 == null || strfield5.charAt(0) == ' ')
    {
    alert("\"ZIP Code\" is a mandatory field.\n")
    return false;
    }

	if (strfield6 == "" || strfield6 == null || strfield6.charAt(0) == ' ')
    {
    alert("\"Email\" is a mandatory field.\n")
    return false;
    }

	if (strfield7 == "" || strfield7 == null || strfield7.charAt(0) == ' ')
    {
    alert("\"Phone Number\" is a mandatory field.\n")
    return false;
    }

    return true;
	
}

function check_merch(form){
if (isMerchEmpty(form.field1)){
  if (isMerchEmpty(form.field2)){
    if (isMerchEmpty(form.field3)){
		if (isValidEmail(form.email)){
			window.location = "http://www.lacrossespartans.com/"
			resize_window();
		  return true;
		}
	  }
  }
}
return false;
}

function isEmpty(strfield1, strfield2, strfield3) {


//change "field1, field2 and field3" to your field names
strfield1 = document.forms[0].fullname.value 
strfield2 = document.forms[0].streetaddress.value
strfield3 = document.forms[0].city.value
strfield4 = document.forms[0].state.value
strfield5 = document.forms[0].zipcode.value
strfield6 = document.forms[0].email.value
strfield7 = document.forms[0].phone.value
strfield8 = document.forms[0].tickettype.value
strfield9 = document.forms[0].quantity.value

    if (strfield1 == "" || strfield1 == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ')
    {
    alert("\"Full Name\" is a mandatory field.\n")
    return false;
    }

    if (strfield2 == "" || strfield2 == null || strfield2.charAt(0) == ' ')
    {
    alert("\"Street Address\" is a mandatory field.\n")
    return false;
    }

    if (strfield3 == "" || strfield3 == null || strfield3.charAt(0) == ' ')
    {
    alert("\"City\" is a mandatory field.\n")
    return false;
    }

	if (strfield4 == "" || strfield4 == null || strfield4.charAt(0) == ' ')
    {
    alert("\"State\" is a mandatory field.\n")
    return false;
    }

	if (strfield5 == "" || strfield5 == null || strfield5.charAt(0) == ' ')
    {
    alert("\"ZIP Code\" is a mandatory field.\n")
    return false;
    }

	if (strfield6 == "" || strfield6 == null || strfield6.charAt(0) == ' ')
    {
    alert("\"Email\" is a mandatory field.\n")
    return false;
    }

	if (strfield7 == "" || strfield7 == null || strfield7.charAt(0) == ' ')
    {
    alert("\"Phone Number\" is a mandatory field.\n")
    return false;
    }

	if (strfield8 == "" || strfield8 == null || strfield8.charAt(0) == ' ')
    {
    alert("\"Ticket Type\" is a mandatory field.\n")
    return false;
    }

	if (strfield9 == "" || strfield9 == null || strfield9.charAt(0) == ' ')
    {
    alert("\"Number of Tickets\" is a mandatory field.\n")
    return false;
    }
    return true;
	
}

function isPiggyEmpty(strfield1, strfield2, strfield3) {


//change "field1, field2 and field3" to your field names
strfield1 = document.forms[0].fullname.value 
strfield6 = document.forms[0].email.value
strfield7 = document.forms[0].phone.value

    if (strfield1 == "" || strfield1 == null || !isNaN(strfield1) || strfield1.charAt(0) == ' ')
    {
    alert("\"Full Name\" is a mandatory field.\n")
    return false;
    }

	if (strfield6 == "" || strfield6 == null || strfield6.charAt(0) == ' ')
    {
    alert("\"Email\" is a mandatory field.\n")
    return false;
    }

	if (strfield7 == "" || strfield7 == null || strfield7.charAt(0) == ' ')
    {
    alert("\"Phone Number\" is a mandatory field.\n")
    return false;
    }

    return true;
	
}

function check_piggys(form){
if (isPiggyEmpty(form.field1)){
  if (isPiggyEmpty(form.field2)){
    if (isPiggyEmpty(form.field3)){
		if (isValidEmail(form.email)){
			window.location = "http://www.lacrossespartans.com/"
			resize_window();
		  return true;
		}
	  }
  }
}
return false;
}

