// open external link in new tab/window

// use rel="external" instead of target="_blank"

$(document).ready( function() {
							
	/*cmx form */
	if(jQuery.browser.mozilla) {
	$('form.cmxform').hide().find('label:not(.nocmx)').each(function(){
	var $labelContent = $(this).html();
			   var $labelWidth = $(this).css('width');
			   $(this).empty();
			   $(this).append('<span style="display: block; width: '+$labelWidth+';">');
			   $(this).prepend('</span>');
			   $(this).css('display', '-moz-inline-box');
			   $(this).find('span').html($labelContent);
			   $('form.cmxform').show();
		});
	};
   
    $('a[rel="external"]').click( function() {
        window.open( $(this).attr('href') );
        return false;
    });
		
	//Input rollover
	$('form.cmxform input.send').css('cursor', 'pointer').hover(function() {$(this).addClass('sendhover');}, function() {$(this).removeClass('sendhover');});
	
	// Contact Form
	$('form#download-form').validate(); 
	
	//hide email and add the hidden email_To on submit
	$("form#download-form").submit(function() {
		var s1 = 'downloads';
		var s2 = '@';
		var s3 = 'linearhydraulics.com.au';
	$(this).append('<input type="hidden" name="Email_To" value="' + s1 + s2 + s3 + '" />');
	});	
	
   
});
