// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

// open external link in new tab/window
// use rel="external" instead of target="_blank"

$(document).ready( function() {

	  $("#enquiryform").validate();
   

    $('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
   
	// Contact Form
	$('form#enquiryform').validate(); 
	
	// JQUERY Input rollover
	$('form.baseform input.send').css('cursor', 'pointer').hover(function() {$(this).addClass('sendhover');}, function() {$(this).removeClass('sendhover');});

  //hide email and add the hidden email_To on submit
  $("form#enquiryform").submit(function() {
	var s1 = 'john';
	var s2 = '@';
	var s3 = 'halfpricepallets.com.au';
    $(this).append('<input type="hidden" name="Email_To" value="' + s1 + s2 + s3 + '" />');
  });   
   
   
});

