//<![CDATA[	
	$(document).ready(function(){
		$('#submitForm').click(function(){
			var error = false;
			
			if($('#firstname').val().replace(/\s+/g,"").length == 0){
				$('#firstname').css('background-color', '#ce6522');
				error = true;
			}
			else{
				$('#firstname').css('background-color', '#ffffff');
			}
			
			if($('#lastname').val().replace(/\s+/g,"").length == 0){
				$('#lastname').css('background-color', '#ce6522');
				error = true;
			}
			else{
				$('#lastname').css('background-color', '#ffffff');
			}
			
			if($('#email').val().replace(/\s+/g,"").length == 0){
				$('#email').css('background-color', '#ce6522');
				error = true;
			}
			else{
				$('#email').css('background-color', '#ffffff');
			}
			
			if($('#phone').val().replace(/\s+/g,"").length == 0){
				$('#phone').css('background-color', '#ce6522');
				error = true;
			}
			else{
				$('#phone').css('background-color', '#ffffff');
			}
			
			if(error){
				$('#message').html('Please fill out all required fields. Form will not process unless all required fields (*) are complete.');
			}
			else{
				$('#message').html('Processing... please wait. ');
				
				var formData = 'firstname=' + $('#firstname').val() + '&lastname=' + $('#lastname').val() + '&address1=' + $('#address1').val() + '&address2=' + $('#address2').val() + '&city=' + $('#city').val() + '&state=' + $('#state').val() + '&zip=' + $('#zip').val() + '&country=' + $('#country').val() + '&email=' + $('#email').val() + '&phone=' + $('#phone').val() + '&how=' + $('#how').val() +  '&comments=' + $('#comments').val()
				
				if($('#help1').attr('checked')){
					formData += '&help[0]=' + $('#help1').val();
				}
				
				if($('#help2').attr('checked')){
					formData += '&help[1]=' +  $('#help2').val();
				}
				
				$.ajax({
					type: 'POST',
					url: 'inc/php/contact.php',
					cache: false,
					data: formData,
					dataType: "xml",
					timeout: 5000,
					error: function(ob, status){
						$('#message').html('Error: ' + status + '. Please try again.');
					},
					success: function(xml){
						var root = xml.getElementsByTagName('root')[0];
						if(root.getElementsByTagName("error")[0].firstChild.nodeValue == 'false'){
							$('#contactleftcol').html('Thank you! Your message has been successfully sent.');
							$('#contactrightcol').html('');
						}
						else{
							$('#message').html('Error. Please try again.');
						}
					}
				});
			}
		});
	});
//]]>
