function JLJS_TicketModuleModify_Fp() {
	var n = 0;
	var xcount = 2;
	var narrowDownArgs = [ 'a', 'E_AREA', 'E_LOCATION_1', 'B_LOCATION_2' ];
	var AMD = JLJS_AMDs[ n ]

	if (arguments[ AMD.number ][ 2 ][ "narrowDownArgs" ] ) {
		narrowDownArgs = arguments[ AMD.number ][ 2 ][ "narrowDownArgs" ] ;
	}

	for( var i = 0; i < xcount; i ++ ) {
		if( ! arguments[ n ][ i ][ "areaSlctSet" ] && ! arguments[ n ][ i ][ "default" ] ) continue;
		var defSet = arguments[ n ][ i ][ "areaSlctSet" ];
		var defArea = arguments[ n ][ i ][ "default" ][ 0 ];
		var defCity = arguments[ n ][ i ][ "default" ][ 1 ];
		var defCity_OJ = arguments[ n ][ i ][ "default" ][ 2 ];

		var JLJS_TMAND = new JLJS_TM_airportNarrowDown( AMD, narrowDownArgs[ 0 ], narrowDownArgs[ 1 ], narrowDownArgs[ 2 ], narrowDownArgs[ 3 ], defSet, defArea );

		JLJS_TMAND.noGroup = ( arguments[ n ][ i ][ "noGroup" ] ) ? true : false;
		JLJS_TMAND.noLabel = ( arguments[ n ][ i ][ "noLabel" ] ) ? true : false;
		JLJS_TMAND.noDevide = ( arguments[ n ][ i ][ "noDevide" ] ) ?true : false;
		JLJS_TMAND.labelOpt = (
			arguments[ n ][ i ][ "labelOpt" ] || 
			( JLJS02.env.isIE50 || JLJS02.env.isIE55 || ( JLJS.env.isMac && JLJS.env.isIE ) || JLJS.env.isOpera )
		) ? true : false;
		JLJS_TMAND.noDOM = ( JLJS02.env.isIE50 ) ? true :false;
		JLJS_TMAND.onLineOnly = ( arguments[ n ][ i ][ "onLineOnly" ] ) ? true : false;
		JLJS_TMAND.onLineSeparatingView_Off = ( arguments[ n ][ i ][ "onLineSeparatingView_Off" ] ) ? true : false;
		JLJS_TMAND.noAreaSelection = ( arguments[ n ][ i ][ "noAreaSelection" ] ) ? true : false;
		JLJS_TMAND.EN = ( arguments[ n ][ i ][ "EN" ] ) ? true : false;
		JLJS_TMAND.AMD = ( arguments[ n ][ i ][ "AMD" ] ) ? true : false;

		if( arguments[ n ][ 3 ] ) {
			JLJS_TMAND.OJ_noAreaSelection = ( arguments[ n ][ 3 ][ "OJ_noAreaSelection" ] ) ? true : false;
			JLJS_TMAND.modifyOJOnly = ( arguments[ n ][ 3 ][ "modifyOJOnly" ] ) ? true : false;
		}

		var ignoreCookie = ( typeof arguments[ n ][ i ][ "ignoreCookie" ] == "undefined" ) ?
			false : arguments[ n ][ i ][ "ignoreCookie" ];


		var cookieArea = null;
		var cookieCity = null;
		var cookieCity_OJ = null;
		JLJS_TMAND.setDefaultByCookie( [ defArea, cookieArea ], [ defCity, cookieCity ], [ defCity_OJ, cookieCity_OJ ], ignoreCookie );

		JLJS_TMAND.setAreaSelector();

		if( JLJS_TMAND.defaultArea ) {
			if( JLJS_TMAND.area )
				for( var k = 0; k < JLJS_TMAND.area.options.length; k ++ )
					if( JLJS_TMAND.area.options[ k ].value == JLJS_TMAND.defaultArea ) {
						JLJS_TMAND.area.options[ k ].selected = true;
						break;
					}
			JLJS_TMAND.narrowDown( JLJS_TMAND.defaultArea );
		}
		else
			JLJS_TMAND.narrowDown();



		JLJS_TMAND.defaultArea = null;
		JLJS_TMAND.defaultCity = null;
		JLJS_TMAND.defaultCity_OJ = null;

	}
}

//[MultiCalenderSet]
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_CALGP = new JLJS_Calendar_GeneralPurpose();
//[/MultiCalenderSet]

function JLJS_MultiModuleSetup_Fp() {
	var targetBlockClass = 'ticketModule_AMD';
	var monthDatePairs = [[ 'B_MONTH', 'B_DAY' ], [ 'E_MONTH', 'E_DAY' ]];
	var calendarClasses = [[ 'TM_Calendar_Meet', 'meet' ], [ 'TM_Calendar_Send', 'send' ]];
	narrowDownArgs = [[ 'd', 'B_AREA_1', 'B_LOCATION_1' ], [ 'a', 'E_AREA_1', 'E_LOCATION_1' ], [ 'd', 'B_AREA_2', 'B_LOCATION_2' ], [ 'a', 'E_AREA_2', 'E_LOCATION_2' ]];

	var blocks = JLJS.getElementsByClassName( targetBlockClass );
	if( ! blocks ) return;
	for( var i = 0; i < blocks.length; i ++ ) {
		var block = blocks[ i ];
		var form  = ( block ) ? JLJS.getElementsByTagName( 'form', block )[ 0 ] : null;
		if( ! form ) continue;
		var JLJS_AMD = new JLJS_ticketModule_Fp( form );
		JLJS_AMD.number = JLJS_AMDs.length;
		JLJS_AMDs[ JLJS_AMDs.length ] = JLJS_AMD;
		JLJS_AMD.block = block;
		
		var defaultDate = [];
		var m, d;

		for( var x = 0; x < arguments[ JLJS_AMD.number ].length; x++ ) {
				if( arguments[ JLJS_AMD.number ][ x ] ) {
				if( arguments[ JLJS_AMD.number ][ x ][ "method" ] ) JLJS_AMD.formMethod = arguments[ JLJS_AMD.number ][ x ][ "method" ];
				if( arguments[ JLJS_AMD.number ][ x ][ "target" ] ) JLJS_AMD.formTarget = arguments[ JLJS_AMD.number ][ x ][ "target" ];
				JLJS_AMD.EN = ( arguments[ JLJS_AMD.number ][ x ][ "EN" ] ) ? true: false;
				JLJS_AMD.isJumpingToOJPage = ( arguments[ JLJS_AMD.number ][ x ][ "isJumpingToOJPage" ] ) ? true: false;
				if( arguments[ JLJS_AMD.number ][ x ][ "OJ_URL" ] ) JLJS_AMD.OJ_URL = arguments[ JLJS_AMD.number ][ x ][ "OJ_URL" ];
			}
			
			if (arguments[ JLJS_AMD.number ][ x ][ "defaultDate" ]){
				for( var j = 0; j < monthDatePairs.length; j ++ ) {
					defaultDate[ j ] = arguments[ JLJS_AMD.number ][ x ][ "defaultDate" ][ j ];
					if( arguments[ JLJS_AMD.number ][ x ][ "ignoreCookie" ] ) {}
					else {
						m = null;
						d = null;
						if( m && d ) defaultDate[ j ] = m + "-" + d;
					}
				}
			}
		}
		
		JLJS_AMD.setFormElements();
		
		var JLJS_AMDDS = new JLJS_TM_DateSelector( JLJS_AMD, monthDatePairs[ 0 ][ 0 ], monthDatePairs[ 0 ][ 1 ], monthDatePairs[ 1 ][ 0 ], monthDatePairs[ 1 ][ 1 ] );
		JLJS_AMDDSs[ JLJS_AMDDSs.length ] = JLJS_AMDDS;
		JLJS_AMDDS.dateSpecify( defaultDate[ 0 ], defaultDate[ 1 ] );
		
		for( var j = 0; j < calendarClasses.length; j ++ ) {
			var calImg =JLJS.getElementsByClassName( calendarClasses[ j ][ 0 ], "img", block )[ 0 ];
			if( ! calImg ) continue;
			JLJS_AMDDS.calendars[ j ] = calImg;
			JLJS_AMDDS.calendars[ j ].type = calendarClasses[ j ][ 1 ];
			JLJS_AMDDS.calendars[ j ]._TMDS_instance_ = JLJS_AMDDS;
			JLJS.addEvent( JLJS_AMDDS.calendars[ j ], "click", function( e ) {
					JLJS_AMDCAL.click( e.target.type, e.target._TMDS_instance_.number );
			} );
		}

		for( var j = 0; j < narrowDownArgs.length; j ++ ) {
			var defSet = arguments[ JLJS_AMD.number ][ j ][ "areaSlctSet" ];
			var defArea = arguments[ JLJS_AMD.number ][ j ][ "default" ][ 0 ];
			var defCity = arguments[ JLJS_AMD.number ][ j ][ "default" ][ 1 ];
			var defCity_OJ = arguments[ JLJS_AMD.number ][ j ][ "default" ][ 2 ];

			var JLJS_TMAND = new JLJS_TM_airportNarrowDown( JLJS_AMD, narrowDownArgs[ j ][ 0 ], narrowDownArgs[ j ][ 1 ], narrowDownArgs[ j ][ 2 ], narrowDownArgs[ j ][ 3 ], defSet, defArea );

			JLJS_TMAND.noGroup = ( arguments[ JLJS_AMD.number ][ j ][ "noGroup" ] ) ? true : false;
			JLJS_TMAND.noLabel = ( arguments[ JLJS_AMD.number ][ j ][ "noLabel" ] ) ? true : false;
			JLJS_TMAND.noDevide = ( arguments[ JLJS_AMD.number ][ j ][ "noDevide" ] ) ? true : false;
			JLJS_TMAND.labelOpt = (
				arguments[ JLJS_AMD.number ][ j ][ "labelOpt" ] || 
				( JLJS02.env.isIE50 || JLJS02.env.isIE55 || ( JLJS.env.isMac && JLJS.env.isIE ) || JLJS.env.isOpera )
			) ? true : false;
			JLJS_TMAND.noDOM = ( JLJS02.env.isIE50 ) ? true : false;
			JLJS_TMAND.onLineOnly = ( arguments[ JLJS_AMD.number ][ j ][ "onLineOnly" ] ) ? true : false;
			JLJS_TMAND.onLineSeparatingView_Off = ( arguments[ JLJS_AMD.number ][ j ][ "onLineSeparatingView_Off" ] ) ? true : false;
			JLJS_TMAND.noAreaSelection = ( arguments[ JLJS_AMD.number ][ j ][ "noAreaSelection" ] ) ? true : false;
			JLJS_TMAND.EN = ( arguments[ JLJS_AMD.number ][ j ][ "EN" ] ) ? true : false;
			JLJS_TMAND.AMD = ( arguments[ JLJS_AMD.number ][ j ][ "AMD" ] ) ? true : false;
			if( arguments[ JLJS_AMD.number ][ 3 ] )
				JLJS_TMAND.OJ_noAreaSelection = ( arguments[ JLJS_AMD.number ][ 3 ][ "OJ_noAreaSelection" ] ) ? true : false;

			var ignoreCookie = ( typeof arguments[ JLJS_AMD.number ][ j ][ "ignoreCookie" ] == "undefined" ) ?
				false : arguments[ JLJS_AMD.number ][ j ][ "ignoreCookie" ];


			var cookieArea = null;
			var cookieCity = null;
			var cookieCity_OJ = null;

			JLJS_TMAND.setDefaultByCookie( [ defArea, cookieArea ], [ defCity, cookieCity ], [ defCity_OJ, cookieCity_OJ ], ignoreCookie );

			JLJS_TMAND.setAreaSelector();

			if( JLJS_TMAND.defaultArea ) {
				if( JLJS_TMAND.area )
					for( var k = 0; k < JLJS_TMAND.area.options.length; k ++ )
						if( JLJS_TMAND.area.options[ k ].value == JLJS_TMAND.defaultArea ) {
							JLJS_TMAND.area.options[ k ].selected = true;
							break;
						}
				JLJS_TMAND.narrowDown( JLJS_TMAND.defaultArea );
			}
			else
				JLJS_TMAND.narrowDown();



			JLJS_TMAND.defaultArea = null;
			JLJS_TMAND.defaultCity = null;
			JLJS_TMAND.defaultCity_OJ = null;

			if( JLJS_TMAND.areaNode ) {
				JLJS.addEvent( JLJS_TMAND.areaNode, 'change', function( e ) {
					e.target._TMAND_instance_.narrowDown( e.target.value );
				} );
			}
		}

		var node = JLJS_AMD.formNode[ "TRIP_TYPE" ];
		var type = node.type ? node.type : node[ 0 ].type;
		if( type == "radio" ) {
			JLJS.addEvent( node[ 0 ], 'click', function( e ) {
				e.target.form._TM_instance_.toggleOR();
			} );
			JLJS.addEvent( node[ 1 ], 'click', function( e ) {
				e.target.form._TM_instance_.toggleOR();
			} );
			if( node[ 2 ] ) JLJS.addEvent( node[ 2 ], 'click', function( e ) {
				e.target.form._TM_instance_.toggleOR();
			} );
			JLJS_AMD.toggleOR();
		}
	}

	JLJS_AMDCAL = new JLJS_TM_Calendar( JLJS_AMDs );
	JLJS_AMDCAL.AMD = true;
}