	$(document).ready(function() { 
			// bind form using ajaxForm 
			$('#HPForm').ajaxForm( { beforeSubmit: validate, target: '#error', url: 'request/guest_list/hp_guestlist.asp' } );
			
		
	
		function validate(formData, jqForm, options) {
			for (var i=0; i < formData.length; i++) {
				if (!formData[i].value) {
					alert('Please enter a value for both Name and Email');
					return false;
				}
			}
			

	
			$('#error').fadeIn('slow');
			$('#HPForm').clearForm();
		}
		})
			



	$(document).ready(function() { 
			// bind form using ajaxForm 
			$('#contact').ajaxForm( { beforeSubmit: validate, target: '#RequestError', url: 'request/corporate_contact.asp' } );
			
			  function validate(formData, jqForm, options) { 
				// fieldValue is a Form Plugin method that can be invoked to find the 
				// current value of a field 
				// 
				// To validate, we can capture the values of both the username and password 
				// fields and return true only if both evaluate to true 
			  
			 
				var form = jqForm[0]; 
				if (!form.Firstname.value || !form.Lastname.value || !form.Email.value) { 
					alert('Please enter a value for All Fields With Red Asterisk'); 
					return false; 
				} 
			
			

	
			$('#RequestError').fadeIn('slow');
			$('#contact').clearForm();
		}
		})
			
			
			
	$(document).ready(function() { 
			// bind form using ajaxForm 
			$('#login').ajaxForm( { beforeSubmit: validate, target: '#RequestError', url: 'login_af.asp' } );
			
		
	
		function validate(formData, jqForm, options) {
			for (var i=0; i < formData.length; i++) {
				if (!formData[i].value) {
					alert('LOGIN');
					return false;
				}
			}
			

	
			$('#RequestError').fadeIn('slow');
			$('#login').clearForm();
		}
		})
		
		
		
		
		
		
//Home Owners Form	

		
// prepare the form when the DOM is ready 
$(document).ready(function() { 
    var options = {
    
    target:     '#RequestError', 
    beforeSubmit:  validate1,
    url:        'request/home_owners_request.asp', 
    success: function() {
        $('#homeowners').html("<div id='message'></div>");
        $('#RequestError').html("")
        .append("<p>Thank your for your input. <br>It will be passed along to the appropriate professionals, who will respond to you shortly.</p>")
        .hide()
        .fadeIn(1500, function() {
          $('#RequestError').append("");
        });
      }
    
}; 
		
   // bind to the form's submit event 
    $('#homeowners').submit(function() { 
        // inside event callbacks 'this' is the DOM element so we first 
        // wrap it in a jQuery object and then invoke ajaxSubmit 
        $(this).ajaxSubmit(options); 
 
        // !!! Important !!! 
        // always return false to prevent standard browser submit and page navigation 
        return false; 
    }); 
}); 


function validate1(formData, jqForm, options) { 
    // formData is an array of objects representing the name and value of each field 
    // that will be sent to the server;  it takes the following form: 
    // 
    // [ 
    //     { name:  username, value: valueOfUsernameInput }, 
    //     { name:  password, value: valueOfPasswordInput } 
    // ] 
    // 
    // To validate, we can examine the contents of this array to see if the 
    // username and password fields have values.  If either value evaluates 
    // to false then we return false from this method. 
 
    for (var i=0; i < formData.length; i++) { 
        if (!formData[i].value) { 
				alert('Please enter a value for All Fields With Red Asterisk');
            return false; 
        } 
    } 
    //alert('All fields contain values.'); 
}


