/*
 ****************************************************************************************************
 *
 * COPYRIGHT NOTICE:
 *   (C) Copyright 2009 DealerTitan, Inc. All rights reserved.
 *
 * FILE NAME:
 *   service.js
 *
 * PURPOSE:
 *   Service Page Javascript functions
 *
 * NOTES:
 *
 * ABBREVIATIONS/ACRONYMS:
 *
 ****************************************************************************************************
*/

//***************************************************************************************************
//Author: Chris Ayers
//Date: 5/27/09
//Function: Validate the Service form
//***************************************************************************************************
function Validate_Service_Form(Form_Ref)
{
  var reason = "";

  reason += Validate_Empty(Form_Ref.Name);
  
  reason += Validate_Email(Form_Ref.Email);
  reason += Validate_Empty(Form_Ref.Day_Phone_1);
  reason += Validate_Empty(Form_Ref.Day_Phone_2);
  reason += Validate_Empty(Form_Ref.Day_Phone_3);
  
  reason += Validate_Empty(Form_Ref.Address);
  reason += Validate_Empty(Form_Ref.City);
  reason += Validate_Empty(Form_Ref.Zip_Code);
  
  reason += Validate_Empty(Form_Ref.Year);
  reason += Validate_Empty(Form_Ref.Make);
  reason += Validate_Empty(Form_Ref.Model);
  
  reason += Validate_Empty(Form_Ref.Desired_Date);
  reason += Validate_Empty(Form_Ref.Dropoff_Time);
  reason += Validate_Empty(Form_Ref.Service_Needed);
  
  if (jQuery("#Early_Bird").val() == -1)
  {
    reason += "You have not selected an option for the Early Bird Drop Off.\n";
  }
  if (jQuery("#Waiting").val() == -1)
  {
    reason += "You have not selected an option for the Waiting or Drop Off.\n";
  }
      
  if (reason != "") {
    alert("Some fields need correction:\n" + reason);
    return false;
  }

  return true;
}
