

		
// manual tweak the placement of the calendar div
// remove these to default to offset from the anchor
var _adjustCPLeft = 85;
var _adjustCPTop = -20;

// cal variables
var now = new Date();
var cal_A = new CalendarPopup("div_cal");
var cal_B = new CalendarPopup("div_cal");
var cal_C = new CalendarPopup("div_cal");

var today = new Date()
today = today.getMonth()+1 + "/" + today.getDate() + "/" + y2k(today.getYear()) 

cal_A.showNavigationDropdowns();  			// Year end navigation
//cal_A.setCssPrefix("A_"); 				// css prefix
cal_A.addDisabledDates(null,today);
cal_A.setTodayText("");
function getCalendar_A(_CAL,_INPUT,_ANCHOR) { getCalendar(_CAL,_INPUT,_ANCHOR) }

cal_B.showNavigationDropdowns();
//cal_B.setCssPrefix("B_"); 
cal_B.addDisabledDates(null,today);
cal_B.setTodayText("");
function getCalendar_B(_CAL,_INPUT,_ANCHOR) { if (document.getElementById('t_date_1').value.length > 2) cal_B.addDisabledDates(null,document.getElementById('t_date_1').value); getCalendar(_CAL,_INPUT,_ANCHOR) }

cal_C.showNavigationDropdowns();
//cal_C.setCssPrefix("C_"); 
cal_C.addDisabledDates(null,today);
cal_C.setTodayText("");
function getCalendar_C(_CAL,_INPUT,_ANCHOR) { getCalendar(_CAL,_INPUT,_ANCHOR) }


var cal_NEXT = new CalendarPopup("div_cal");
cal_NEXT.showNavigationDropdowns();  			// Year end navigation
cal_NEXT.addDisabledDates(null,today);
cal_NEXT.setTodayText("");

function getCalendar_NEXT(_INPUT,_ANCHOR) { 
idx = _ANCHOR.split("_")[1]

 if (document.getElementById('t_date_' + (idx-1)).value.length > 2) {
	// get ne day back to provide same day flight as previous segment
	dte = new Date(document.getElementById('t_date_' + (idx-1)).value);
	dte.setDate(dte.getDate()-1);// day before
	dte_day = dte.getDate()
	dte_mon = dte.getMonth()+1
	dte_yer = dte.getYear() 
	if (dte_yer < 2000) { dte_yer += 1900 } else { dte_yer; }
	datez = dte_mon + "/" + dte_day  + "/" + dte_yer;
	
	cal_NEXT.addDisabledDates(null,datez);
	
	
	getCalendar(cal_NEXT,_INPUT,_ANCHOR)
	
	_INPUTZ = _INPUT
	_INPUTZ = document.getElementById(_INPUTZ);
	_FORMAT = 'MM/dd/yyyy'
	_DATE = document.getElementById('t_date_' + (idx-1)).value;
	cal_NEXT.select(_INPUTZ,_ANCHOR,_FORMAT,_DATE)
	
	
 } else {
 
	 getCalendar(cal_NEXT,_INPUT,_ANCHOR)
 
 }


	

}

// for a more simplified call

function getCalendar(_CAL,_INPUT,_ANCHOR) {
	_INPUT = document.getElementById(_INPUT);
	_FORMAT = 'MM/dd/yyyy'
	_DATE = _INPUT.value;
	_CAL.select(_INPUT,_ANCHOR,_FORMAT,_DATE)
}


