// FORM SCRIPTS
//================================================

  $(document).ready(function(){
    
// -----------------------------------------------  
//Form Validation
   
  $('#orderForm').validate();

// -----------------------------------------------  
//Inline block for firefox
  if($.browser.mozilla){
  // Hide forms
  $( 'form.cmxform' ).hide().end();

  // Processing
  $( 'form.cmxform' ).find( 'li label' ).not( '.nocmx' ).each( function( i ){
    var labelContent = this.innerHTML;
    var labelWidth = document.defaultView.getComputedStyle( this, '' ).getPropertyValue( 'width' );
    var labelSpan = document.createElement( 'span' );
        labelSpan.style.display = 'block';
        labelSpan.style.width = labelWidth;
        labelSpan.innerHTML = labelContent;
    this.style.display = '-moz-inline-box';
    this.innerHTML = null;
    this.appendChild( labelSpan );
  } ).end();

  // Show forms
  $( 'form.cmxform' ).show().end(); 
  }
  
// -----------------------------------------------  
// Progressive disclosure. Hide/show on continue.

$('.form_section2').hide();
$('.form_section3').hide(); 

$('.more_form').click(function(event){
       window.location.hash = "form_2of3";
       $('.form_section2').show();
       $('.more_form').hide();
		$('html,body').animate({scrollTop: 650}, 1000); 
     });
     
$('.more_form2').click(function(event){
       window.location.hash = "form_3of3"; 
       $('.form_section3').show();
       $('.more_form2').hide();
       $('html,body').animate({scrollTop: 1230}, 1000); 
     });
// -----------------------------------------------  
// DatePicker settings

$('#date_charter').datepicker();


// -----------------------------------------------  
// Need quote toggle

$('form div div#input_quote').hide(); 

 $('input[@type="radio"]').click( 
 function() { 
	 	$('form div div#input_quote').show('fast'); 
	 	
 }); 
        
 });