// JavaScript Document
$(document).ready(function() {
function customRange_edit(input) 
{ 
  return {minDate:t_i_date,maxDate:t_f_date }; 
}
function customRange_plan_popup(input) 
{ 
  return {minDate:trip_i,maxDate:t_f_date }; 
}

$("#restricting_mytrips_plan").datepicker({ 
firstDay: 0, 
changeFirstDay: false,
showOn: "both",
beforeShow: customRange_plan_popup,
buttonImage: "/images/mytripsdate.PNG", 
buttonText: "Click to choose end date",
buttonImageOnly: true 
});
$("#restricting1_mytrips_plan").datepicker({ 
firstDay: 0, 
changeFirstDay: false,
showOn: "both",
beforeShow: customRange_edit,
buttonImage: "/images/mytripsdate.PNG", 
buttonText: "Click to choose end date",
buttonImageOnly: true 
});

$("#restricting1_mytrips").datepicker({ 
firstDay: 0, 
changeFirstDay: false,
showOn: "both",
beforeShow: customRange_edit,
buttonImage: "/images/mytripsdate.PNG", 
buttonText: "Click to choose end date",
buttonImageOnly: true 
});
$("#restricting1_mytrips1").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both", 
beforeShow: customRange,
buttonImage: "/images/mytripsdate.PNG", 
buttonText: "Click to choose end date",
buttonImageOnly: true 
});
$("#restricting_mytrips_edit").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both",
beforeShow: customRange_plan,
buttonImage: "/images/mytripsdate.PNG", 
buttonText: "Click to choose end date",
buttonImageOnly: true 
});

$("#restricting1_mytrips_create").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both",
beforeShow: customRange,
buttonImage: "/images/mytripsdate.PNG", 
buttonText: "Click to choose end date",
buttonImageOnly: true 
});

$("#restricting_mytrips_create").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both", 
minDate: 0,
buttonImage: "/images/mytripsdate.PNG", 
buttonText: "Click to choose start date",
buttonImageOnly: true 
});

$("#restricting_mytrips").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both", 
buttonImage: "/images/mytripsdate.PNG", 
buttonText: "Click to choose start date",
buttonImageOnly: true 
});
function customRange_plan(input) 
{ 
  return {minDate: chan_date_plan }; 
}
function custominitial(input) 
{ 
  return {minDate:initila_date  }; 
}

function customRange(input) 
{ 
  return {minDate: chan_date }; 
}
$("#t_pickuphome").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both",
beforeShow:custominitial,
buttonImage: "/images/calender.PNG", 
buttonText: "Click to choose pick-up date",
buttonImageOnly: true 
});
$("#t_pickup").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both",
minDate: 0,
buttonImage: "/images/calender.PNG", 
buttonText: "Click to choose pick-up date",
buttonImageOnly: true 
});

$("#t_departdatehome").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both",
beforeShow:custominitial,
buttonImage: "/images/calender.PNG", 
buttonText: "Click to choose check-in date",
buttonImageOnly: true 
});

$("#t_departdate").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both",
minDate: 0,
buttonImage: "/images/calender.PNG", 
buttonText: "Click to choose check-in date",
buttonImageOnly: true 
});
$("#restrictinghome").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both", 
beforeShow:custominitial,
buttonImage: "/images/calender.PNG", 
buttonText: "Click to choose flight departing date",
buttonImageOnly: true 
});

$("#restricting").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both", 
minDate: 0,
buttonImage: "/images/calender.PNG", 
buttonText: "Click to choose flight departing date",
buttonImageOnly: true 
});
$("#restricting1").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both",
beforeShow: customRange,
buttonImage: "/images/calender.PNG", 
buttonText: "Click to choose returning date",
buttonImageOnly: true 
});

$("#t_dropoff").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both",
beforeShow: customRange,
//minDate: 0,
buttonImage: "/images/calender.PNG", 
buttonText: "Click to choose drop-off date",
buttonImageOnly: true 
});
$("#t_returndate").datepicker({ 
firstDay: 0, 
changeFirstDay: false, 
showOn: "both",
beforeShow: customRange,
//minDate: 0,
buttonImage: "/images/calender.PNG", 
buttonText: "Click to choose check-out date",
buttonImageOnly: true 
});
});
