// ###############################################################################


   function getYMM()
   {

      year = $("#year option:selected").val();
      make = $("#make option:selected").val();

      $.ajax({
           type: "POST",
           url: 'getYMM',
           data: "year="+year+"&make="+make,
           dataType: "html",
           success: function(data)
                     {
                     $('#ymm_div').html(data);
                   }
      });
        

   }


   function validate_auto_Form()
   {

       var error = '';
       if (!$('#full_name').val()) error += 'Fill "Full Name" field\n';
       
       if (!$("#email").val() || !checkEmail($("#email").val())) error += "Please, enter valid Email\n";
       
       if (!$('#phone1').val() || !$('#phone2').val() || !$('#phone3').val()) error += 'Please Enter Correct Phone Number\n';

       if (!$('#insurance_company').val()) error += 'Fill "Insurance Company" field\n';
       if (!$('#policy_num').val()) error += 'Fill "Policy #" field\n';

       if ($('#year').val() == 0) error += 'Fill "Vehicle Year" field\n';
       if ($('#make').val() == 0) error += 'Fill "Make" field\n';
       if ($('#model').val() == 0) error += 'Fill "Model" field\n';

       if ($('.win:checked').length > 0)
       {
       } else {
         error += 'Fill "Which window" field\n';
        }
       
       if (error)
       {
          alert(error);
          return false;
       } else {
          submitAutoQuote();
       }
   }


   function submitAutoQuote()
   {
   


        $.ajax({
           type: "POST",
           url: 'auto_quote_save.php',
           data: $('#auto_quote_form').serialize(),
           dataType: "html",
           complete: function()
                     {
                         $.unblockUI();
                     },
                     beforeSend: function()
                     {


                      $.blockUI({ css: { 
                          border: 'none', 
                          padding: '15px', 
                          backgroundColor: '#000', 
                          '-webkit-border-radius': '10px', 
                          '-moz-border-radius': '10px', 
                          opacity: .95, 
                          color: '#fff' 
                      } });

                     },
           success: function(data)
                     {
                     $.unblockUI();
                     $('#auto_quote_form_div').html("<center><br /><br /><h2>Thank you! We will contact you soon!</h2></center>");
                     }
        });
        
 
  }

  
   function validate_residental_Form()
   {

       var error = '';
       if (!$('#full_name').val()) error += 'Fill "Full Name" field\n';
       
       if (!$("#email").val() || !checkEmail($("#email").val())) error += "Please, enter valid Email\n";
       
       if (!$('#phone1').val() || !$('#phone2').val() || !$('#phone3').val()) error += 'Please Enter Correct Phone Number\n';

       if (!$('#glass_description').val()) error += 'Fill "Description" field\n';
       
       if (error)
       {
          alert(error);
          return false;
       } else {
          submitResidentalQuote();
       }
   }

   function submitResidentalQuote()
   {
   


        $.ajax({
           type: "POST",
           url: 'residental_quote_save.php',
           data: $('#residental_quote_form').serialize(),
           dataType: "html",
           complete: function()
                     {
                         $.unblockUI();
                     },
                     beforeSend: function()
                     {

                      $.blockUI({ css: { 
                          border: 'none', 
                          padding: '15px', 
                          backgroundColor: '#000', 
                          '-webkit-border-radius': '10px', 
                          '-moz-border-radius': '10px', 
                          opacity: .95, 
                          color: '#fff' 
                      } });

                     },
           success: function(data)
                     {
                     $.unblockUI();
                     $('#residental_quote_form_div').html("<center><br /><br /><h2>Thank you! We will contact you soon!</h2></center>");
                     }
        });
        
 
  }

