//*****************************************************************
//Please save this file with a character code "iso-8859-1".
//*****************************************************************

// [Balloon]
var adt_number = "";
var chd_number = "";
var infants_number = "";
var member_no = "";
if (JLJS02.site.lang.isEN) {
	adt_number = "Adults (age 12 and older on the day of international departure)";
	chd_number = "Children (ages 2 - 11 on the day of international departure and infant occupying a seat)";
	infants_number =
			"Infants (younger than age 2 on the day of international departure and not occupying a seat)";
	member_no = '<img src="/common/img/icon_balloon_001.gif" width="52" height="30" alt="">Membership Number<br>(7 or 9 digits)'	
}else{
	adt_number = "\u5927\u4eba(12\u624d\u4ee5\u4e0a)&nbsp;&nbsp;&nbsp;&nbsp;(\u6d77\u5916\u65c5\u884c\u958b\u59cb\u65e5\u306e\u5e74\u9f62)";
	chd_number ="\u5c0f\u5150(2\u624d~11\u624d)&nbsp;&nbsp;&nbsp;&nbsp;(\u6d77\u5916\u65c5\u884c\u958b\u59cb\u65e5\u306e\u5e74\u9f62)&nbsp;&nbsp;&nbsp;&nbsp;(\u304a\u3088\u3073\u5ea7\u5e2d\u3092\u3054\u5229\u7528\u306e\u5e7c\u5150)";
	infants_number =			"\u5e7c\u5150(0\u624d~1\u624d)&nbsp;&nbsp;&nbsp;&nbsp;(\u6d77\u5916\u65c5\u884c\u958b\u59cb\u65e5\u306e\u5e74\u9f62)&nbsp;&nbsp;&nbsp;&nbsp;(\u4f46\u3057\u3001\u5ea7\u5e2d\u3054\u5229\u7528\u306e\u5e7c\u5150\u3092\u9664\u304f)";
	member_no = '<img src="/common/img/icon_balloon_001.gif" width="52" height="30" alt="">\u304a\u5f97\u610f\u69d8\u756a\u53f7<br>(7\u6841\u304b9\u6841)'
}

var JLJS_InfoBalloonData = {
	'member_no' : member_no,
	'FIELD_ADT_NUMBER1' : adt_number,
	'FIELD_CHD_NUMBER1' : chd_number,
	'FIELD_INFANTS_NUMBER1' : infants_number//,
};

// [/Balloon]

//---------- [TOP-MULTI Common] ----------

JLJS_ticketModule_Fp.prototype.usaArea = "USA_01";
JLJS_ticketModule_Fp.prototype.pageType = null;
JLJS_ticketModule_Fp.prototype.siteType = null;
// [changeBArea]
JLJS_ticketModule_Fp.prototype.changeBArea = function(num, defaultValue){

	var b_area = "B_AREA";
	var e_area = "E_AREA";
	var b_loc = "B_LOCATION";
	var e_loc = "E_LOCATION";
	
	if (num == 0) {
		b_loc = b_loc + "_1";
		e_loc = e_loc + "_1";
	}else{
		b_area = b_area + "_" + num;
		e_area = e_area + "_" + num;
		b_loc = b_loc + "_" + num;
		e_loc = e_loc + "_" + num;
	}

	var whole;
	var usa;
	var amsJpn;
	var fp_jpnList = "JPN_02";//FP cassette use
	var sd_jpnList = "JPN_03";//SD cassette use
	
	var node = this.formNode[b_area];
	var value;
	if (defaultValue) {
		value = defaultValue;
	}else{
		value = node.value;
	}
	
	var defaultSet = null;
	var defaultArea = null;
	var noArea = null;
	
	if (this.pageType == "T"){//Top_module
		whole = "whole_01";
		usa = this.usaArea;
		amsJpn = "USA_JPN";
	}else{//Multi_module
		whole = "whole_03";
		usa = "AMS_13";
		amsJpn = "AMS_JPN";
	}
	
	switch( value ) {
	case "JPN_03":
		defaultSet = whole;
		defaultArea = usa;
		break;
	case "ASA":
		defaultSet = amsJpn;
		defaultArea = usa;
		break;
	case "CAN_01":
		defaultSet = "whole_10";
		defaultArea = sd_jpnList;
		break;
	case "MEX_01":
		defaultSet = "whole_09";
		defaultArea = sd_jpnList;
		break;
	case "BRA_01":
		defaultSet = "whole_08";
		defaultArea = sd_jpnList;
		break;
	case this.usaArea: //Only this is FP cassette.
		defaultSet = "JPN_ASA_OCE";
		defaultArea = fp_jpnList;
		break;
	case "AMS_13":
		defaultSet = "JPN_ASA";
		defaultArea = sd_jpnList;
		break;
	case "":
		defaultSet = whole;
		defaultArea = usa;
		noArea = 1;
		break;
	}

	var narrowDownArgs;
	if (num != 0){
		narrowDownArgs = [[ 'd', 'B_AREA_' + num, 'B_LOCATION_' + num ], [ 'a', 'E_AREA_' + num, 'E_LOCATION_' + num ]];
	}

	JLJS_TicketModuleModify_Fp( [
		{ "areaSlctSet" : whole, "default" : [ value, "" ], "AMD" : 1, "noGroup" : 1, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 },
		{ "areaSlctSet" : defaultSet, "default" : [ defaultArea, "" ], "AMD" : 1, "noGroup" : 1, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 },
		{ "narrowDownArgs" : narrowDownArgs, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 }
	] );

	this.formNode[b_loc].disabled = noArea ? true : false;
	this.formNode[e_area].disabled = noArea ? true : false;
	this.formNode[e_loc].disabled = noArea ? true : false;
	if (num == 0) {
		this.formNode[b_loc].disabled = noArea ? true : false;
	}

	var node = this.formNode[b_area];

	if (num == 0){
		this.changeTopCassate();
		this.createTopClass();
	}

}
// [/changeBArea]

// [private_submitCheck]
JLJS_ticketModule_Fp.prototype.private_submitCheck = function() {
	if (this.pageType == "T"){
		return this.topSubmitCheck();
	}else{
		return this.soSubmitCheck();
	}
};
// [/private_submitCheck]

// [setHiddenPrm]
JLJS_ticketModule_Fp.prototype.setHiddenPrm = function(){
	if (this.pageType == "T") {
		this.setTopPrm();
	}else if(this.pageType == "M"){
		this.setMultiPrm();
	}
}
// [/setHiddenPrm]


// [createAdditionalPrm]
JLJS_ticketModule_Fp.prototype.createAdditionalPrm = function(){
	
	while( this.additionalParameterBlock.firstChild ){
		this.additionalParameterBlock.removeChild( this.additionalParameterBlock.firstChild );
	}
	
	for( var i = 0; i < this.ADT; i ++ ) {
		var newINPUT = document.createElement( 'input' );
		newINPUT.type = "hidden";
		newINPUT.name = "TRAVELLER_TYPE_" + ( i + 1 );
		newINPUT.value = "ADT";
		this.additionalParameterBlock.appendChild( newINPUT );
	}
	
	for( var i = this.ADT; i < this.ADT + this.CHD; i ++ ) {
		var newINPUT = document.createElement( 'input' );
		newINPUT.type = "hidden";
		newINPUT.name = "TRAVELLER_TYPE_" + ( i + 1 );
		newINPUT.value = "CHD";
		this.additionalParameterBlock.appendChild( newINPUT );
	}

	if( this.tripType != "M" && this.formNode["B_AREA"].value != this.usaArea ) {
		for( var i = this.ADT + this.CHD; i < this.ADT + this.CHD + this.INF; i ++ ) {
			var newINPUT = document.createElement( 'input' );
			newINPUT.type = "hidden";
			newINPUT.name = "TRAVELLER_TYPE_" + ( i + 1 );
			newINPUT.value = "INF";
			this.additionalParameterBlock.appendChild( newINPUT );
		}
	}
	else {
		for( var i = 0; i < this.INF; i ++ ) {
			var newINPUT = document.createElement( 'input' );
			newINPUT.type = "hidden";
			newINPUT.name = "HAS_INFANT_" + ( i + 1 );
			newINPUT.value = "TRUE";
			this.additionalParameterBlock.appendChild( newINPUT );
		}
	}

// [/createAdditionalPrm]
}

// [setOption]
JLJS_ticketModule_Fp.prototype.setOption = function(list, node){
	for (var i=0;i<list.length;i++) {
		var newOpt = document.createElement( 'option' );
		newOpt.value = list[i][0];
		newOpt.innerHTML = list[i][1];
		node.appendChild( newOpt );
	}
}
// [/setOption]

//---------- [TOP-MULTI Common] ----------


//---------- [topModule] ----------
function JLJS_topModuleSetup() {

	var defaultAreaSlctSet1 = "whole_01";
	var defaultAreaSlctSet2 = "JPN_ASA_OCE";
	var defaultArea1 = "USA_01";
	var defaultArea2 = "JPN_02";
	var defaultCity1 = null;
	var defaultCity2 = null;
	var onLineOnly1 = 0;
	var onLineOnly2 = 0;
	var onLineSeparatingView_Off1 = 0;
	var onLineSeparatingView_Off2 = 0;
	var noAreaSelection1 = 1;
	var noAreaSelection2 = 1;
	var noGroup1 = 1;
	var noGroup2 = 1;
	var noDevide1 = 0;
	var noDevide2 = 0;
	var defaultDay_Outbound = 5;
	var defaultDay_Inbound = defaultDay_Outbound + 5;

	JLJS_TicketModuleSetup_Fp( [
		{ "areaSlctSet" : defaultAreaSlctSet1, "default" : [ defaultArea1, defaultCity1 ], "AMD" : 1, "onLineOnly" : onLineOnly1, "noAreaSelection" : noAreaSelection1, "onLineSeparatingView_Off" : onLineSeparatingView_Off1, "noGroup" : noGroup1, "noDevide" : noDevide1, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 },
		{ "areaSlctSet" : defaultAreaSlctSet2, "default" : [ defaultArea2, defaultCity2 ], "AMD" : 1, "onLineOnly" : onLineOnly2, "noAreaSelection" : noAreaSelection2, "onLineSeparatingView_Off" : onLineSeparatingView_Off2, "noGroup" : noGroup2, "noDevide" : noDevide2, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 },
		{ "default" : [ "today+" + defaultDay_Outbound, "today+" + defaultDay_Inbound ] }
		, { "isJumpingToOJPage" : 1, "OJ_URL" : "/ja/flight_planning/reservation/oj/", "method" : "get", "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 }
	] );

	for (var i=0;i<JLJS_AMDs.length;i++) {

		//JLJS_AMDs[i].displayCassate(1);

		JLJS.addEvent( JLJS_AMDs[i].formNode["B_AREA"], "change", function( e ) {
				e.target.form._TM_instance_.changeBArea(0,"");
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["B_LOCATION_1"], "change", function( e ) {
				e.target.form._TM_instance_.changeTopBCity();
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["E_AREA"], "change", function( e ) {
				e.target.form._TM_instance_.changeTopEArea();
				e.target.form._TM_instance_.createTopClass();
		} );
		
		JLJS.addEvent( JLJS_AMDs[i].formNode["COMMERCIAL_FARE_FAMILY_1"], "change", function( e ) {
				e.target.form._TM_instance_.openPopupWindow();
		} );
		
		if (JLJS_AMDs[i].EN) {
			JLJS_AMDCAL.lang = "en";
		}else{
			JLJS_AMDCAL.lang = "ja";
		}
	}
	JLJS_AMDCAL.url = "/world/fp/common/html/ticketModuleCalendar.html";

}


// [changeTopCassate]
JLJS_ticketModule_Fp.prototype.changeTopCassate = function(){

	var bAreaNode = this.formNode["B_AREA"];
	var eAreaNode = this.formNode["E_AREA"];
	var fpArea = document.getElementById("fpElements" + this.number);
	var sdNextImg = document.getElementById("next" + this.number + "_1");

	if (bAreaNode.value == this.usaArea && (eAreaNode.value != "BRA_01" && eAreaNode.value != "")) {
		fpArea.style.display = "block";
		sdNextImg.style.display = "none";
	}else{
		fpArea.style.display = "none";
		sdNextImg.style.display = "none";
		sdNextImg.style.display = "";
	}

}
// [/changeTopCassate]



JLJS_ticketModule_Fp.prototype.topClassList = null;
// [getTopClassList]
JLJS_ticketModule_Fp.prototype.getTopClassList = function(){
	if (this.tripType == "O"){
		if (this.EN) {
			this.topClassList = [[["1OW03", "One way fares"]], [["1OW03", "One way fares"]]];
		}else{
			this.topClassList = [[["1OW03", "\u7247\u9053\u904b\u8cc3"]], [["1OW03", "\u7247\u9053\u904b\u8cc3"]]];
		}		
	}else{
		if (this.EN) {
			this.topClassList = [[["1ECOR03", "Economy Lowest"], ["1ECOP03", "Premium Economy"], ["1BIZ03", "Business / First"], ["1FFPU03", "JMB Upgradeable"]]
						, [["1ECOR03", "Economy Lowest"], ["1BIZ03", "Business / First"], ["1FFPU03", "JMB Upgradeable"]]];
		}else{
			this.topClassList = [[["1ECOR03", "\u30a8\u30b3\u30ce\u30df\u30fc\uff08\u3082\u3063\u3068\u3082\u5b89\u3044\u904b\u8cc3\uff09"], ["1ECOP03", "\u30d7\u30ec\u30df\u30a2\u30e0\u30a8\u30b3\u30ce\u30df\u30fc"], ["1BIZ03", "\u30d3\u30b8\u30cd\u30b9 / \u30d5\u30a1\u30fc\u30b9\u30c8"], ["1FFPU03", "JMB\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u7279\u5178\u5bfe\u8c61"]]
						, [["1ECOR03", "\u30a8\u30b3\u30ce\u30df\u30fc\uff08\u3082\u3063\u3068\u3082\u5b89\u3044\u904b\u8cc3\uff09"], ["1BIZ03", "\u30d3\u30b8\u30cd\u30b9 / \u30d5\u30a1\u30fc\u30b9\u30c8"], ["1FFPU03", "JMB\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u7279\u5178\u5bfe\u8c61"]]];
		}
	}
}
// [/getTopClassList]

// [createTopClass]
JLJS_ticketModule_Fp.prototype.createTopClass = function(){

	var bAreaNode = this.formNode["B_AREA"];
	var eAreaNode = this.formNode["E_AREA"];
	var bLocationNode =  this.formNode["B_LOCATION_1"];
	var classNode = this.formNode["COMMERCIAL_FARE_FAMILY_1"];
	var ypflag;

	
	this.getTopClassList();	
	if (bAreaNode.value != this.usaArea) {
		return;
	}
	
	this.changeTopCassate();
	if (eAreaNode.value == "BRA_01" || eAreaNode.value == "") {
		return;
	}

	if( JLJS.env.isIE ) {
		while( classNode.options[ 0 ] ) {
			classNode.options.remove( 0 );
		}
		while( classNode.firstChild ) {
			classNode.removeChild( classNode.firstChild );
		}
	} else {
		while( classNode.firstChild ) {
			classNode.removeChild( classNode.firstChild );
		}
	}

	if (bAreaNode.value == this.usaArea && eAreaNode.value == "JPN_02"){
		if(bLocationNode.value != "HNL" && bLocationNode.value != "KOA"){
			ypflag = 0;//YP Set
		}else{
			ypflag = 1;//Not YP
		}
				
		this.setOption(this.topClassList[ypflag], classNode);
	}else{
		this.setOption(this.topClassList[1], classNode);
	}
	classNode.selectedIndex = 0;
}
// [/createTopClass]

// [changeTopBCity]
JLJS_ticketModule_Fp.prototype.changeTopBCity = function() {

	var b_area = "B_AREA";
	var b_loc = "B_LOCATION_1";
	var e_loc = "E_LOCATION_1";

	var bAreaNode = this.formNode[b_area];
	var bAreaVal = bAreaNode.value;

	var bLocNode = this.formNode[b_loc];
	var bLocVal = bLocNode.value;
	
	var eLocNode = this.formNode[e_loc];

	var defaultSet;
	var defaultArea;

	if (bLocVal == "JFK") {//Brazil addition when JFK is selected
		defaultSet = "whole_11";
		defaultArea = "JPN_02";
	}else{
		switch( bAreaVal ) {
		case "JPN_03":
			defaultSet = "whole_01";
			defaultArea = this.usaArea;
			break;
		case "ASA":
			defaultSet = "USA_JPN";
			defaultArea = this.usaArea;
			break;
		case "CAN_01":
			defaultSet = "whole_10";
			defaultArea = "JPN_03";
			break;
		case "MEX_01":
			defaultSet = "whole_09";
			defaultArea = "JPN_03";
			break;
		case "BRA_01":
			defaultSet = "whole_08";
			defaultArea = "JPN_03";
			break;
		case "USA_01"://Only this is FP cassette.
			defaultSet = "JPN_ASA_OCE";
			defaultArea = "JPN_02";
			break;
		case "":
			defaultSet = "whole_01";
			defaultArea = this.usaArea;
			noArea = 1;
			break;
		}
	}

	var narrowDownArgs;
	JLJS_TicketModuleModify_Fp( [
		{},
		{ "areaSlctSet" : defaultSet, "default" : [ defaultArea, "" ], "AMD" : 1, "noGroup" : 1, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0  },
		{ "narrowDownArgs" : narrowDownArgs, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0  }
	] );
	eLocNode.disabled = false;
	this.changeTopCassate();
	this.createTopClass();
	
};
// [/changeTopBCity]

// [topSubmitCheck]
JLJS_ticketModule_Fp.prototype.topSubmitCheck = function() {
	
	var msg = "";
	return msg;

};
// [/topSubmitCheck]

// [setTopPrm]
JLJS_ticketModule_Fp.prototype.setTopPrm = function(){

	this.formNode.action = this.formAction;
	if (this.formNode["B_AREA"].value == this.usaArea && (this.formNode["E_AREA"].value != "BRA_01" && this.formNode["E_AREA"].value != "")){
		this.setTopFpPrm();
	}else{
		this.setTopSdPrm();
	}
}
// [/setTopPrm]

// [setTopFpPrm]
JLJS_ticketModule_Fp.prototype.setTopFpPrm = function(){

	this.formNode["amadeusAction"].value = "http://" + this.siteType + "wftc1.e-travel.com/plnext/JALUSFPC/Override.action";	
	this.formNode["EMBEDDED_TRANSACTION"].value = "FlexPricerAvailability";
	this.formNode["SITE"].value = "ACFPACFP";
	this.formNode["TRIP_FLOW"].value = "YES";
	this.formNode["DIRECT_LOGIN"].value = "NO";
	this.formNode["ARRANGE_BY"].value = "N";
	this.formNode["REFRESH"].value = "0";
	this.formNode["EXTERNAL_ID"].value = "JAL_AR_US";
	this.formNode["PRICING_TYPE"].value = "I";
	this.formNode["DATE_RANGE_VALUE_1"].value = "3";
	this.formNode["DATE_RANGE_VALUE_2"].value = "3";
	this.formNode["DATE_RANGE_QUALIFIER_1"].value = "C";
	this.formNode["DATE_RANGE_QUALIFIER_2"].value = "C";
	this.formNode["SO_SITE_OFFICE_ID"].value = "LAXJL18AA";
	this.formNode["SO_GL"].value = '';	//"SO_GL" is made in a "imprtant notice" page.
	
	if (this.EN){
		this.formNode["LANGUAGE"].value = "GB";
	}else{
		this.formNode["LANGUAGE"].value = "JP";	
	}
	this.formNode["B_ANY_TIME_1"].value = "TRUE";

	if (this.tripType == "R") {
		this.formNode["B_ANY_TIME_2"].value = "TRUE";
	}
	if (this.formNode["IS_FLEXIBLE"].checked) {
		this.formNode["DISPLAY_TYPE"].value = "1";
	}else{
		this.formNode["DISPLAY_TYPE"].value = "2";
	}	
	this.createAdditionalPrm();
}
// [/setTopFpPrm]

// [setTopSdPrm]
JLJS_ticketModule_Fp.prototype.setTopSdPrm= function(){

	this.formNode["amadeusAction"].value = "http://" + this.siteType + "wftc1.e-travel.com/plnext/JALUSFPC/Override.action";
	
	this.formNode["EMBEDDED_TRANSACTION"].value = "AirAvailability";
	this.formNode["SITE"].value = "ACFPACFP";
	this.formNode["TRIP_FLOW"].value = "YES";
	this.formNode["DIRECT_LOGIN"].value = "NO";
	this.formNode["B_ANY_TIME_1"].value = "TRUE";
	if (this.tripType == "R") {
		this.formNode["B_ANY_TIME_2"].value = "TRUE";
	}
	this.formNode["ARRANGE_BY"].value = "N";
	this.formNode["SEVEN_DAY_SEARCH"].value = "TRUE";
	this.formNode["SEARCH_PAGE"].value = "SD";
	this.formNode["EXTERNAL_ID"].value = "JAL_AR_US";
	this.formNode["SO_SITE_OFFICE_ID"].value = "LAXJL18AA";
	this.formNode["SO_GL"].value = '';	//"SO_GL" is made in a "imprtant notice" page.
	
	if (this.EN){
		this.formNode["LANGUAGE"].value = "GB";
	}else{
		this.formNode["LANGUAGE"].value = "JP";	
	}
	
	while( this.additionalParameterBlock.firstChild ){
		this.additionalParameterBlock.removeChild( this.additionalParameterBlock.firstChild );
	}
// [/setTopSdPrm]
}

// [openPopupWindow]
JLJS_ticketModule_Fp.prototype.openPopupWindow = function(){
	var popupFile = "";
	
	if (this.formNode["COMMERCIAL_FARE_FAMILY_1"].value == "1FFPU03"){//JMB Upgradeable
		if (this.EN){
			popupFile = "/en/notes.html";
		}else{
			popupFile = "/ja/notes.html";
		}
		
		JLJS.openWindow(popupFile, "popup", 500, 240, "resizable=yes,location=no,menubar=no,scrollbars=no,status=yes,titlebar=yes,toolbar=no,left=300,top=300");
		
	}else if(this.formNode["COMMERCIAL_FARE_FAMILY_1"].value == "1ECOP03"){//Premium Economy
		if (this.EN){
			popupFile = "/en/notes_yp.html";
		}else{
			popupFile = "/ja/notes_yp.html";
		}
		
		JLJS.openWindow(popupFile, "popup", 500, 340, "resizable=yes,location=no,menubar=no,scrollbars=no,status=yes,titlebar=yes,toolbar=no,left=300,top=300");
	}	
}
// [/openPopupWindow]

// [toggleOR]
JLJS_ticketModule_Fp.prototype.toggleOR = function(){
	
		this.getTripType();
		var value;
		if( typeof arguments[ 0 ] != "undefined" )
			value = arguments[ 0 ];
		else {
			var node = this.formNode[ "TRIP_TYPE" ];
			var type = node.type ? node.type : node[ 0 ].type;
			if( type != "radio" ) return;
		}
		
		if ( this.tripType == "O" ) {
			this.formNode[ "E_MONTH" ].disabled = true;
			this.formNode[ "E_DAY" ].disabled = true;
		}else{
			this.formNode[ "E_MONTH" ].disabled = false;
			this.formNode[ "E_DAY" ].disabled = false;
		}
		
		this.createTopClass();
}
// [/toggleOR]

// [changeTopEArea]
JLJS_ticketModule_Fp.prototype.changeTopEArea = function(){

	var b_area = "B_AREA";
	var e_area = "E_AREA";
	var e_loc = "E_LOCATION_1";
	var whole = "";
	var mex1 = "MEX_01";
	var mex2 = "MEX_02";
	var can1 = "CAN_01";
	var can2 = "CAN_02";
	
	var bAreaNode = this.formNode[b_area];
	var eAreaNode = this.formNode[e_area];
	var eLocNode = this.formNode[e_loc];
	
	if (!eAreaNode.value){
		eLocNode.disabled = true;
		return;
	}else{
		eLocNode.disabled = false;
	}

	if (bAreaNode.value != mex1 && bAreaNode.value != mex2 && bAreaNode.value != can1 && bAreaNode.value != can2) {
		return;
	}
	
	var defaultSet;
	var defaultArea;
	var value;
	
	if (eAreaNode.value == mex1) {
		whole = "whole_14";
		value = can2;
		defaultSet = "whole_13";
		defaultArea = mex2;
	}else if (eAreaNode.value == can1) {
		whole = "whole_15";
		value = mex2;
		defaultSet = "whole_12";
		defaultArea = can2;
	}else{
		if (bAreaNode.value == mex2) {
			whole = "whole_15";
			value = mex2;
			defaultSet = "whole_12";
			//defaultArea = can2;
		}else if(bAreaNode.value == can2){
			whole = "whole_14";
			value = can2;
			defaultSet = "whole_13";
			//defaultArea = mex2;
		}else{
			return;
		}
		defaultArea = eAreaNode.value;
	}
	
	JLJS_TicketModuleModify_Fp( [
		{ "areaSlctSet" : whole, "default" : [ value, "" ], "AMD" : 1, "noGroup" : 1, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 },
		{ "areaSlctSet" : defaultSet, "default" : [ defaultArea, "" ], "AMD" : 1, "noGroup" : 1, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 },
		{ "narrowDownArgs" : "", "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 }
	] );
	eLocNode.disabled = false;
}
// [/changeTopEArea]

//---------- [/topModule] ----------




//---------- [multiModule] ----------
function JLJS_multiModuleSetup() {

	var defaultAreaSlctSet1 = "whole_03";
	var defaultAreaSlctSet2 = "JPN_ASA";
	var defaultArea1 = "AMS_13";
	var defaultArea2 = "JPN_03";
	var defaultCity1 = null;
	var defaultCity2 = null;
	var onLineOnly1 = 0;
	var onLineOnly2 = 0;
	var onLineSeparatingView_Off1 = 0;
	var onLineSeparatingView_Off2 = 0;
	var noAreaSelection1 = 1;
	var noAreaSelection2 = 1;
	var noGroup1 = 1;
	var noGroup2 = 1;
	var noDevide1 = 0;
	var noDevide2 = 0;
	var defaultDay_Outbound = 5;
	var defaultDay_Inbound = defaultDay_Outbound + 5;

	JLJS_TicketModuleSetup_Fp( [
		{ "areaSlctSet" : defaultAreaSlctSet1, "default" : [ defaultArea1, defaultCity1 ], "AMD" : 1, "onLineOnly" : onLineOnly1, "noAreaSelection" : noAreaSelection1, "onLineSeparatingView_Off" : onLineSeparatingView_Off1, "noGroup" : noGroup1, "noDevide" : noDevide1, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 },
		{ "areaSlctSet" : defaultAreaSlctSet2, "default" : [ defaultArea2, defaultCity2 ], "AMD" : 1, "onLineOnly" : onLineOnly2, "noAreaSelection" : noAreaSelection2, "onLineSeparatingView_Off" : onLineSeparatingView_Off2, "noGroup" : noGroup2, "noDevide" : noDevide2, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0 },
		{ "default" : [ "today+" + defaultDay_Outbound, "today+" + defaultDay_Inbound ] },
		{ "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0, "method" : "get", "areaDisp" : 1 }
		
	] );

	for (var i=0;i<JLJS_AMDs.length;i++) {
		
		JLJS_AMDs[i].formNode["TRIP_TYPE"].value = "M";
		JLJS_AMDs[i].formNode[ "stopoverCheck_1" ].value = "0";
		JLJS_AMDs[i].formNode[ "stopoverCheck_2" ].value = "0";
		
		JLJS_AMDs[i].add_setDefaultValue( 1, 1 );
		JLJS_AMDs[i].add_setDefaultValue( 2, 1 );

		JLJS_AMDs[i].changeBArea(2,"JPN_03");

		JLJS.addEvent( JLJS_AMDs[i].formNode["B_AREA_1"], "change", function( e ) {
				e.target.form._TM_instance_.changeBArea(1,"");
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["B_AREA_2"], "change", function( e ) {
				e.target.form._TM_instance_.changeBArea(2,"");
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["B_LOCATION_1"], "change", function( e ) {
				e.target.form._TM_instance_.changeMultiBCity(1);
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["B_LOCATION_2"], "change", function( e ) {
				e.target.form._TM_instance_.changeMultiBCity(2);
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["E_AREA_1"], "change", function( e ) {
				e.target.form._TM_instance_.changeMultiEArea(1,"");
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["E_AREA_2"], "change", function( e ) {
				e.target.form._TM_instance_.changeMultiEArea(2,"");
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["B_MONTH"], "change", function( e ) {
			e.target.form._TM_instance_.add_adjustDates( 1 );
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["B_DAY"], "change", function( e ) {
			e.target.form._TM_instance_.add_adjustDates( 1 );
		} );

		JLJS.addEvent( JLJS_AMDs[i].formNode["B_MONTH_SO_1"], "change", function( e ) {
			e.target.form._TM_instance_.add_adjustDates( 2 );
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["B_DAY_SO_1"], "change", function( e ) {
			e.target.form._TM_instance_.add_adjustDates( 2 );
		} );

		JLJS.addEvent( JLJS_AMDs[i].formNode["E_MONTH"], "change", function( e ) {
			e.target.form._TM_instance_.add_adjustDates( 3 );
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["E_DAY"], "change", function( e ) {
			e.target.form._TM_instance_.add_adjustDates( 3 );
		} );

		JLJS.addEvent( JLJS_AMDs[i].formNode["B_MONTH_SO_2"], "change", function( e ) {
			e.target.form._TM_instance_.add_adjustDates( 4 );
		} );
		JLJS.addEvent( JLJS_AMDs[i].formNode["B_DAY_SO_2"], "change", function( e ) {
			e.target.form._TM_instance_.add_adjustDates( 4 );
		} );

	}

	JLJS_CALGP = new JLJS_Calendar_GeneralPurpose();

	JLJS.addEvent( document.getElementById( "TM_Calendar_1" ), "click", function() {
		JLJS_CALGP.click( "B_MONTH", "B_DAY", 1 );
	} );

	JLJS.addEvent( document.getElementById( "TM_Calendar_2" ), "click", function() {
		JLJS_CALGP.click( "B_MONTH_SO_1", "B_DAY_SO_1", 2 );
	} );

	JLJS.addEvent( document.getElementById( "TM_Calendar_3" ), "click", function() {
		JLJS_CALGP.click( "E_MONTH", "E_DAY", 3 );
	} );

	JLJS.addEvent( document.getElementById( "TM_Calendar_4" ), "click", function() {
		JLJS_CALGP.click( "B_MONTH_SO_2", "B_DAY_SO_2", 4 );
	} );

}

// [changeMultiEArea]
JLJS_ticketModule_Fp.prototype.changeMultiEArea = function(num) {

	var e_area = "E_AREA" + "_" + num;
	var e_loc = "E_LOCATION" + "_" + num;
	var eAreaNode = this.formNode[e_area];
	var eLocNode = this.formNode[e_loc];
	
	if (!eAreaNode.value){
		eLocNode.disabled = true;
	}else{
		eLocNode.disabled = false;
	}

};
// [/changeMultiEArea]

// [changeMultiBCity]
JLJS_ticketModule_Fp.prototype.changeMultiBCity = function(num) {

	var b_area = "B_AREA_" + num;
	var b_loc = "B_LOCATION_" + num;
	var e_area = "E_AREA_" + num;
	var e_loc = "E_LOCATION_" + num;

	var bAreaNode = this.formNode[b_area];
	var bAreaVal = bAreaNode.value;
	var bLocNode = this.formNode[b_loc];
	var bLocVal = bLocNode.value;
	var eAreaNode = this.formNode[e_area];
	var eAreaVal = eAreaNode.value;

	var isAdded = 0;
	for( var i = 0; i < eAreaNode.options.length; i ++ ){
		if( eAreaNode.options[i].value.match( /^AMS_[0-9]+$/ )) {
			isAdded = 1;
			break;
		}
	}

	var isMatched = false;
	if ( bLocVal == "JFK" || bLocVal == "MEX" || bLocVal == "GRU" || bLocVal == "YVR" ) {
		isMatched = true;
	}
	var cond = eAreaVal.match( /^AMS_[0-9]+$/ );

	var defaultSet = null;
	var defaultArea = null;

	if( isMatched ){
		switch( bLocVal ) {
			case "JFK": defaultSet = "whole_06"; defaultArea = cond ? "AMS_04" : eAreaVal; break;
			case "GRU": defaultSet = "whole_04"; defaultArea = cond ? "AMS_02" : eAreaVal; break;
			case "MEX": defaultSet = "whole_07"; defaultArea = cond ? "AMS_05" : eAreaVal; break;
			case "YVR": defaultSet = "whole_05"; defaultArea = cond ? "AMS_03" : eAreaVal; break;
		}
	}
	if( isAdded && !isMatched ){
		switch( bAreaVal ) {
			case "AMS_13": defaultSet = "JPN_ASA"; defaultArea = cond ? "JPN_03" : eAreaVal; break;
			case "JPN_03": defaultSet = "whole_03"; defaultArea = cond ? "AMS_13" : eAreaVal; break;
			case "ASA": defaultSet = "AMS_JPN"; defaultArea = cond ? "AMS_13" : eAreaVal; break;
			case "": defaultSet = "whole_03"; defaultArea = cond ? "AMS_13" : eAreaVal; break;
		}
	}
	if( defaultSet ){
		var narrowDownArgs;
		if (num != 0){
			narrowDownArgs = [[ 'd', b_area, b_loc ], [ 'a', e_area, e_loc ]];
		}
		JLJS_TicketModuleModify_Fp( [
			{},
			{ "areaSlctSet" : defaultSet, "default" : [ defaultArea, "" ], "AMD" : 1, "noGroup" : 1, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0  },
			{ "narrowDownArgs" : narrowDownArgs, "EN" : ( JLJS02.site.lang.isEN ) ? 1 : 0  }
		] );
	}
};
// [/changeMultiBCity]

// [displaySo]
var openImg = new Image();
var closeImg = new Image();
openImg.src = "/world/common/img/icon_open_001.gif";
closeImg.src = "/world/common/img/icon_close_001.gif";
function JLJS_displaySo(num) {

	var imgElem = document.getElementById("soArea" + num + "_img");
	var imgText = document.getElementById("soArea" + num + "_text");

	var areaElem = document.getElementById("soArea" + num);
	var display = areaElem.style.display;
	var text = "";

	if(display == "none") {
		JLJS_AMDs[ 0 ].formNode[ "B_LOCATION_SO_" + num ].disabled = false;
		JLJS_AMDs[ 0 ].formNode[ "B_MONTH_SO_" + num ].disabled = false;
		JLJS_AMDs[ 0 ].formNode[ "B_DAY_SO_" + num ].disabled = false;
		areaElem.style.display = "";
		imgElem.src = closeImg.src;
		if (JLJS02.site.lang.isEN){
			text = "Cancel";
		}else{
			text = "\u3092\u89e3\u9664\u3059\u308b";
		}
		imgText.innerHTML = text;

		JLJS_AMDs[ 0 ].formNode[ "stopoverCheck_" + num ].value = 1;
	} else {
		areaElem.style.display = "none";
		imgElem.src = openImg.src;
		if (JLJS02.site.lang.isEN){
			text = "Make";
		}else{
			text = "\u3059\u308b";
		}
		imgText.innerHTML = text;
		JLJS_AMDs[ 0 ].formNode[ "B_LOCATION_SO_" + num ].disabled = true;
		JLJS_AMDs[ 0 ].formNode[ "B_MONTH_SO_" + num ].disabled = true;
		JLJS_AMDs[ 0 ].formNode[ "B_DAY_SO_" + num ].disabled = true;
		JLJS_AMDs[ 0 ].formNode[ "stopoverCheck_" + num ].value = 0;
	}
}
// [/displaySo]

JLJS_ticketModule_Fp.prototype.add_adjustDates = function( calendarNumber, onload ) {
	var oi_interval = 5;
	var d = new Date();
	var f = JLJS_AMDs[ 0 ].formNode;
	var M_node =
		calendarNumber == 1 ? f.elements[ "B_MONTH" ] :

		calendarNumber == 2 ? f.elements[ "B_MONTH_SO_1" ] :
		calendarNumber == 4 ? f.elements[ "B_MONTH_SO_2" ] :

		calendarNumber == 3 ? f.elements[ "E_MONTH" ] : null;
	var D_node =
		calendarNumber == 1 ? f.elements[ "B_DAY" ] :

		calendarNumber == 2 ? f.elements[ "B_DAY_SO_1" ] :
		calendarNumber == 4 ? f.elements[ "B_DAY_SO_2" ] :

		calendarNumber == 3 ? f.elements[ "E_DAY" ] : null;

	var M = M_node.selectedIndex;
	var D = D_node.selectedIndex + 1;
	var Y = M < d.getMonth() ? d.getFullYear() + 1 : d.getFullYear();

	var d0 = new Date( Y, M, D );
	var T0 = d0.getTime();

	var M_origin =
		calendarNumber == 2 ? f.elements[ "B_MONTH" ].selectedIndex :
		calendarNumber == 4 ? f.elements[ "E_MONTH" ].selectedIndex : null;
	var D_origin =
		calendarNumber == 2 ? f.elements[ "B_DAY" ].selectedIndex + 1 :
		calendarNumber == 4 ? f.elements[ "E_DAY" ].selectedIndex + 1 : null;
	var Y_origin = M_origin < d.getMonth() ? d.getFullYear() + 1 : d.getFullYear();
	var d_origin = new Date( Y_origin, M_origin, D_origin );
	var T_origin = d_origin.getTime();

	var interval = ( T0 - T_origin ) / ( 24 * 60 * 60 * 1000 );
	if( calendarNumber == 1 ) {
		var d = new Date( Y, M, D + 2 );

		f.elements[ "B_MONTH_SO_1" ].selectedIndex = d.getMonth();
		f.elements[ "B_DAY_SO_1" ].selectedIndex = d.getDate() - 1;

	}
	if( calendarNumber <= 2 ) {
		var node = JLJS_AMDs[ 0 ].formNode[ "stopoverCheck_1" ];
		var n = node && calendarNumber == 1 && node.checked ? 2 : 0;
		var d1 = new Date( Y, M, D + n + oi_interval );
		f.elements[ "E_MONTH" ].selectedIndex = d1.getMonth();
		f.elements[ "E_DAY" ].selectedIndex = d1.getDate() - 1;

		var d2 = new Date( Y, M, D + n + oi_interval + 2 );
		f.elements[ "B_MONTH_SO_2" ].selectedIndex = d2.getMonth();
		f.elements[ "B_DAY_SO_2" ].selectedIndex = d2.getDate() - 1;

	}
	if( calendarNumber == 3 ) {

		var d = new Date( Y, M, D + 2 );
		f.elements[ "B_MONTH_SO_2" ].selectedIndex = d.getMonth();
		f.elements[ "B_DAY_SO_2" ].selectedIndex = d.getDate() - 1;

	}
};

JLJS_ticketModule_Fp.prototype.add_setDefaultValue = function( n, onload ) {
	var defaultDay_Outbound = 5;
	var defaultDay_Inbound = defaultDay_Outbound + 5;

	if( n == 1 ) {

		var sel1 = JLJS_AMDs[ 0 ].formNode[ "B_MONTH_SO_1" ];
		var sel2 = JLJS_AMDs[ 0 ].formNode[ "B_DAY_SO_1" ];
		var S = new JLJS_DateSelector( sel1, sel2 );
		S.adjustToToday();
		S.applyOffset( '+' + ( defaultDay_Outbound + 2 ) + 'd' );

		var sel1 = JLJS_AMDs[ 0 ].formNode[ "B_MONTH_SO_2" ];
		var sel2 = JLJS_AMDs[ 0 ].formNode[ "B_DAY_SO_2" ];
		var S = new JLJS_DateSelector( sel1, sel2 );
		S.adjustToToday();
		S.applyOffset( '+' + ( defaultDay_Inbound + 2 ) + 'd' );


		var node = JLJS_AMDs[ 0 ].formNode[ "B_LOCATION_1" ];
		for( var i = 0; i < node.options.length; i ++ )
			if( node.options[ i ].value != "" ) {
				node.selectedIndex = i;
				break;
			}
		var node = JLJS_AMDs[ 0 ].formNode[ "E_LOCATION_1" ];

		for( var i = 0; i < node.options.length; i ++ )
			if( node.options[ i ].value != "" ) {
				node.selectedIndex = i;
				break;
			}

		var elmNames = [
			"B_LOCATION_1", "B_MONTH", "B_DAY",
			"E_LOCATION_1", "E_MONTH", "E_DAY",
			"FIELD_ADT_NUMBER", "FIELD_CHD_NUMBER", "FIELD_INFANTS_NUMBER"
		];

		for( var i = 0; i < elmNames.length; i ++ ) {
			var cookieVal = JLJS02.getValueFromCookie( elmNames[ i ] + "0" );
			if( ! cookieVal ) continue;
			if( elmNames[ i ].match( /^(B|E)_MONTH$/ )) cookieVal = Number( cookieVal.substring( 4, 6 ));

			var node = JLJS_AMDs[ 0 ].formNode[ elmNames[ i ]];
			for( var j = 0; j < node.options.length; j ++ ) {
				if( node.options[ j ].value == cookieVal ) {
					node.selectedIndex = j;
					if( elmNames[ i ] == "B_DAY" ) JLJS_AMDs[ 0 ].add_adjustDates( 1, onload );
					if( elmNames[ i ] == "E_DAY" ) JLJS_AMDs[ 0 ].add_adjustDates( 3, onload );
					break;
				}
			}
		}
	}
	else if( n == 2 ) {
		var node = JLJS_AMDs[ 0 ].formNode[ "B_LOCATION_2" ];
		for( var i = 0; i < node.options.length; i ++ )
			if( node.options[ i ].value != "" ) {
				node.selectedIndex = i;
				break;
			}
		var node = JLJS_AMDs[ 0 ].formNode[ "E_LOCATION_2" ];
		for( var i = 0; i < node.options.length; i ++ )
			if( node.options[ i ].value != "" ) {
				node.selectedIndex = i;
				break;
			}

		var elmNames = [[ "B_LOCATION_1", "E_LOCATION_2" ], [ "E_LOCATION_1", "B_LOCATION_2" ]];

		for( var i = 0; i < elmNames.length; i ++ ) {
			var cookieVal = JLJS02.getValueFromCookie( elmNames[ i ][ 0 ] + "0" );
			if( ! cookieVal ) continue;

			var node = JLJS_AMDs[ 0 ].formNode[ elmNames[ i ][ 1 ]];
			for( var j = 0; j < node.options.length; j ++ ) {
				if( node.options[ j ].value == cookieVal ) {
					node.selectedIndex = j;
					break;
				}
			}
		}
	}
};


function JLJS_Calendar_GeneralPurpose() {
	this.year = null;
	this.month = null;
	this.day = null;
	this.monNode = null;
	this.dayNode = null;
	this.calendarNumber = null;
	if (JLJS02.site.lang.isEN) {
		this.url = "/world/en/flight_planning/calendar_GeneralPurpose.html";
	}else{
		this.url = "/world/ja/flight_planning/calendar_GeneralPurpose.html";
	}

	this.window = null;
}

JLJS_Calendar_GeneralPurpose.prototype = {
	click : function( mon, day, calendarNumber ) {
		var f = JLJS_AMDs[ 0 ].formNode;
		var d = new Date();
		this.year = d.getFullYear();
		this.month = d.getMonth();
		this.day = d.getDate();
		this.monNode = f.elements[ mon ];
		this.dayNode = f.elements[ day ];
		this.calendarNumber = calendarNumber;
		this.open();
	},

	open : function() {
		var w = JLJS.env.isWin ? "500" : "510";
		var h = ( JLJS.env.isWin || JLJS.env.isSafari ) ? "240" : "260";
		this.window = open( this.url, "newcalwin", "titlebar=0,resizable=no,width=" + w + ",height=" + h );
		this.window.focus();
	},

	close : function() {
		if( this.month < 0 ) this.month += 12;
		var idx = idx2 = 0;
		for( var i = 0; i < this.monNode.length; i ++  )
			if( this.monNode[i].value == this.month + 1 ) { idx = i; break; }
		this.monNode.selectedIndex = idx;
		for( var i = 0; i < this.dayNode.length; i++ )
			if( this.dayNode[i].value == this.day ) { idx2 = i; break; }
		this.dayNode.selectedIndex = idx2;

		JLJS_AMDs[ 0 ].add_adjustDates( this.calendarNumber );
		this.window.close();
	}
};

JLJS_ticketModule_Fp.prototype.soSubmitCheck = function() {
	var node = this.formNode[ "stopoverCheck_1" ];
	var is_so1 = node.value == "1" ? true : false;
	node = this.formNode[ "B_LOCATION_1" ];
	var val_b1 = node ? node[ node.selectedIndex ].value : "";
	node = this.formNode[ "B_LOCATION_SO_1" ];
	var val_so1 = node ? node[ node.selectedIndex ].value : "";
	node = this.formNode[ "E_LOCATION_1" ];
	var val_e1 = node ? node[ node.selectedIndex ].value : "";

	node = this.formNode[ "stopoverCheck_2" ];
	var is_so2 = node.value == "1" ? true : false;
	node = this.formNode[ "B_LOCATION_2" ];
	var val_b2 = node ? node[ node.selectedIndex ].value : "";
	node = this.formNode[ "B_LOCATION_SO_2" ];
	var val_so2 = node ? node[ node.selectedIndex ].value : "";
	node = this.formNode[ "E_LOCATION_2" ];
	var val_e2 = node ? node[ node.selectedIndex ].value : "";
	
	var msg = "";
	
	var soDate;
	if ( is_so1 ) {
		msg += this.checkSoDate("1");
	}
	
	if ( is_so2 ) {
		msg += this.checkSoDate("2");
	}

	if ( ( is_so1 && ( val_b1 == val_so1 || val_so1 == val_e1 )) || ( is_so2 && ( val_b2 == val_so2 || val_so2 == val_e2 )) ) {
		if (this.EN) {
			msg += "- Please confirm the city of stopover again.\n";	
		}else{
			msg += "- \u518d\u5ea6\u30b9\u30c8\u30c3\u30d7\u30aa\u30fc\u30d0\u30fc\u3059\u308b\u90fd\u5e02\u3092\u3054\u78ba\u8a8d\u304f\u3060\u3055\u3044\u3002\n";			
		}
	}
	return msg;

};

JLJS_ticketModule_Fp.prototype.checkSoDate = function(num) {
	
	var yearMon = this.formNode[ "B_MONTH" ].options[ this.formNode[ "B_MONTH_SO_" + num].selectedIndex ].value;
	var depDay = this.formNode[ "B_DAY_SO_" + num ].value;
	if (depDay.length < 2) {
		depDay = "0" + depDay;
	}
	
	var isReturn;
	if (num == "1" ) {
		isReturn = false;
	}else{
		isReturn = true;
	}
	var msg = this.checkDate(yearMon.substr(4, 2), depDay, yearMon.substr(0, 4), isReturn);

	var soDate = new Date(yearMon.substr(0, 4), parseInt(yearMon.substr(4, 2), 10) - 1, depDay);
	
	var targetDate;
	if (num == "1" ) {
		targetDate = new Date(this.depYear, this.depMon - 1, this.depDay);
		if ( soDate < targetDate ){
			if (this.EN){
				msg += "- Departure date is not valid.\n"
			}else{
				msg += "- \u51FA\u767A\u65E5\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002\n"
			}
		}
	}else{
		targetDate = new Date(this.rtnYear, this.rtnMon - 1, this.rtnDay);
		if ( soDate < targetDate ){
			if (this.EN){
				msg += "- Return date is not valid.\n"
			}else{
				msg += "- \u5E30\u56FD\u642D\u4E57\u65E5\u304C\u6B63\u3057\u304F\u3042\u308A\u307E\u305B\u3093\u3002\n"
			}
		}
	}
	
	return msg;
}



JLJS_ticketModule_Fp.prototype.setMultiPrm = function(){
	this.formNode.action = this.formAction;
	this.formNode["amadeusAction"].value = this.amadeusAction;
	this.formNode["EMBEDDED_TRANSACTION"].value = "AirComplexAvailability";
	this.formNode["SITE"].value = "ACFPACFP";
	this.formNode["TRIP_FLOW"].value = "YES";
	this.formNode["DIRECT_LOGIN"].value = "NO";
	this.formNode["B_ANY_TIME_1"].value = "TRUE";
	this.formNode["B_ANY_TIME_2"].value = "TRUE";
	this.formNode["ARRANGE_BY"].value = "N";
	this.formNode["SEVEN_DAY_SEARCH"].value = "TRUE";
	this.formNode["EXTERNAL_ID"].value = "JAL_AR_US";
	this.formNode["SO_SITE_OFFICE_ID"].value = "LAXJL18AA";
	this.formNode["SO_GL"].value = '';	//"SO_GL" is made in a "imprtant notice" page.
	
	if (this.EN){
		this.formNode["LANGUAGE"].value = "GB";
	}else{
		this.formNode["LANGUAGE"].value = "JP";	
	}
	this.createAdditionalPrm();
	//OJ/SO parameters are made in a "imprtant notice" page.
}

//---------- [/multiModule] ----------
