// JavaScript Document


function validate_online_registration()
{	
	//	VALIDATE REQUIRED FIELDS
	
	if( $('Name').value.length <= 0 ) {
		alert( 'You must complete the Name field to continue.' ); return false; }
		
	if( $('Email').value.length <= 0 ) {
		alert( 'You must complete the Email field to continue.' ); return false; }
	
	if( $('Phone').value.length <= 10 ) {
		alert( 'You must complete the Phone field to continue.' ); return false; }
		
	if( $('Pet1').value.length <= 0 ) {
		alert( 'You must provide atleast one pet name to continue.' ); return false; }
		
	if( $('InDate').value.length <= 0 ) {
		alert( 'You must provide atleast your requested arrival time to continue.'); return false; }
			
	return true;
	/*
	$('onlineregistration').request({
		parameters: { p:'onlineregistration' },
		onSuccess: function(e) 
		{ 
			var response = e.responseText.split('^');;
			var success = response[0];  
			success = success.replace(/\s/gi, '');
			
			var message = response[1];
						
			//	
			if( success === "false" )
			{
				alert("ERROR!\n\nServer Response:\n"+message);
			}
			if( success === "true" )
			{
				alert("Thank you for registering your pet with us! You will receive a confirmation email shortly with more information.");
				//window.location="index.php";
			}
			
		} });
	
	*/
}

function validate_contact_form()
{	
	//	VALIDATE REQUIRED FIELDS
	
	if( $('Name').value.length <= 0 ) {
		alert( 'You must complete the Name field to continue.' ); return false; }
		
	if( $('Email').value.length <= 0 ) {
		alert( 'You must complete the Email field to continue.' ); return false; }
	
	if( $('Phone').value.length <= 0 ) {
		alert( 'You must complete the Phone field to continue.' ); return false; }
	
	return true;
	
	/*
	$('contact').request({
		parameters: { p:'contact' },
		onSuccess: function(e) 
		{ 
			var response = e.responseText.split('^');;
			var success = response[0];
			success = success.replace(/\s/gi, '');
			
			var message = response[1];
						
			//	
			if( success === "false" )
			{
				alert("ERROR!\n\nServer Response:\n"+message);
			}
			if( success === "true" )
			{
				alert("Thank you for registering your pet with us! You will receive a confirmation email shortly with more information.");
				//window.location="index.php";
			}
			
		} });
	
	*/
}
