$(function() {
		   
	   $('.errorcontact').hide();
	   $('.error').hide();
	   $("#contactForm input.submit").click(function() {
								   
			   $('.errorcontact').hide();
			   var company = $("input#company").val();
			   var comments = $("textarea#comments").val();
			   
			   var name = $("input#name").val();
			   if (name == "") {
				   $("th#name_error").show();
				   $("label#name_error").show();
				   $("input#name").focus();
				   return false;
			   }
			   
			   var email = $("input#email").val();
			   if (email == "") {
				   $("th#email_error").show();
				   $("label#email_error").show();
				   $("input#email").focus();
				   return false;
			   }
			   
			   var phone = $("input#phone").val();
			   if (phone == "") {
				   $("th#phone_error").show();
				   $("label#phone_error").show();
				   $("input#phone").focus();
				   return false;
			   }  
			   
			     var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone + '&company=' + company + '&comments=' + comments;
				  //alert (dataString);return false;
				  $.ajax({
					type: "POST",
					url: "bin/process_contact.php",
					data: dataString,
					success: function() {
					  $('#contactForm').html("<div id='contactForm_header'><p></p></div><div id='message'></div>");
					  $('#message').html("<h2 style='color:#ffffff; text-align:center; margin-top:40px;'>Thank you for your request.  We'll get back to you soon.</h2>")
					  .append("<p style='text-align:center;'>If you are in a hurry to get started, please feel free to give us a call at 800-930-3938.</p>")
					  .hide()
					  .fadeIn(1500, function() {
						$('#message').append("<img style='margin-left:250px;' id='checkmark' src='img/check.png' />");
					  });
					}
				  });
				  return false;
  
								   
	   });
	   
	   $("#resellerForm input.submit").click(function() {
								   
			   $('.error').hide();
			   var company = $("input#company").val();
			   var address2 = $("input#address2").val();
			   var ext = $("input#ext").val();
			   var pick = $("select#pick").val();
			   var other = $("input#other").val();
			   
			   var fname = $("input#fname").val();
			   if (fname == "") {
				   $("th#name_error").show();
				   $("label#name_error").show();
				   $("input#fname").focus();
				   return false;
			   }
			   
			   var lname = $("input#lname").val();
			   if (lname == "") {
				   $("th#name_error").show();
				   $("label#name_error").show();
				   $("input#lname").focus();
				   return false;
			   }
			   
			   var address = $("input#address").val();
			   if (address == "") {
				   $("th#address_error").show();
				   $("label#address_error").show();
				   $("input#address").focus();
				   return false;
			   }
			   
			   var city = $("input#city").val();
			   if (city == "") {
				   $("th#city_error").show();
				   $("label#city_error").show();
				   $("input#city").focus();
				   return false;
			   }
			   
			   var state = $("select#state").val();
			   if (state == "") {
				   $("th#state_error").show();
				   $("label#state_error").show();
				   $("select#state").focus();
				   return false;
			   }
			   
			   var zipcode = $("input#zipcode").val();
			   if (zipcode == "") {
				   $("th#state_error").show();
				   $("label#state_error").show();
				   $("input#zipcode").focus();
				   return false;
			   }
			   
			   var areacode = $("input#areacode").val();
			   if (areacode == "") {
				   $("th#phone_error").show();
				   $("label#phone_error").show();
				   $("input#areacode").focus();
				   return false;
			   }
			   
			   var phone = $("input#phone").val();
			   if (phone == "") {
				   $("th#phone_error").show();
				   $("label#phone_error").show();
				   $("input#phone").focus();
				   return false;
			   }
			   
			   var email = $("input#email").val();
			   if (email == "") {
				   $("th#email_error").show();
				   $("label#email_error").show();
				   $("input#email").focus();
				   return false;
			   }
			   
			     var dataString = 'company='+ company + '&fname='+ fname + '&lname='+ lname + '&address='+ address + '&address2='+ address2 + '&city='+ city + '&state='+ state + '&zipcode='+ zipcode + '&areacode='+ areacode + '&phone='+ phone + '&ext='+ ext + '&email=' + email + '&pick=' + pick + '&other='+ other;
				  //alert (dataString);return false;
				  $.ajax({
					type: "POST",
					url: "bin/process_reseller.php",
					data: dataString,
					success: function() {
					  $('#resellerForm').html("<div id='message'></div>");
					  $('#message').html("<h2 style='text-align:center; margin-top:40px;'>Thank you for your request.  We'll get back to you soon.</h2>")
					  .append("<p style='text-align:center;'>If you are in a hurry to get started, please feel free to give us a call at 800-930-3938.</p>")
					  .hide()
					  .fadeIn(1500, function() {
						$('#message').append("<img style='margin:20px 0 0 250px;' id='checkmark' src='img/check.png' />");
					  });
					}
				  });
				  return false;
  
								   
	   });
	   
	   $("#quoteForm input.submit").click(function() {
								   
			   $('.error').hide();
			   var company = $("input#company").val();
			   var ext = $("input#ext").val();
			   
			   var fname = $("input#fname").val();
			   if (fname == "") {
				   $("th#name_error").show();
				   $("label#name_error").show();
				   $("input#fname").focus();
				   return false;
			   }
			   
			   var lname = $("input#lname").val();
			   if (lname == "") {
				   $("th#name_error").show();
				   $("label#name_error").show();
				   $("input#lname").focus();
				   return false;
			   }
			   
			   var project = $("input#project").val();
			   if (project == "") {
				   $("th#project_error").show();
				   $("label#project_error").show();
				   $("input#project").focus();
				   return false;
			   }
			   
			   var quantity = $("input#quantity").val();
			   if (quantity == "") {
				   $("th#quantity_error").show();
				   $("label#quantity_error").show();
				   $("input#quantity").focus();
				   return false;
			   }
			   
			   var details = $("textarea#details").val();
			   if (details == "") {
				   $("th#details_error").show();
				   $("label#details_error").show();
				   $("input#details").focus();
				   return false;
			   }
			   
			   var areacode = $("input#areacode").val();
			   if (areacode == "") {
				   $("th#phone_error").show();
				   $("label#phone_error").show();
				   $("input#areacode").focus();
				   return false;
			   }
			   
			   var phone = $("input#phone").val();
			   if (phone == "") {
				   $("th#phone_error").show();
				   $("label#phone_error").show();
				   $("input#phone").focus();
				   return false;
			   }
			   
			   var email = $("input#email").val();
			   if (email == "") {
				   $("th#email_error").show();
				   $("label#email_error").show();
				   $("input#email").focus();
				   return false;
			   }
			   
			     var dataString = 'company='+ company + '&fname='+ fname + '&lname='+ lname + '&project='+ project + '&quantity='+ quantity + '&details='+ details +  '&areacode='+ areacode + '&phone='+ phone + '&ext='+ ext + '&email=' + email;
				  //alert (dataString);return false;
				  $.ajax({
					type: "POST",
					url: "bin/process_quote.php",
					data: dataString,
					success: function() {
					  $('#quoteForm').html("<div id='message'></div>");
					  $('#message').html("<h2 style='text-align:center; margin-top:40px;'>Thank you for your request.  We'll get back to you soon.</h2>")
					  .append("<p style='text-align:center;'>If you are in a hurry to get started, please feel free to give us a call at 800-930-3938.</p>")
					  .hide()
					  .fadeIn(1500, function() {
						$('#message').append("<img style='margin:20px 0 0 250px;' id='checkmark' src='img/check.png' />");
					  });
					}
				  });
				  return false;
  
								   
	   });
	   
	   $("#paperForm input.submit").click(function() {
								   
			   $('.error').hide();
			   var company = $("input#company").val();
			   var address2 = $("input#address2").val();
			   var ext = $("input#ext").val();
			   var business = $("select#business").val();
			   
			   var name = $("input#name").val();
			   if (name == "") {
				   $("th#name_error").show();
				   $("label#name_error").show();
				   $("input#name").focus();
				   return false;
			   }
			   
			   var address = $("input#address").val();
			   if (address == "") {
				   $("th#address_error").show();
				   $("label#address_error").show();
				   $("input#address").focus();
				   return false;
			   }
			   
			   var city = $("input#city").val();
			   if (city == "") {
				   $("th#city_error").show();
				   $("label#city_error").show();
				   $("input#city").focus();
				   return false;
			   }
			   
			   var state = $("select#state").val();
			   if (state == "") {
				   $("th#state_error").show();
				   $("label#state_error").show();
				   $("select#state").focus();
				   return false;
			   }
			   
			   var zipcode = $("input#zipcode").val();
			   if (zipcode == "") {
				   $("th#state_error").show();
				   $("label#state_error").show();
				   $("input#zipcode").focus();
				   return false;
			   }
			   
			   var areacode = $("input#areacode").val();
			   if (areacode == "") {
				   $("th#phone_error").show();
				   $("label#phone_error").show();
				   $("input#areacode").focus();
				   return false;
			   }
			   
			   var phone = $("input#phone").val();
			   if (phone == "") {
				   $("th#phone_error").show();
				   $("label#phone_error").show();
				   $("input#phone").focus();
				   return false;
			   }
			   
			   var email = $("input#email").val();
			   if (email == "") {
				   $("th#email_error").show();
				   $("label#email_error").show();
				   $("input#email").focus();
				   return false;
			   }
			   
			     var dataString = 'company='+ company + '&name='+ name + '&address='+ address + '&address2='+ address2 + '&city='+ city + '&state='+ state + '&zipcode='+ zipcode + '&areacode='+ areacode + '&phone='+ phone + '&ext='+ ext + '&email=' + email + '&business=' + business;
				  //alert (dataString);return false;
				  $.ajax({
					type: "POST",
					url: "bin/process_paper.php",
					data: dataString,
					success: function() {
					  $('#paperForm').html("<div id='message'></div>");
					  $('#message').html("<h2 style='text-align:center; margin-top:40px;'>Thank you for requesting your free white paper..</h2>")
					  .append("<p style='text-align:center;'><a style='font-weight:bold;'href='http://www.pflpro.com/Boost_Revenue_as_Print_Broker.pdf'>Click here to download your complimentary white paper now</a><br />If you have any questions, please feel free to contact us at: <br />800-930-3938.<br /><a href='mailto:pflpro@printingforless.com'>pflpro@printingforless.com</a></p>")
					  .hide()
					  .fadeIn(1500, function() {
						$('#message').append("<img style='margin:20px 0 0 240px;' id='checkmark' src='img/check.png' />");
					  });
					}
				  });
				  return false;
  
								   
	   });
	   
});