// JQuery Document
$(function(){
	$('#extra #quickquote .qqSubmit').click(function(e){
		var sName = $('#extra #quickquote .Name').val();
		var sEmail = $('#extra #quickquote .Email').val();
		var sPhone = $('#extra #quickquote .Phone').val();
		var sCompany = $('#extra #quickquote .Company').val();
		var sDetails = $('#extra #quickquote .Details').val();
				
		e.preventDefault();
		
		if(sName.length > 0 && sEmail.length > 0 ){
			$.ajax({
				url: "/rpc/quickQuote.aspx",
				type: "post", 
				datatype: "text",
				data:{'name': sName, 'email': sEmail, 'phone': sPhone, 'company': sCompany, 'details': sDetails},												
				success: function(sResponse){	
					if(sResponse == 'success'){
						$('#extra #quickquote fieldset').animate({opacity: 0}, 750).slideUp(750);
						$('#extra #quickquote #msg').html('<br /><h2>Thank you<br />We have received your enquiry.</h2>')
					}
					else{
						$('#extra #quickquote #msg').html('We\'re sorry - there was a problem sending your quote request. Please try again later.')
					}
				}
			});//End Ajax
		}
	});
	
});//End JQuery