function changeDepDateAuto(form, pkgTF){
	arrDate = new Date(Date.parse(form.arrDate.value));	
	depDate = new Date(Date.parse(form.depDate.value));	
	if(isDateNoAlert(form.arrDate.value)){
		if(pkgTF == true || pkgTF == 'true'){			
			temp_date = new Date(arrDate.getTime() +(2*24*60*60*1000)); //Incrementing the arrival date to two days.				
			tempDMY= (temp_date.getMonth() +1) + "/" + temp_date.getDate() + "/" + temp_date.getFullYear();		
			form.depDate.value = tempDMY;	
		}else{
			temp_date = new Date(arrDate.getTime() +(24*60*60*1000)); //Incrementing the arrival date to one day.								
			tempDMY= (temp_date.getMonth() +1) + "/" + temp_date.getDate() + "/" + temp_date.getFullYear();		
			form.depDate.value = tempDMY;
		}	
	}
}

function isDateNoAlert(dtStr){
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		//alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		//alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		//alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYr || year>maxYr){
		//alert("Please enter a valid 4 digit year between "+minYr+" and "+maxYr)
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		//alert("Please enter a valid date")
		return false
	}
return true;
}
