$(document).ready(function(){

contactForm = $("body#www-tcadvertisinggifts-co-uk.page.contact-us #primary form");
if (contactForm.length){
      contactForm.submit(function(){ 
          if ($.trim($("#primary input#formfield-first_name").val()) == '' ){
              alert('Please enter your First Name');
              return false;
          }
          if ($.trim($("#primary input#formfield-surname").val()) == '' ){
              alert('Please enter your Last Name');
              return false;
          }
          if ($.trim($("#primary input#formfield-email").val()) == '' ){
              alert('Please enter your Email Address');
              return false;
          }
          if ($.trim($("#primary input#formfield-phone").val()) == '' ){
              alert('Please enter your Phone Number');
              return false;
          }
      });
}

catalogueForm = $("body#www-tcadvertisinggifts-co-uk.page.catalogue-request #primary form");
if (catalogueForm.length){
      catalogueForm.submit(function(){ 
          if ($.trim($("#primary input#formfield-first_name").val()) == '' ){
              alert('Please enter your First Name');
              return false;
          }
          if ($.trim($("#primary input#formfield-surname").val()) == '' ){
              alert('Please enter your Last Name');
              return false;
          }
          if ($.trim($("#primary input#formfield-email").val()) == '' ){
              alert('Please enter your Email Address');
              return false;
          }
          if ($.trim($("#primary input#formfield-phone").val()) == '' ){
              alert('Please enter your Phone Number');
              return false;
          }
		  if ($.trim($("#primary input#formfield-company").val()) == '' ){
              alert('Please enter your Company Name');
              return false;
          }
		  if ($.trim($("#primary input#formfield-address1").val()) == '' ){
              alert('Please enter your Address Line 1');
              return false;
          }
		  if ($.trim($("#primary input#formfield-address2").val()) == '' ){
              alert('Please enter your Address Line 2');
              return false;
          }
		  if ($.trim($("#primary input#formfield-address3").val()) == '' ){
              alert('Please enter your Address Line 3');
              return false;
          }
		  if ($.trim($("#primary input#formfield-postcode").val()) == '' ){
              alert('Please enter your Post Code');
              return false;
          }
      });
}

enquiryForm = $("body#www-tcadvertisinggifts-co-uk.page.enquiry-basket #primary form.datamate");
  if (enquiryForm.length){
      enquiryForm.submit(function(){
          if ($.trim($("#primary input#first_name").val()) == '' ){
              alert('Please enter your First Name');
              return false;
          }
          if ($.trim($("#primary input#surname").val()) == '' ){
              alert('Please enter your Last Name');
              return false;
          }
		  if ($.trim($("#primary input#email").val()) == '' ){
              alert('Please enter your Email Address');
              return false;
          }
          if ($.trim($("#primary input#phone").val()) == '' ){
              alert('Please enter your Phone Number');
              return false;
          }
		  if ($.trim($("#primary input#company").val()) == '' ){
              alert('Please enter your Company Name');
              return false;
          }
		  if ($.trim($("#primary input#address1").val()) == '' ){
              alert('Please enter your Address Line 1');
              return false;
          }
		  if ($.trim($("#primary input#address2").val()) == '' ){
              alert('Please enter your Address Line 2');
              return false;
          }
		  if ($.trim($("#primary input#address3").val()) == '' ){
              alert('Please enter your Address Line 3');
              return false;
          }
		  if ($.trim($("#primary input#postcode").val()) == '' ){
              alert('Please enter your Post Code');
              return false;
          }
      });
}

productForm = $("body#www-tcadvertisinggifts-co-uk.product #product div.pdv-mini-enquiry-form form");
if (productForm.length){
      productForm.submit(function(){ 
          if ($.trim($("div.pdv-mini-enquiry-form input#mini-enquiry-first-name").val()) == '' ){
              alert('Please enter your First Name');
              return false;
         }
          if ($.trim($("div.pdv-mini-enquiry-form input#mini-enquiry-surname").val()) == '' ){
              alert('Please enter your Last Name');
              return false;
          }
          if ($.trim($("div.pdv-mini-enquiry-form input#mini-enquiry-company").val()) == '' ){
              alert('Please enter your Company Name');
              return false;
          }
          if ($.trim($("div.pdv-mini-enquiry-form input#mini-enquiry-email").val()) == '' ){
              alert('Please enter your Email Address');
              return false;
          }
          if ($.trim($("div.pdv-mini-enquiry-form input#mini-enquiry-phone").val()) == '' ){
              alert('Please enter your Phone Number');
              return false;
          }
      });
}

registerForm = $("body#www-tcadvertisinggifts-co-uk.page.register #primary form");
if (registerForm.length){
      registerForm.submit(function(){ 
          if ($.trim($("#primary input#org").val()) == '' ){
              alert('Please enter your Company Name');
              return false;
          }
      });
}

$("<em>*</em>").insertAfter("#primary input#org");

$("<em>*</em>").insertAfter("#primary input#formfield-first_name");
$("<em>*</em>").insertAfter("#primary input#formfield-surname");
$("<em>*</em>").insertAfter("#primary input#formfield-email");
$("<em>*</em>").insertAfter("#primary input#formfield-phone");
$("<em>*</em>").insertAfter("#primary input#formfield-company");
$("<em>*</em>").insertAfter("#primary input#formfield-address1");
$("<em>*</em>").insertAfter("#primary input#formfield-address2");
$("<em>*</em>").insertAfter("#primary input#formfield-address3");
$("<em>*</em>").insertAfter("#primary input#formfield-postcode");

$("<em>*</em>").insertAfter("#primary input#first_name");
$("<em>*</em>").insertAfter("#primary input#surname");
$("<em>*</em>").insertAfter("#primary input#email");
$("<em>*</em>").insertAfter("#primary input#phone");
$("<em>*</em>").insertAfter("#primary input#company");
$("<em>*</em>").insertAfter("#primary input#address1");
$("<em>*</em>").insertAfter("#primary input#address2");
$("<em>*</em>").insertAfter("#primary input#address3");
$("<em>*</em>").insertAfter("#primary input#postcode");

$("<em>*</em>").insertAfter("div.pdv-mini-enquiry-form label#mini-enquiry-first-name-label span.desc");
$("<em>*</em>").insertAfter("div.pdv-mini-enquiry-form label#mini-enquiry-surname-label span.desc");
$("<em>*</em>").insertAfter("div.pdv-mini-enquiry-form label#mini-enquiry-company-label span.desc");
$("<em>*</em>").insertAfter("div.pdv-mini-enquiry-form label#mini-enquiry-email-label span.desc");
$("<em>*</em>").insertAfter("div.pdv-mini-enquiry-form label#mini-enquiry-phone-label span.desc");

});
