//////////////////////////////////////////////////////
// ACTIVE MENU GOES HERE /////////////////////////////
//////////////////////////////////////////////////////





$(".close-x").click(function(){
	$('.car-detail-box ').css('transform','translateY(100%)');
})

if($("#submit-form").length > 0){
		$("#submit-form").formvalidate();
}	
	
if($('ul.messages').length>0){
	$('.close-msg').click(function(e) {
		$('ul.messages').slideUp('fast');
	 });
 }	

$('.pickupdate').datepicker({	
startDate: "dateToday",			
				autoclose: true,
				format: 'dd-mm-yyyy',
			}).on('changeDate', function (selected) {
				
    /*var minDate = new Date(selected.date.valueOf());
	//var minDate = minDate.setDate(minDate.getDate() + 1);
	
	
	var myDate = new Date(minDate.getTime()+(1*24*60*60*1000));

	var dd = myDate.getDate();
	var mm = myDate.getMonth() + 1;
	var y = myDate.getFullYear();

	var someFormattedDate = dd + '-'+ mm + '-'+ y;
	
    $('.dropoffdate').datepicker('setStartDate', someFormattedDate);
    $('.dropoffdate').datepicker('setDate', someFormattedDate); // <--THIS IS THE LINE ADDED*/
	
	$(".dropoffdate").datepicker('setStartDate', $(".pickupdate").val());;
     $(".dropoffdate").val($(".pickupdate").val());
});
			
			
			
$('.dropoffdate').datepicker({
				autoclose: true,
				format: 'dd-mm-yyyy',
			});			
			
	

$('.pickuptime').timepicker({ 'scrollDefault': 'now',durationTime: 2, });


			
$('.dropofftime').timepicker({ 'scrollDefault': 'now' });	
	

$(".pickuptime").on("change", function (e) {
	
	var time = $('.pickuptime').timepicker('getTime');

	var myDate = new Date(time.getTime()+(1*0.5*60*60*1000));
	
	$('.dropofftime').timepicker('option', { 'minTime':  myDate, 'maxTime': '11:30pm' });
	

      // $('.dropofftime').timepicker({ 'minTime': $(".pickuptime").val() });	
    });			
			
	 /* $(".pickupdate").on("change", function (e) {	
        $(".dropoffdate").datepicker('setStartDate', $(".pickupdate").val());;
        $(".dropoffdate").val($(".pickupdate").val());
    });		*/
			
	
	
	  $(".pickuplocation").on("change", function (e) {
		
        $(".dropofflocation").val($(".pickuplocation").val());
    });			
	
	



if($("#contact-us123").length){
    function initMap() {
        var map = new google.maps.Map(document.getElementById('map'), {
          zoom: 8,
          center: {lat: 35.717, lng: 139.731}
        });
      }
}

$(".first-apply").click(function(){
const elem = $(this).parent().parent().parent().children(".application-form")
elem.css("transform","translateY(0)")
}
)

$(".custom-checkbox").click(function(){
 // $(".custom-checkbox").removeClass("active");
 // $(this).addClass("active")
})

$(".car-selection-box .view-detail").click(function(){
  $(".car-detail-box").css("transform","translateY(100%)")
  $(this).parent().parent().parent().children(".car-detail-box").css("transform","translateY(0)")
})