<!--

<!-- 
//Browser Support Code

/******** This sets up the AJAX variable. ********/
function ajaxbrowser() {
  var ajaxRequest; // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser does not support AJAX. Please update your browser. This site may not display correctly.");
			}
		}
	}  
return ajaxRequest;
}

/** VALIDATES DATA **/
function validate_zip() {
	ajaxRequest = ajaxbrowser();
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4)
		{
			xmlDoc = ajaxRequest.responseText;
			document.getElementById('valid_zip').innerHTML = xmlDoc;
		}
	}
	var state = document.getElementById('state').value;
	var zip = document.getElementById('zip').value;

	state = escape(state);
	zip = escape(zip);
	var queryString = 'field=zip&state=' + state + '&zip=' + zip;
	ajaxRequest.open("POST", "validate.php", true);
	
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", queryString.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	
	ajaxRequest.send(queryString);

}

/** VALIDATES ZIP **/
function validate(field) {
	ajaxRequest = ajaxbrowser();
	// Create a function that will receive data sent from the server
	
	var valid = 'valid_' + field;

	
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4)
		{
			xmlDoc = ajaxRequest.responseText;
			document.getElementById(valid).innerHTML = xmlDoc;
		}
	}
	var data = document.getElementById(field).value;

	data = escape(data);
	var queryString = 'field=' + field + '&data=' + data;
	ajaxRequest.open("POST", "validate.php", true);
	
	ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	ajaxRequest.setRequestHeader("Content-length", queryString.length);
	ajaxRequest.setRequestHeader("Connection", "close");
	
	ajaxRequest.send(queryString);

}
function validate_input()
{
	
	var first_name = document.getElementById('first_name');
	var last_name = document.getElementById('last_name');
	var address01 = document.getElementById('address01');
	var city = document.getElementById('city');
	var state = document.getElementById('state');
	var zip = document.getElementById('zip');
	var email = document.getElementById('email');
	var first_name_valid = document.getElementById('first_name_valid');
	var last_name_valid = document.getElementById('last_name_valid');
	var address_valid = document.getElementById('address_valid');
	var city_valid = document.getElementById('city_valid');
	var state_valid = document.getElementById('state_valid');
	var zip_valid = document.getElementById('zip_valid');
	var email_valid = document.getElementById('email_valid');

	
	if (first_name.value == ''){
		alert('You must enter a first name!');
		return false;
	}
	
	if (last_name.value == ''){
		alert('You must enter a last name!');
		return false;
	}
	
	if (address01.value == ''){
		alert('You must enter an address!');
		return false;
	}
	
	if (city.value == ''){
		alert('You must enter a city!');
		return false;
	}
	
	if (state.value == ''){
		alert('You must enter a state!');
		return false;
	}
	
	if (zip.value == ''){
		alert('You must enter a zip code!');
		return false;
	}
	
	if (email.value == ''){
		alert('You must enter an email address!');
		return false;
	}
	
	if (first_name_valid.value == ''){
		alert('Your first name is invalid! Please check it and try again.');
		return false;
	}
	
	if (last_name_valid.value == ''){
		alert('Your last name is invalid! Please check it and try again.');
		return false;
	}
	
	if (address_valid.value == ''){
		alert('Your address is invalid! Please check it and try again.');
		return false;
	}
	
	if (city_valid.value == ''){
		alert('Your city is invalid! Please check it and try again.');
		return false;
	}
	
	if (state_valid.value == ''){
		alert('Your state is invalid! Please check it and try again.');
		return false;
	}
	
	if (zip_valid.value == ''){
		alert('Your zip code is invalid! Please check it and try again.');
		return false;
	}
	
	if (email_valid.value == ''){
		alert('Your email address is invalid! Please check it and try again.');
		return false;
	}
	
}

//-->
