// JavaScript Document

var xmlHttp


function SubmitForm(theForm)
{
var why = "";

var Name = theForm.Name.value.replace(/[&]/g, 'and');
var Email = theForm.Email.value.replace(/[&]/g, 'and');
var Address = theForm.Address.value.replace(/[&]/g, 'and');
var City = theForm.City.value.replace(/[&]/g, 'and');	
var State = theForm.State.value.replace(/[$]/g, 'and');
var Zip = theForm.Zip.value.replace(/[$]/g, 'and');
var Guests = theForm.Guests.value.replace(/[$]/g, 'and');
var School = theForm.School.value.replace(/[$]/g, 'and');

    if (why != "") {
       alert(why);
       return false;
    }
	
	else{
		
		
		
		xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
  		{
  alert ("Your browser does not support AJAX!");
  return;
  		} 
var url="submit.php";

url=url+"?Name="+Name;

url=url+"&Email="+Email;

url=url+"&Address="+Address;

url=url+"&City="+City;

url=url+"&State="+State;

url=url+"&Zip="+Zip;

url=url+"&Guests="+Guests;

url=url+"&School="+School;




url=url+"&sid="+Math.random();

xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET", url ,true);
xmlHttp.send(null);

	}

}


function stateChanged() 
{ 
if (xmlHttp.readyState==4)
{ 
document.getElementById("maincontent").innerHTML=xmlHttp.responseText;
}
}

function GetXmlHttpObject()
{
var xmlHttp=null;
try
  {
  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
    {
    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
    }
  catch (e)
    {
    xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  }
return xmlHttp;
}



