/*[CountryJudgmentObj]*/
function JLJS_CountryJudgmentObj(){
	this.langCode = "en";
	this.currencyCD = "USD";
	this.countryCD = null;
	this.tabImgText = "tab_sidepane_ticket_";
	
	if(JLJS02.site.region.isAU){ 
		this.currencyCD = "AUD"; this.countryCD = "AU";
	}else if(JLJS02.site.region.isHK){ 
		this.currencyCD = "HKD"; this.countryCD = "HK";
	}else if(JLJS02.site.region.isCN){
		this.countryCD = "CN"; this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isKR){
		this.currencyCD = "KRW";
		this.countryCD = "KR";
		this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isSG){
		this.currencyCD = "SGD"; this.countryCD = "SG";
	}else if(JLJS02.site.region.isNZ){
		this.currencyCD = "NZD";
		this.countryCD = "NZ";
		this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isID){
		this.countryCD = "ID"; this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isPH){
		this.countryCD = "PH"; 	this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isIN){
		this.countryCD = "IN"; this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isMY){
		this.countryCD = "MY"; this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isVN){
		this.countryCD = "VN"; this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isTH){
		this.currencyCD = "THB";
		this.countryCD = "TH";
		this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isGU){ 
		this.countryCD = "GU"; this.tabImgText = "tab_sidepane_fligtscd_r_"; 
	}else if(JLJS02.site.region.isTW){
		this.countryCD = "TW"; this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isUK){
		this.currencyCD = "GBP"; this.countryCD = "UK";
	}else if(JLJS02.site.region.isFR){
		this.langCode = "fr";
		this.currencyCD = "EUR";
		this.countryCD = "FR";
	}else if(JLJS02.site.region.isDE){
		this.langCode = "de";
		this.currencyCD = "EUR";
		this.countryCD = "DE";
	}else if(JLJS02.site.region.isNL){
		this.currencyCD = "EUR"; this.countryCD = "NL";
	}else if(JLJS02.site.region.isES){
		this.langCode = "es";
		this.currencyCD = "EUR";
		this.countryCD = "ES";
	}else if(JLJS02.site.region.isIT){
		this.langCode = "it";
		this.currencyCD = "EUR";
		this.countryCD = "IT";
	}else if(JLJS02.site.region.isEG){
		this.currencyCD = "EUR";
		this.countryCD = "EG";
		this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isAT){
		this.currencyCD = "EUR"; this.countryCD = "AT";
	}else if(JLJS02.site.region.isCH){
		this.langCode = "de";
		this.currencyCD = "CHF";
		this.countryCD = "CH";
	}else if(JLJS02.site.region.isRU){
		this.currencyCD = "EUR";
		this.countryCD = "RU";
		this.tabImgText = "tab_sidepane_fligtscd_r_";
	}else if(JLJS02.site.region.isAR){ this.countryCD = "AR"; }
}

JLJS_CountryJudgmentObj.prototype = {
	ticketModuleSetUp : function( countryCD ){
		if(countryCD == "AR"){
			JLJS_topModuleSetup();
		}
	}
}

var JLJS_countryObj = new JLJS_CountryJudgmentObj();
/*[/CountryJudgmentObj]*/

/* ------ JLJS_DateSelector ----- */
function JLJS_DateSelector() {
	this.Date = new Date();
	this.days = new Array("\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f");
	this.end = new Date();
	this.endDay = null;
	if (arguments.length == 3) {
		this.year   = new JLJS_Selector(arguments[0]);
		this.month  = new JLJS_Selector(arguments[1]);
		this.day    = new JLJS_Selector(arguments[2]);
		this.format = (this.year.node && this.month.node && this.day.node) ? 3 : 0;
	} else if (arguments.length == 2) {
		this.month  = new JLJS_Selector(arguments[0]);
		this.day    = new JLJS_Selector(arguments[1]);
		this.format = (this.month.node && this.day.node) ? 2 : 0;
	}
}

JLJS_DateSelector.prototype = {
	adjust : function() {
		if (this.year)  this.year.adjustByValue(this.Date.getFullYear());
		if (this.month) this.month.adjustByValue(this.Date.getMonth() + 1);		
		if (this.day)   this.day.adjustByValue(this.Date.getDate());
	},

	applyOffset : function () {
		var offset = { y : 0, m : 0, d : 0 };
		var ptn    = /^((\+|\-)\d+)(y|m|d)$/;
		for (var i = 0; i < arguments.length; i++) {
			if (typeof arguments[i] == 'string' && arguments[i].match(ptn)) {
				offset[RegExp.$3] = eval(RegExp.$1);
			}
		}
		this.Date.setFullYear(this.Date.getFullYear() + offset.y);
		this.Date.setMonth(this.Date.getMonth() + offset.m);
		this.Date.setDate(this.Date.getDate() + offset.d);
		this.adjust();
	},

	adjustToToday : function () {
		this.Date = new Date();
		this.adjust();
	},

	adjustToDate : function (arg) {
		if (arg.constructor == Date) {
			this.Date = arg
		} else if (typeof arg == 'string' && arg.match(/^[\d\-\/]*$/)) {
			var date = (arg.match(/\-/)) ? arg.split('-') : arg.split('/');
			if (date.length == 3) {
				this.Date.setFullYear(parseInt(date[0], 10));
				this.Date.setMonth(parseInt(date[1], 10) - 1);
				this.Date.setDate(parseInt(date[2], 10));
			} else if (date.length == 2) {
				this.Date.setMonth(parseInt(date[0], 10) - 1);
				this.Date.setDate(parseInt(date[1], 10));
			} else {
				return;
			}
		}
		this.adjust();
	},
	
	setDay : function (zeroPadFlg) {

		var day = this.day.node.value ? this.day.node.value : 0;

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

		var fullYear;

		if ( this.month.node.value < this.Date.getMonth() + 1 ) {
			fullYear = this.Date.getFullYear() + 1;
		} else {
			fullYear = this.Date.getFullYear();
		}
		
		this.end.setFullYear(fullYear);
		this.end.setDate(1);
		this.end.setMonth(this.month.node.value);
		this.end.setDate(0);
		this.endDay = parseInt(this.end.getDate());
		for (i=0;i<this.endDay;i++) {
			this.end.setDate(i+1);
			var newOPT = document.createElement( 'option' );
			newOPT.value = (zeroPadFlg) ? this.padZero(i+1, 2) : i+1;
			newOPT.text = parseInt(i+1) + "\u65e5(" + this.days[this.end.getDay()] + ")";
			if( JLJS.env.isIE ) {
				this.day.node.add( newOPT, i )
			} else {
				this.day.node.appendChild( newOPT );
			}
			
		}
		
		if (day && this.day.node.length > day -1) {
			this.day.node.selectedIndex = day - 1;
		}

	},
	
	padZero : function (val, argLength) {
		val = "" + val;
		var result = val;
		for (var i = 1 ; i <= (argLength - val.length); i++) {
			result = "0" + result;
		}
		return result;		
	},
	
	getFullDay : function (arg) {
		var tempDay = new Date;
		tempDay.setDate(1);
		if (arg.constructor == Date) {
			tempDay = arg;
			return tempDay;
		} else if (typeof arg == 'string' && arg.match(/^[\d\-\/]*$/)) {
			var date = (arg.match(/\-/)) ? arg.split('-') : arg.split('/');
			if (date.length == 3) {
				tempDay.setFullYear(parseInt(date[0], 10));
				tempDay.setMonth(parseInt(date[1], 10) - 1);
				tempDay.setDate(parseInt(date[2], 10));
			} else if (date.length == 2) {
				if (parseInt(date[0], 10) < tempDay.getMonth() + 1) {
					tempDay.setFullYear(tempDay.getFullYear() + 1);
				}
				tempDay.setMonth(parseInt(date[0], 10) - 1);
				tempDay.setDate(parseInt(date[1], 10));
			}
		}
		return tempDay;		
	}
};
/* ------ /JLJS_DateSelector ----- */

/*[CalendarSet]*/
function JLJS_Calendar_HMGeneralPurpose( forms ) {
	this.HMForms = forms;
	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_HMGeneralPurpose.prototype = {
	click : function( mon, day, calendarNumber ) {
		var d = new Date();
		this.year = d.getFullYear();
		this.month = d.getMonth();
		this.day = d.getDate();
		this.monNode = this.HMForms[ "month" ];
		this.dayNode = this.HMForms[ "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();
	}
};
/*[/CalendarSet]*/

/*[hotel_AreaNarrowDawn]*/
function JLJS_HotelModuleNarrowDown(){
	this.countries = {
		"JPN" : {
		"CD" : "JPN", "title" : "Japan",
		"list" : [ "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47" ],
		"defaultFlg" : 1
		}
	};
	this.cities = {
		"01" : { "CD" : "01", "title" : "Sapporo", "list" : [ "ALL", "AIR" ] },
		"02" : { "CD" : "02", "title" : "Aomori", "list" : [ "ALL", "AIR" ] },
		"03" : { "CD" : "03", "title" : "Morioka","list" : [ "ALL", "AIR" ] },
		"04" : { "CD" : "04", "title" : "Sendai","list" : [ "ALL", "AIR" ] },
		"05" : { "CD" : "05", "title" : "Akita", "list" : [ "ALL", "AIR" ] },
		"06" : { "CD" : "06", "title" : "Yamagata", "list" : [ "ALL", "AIR" ] },
		"07" : { "CD" : "07", "title" : "Fukushima", "list" : [ "ALL", "AIR" ] },
		"08" : { "CD" : "08", "title" : "Mito", "list" : [ "ALL", "AIR" ] },
		"09" : { "CD" : "09", "title" : "Utsunomiya", "list" : [ "ALL", "AIR" ] },
		"10" : { "CD" : "10", "title" : "Maebashi", "list" : [ "ALL", "AIR" ] },
		"11" : { "CD" : "11", "title" : "Saitama", "list" : [ "ALL", "AIR" ] },
		"12" : { "CD" : "12", "title" : "Chiba","list" : [ "ALL", "NRT" ] },
		"13" : {
			"CD" : "13", "title" : "Tokyo",
			"list" : [ "TYO", "HND", "AKA", "RPG", "ASA", "UEN", "GIZ", "IKE", "ODA", "SBY", "SNG", "SIN", "IDA", "SBA", "NHB" ],
			"defaultFlg" : 1
		},
		"14" : { "CD" : "14", "title" : "Yokohama","list" : [ "ALL", "AIR" ] },
		"15" : { "CD" : "15", "title" : "Niigata","list" : [ "ALL", "AIR" ] },
		"16" : { "CD" : "16", "title" : "Toyama","list" : [ "ALL", "AIR" ] },
		"17" : { "CD" : "17", "title" : "Kanazawa","list" : [ "ALL", "AIR" ] },
		"18" : { "CD" : "18", "title" : "Fukui","list" : [ "ALL", "AIR" ] },
		"19" : { "CD" : "19", "title" : "Kofu","list" : [ "ALL", "AIR" ] },
		"20" : { "CD" : "20", "title" : "Nagano","list" : [ "ALL", "AIR" ] },
		"21" : { "CD" : "21", "title" : "Gifu","list" : [ "ALL", "AIR" ] },
		"22" : { "CD" : "22", "title" : "Shizuoka","list" : [ "ALL", "AIR" ] },
		"23" : { "CD" : "23", "title" : "Nagoya","list" : [ "ALL", "AIR" ] },
		"24" : { "CD" : "24", "title" : "Tsu","list" : [ "ALL", "AIR" ] },
		"25" : { "CD" : "25", "title" : "Otsu","list" : [ "ALL", "AIR" ] },
		"26" : { "CD" : "26", "title" : "Kyoto","list" : [ "ALL", "AIR" ] },
		"27" : { "CD" : "27", "title" : "Osaka","list" : [ "ALL", "AIR" ] },
		"28" : { "CD" : "28", "title" : "Kobe","list" : [ "ALL", "AIR" ] },
		"29" : { "CD" : "29", "title" : "Nara","list" : [ "ALL", "AIR" ] },
		"30" : { "CD" : "30", "title" : "Wakayama","list" : [ "ALL", "AIR" ] },
		"31" : { "CD" : "31", "title" : "Tottori","list" : [ "ALL", "AIR" ] },
		"32" : { "CD" : "32", "title" : "Matsue","list" : [ "ALL", "AIR" ] },
		"33" : { "CD" : "33", "title" : "Okayama","list" : [ "ALL", "AIR" ] },
		"34" : { "CD" : "34", "title" : "Hiroshima","list" : [ "ALL", "AIR" ] },
		"35" : { "CD" : "35", "title" : "Yamaguchi","list" : [ "ALL", "AIR" ] },
		"36" : { "CD" : "36", "title" : "Tokushima","list" : [ "ALL", "AIR" ] },
		"37" : { "CD" : "37", "title" : "Takamatsu","list" : [ "ALL", "AIR" ] },
		"38" : { "CD" : "38", "title" : "Matsuyama","list" : [ "ALL", "AIR" ] },
		"39" : { "CD" : "39", "title" : "Kochi","list" : [ "ALL", "AIR" ] },
		"40" : { "CD" : "40", "title" : "Fukuoka","list" : [ "ALL", "AIR" ] },
		"41" : { "CD" : "41", "title" : "Saga","list" : [ "ALL", "AIR" ] },
		"42" : { "CD" : "42", "title" : "Nagasaki","list" : [ "ALL", "AIR" ] },
		"43" : { "CD" : "43", "title" : "Kumamoto","list" : [ "ALL", "AIR" ] },
		"44" : { "CD" : "44", "title" : "Oita","list" : [ "ALL", "AIR" ] },
		"45" : { "CD" : "45", "title" : "Miyazaki","list" : [ "ALL", "AIR" ] },
		"46" : { "CD" : "46", "title" : "Kagoshima","list" : [ "ALL", "AIR" ] },
		"47" : { "CD" : "47", "title" : "Naha","list" : [ "ALL", "AIR" ] }
	};
	this.areas = {
		"TYO" : { "CD" : "130", "title" : "-", "defaultFlg" : 1 },
		"HND" : { "CD" : "131", "title" : "Haneda Airport" },
		"AKA" : { "CD" : "132", "title" : "Akasaka" },
		"RPG" : { "CD" : "133", "title" : "Roppongi" },
		"ASA" : { "CD" : "134", "title" : "Asakusa" },
		"UEN" : { "CD" : "135", "title" : "Ueno" },
		"GIZ" : { "CD" : "136", "title" : "Ginza" },
		"IKE" : { "CD" : "137", "title" : "Ikebukuro" },
		"ODA" : { "CD" : "138", "title" : "Odaiba" },
		"SBY" : { "CD" : "139", "title" : "Shibuya" },
		"SNG" : { "CD" : "13a", "title" : "Shinagawa" },
		"SIN" : { "CD" : "13b", "title" : "Shinjuku" },
		"IDA" : { "CD" : "13c", "title" : "Iidabashi" },
		"SBA" : { "CD" : "13d", "title" : "Shiba" },
		"NHB" : { "CD" : "13e", "title" : "Nihonbashi" },
		"ALL" : { "CD" : "", "title" : "-" },
		"AIR" : { "CD" : "", "title" : "Airport" },
		"NRT" : { "CD" : "", "title" : "Narita Airport" }
	};
	this.countryOP = null;
	this.cityOP = null;
	this.areaOP = null;
}

JLJS_HotelModuleNarrowDown.prototype = {
	init : function( forms ){
		if(!forms){ return; }
		
		this.countryOP = forms["country"];
		this.cityOP = forms["city"];
		this.areaOP = forms["area"];
		this.setCountryOptions();
	},
	
	narrowDownCountry : function(){
		var countryVal = this.countryOP[this.countryOP.selectedIndex].value;
		this.cityOP.options.length = 0;
		
		for(var i=0; i<this.countries[countryVal]["list"].length; i++){
			var countryList = this.countries[countryVal]["list"][i];			
			var newOPT = this.setCityTextValue(countryVal, countryList);
			this.cityOP.appendChild(newOPT);	
		}
		
		this.narrowDownCity();		
	},
	
	narrowDownCity : function(){
		var cityVal = this.cityOP[this.cityOP.selectedIndex].value;
		this.areaOP.options.length = 0;
		
		for(var i=0; i<this.cities[cityVal]["list"].length; i++){
			var cityList = this.cities[cityVal]["list"][i];
			var newOPT = this.setAreaTextValue(cityVal, cityList);
			this.areaOP.appendChild(newOPT);
		}
	},
	
	setCountryOptions : function(){

		for(var i in this.countries){
			var newOPT = document.createElement( 'option' );
			newOPT.value = this.countries[i][ "CD" ];
			newOPT.innerHTML = this.countries[i][ "title" ];
			
			if(this.countries[i]["defaultFlg"]){
				newOPT.selected = true;
			}
			this.countryOP.appendChild(newOPT);	
		}
		
		this.setCityOptions();
	},
	
	setCityOptions : function(){
		var countryVal = this.countryOP[this.countryOP.selectedIndex].value;
		
		for(var j=0; j<this.countries[countryVal]["list"].length; j++){
			var countryList = this.countries[countryVal]["list"][j];
			var newOPT = this.setCityTextValue(countryVal, countryList);
			this.cityOP.appendChild(newOPT);
		}
		
		this.setAreaOptions();
	},
	
	setAreaOptions : function(){
		var cityVal = this.cityOP[this.cityOP.selectedIndex].value;
		
		for(var k=0; k<this.cities[cityVal]["list"].length; k++){
			var cityList = this.cities[cityVal]["list"][k];
			var newOPT = this.setAreaTextValue(cityVal, cityList);
			this.areaOP.appendChild(newOPT);
		}
	},
	
	setAreaTextValue : function(cityVal, cityList){
		var newOPT = document.createElement( 'option' );

		if(cityList == "ALL"){
			newOPT.value = cityVal +"0";
		}else if(cityList == "AIR"){
			newOPT.value =  cityVal + "1";
		}else if(cityList == "NRT"){
			newOPT.value =  cityVal + "1";
		}else{
			newOPT.value = this.areas[cityList][ "CD" ];
		}
		newOPT.innerHTML = this.areas[cityList][ "title" ];
		
		if(this.areas[cityList]["defaultFlg"]){
			newOPT.selected = true;
		}
		
		return newOPT;
	},
	
	setCityTextValue : function(countryVal, countryList){
		var newOPT = document.createElement( 'option' );
		newOPT.value = this.cities[countryList][ "CD" ];
		newOPT.innerHTML = this.cities[countryList][ "title" ];
		
		if(this.cities[countryList]["defaultFlg"]){
			newOPT.selected = true;
		}
		
		return newOPT;
	}
}

var JLJS_HMnarrowdown = new JLJS_HotelModuleNarrowDown();
/*[/hotel_AreaNarrowDawn]*/

/*[hotelModule_Currency]*/
function JLJS_HotelModuleCurrency(){
	this.priceList = {
		"USD" : [ 50, 100, 150, 200, 250, 300 ],
		"EUR" : [ 25, 50, 75, 100, 125, 150 ],
		"GBP" : [ 25, 50, 75, 100, 125, 150 ],
		"CHF" : [ 50, 100, 150, 200, 250, 300 ],
		"AUD" : [ 50, 100, 150, 200, 250, 300 ],
		"NZD" : [ 50, 100, 150, 200, 250, 300 ],
		"SGD" : [ 50, 100, 150, 200, 250, 300 ],
		"HKD" : [ 250, 500, 750, 1000, 1250, 1500 ],
		"THB" : [ 2500, 5000, 7500, 10000, 12500, 15000 ],
		"KRW" : [ 50000, 100000, 150000, 200000, 250000, 300000 ]};
	this.hotelform = null;
	this.currencyCD = JLJS_countryObj.currencyCD;
	this.moneyList = [];
}

JLJS_HotelModuleCurrency.prototype = {
	init : function( forms ){
		this.hotelform = forms;		
		this.moneyList = this.priceList[this.currencyCD];
		
		this.setFromOption();
		this.setToOption();
	},
	
	setFromOption : function(){
		var p_fromText = "";
		var newOPT_from = document.createElement( 'option' );
		
		newOPT_from.value = "";
		newOPT_from.innerHTML = "any";
		newOPT_from.selected = true;
		this.hotelform["p_from"].appendChild(newOPT_from);
		
		for(var i=0; i<this.moneyList.length-1; i++){
			newOPT_from = document.createElement( 'option' );
			newOPT_from.value = this.moneyList[i];
			newOPT_from.innerHTML = this.currencyCD + " " + this.moneyList[i];
			this.hotelform["p_from"].appendChild(newOPT_from);
		}
	},
	
	setToOption : function(){
		var p_toText = "";
		
		for(var i=0; i<this.moneyList.length; i++){
			var newOPT_to = document.createElement( 'option' );
			newOPT_to.value = this.moneyList[i];
			newOPT_to.innerHTML = this.currencyCD + " " + this.moneyList[i];
			this.hotelform["p_to"].appendChild(newOPT_to);
		}
		
		newOPT_to = document.createElement( 'option' );
		newOPT_to.value = "";
		newOPT_to.innerHTML = "any";
		newOPT_to.selected = true;
		this.hotelform["p_to"].appendChild(newOPT_to);
	}
}

var JLJS_HMcurrency = new JLJS_HotelModuleCurrency();
/*[/hotelModule_Currency]*/

function JLJS_HotelModule() {
	
	this.HOTEL_FORM = "hotelSearchForm";
	this.TOPMODULE_HOTELFROM = "topHotelSearchForm";
	this.HOTEL_HIDDENPARAM = "hotelHiddenParam";
	this.setupOnLoadFlag = true;
	this.hotelform = {};
	this.tophotelform = {};
	this.hiddenParamform = {};
	this.cityNode = {};
	this.currencyCD = null;
}

JLJS_HotelModule.prototype = {
	setup : function() {
		this.hotelform = document.getElementById(this.HOTEL_FORM);
		if (!this.hotelform) return;
		
		this.dateSpecifyH(this.hotelform);
		this.hotelCalendarSet(this.hotelform);
		JLJS_HMnarrowdown.init(this.hotelform);
		JLJS_HMcurrency.init(this.hotelform);
		this.hotelAreaNarrowDown(this.hotelform);
		
		this.hiddenParamform = document.getElementById(this.HOTEL_HIDDENPARAM);
		if (!this.hiddenParamform) return;
	},
	
	topModuleSetup : function(){
		this.tophotelform = document.getElementById(this.TOPMODULE_HOTELFROM);
		if (!this.tophotelform) return;
		
		this.dateSpecifyH(this.tophotelform);
		this.hotelCalendarSet(this.tophotelform);
		JLJS_HMnarrowdown.init(this.tophotelform);
		JLJS_HMcurrency.init(this.tophotelform);
		this.hotelAreaNarrowDown(this.tophotelform);
				
		this.hiddenParamform = document.getElementById(this.HOTEL_HIDDENPARAM);
		if (!this.hiddenParamform) return;
	},
	
	submitActionForm : function( forms ) {
		var paramString = "";
		var params = [ "month", "day", "period", "room_type", "rooms", "p_from", "p_to",  "start_rating", "area" , "call_lang", "currency_flg" ];
		
		if(forms["siteid1"] && forms["siteid2"] && forms["siteid3"]){
			if(forms["siteid1"].checked){
				params.push("siteid1");
			}
			if(forms["siteid2"].checked){
				params.push("siteid2");
			}
			if(forms["siteid3"].checked){
				params.push("siteid3");
			}
			
			if(!forms["siteid1"].checked && !forms["siteid2"].checked && !forms["siteid3"].checked){
				params.push("siteid1", "siteid2", "siteid3");
			}
		}
		
		for(var i=0; i<params.length; i++){
			var value = "";
			if(params[i] == "call_lang"){
				value = "en";
			}else if(params[i] == "currency_flg"){
				value = JLJS_countryObj.currencyCD;
			}else{
				value = forms[ params[i] ].value;
			}

			paramString = paramString + "\n<input type='hidden' name='" + params[i] + "' value='" + value + "'>"
		}
		
		this.hiddenParamform.innerHTML = paramString;

		this.hiddenParamform.submit();
	},
	
	dateSpecifyH : function(forms, days){
		var sel2 = forms.elements["month"];
		var sel3 = forms.elements["day"];
		var S = new JLJS_DateSelector(/*sel1, */sel2, sel3);
		S.adjustToToday();
		
		if (days) {
			S.applyOffset(days);
		}else{
			S.applyOffset('+7d');
		}
	},
	
	hotelCalendarSet : function( forms ){
		calImg = JLJS.getElementsByClassName( "HM_Calendar", "img" )[ 0 ];
		JLJS_CALGP = new JLJS_Calendar_HMGeneralPurpose(forms);
		JLJS.addEvent( calImg, "click", function() { JLJS_CALGP.click("month", "day", 1); } );
	},
	
	hotelAreaNarrowDown : function( forms ){
		var countryNode = forms["country"];
		var cityNode = forms["city"];
		JLJS.addEvent( countryNode, "change", function(){ JLJS_HMnarrowdown.narrowDownCountry(); } );
		JLJS.addEvent( cityNode, "change", function(){ JLJS_HMnarrowdown.narrowDownCity(); } );
	}
};

var JLJS_HM = new JLJS_HotelModule();
var JLJS_CALGP = null;