$(document).ready(function() {

function bannerFade() {
	if(!isHomePage()) return; // Only on home page
	$('#bannerFade ul').innerfade({
		animationtype: 'fade',
		speed: 2000,
		timeout: 6000,
		type: 'sequence',
		containerheight: 'auto'
	});
}

$('#header .inner-content').append("<div id='top-phone') 0 bottom repeat-x\">0500 82 70 73</div>");
$('#header .inner-content').append("<div id='top-email') 0 bottom repeat-x\"><a href='mailto:sales@insigniauk.com'>sales@insigniauk.com</a></div>");
$('table#print-colours-table caption').append("<div id='prices') 0 bottom repeat-x\">Prices are an indication, please contact us for a specific quote.</div>");

$("#homeinfo1").insertAfter("#featured");
$("#homeinfo2").insertAfter("#homeinfo1");

//$("body.category .body").insertAfter("#sub-categories");
//$('body.category .body p').append("<div id='createbrandpromote' style=\"color:#096ab1;) 0 bottom repeat-x\"><img src='/static/mainsite-css/createbrandpromote.png'></div>");
$("body.category .body p").insertAfter("#product-list");
//$("#product .basket fieldset .multi-select ").insertAfter("#product .image");

$("#product div.pdv-mini-enquiry-form span.mini-enquiry-tagline").insertAfter("#product div.pdv-mini-enquiry-form fieldset label#mini-enquiry-phone-label");

productForm = $("body#www-insigniauk-com.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-phone").val()) == '' ){
              alert('Please enter your Phone Number');
              return false;
          }
          if ($.trim($("div.pdv-mini-enquiry-form input#mini-enquiry-email").val()) == '' ){
              alert('Please enter your Email Address');
              return false;
          }
      });
}

brochureForm = $("body#www-insigniauk-com.page.request-a-brochure #primary form");
if (brochureForm.length){
      brochureForm.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-company").val()) == '' ){
              alert('Please enter your Organisation');
              return false;
          }
          if ($.trim($("#primary input#formfield-address1").val()) == '' ){
              alert('Please enter Address Line 1');
              return false;
          }
          if ($.trim($("#primary input#formfield-postcode").val()) == '' ){
              alert('Please enter a Post Code');
              return false;
          }
      });
}

newsletterForm = $("body#www-insigniauk-com.page.sign-up-to-our-newsletter #primary form");
if (newsletterForm.length){
      newsletterForm.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-company").val()) == '' ){
              alert('Please enter your Organisation');
              return false;
          }
      });
}

});
