//if submit button is clicked
	function mfvs_newsletter_submit(id) {
		//Get the data from all the fields
		var email = jQuery('#mfvs_newsletter_form_'+id+' input[name=email]');
		var data = 'email=' + email.val();

		//show the loading sign
		jQuery('.loading').show();
		
		//start the ajax
		jQuery.ajax({
			//this is the php file that processes the data and send mail
			url: "http://www.pumpsmag.com/wp-content/plugins/mfvs-newsletter/sign-up.php",	
			
			//GET method is used
			type: "POST",

			//pass the data			
			data: data,		
			
			//Do not cache the page
			cache: false,
			
			//success
			success: function (error) {				
						alert(error);

				if (error == 'exists') {
					jQuery('#mfvs_newsletter_form_'+id+' input[name=email]').val('Sorry that email already exists');
					jQuery('#mfvs_newsletter_form_'+id+' input[name=email]').focus(function(){
						if(jQuery(this).val() == 'Sorry that email already exists'){
							jQuery(this).val('');
						}
					});
				} else if(error == 'invalid') {
					jQuery('#mfvs_newsletter_form_'+id+' input[name=email]').val('Please enter a valid email');
					jQuery('#mfvs_newsletter_form_'+id+' input[name=email]').focus(function(){
						if(jQuery(this).val() == 'Please enter a valid email'){
							jQuery(this).val('');
						}
					});
				} else if(error == 'mysql') {
					jQuery('#mfvs_newsletter_form_'+id+' input[name=email]').val('Database Error');
				} else {
					jQuery('#mfvs_newsletter_'+id).children('.success').fadeIn();
					jQuery('#mfvs_newsletter_'+id).children('.form').fadeOut();
				}
			}		
		});
		//Simple validation to make sure user entered something
		//If error found, add hightlight class to the text field
						
		//organize the data properly
		
		//cancel the submit button default behaviours
		return false;
	}	

