	$().ready(function() {

//>> Email validation and submitter

	$("form").validate({
		submitHandler:function() {
			//hide the form
			$('form').hide();
			
			//show the loading bar
			$('.loader').append($('.bar')); 
			$('.bar').css({display:'block'});

			//send the ajax request  
			$.get('mail.php',{name:$('#name').val(), email:$('#email').val(), comment:$('#comment').val()},
		
			//return the data
			function(data){
				//hide the graphic
				$('.bar').css({display:'none'}); 
				$('.loader').append(data);  
			});	
		
			//stay on the page					
			return false;

		},
		rules: {
			name: "required",
			email: {
				required: true,
				email: true
			}
		},
		messages: {
			name: "Enter your first name",
			email: "Enter a valid email address"
		},
	});




//>> Cycling testimonials

		$(function(){
			$('.testimonials').cycle({
				fx: 'fade',
				speed:    500,
				timeout:  7000
			});
		});

		var dataString = 'name='+ name + '&email=' + email;  



	});
	
//>> ajax contact form

/*
$(function() {
	//trigger ajax on submit
	$('#contactform').submit( function(){
		
		//hide the form
		$('#contactform').hide();
		
		//show the loading bar
		$('.loader').append($('.bar')); 
		$('.bar').css({display:'block'});
		
		//send the ajax request  
		$.get('mail.php',{name:$('#name').val(), email:$('#email').val(), comment:$('#message').val()},
	
		//return the data
		function(data){
			//hide the graphic
			$('.bar').css({display:'none'}); 
			$('.loader').append(data);  
		});	
	
		//stay on the page					
		return false;	
	});
});
*/

