// JavaScript Document
//根据航班类型，设置是否有返回日期
function CheckFlightType(){
	var Flight1 = document.getElementById("JT1");
	var Flight2 = document.getElementById("JT2");
	
	if (Flight1.checked){
		document.getElementById("BackDate").style.display = "none";
	}else if (Flight2.checked){
		document.getElementById("BackDate").style.display = "block";
	}
}
//检查日期
function CheckFlightDate(){
	//初始化日期数据
	var DD = document.getElementById("DD");
	var BD = document.getElementById("BD");
	var DateObj = new Date();
	var _Year = DateObj.getFullYear();
	var _Month = DateObj.getMonth()+1;
	var _Date = DateObj.getDate();
	var Today = "";
	if (_Month <= 8){
		Today = _Year + "-0" + _Month;
	}else{
		Today = _Year + "-" + _Month;
	}
	if (_Date <= 9){
		Today += "-0" + _Date;
	}else{
		Today += "-" + _Date;
	}
	//日期比较
	//if (DD.value < Today){
	//	alert("出发日期不能小于当前日期!");
	//	return false;
	//}
	if (document.getElementById("JT2").checked){
		if (BD.value < Today){
			alert("返回日期不能小于当前日期!");
			return false;
		}
	}
	return true;
}
//检查出发及到达城市
function CheckFlightCity(){
	var OC = document.getElementById("OC");
	var DC = document.getElementById("DC");
	if (OC.value == "ZZZ"){
		alert("请选择出发城市!");
		return false;
	}
	if (DC.value == "ZZZ"){
		alert("请选择到达城市!");
		return false;
	}
	if (OC.value == DC.value){
		alert("请选择不同的出发与到达城市!");
		return false;
	}
	return true;
}
//查询
function CheckSubmit(){
	var Check1 = CheckFlightDate();
	var Check2 = CheckFlightCity();
	if (!Check1 || !Check2){
		return false;
	}else{
		return true;
	}
}
