﻿$("#downloadPDF").submit(function(event){
event.preventDefault();
var sendOk = false;
$("input.required").each(function(){
      if(this.value == '') {
      alert(pleaseFill);
      sendOk = false;
      return false;

      } else {
      sendOk = true;
      }
});
if (sendOk == true) {
var inputs = $('form#downloadPDF').serialize();
$.ajax({
	type: "POST",
	url: "/asp/sendmail2.asp",
	data: inputs,
	success: function(msg){
	// Set cookie
	setCookie('hasInfo','hasInfo',1);
         document.location.href = pdf;
         $('#pdfDownloadForm').html('<p><strong>' + thankYou + '</strong></p>');
	},
	error: function(msg){
           alert('Sending failed, try again!');
	}
	});
return false;
}
});



