function checkEmailFields()
{
}

function loadQuote() {
	$('#flash').hide();
	$("#footer").append("<div id=\"quote\"></div>");
	$("#quote").load("quote.php", {}, function() {
		$(this).dialog({
			modal: true,
			width: 800,
			height: 700,
			title: 'Free Online Quotation',
			buttons: {
				'Continue': function() {

					var counter = 0;
					    $("select").each(function() {
							  if($(this).val() == "none")
							  {
								  alert("Please select an option from the drop down box.");
								  counter++;
								  return false;
							  }
					    });
					    
						if(counter == 0)
						{
					    var rw = $("#What_Type_Of_Home_Do_You_Have>option:selected").text();
					    $("#real_what").val(rw);
					    var rx = $("#Where_Is_Your_Home>option:selected").text();
					    $("#real_where").val(rx);
					    var ry = $("#Roof_Pitch>option:selected").text();
					    $("#real_roof").val(ry);
						var getvars = $("#cleanform").serialize();
					    $(this).load("process.php?"+getvars);
						var buttons = $(this).dialog('option', 'buttons');
                        $(this).dialog('option', 'buttons', { 
									   "Send Enquiry": function() { 
									   $(this).load("enquiry.php?"+getvars); 
										var buttons = $(this).dialog('option', 'buttons');
										$(this).dialog('option', 'buttons', { 
													   "Send": function() { 
													   var counter2 = 0;
													   $("input").each(function(){
																if($(this).val() == "")
																{
																	alert("You must enter information in all fields.");
																	counter2++;
																	return false;
																}
														});
														 if(counter2 == 0)
														 {
													     document.enquire.submit();
														 }
													   },
													   "Close": function() { $(this).dialog('destroy'); 	$('#flash').show();}
													   });
									   },
									   "Print": function() { window.open("process.php?action=print&"+getvars); },
									   "Close": function() { $(this).dialog('destroy');	$('#flash').show(); }
									   });
						}
				},
				'Cancel': function() {
					$(this).dialog('destroy');
					$('#flash').show();
				}
			}
		});
});
}
	
