	$(document).ready(function() {
		$(".frmbut").click(function() {  
			var name = $("input#name").val();
			if (name == "") {  
				alert("You have missed one of the mandatory fields.\n Name was left blank or not selected.\n");
				$("input#name").focus();  
				return false;  
			} 
			var email = $("input#email").val();
			if (email == "") {  
				alert("You have missed one of the mandatory fields.\n Emaik was left blank or not selected.\n");
				$("input#email").focus();  
				return false;  
			} 
			var phone = $("input#phone").val();
			if (phone == "") {  
				alert("You have missed one of the mandatory fields.\n Phone was left blank or not selected.\n");
				$("input#phone").focus();  
				return false;  
			} 
			var make = $("input#make").val();
			if (make == "") {  
				alert("You have missed one of the mandatory fields.\n Make was left blank or not selected.\n");
				$("input#make").focus();  
				return false;  
			} 
			var model = $("input#model").val();
			if (model == "") {  
				alert("You have missed one of the mandatory fields.\n Model was left blank or not selected.\n");
				$("input#model").focus();  
				return false;  
			} 
			var year = $("input#year").val();
			if (year == "") {  
				alert("You have missed one of the mandatory fields.\n Year was left blank or not selected.\n");
				$("input#year").focus();  
				return false;  
			} 
			var details = $("#details").val();
			var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone + '&make=' + make + '&model=' + model + '&year=' + year + '&details=' + details;
			$.ajax({
				type: "POST",
				url: "inc_common.php",
				data: dataString,
				success: function() {
					$('#quote_form').html("<div id='message'></div>");  
					$('#message').html("<img id='checkmark' src='images/check.png' />")  
								.append("<h2>Free Quote Form Submitted!</h2>")
								.hide()  
								.fadeIn(1500, function() {  
									$('#message').append("<p>We will be in touch soon.</p>");
								});  
				}
			});
			return false;
		});
		$("a.iframe").fancybox({
			'frameWidth': 400,
			'frameHeight': 255,
			'hideOnContentClick': false,
			'zoomSpeedIn': 900,
			'zoomSpeedOut':	900,
			'zoomOpacity': true,
			'centerOnScroll': true
		});
		$("a.directi").fancybox({
			'hideOnContentClick': false,
			'zoomSpeedIn': 900,
			'zoomSpeedOut':	900,
			'zoomOpacity': true,
			'centerOnScroll': true
		});
		$("a.group").fancybox({
			'hideOnContentClick': false,
			'zoomSpeedIn': 900,
			'zoomSpeedOut':	900,
			'zoomOpacity': true,
			'centerOnScroll': true
		});
	});
