/* JALMAP用のJSファイル。
 * リスト対象都市のうち、都市名に「(JALMAP)」と記述されている都市のみを表示します。
 * 「検索する」ボタンがクリックされた際に、各都市のTopではなく「http://di.jal.co.jp/jalmap/」を呼びます。
 * callHtml、writeMap、intCitySetupOnloadを修正。
 * createList、listCheckを新規追加。
 */

/**
 * 都市ガイド処理
 */
function cityGuide() {
	// ベース
	this.BASE_HREF;

	// プロトコル判定
	var protocol = window.location.protocol;
	if(protocol == "http:") {
		this.BASE_HREF = "";
	} else {
		this.BASE_HREF = "https://www.jal.co.jp";
	}

	// マップ用NODE
	this.MAP_NODES = [];
	
	this.flashVerFlg = JLJS_plugin.isFlashPlugin(JLJS_plugin.requiredMajorVersion, JLJS_plugin.requiredMinorVersion, JLJS_plugin.requiredRevision);
}


cityGuide.prototype = {

	/**
	 * 初期処理
	 */
	cgInit : function () {
		var flash = document.getElementById("headLineB01_2_FLASH");
		var html = document.getElementById("headLineB01_2_HTML");
		if(this.flashVerFlg) {
			flash.style.display = "block";
			html.style.display = "none";
		} else {
			flash.style.display = "none";
			html.style.display = "block";
		}
	},

	/**
	 * 海外都市ガイドの表示変更処理
	 */
	toCityGuide : function (guide) {

		var link = document.getElementById("headLineB01_1");
		var flash = document.getElementById("headLineB01_2_FLASH");
		var html = document.getElementById("headLineB01_2_HTML");

		var src = "";
		var alt = "";
		var href = "";

		if(guide == "flash") {
			// FLASH
			href = "javascript:cg.toCityGuide('html');";
			src = "/inter/img/link-text_html.gif";
			alt="HTML版";
			flash.style.display = "block";
			html.style.display = "none";
		} else {
			// HTML
			href = "javascript:cg.toCityGuide('flash');";
			src = "/inter/img/link-text_flash.gif";
			alt="FLASH版";
			flash.style.display = "none";
			html.style.display = "block";
		}
		link.href = href;
		link.innerHTML = '<img src="' + cg.BASE_HREF +  src + '" alt="' + alt + '" width="53" height="12" border="0">';
		
	},

	/**
	 * リンク画像を切り替える処理
	 */
	toImg : function () {
		if(this.flashVerFlg) {
			document.write('<td><a href="javascript:cg.toCityGuide(\'html\')" id="headLineB01_1"><img src="' + cg.BASE_HREF + '/inter/img/link-text_html.gif" alt="HTML版" width="53" height="12" border="0"></a></td>');
		}
	},

	/**
	 * Flashを呼び出す処理
	 */
	callFlash : function () {

		var SWF = "/jalmap_flash/img/swf/worldmap.swf";
		var protocol = window.location.protocol;
		var param = "?ssl=";

		if(protocol == "http:") {
			param = param + "no";
		} else {
			param = param + "yes";
		}

		var url = cg.BASE_HREF + SWF + param;

		JLJS_plugin.outputFlash(
			'codebase', protocol + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0',
			'width', '375',
			'height', '240',
			'quality', 'high',
			'pluginspage', protocol + '//www.macromedia.com/go/getflashplayer',
			'movie', url,
			'menu', 'false'
			);

	},

	/**
	 * Htmlを呼び出す処理
	 */
	callHtml : function () {

		document.write('<!-- クリッカブルマップ -->');
		document.write('<map name="worldMap" id="worldMap">');
		document.write('<area alt="北米・中南米" href="#cityGuide-02" onclick=\'cg.createList("america", "infoCityBlockAmerica");\' shape="poly" ');
		document.write('coords="349,39, 350,39, 351,39, 352,39, 353,39, 354,39, 355,39, 356,40, 357,40, 358,40, 359,41, 360,41, 361,42, 362,43, 363,44, 364,43, 365,43, 366,43, 367,43, 368,43, 369,44, 369,45, 368,46, 368,47, 367,48, 366,49, 365,50, 364,50, 363,51, 363,52, 363,53, 364,54, 364,55, 364,56, 364,57, 363,57, 362,58, 362,59, 362,60, 362,61, 362,62, 362,63, 362,64, 361,64, 360,64, 359,65, 360,66, 361,67, 361,68, 360,69, 360,70, 360,71, 360,72, 360,73, 359,74, 358,75, 359,76, 360,76, 361,76, 362,77, 363,77, 364,77, 365,77, 366,77, 367,77, 368,77, 369,77, 369,78, 370,79, 370,80, 370,81, 369,82, 368,83, 367,84, 366,84, 365,84, 364,84, 363,84, 362,84, 361,84, 360,84, 359,84, 358,83, 358,82, 358,81, 357,80, 357,79, 357,78, 357,77, 356,76, 355,76, 354,76, 353,76, 352,77, 352,78, 351,79, 351,80, 350,80, 349,80, 348,80, 347,80, 346,81, 345,82, 344,83, 343,84, 343,85, 343,86, 342,87, 342,88, 342,89, 341,90, 340,90, 339,90, 338,89, 337,88, 336,87, 335,86, 335,85, 334,84, 333,83, 333,82, 332,81, 332,80, 332,79, 331,78, 331,77, 331,76, 331,75, 332,74, 331,73, 330,72, 331,71, 331,70, 330,69, 330,68, 330,67, 329,66, 329,65, 328,64, 328,63, 328,62, 327,61, 326,61, 325,60, 324,60, 323,60, 322,60, 321,60, 320,60, 319,60, 318,59, 317,59, 316,58, 316,57, 315,56, 314,55, 313,54, 312,55, 311,55, 310,56, 311,57, 310,58, 310,59, 309,59, 308,59, 307,60, 308,61, 308,62, 309,63, 310,63, 311,64, 312,65, 313,66, 314,67, 315,67, 316,68, 317,69, 318,69, 319,69, 320,70, 320,71, 320,72, 321,73, 322,74, 323,75, 324,76, 325,76, 325,77, 325,78, 325,79, 324,80, 323,81, 324,82, 324,83, 324,84, 323,84, 322,85, 321,86, 320,86, 319,86, 318,87, 318,88, 318,89, 319,90, 320,89, 320,88, 321,88, 322,88, 323,89, 323,90, 324,91, 324,92, 325,93, 326,94, 327,95, 328,96, 329,97, 330,98, 331,99, 331,100, 331,101, 331,102, 330,103, 331,104, 332,104, 333,105, 333,106, 334,107, 333,108, 332,109, 331,109, 330,109, 329,109, 328,108, 327,109, 327,110, 326,111, 326,112, 325,112, 324,113, 323,113, 322,113, 321,113, 320,113, 319,113, 318,113, 317,114, 317,115, 316,116, 316,117, 315,118, 314,118, 313,119, 312,120, 312,121, 312,122, 312,123, 312,124, 313,125, 314,125, 315,124, 316,125, 317,124, 318,124, 319,124, 320,125, 321,124, 322,125, 323,125, 324,126, 324,127, 324,128, 325,129, 325,130, 325,131, 326,132, 326,133, 326,134, 326,135, 326,136, 326,137, 326,138, 326,139, 325,139, 324,140, 323,139, 322,140, 321,141, 321,142, 321,143, 320,144, 319,144, 318,144, 317,144, 316,144, 315,145, 314,145, 313,144, 312,143, 311,144, 310,143, 309,143, 308,142, 307,141, 306,141, 305,141, 304,141, 303,141, 302,142, 302,143, 302,144, 303,145, 304,145, 305,145, 306,145, 307,146, 307,147, 306,148, 306,149, 306,150, 306,151, 307,152, 308,152, 309,152, 310,152, 311,152, 312,152, 313,151, 314,151, 315,150, 316,150, 317,150, 318,150, 318,151, 319,152, 320,152, 321,152, 322,152, 323,152, 324,153, 325,153, 326,153, 327,154, 328,155, 329,156, 330,156, 331,156, 332,157, 333,158, 334,159, 334,160, 335,161, 335,162, 336,163, 337,163, 338,164, 339,165, 340,165, 341,165, 342,165, 343,166, 344,166, 345,167, 346,167, 347,168, 348,168, 349,169, 349,170, 349,171, 349,172, 349,173, 348,174, 348,175, 347,176, 347,177, 346,178, 345,179, 345,180, 345,181, 345,182, 345,183, 344,184, 344,185, 344,186, 343,187, 343,188, 343,189, 342,190, 341,190, 340,191, 339,191, 338,191, 337,192, 337,193, 337,194, 337,195, 337,196, 337,197, 336,198, 335,199, 334,200, 333,201, 333,202, 332,203, 331,203, 330,203, 329,204, 330,205, 330,206, 329,207, 328,208, 327,208, 326,208, 325,209, 325,210, 324,211, 323,211, 322,212, 322,213, 322,214, 322,215, 321,216, 321,217, 320,218, 321,219, 321,220, 321,221, 320,222, 320,223, 319,224, 318,225, 319,226, 319,227, 320,228, 321,229, 322,229, 322,230, 323,231, 322,232, 321,232, 320,232, 319,233, 318,233, 317,232, 316,232, 315,231, 314,230, 314,229, 313,228, 313,227, 312,226, 311,225, 311,224, 310,223, 310,222, 311,221, 311,220, 311,219, 311,218, 312,217, 312,216, 313,215, 312,214, 312,213, 312,212, 312,211, 312,210, 312,209, 312,208, 313,207, 313,206, 314,205, 314,204, 314,203, 314,202, 314,201, 314,200, 314,199, 314,198, 314,197, 315,196, 315,195, 315,194, 315,193, 315,192, 316,191, 316,190, 316,189, 316,188, 315,187, 315,186, 315,185, 314,184, 313,183, 312,182, 311,181, 310,181, 309,181, 309,180, 309,179, 309,178, 309,177, 308,176, 308,175, 307,174, 307,173, 306,172, 306,171, 305,170, 305,169, 305,168, 306,167, 306,166, 306,165, 306,164, 306,163, 306,162, 307,161, 308,160, 309,159, 309,158, 309,157, 308,156, 307,156, 306,156, 305,156, 304,156, 303,155, 302,154, 302,153, 301,152, 301,151, 301,150, 300,149, 299,149, 298,149, 297,149, 296,148, 295,147, 294,146, 293,146, 292,147, 291,147, 290,147, 289,147, 288,146, 287,145, 286,144, 285,143, 284,142, 283,142, 283,141, 282,140, 281,140, 280,140, 279,140, 278,139, 277,139, 276,140, 275,140, 274,140, 273,140, 272,140, 271,140, 270,140, 269,140, 268,140, 267,140, 266,140, 265,140, 264,140, 263,140, 263,139, 262,138, 261,137, 260,136, 260,135, 260,134, 260,133, 261,132, 260,131, 260,130, 260,129, 260,128, 261,127, 262,127, 263,126, 263,125, 264,124, 265,124, 266,124, 267,124, 268,124, 269,124, 270,123, 269,122, 269,121, 268,120, 268,119, 268,118, 267,117, 267,116, 267,115, 267,114, 267,113, 267,112, 267,111, 267,110, 266,109, 266,108, 266,107, 266,106, 265,105, 264,106, 263,105, 262,105, 261,104, 261,103, 260,102, 260,101, 259,100, 258,99, 257,98, 257,97, 257,96, 258,95, 257,94, 257,93, 256,92, 255,92, 254,91, 253,90, 252,90, 251,90, 250,89, 249,90, 248,91, 247,91, 246,91, 245,91, 244,91, 243,91, 242,92, 241,92, 240,93, 239,94, 238,95, 238,96, 237,97, 236,98, 235,98, 234,98, 233,99, 232,99, 231,99, 230,100, 229,100, 228,101, 227,101, 226,101, 225,100, 226,99, 227,98, 227,97, 228,96, 229,96, 230,95, 231,95, 232,95, 233,94, 234,93, 235,92, 234,91, 233,91, 232,91, 232,90, 231,89, 230,88, 229,87, 229,86, 229,85, 229,84, 230,83, 230,82, 229,81, 228,81, 227,80, 228,79, 229,78, 230,78, 231,77, 231,76, 230,75, 230,74, 231,73, 231,72, 232,71, 233,70, 234,69, 235,69, 236,69, 237,68, 238,68, 239,67, 240,67, 241,68, 242,69, 243,70, 244,70, 245,70, 246,70, 247,70, 248,71, 249,71, 250,71, 251,71, 252,71, 253,71, 254,71, 255,72, 256,72, 257,73, 258,72, 259,72, 260,71, 261,71, 262,71, 263,71, 264,70, 265,70, 266,71, 267,71, 268,71, 269,70, 268,69, 267,68, 266,67, 266,66, 266,65, 266,64, 267,63, 267,62, 268,61, 269,61, 270,60, 269,59, 268,58, 268,57, 268,56, 269,56, 270,55, 271,55, 272,54, 273,53, 274,53, 275,54, 276,55, 277,54, 277,53, 277,52, 278,52, 279,51, 280,51, 281,52, 282,52, 282,53, 283,54, 284,54, 285,53, 285,52, 285,51, 285,50, 286,49, 287,49, 288,50, 289,50, 289,51, 290,52, 291,52, 292,51, 292,50, 291,49, 292,48, 292,47, 293,46, 294,46, 295,45, 296,45, 297,44, 298,43, 299,43, 300,42, 301,42, 302,42, 303,42, 304,42, 305,42, 306,42, 307,42, 308,41, 309,41, 310,41, 311,41, 312,41, 313,40, 314,40, 315,41, 316,41, 317,41, 318,41, 319,41, 320,41, 321,41, 322,41, 323,41, 324,41, 325,41, 325,42, 325,43, 326,44, 327,43, 328,43, 329,43, 330,43, 331,42, 332,42, 333,42, 334,42, 335,41, 336,41, 337,41, 338,40, 339,40, 340,40, 341,40, 342,40, 343,40, 344,40, 345,40, 346,40, 347,40, 348,40">');

		document.write('<area alt="ハワイ" href="#cityGuide-03" onclick=\'cg.createList("hawaii", "infoCityBlockHawaii");\' shape="rect" ');
		document.write('coords="206,123,245,160">');

		document.write('<area alt="ヨーロッパ・アフリカ" href="#cityGuide-04" onclick=\'cg.createList("euro", "infoCityBlockEuro");\' shape="poly" ');
		document.write('coords="119,33, 120,33, 121,33, 122,33, 123,33, 124,33, 124,34, 124,35, 125,36, 126,37, 127,37, 128,38, 129,38, 130,38, 131,39, 132,39, 132,40, 132,41, 132,42, 132,43, 133,44, 134,45, 135,45, 136,45, 137,45, 138,45, 139,45, 140,46, 141,47, 141,48, 141,49, 141,50, 141,51, 140,52, 139,52, 138,53, 139,54, 140,54, 141,54, 142,54, 143,54, 144,54, 145,53, 146,53, 147,54, 148,55, 149,54, 150,54, 151,53, 152,54, 153,54, 154,54, 155,54, 156,54, 157,55, 157,56, 157,57, 158,58, 159,58, 160,58, 161,58, 162,58, 163,58, 164,58, 165,58, 166,58, 167,57, 168,56, 169,55, 168,54, 167,54, 166,54, 165,53, 164,52, 163,52, 163,51, 163,50, 164,49, 164,48, 165,48, 166,48, 167,48, 168,48, 169,48, 170,48, 171,48, 172,49, 173,49, 174,49, 175,49, 176,49, 177,49, 178,49, 179,49, 179,50, 179,51, 179,52, 179,53, 178,53, 177,53, 176,53, 175,53, 174,53, 173,52, 172,52, 171,53, 170,54, 171,55, 172,56, 173,56, 174,57, 175,56, 176,56, 177,57, 178,57, 179,58, 180,59, 181,60, 182,60, 183,59, 184,59, 185,59, 186,59, 187,59, 188,60, 189,60, 190,61, 191,62, 192,62, 193,62, 194,62, 195,62, 196,62, 197,62, 198,62, 199,62, 200,62, 201,62, 202,61, 203,61, 204,62, 205,62, 206,61, 206,60, 206,59, 207,58, 208,58, 209,58, 210,58, 211,58, 212,58, 213,59, 213,60, 213,61, 212,62, 211,62, 210,62, 209,62, 208,62, 207,63, 208,64, 209,64, 210,65, 211,65, 212,66, 213,66, 214,66, 215,67, 216,67, 217,68, 218,68, 219,69, 219,70, 220,71, 220,72, 219,73, 218,74, 217,75, 216,75, 215,74, 214,74, 213,73, 212,73, 211,72, 210,73, 209,74, 210,75, 210,76, 210,77, 209,78, 208,78, 207,78, 206,78, 205,79, 205,80, 204,81, 203,82, 202,82, 201,83, 200,83, 199,84, 198,83, 197,83, 196,83, 195,83, 194,84, 193,85, 193,86, 193,87, 192,88, 192,89, 192,90, 192,91, 192,92, 191,93, 190,94, 190,95, 190,96, 189,97, 189,98, 189,99, 188,99, 187,99, 186,99, 185,99, 185,98, 185,97, 185,96, 185,95, 185,94, 184,93, 184,92, 184,91, 184,90, 184,89, 184,88, 185,87, 185,86, 186,85, 187,84, 188,84, 189,83, 189,82, 188,81, 187,80, 186,81, 185,82, 184,83, 184,84, 183,85, 182,85, 181,85, 180,85, 179,85, 178,85, 177,85, 176,85, 175,85, 174,84, 173,84, 172,84, 171,85, 170,86, 169,87, 168,88, 167,89, 166,90, 165,91, 166,92, 167,91, 168,91, 169,92, 170,93, 171,93, 172,93, 172,94, 172,95, 173,96, 173,97, 173,98, 173,99, 174,100, 174,101, 174,102, 173,103, 172,104, 172,105, 171,106, 170,105, 169,106, 168,107, 167,108, 167,109, 166,110, 165,111, 164,112, 163,113, 162,113, 161,114, 160,114, 159,114, 158,113, 158,112, 158,111, 158,110, 158,109, 159,108, 160,107, 161,107, 162,106, 162,105, 162,104, 161,103, 160,103, 159,103, 158,103, 157,102, 156,102, 156,101, 155,100, 155,99, 155,98, 154,97, 153,96, 152,96, 151,95, 150,95, 149,95, 148,95, 147,96, 147,97, 147,98, 146,99, 145,100, 144,101, 143,101, 142,101, 141,102, 140,102, 139,102, 138,102, 137,102, 136,102, 135,102, 134,102, 133,102, 132,101, 131,101, 130,101, 129,100, 128,100, 127,99, 126,99, 125,100, 124,101, 123,101, 122,101, 121,101, 120,100, 119,100, 118,101, 117,101, 116,101, 115,100, 114,100, 113,100, 112,100, 111,100, 110,100, 109,99, 108,99, 107,99, 106,99, 105,98, 104,97, 103,96, 102,95, 101,95, 100,95, 99,94, 98,94, 97,93, 96,92, 95,93, 94,93, 93,93, 92,93, 91,93, 90,93, 89,93, 88,93, 87,94, 87,95, 87,96, 87,97, 87,98, 87,99, 87,100, 86,100, 85,100, 84,100, 83,100, 82,100, 81,100, 80,100, 79,100, 78,99, 77,99, 76,99, 75,99, 74,100, 73,100, 72,101, 73,102, 73,103, 74,104, 75,104, 76,104, 77,104, 78,104, 78,105, 79,106, 79,107, 79,108, 78,109, 77,110, 78,111, 78,112, 79,113, 79,114, 79,115, 80,116, 80,117, 80,118, 81,119, 81,120, 81,121, 80,121, 79,121, 78,121, 77,121, 76,120, 75,120, 74,119, 73,118, 72,118, 71,118, 70,118, 70,117, 70,116, 70,115, 69,114, 68,114, 67,114, 66,114, 65,114, 64,114, 63,114, 62,114, 61,114, 60,114, 59,114, 58,115, 57,115, 56,115, 55,115, 54,115, 53,115, 52,115, 51,114, 50,113, 50,112, 50,111, 49,110, 48,111, 48,112, 48,113, 48,114, 47,114, 46,114, 45,115, 45,116, 45,117, 44,117, 43,117, 42,118, 41,119, 40,120, 39,121, 38,121, 37,121, 36,121, 35,120, 35,119, 35,118, 36,118, 37,118, 38,117, 38,116, 37,115, 36,114, 35,113, 34,113, 33,112, 33,111, 32,110, 31,111, 30,112, 29,112, 28,111, 27,112, 27,113, 26,114, 25,115, 24,116, 24,117, 24,118, 24,119, 23,120, 22,121, 21,121, 20,121, 19,121, 18,122, 17,122, 16,121, 15,121, 14,120, 13,119, 13,118, 13,117, 13,116, 13,115, 13,114, 13,113, 13,112, 13,111, 14,110, 15,110, 16,110, 17,109, 18,109, 19,109, 20,109, 21,108, 21,107, 21,106, 20,105, 19,105, 18,104, 18,103, 18,102, 19,101, 18,100, 17,100, 17,99, 16,98, 15,99, 14,99, 13,99, 12,98, 12,97, 12,96, 12,95, 12,94, 12,93, 12,92, 13,92, 14,91, 15,91, 16,90, 16,89, 16,88, 16,87, 16,86, 17,85, 17,84, 18,83, 19,82, 18,81, 17,80, 16,80, 16,79, 16,78, 16,77, 16,76, 16,75, 17,75, 18,75, 19,75, 20,76, 21,76, 22,77, 22,78, 22,79, 22,80, 21,81, 20,81, 19,82, 20,83, 20,84, 20,85, 21,86, 22,86, 23,87, 23,88, 23,89, 23,90, 24,91, 24,92, 24,93, 25,94, 25,95, 25,96, 26,97, 27,96, 28,95, 29,95, 30,94, 31,93, 32,92, 32,91, 32,90, 32,89, 32,88, 31,87, 30,86, 29,85, 28,84, 28,83, 28,82, 28,81, 28,80, 28,79, 29,78, 29,77, 30,76, 31,75, 32,75, 33,74, 34,73, 35,72, 35,71, 35,70, 35,69, 36,68, 37,67, 38,66, 39,65, 40,64, 41,63, 41,62, 41,61, 41,60, 41,59, 41,58, 41,57, 41,56, 41,55, 41,54, 41,53, 41,52, 41,51, 41,50, 41,49, 41,48, 40,47, 39,47, 38,47, 38,46, 37,45, 36,44, 35,44, 34,44, 33,43, 33,42, 33,41, 33,40, 33,39, 34,38, 34,37, 35,37, 36,37, 37,37, 38,37, 39,37, 40,37, 41,37, 42,36, 42,35, 43,35, 44,35, 45,35, 46,35, 47,34, 48,34, 49,34, 50,34, 51,35, 52,35, 52,36, 52,37, 52,38, 51,39, 50,39, 49,39, 48,39, 47,40, 48,41, 48,42, 48,43, 48,44, 47,45, 46,45, 45,45, 44,45, 43,46, 42,47, 41,48, 41,49, 41,50, 41,51, 41,52, 41,53, 41,54, 41,55, 41,56, 41,57, 41,58, 41,59, 41,60, 41,61, 41,62, 42,63, 43,63, 44,62, 44,61, 45,60, 46,59, 47,59, 48,59, 49,59, 50,59, 51,59, 52,59, 53,59, 54,59, 55,60, 56,61, 57,62, 58,63, 59,63, 60,63, 61,63, 62,64, 63,64, 64,65, 65,65, 66,66, 67,67, 68,67, 69,66, 70,67, 71,66, 72,66, 73,66, 74,66, 75,65, 76,65, 77,64, 78,64, 79,64, 80,64, 81,63, 81,62, 80,61, 79,61, 78,61, 77,61, 76,60, 76,59, 76,58, 76,57, 77,56, 77,55, 77,54, 78,53, 79,52, 80,51, 81,50, 81,49, 82,48, 83,47, 84,47, 85,47, 86,47, 87,47, 88,47, 89,47, 90,47, 91,46, 92,46, 93,46, 94,46, 94,47, 94,48, 94,49, 93,50, 93,51, 92,51, 91,51, 90,51, 89,51, 88,52, 87,52, 86,53, 85,54, 84,55, 83,56, 83,57, 83,58, 83,59, 83,60, 83,61, 82,61, 81,62, 82,63, 82,64, 83,65, 84,64, 85,63, 85,62, 86,62, 87,62, 88,62, 89,62, 90,62, 91,61, 91,60, 91,59, 92,58, 93,57, 93,56, 94,55, 95,54, 96,54, 97,53, 98,54, 98,55, 99,56, 100,56, 101,56, 102,55, 103,55, 104,56, 105,55, 106,54, 107,53, 108,53, 109,53, 110,53, 111,53, 112,52, 112,51, 113,50, 114,49, 115,49, 116,48, 117,48, 118,48, 119,48, 120,48, 121,48, 122,47, 123,47, 124,47, 125,47, 126,46, 126,45, 127,44, 127,43, 126,42, 125,42, 124,42, 123,42, 122,42, 121,41, 120,40, 119,40, 118,40, 118,39, 118,38, 117,37, 117,36, 117,35, 117,34, 118,34">');

		document.write('<area alt="アジア･中近東" href="#cityGuide-05" onclick=\'cg.createList("asia", "infoCityBlockAsia");\' shape="poly" ');
		document.write('coords="94,91, 95,91, 96,91, 97,91, 98,91, 99,92, 100,93, 101,93, 102,93, 103,93, 104,93, 104,94, 105,95, 106,96, 107,97, 108,97, 109,97, 110,97, 111,98, 112,99, 113,99, 114,100, 114,101, 114,102, 113,102, 112,103, 112,104, 112,105, 111,105, 110,105, 109,106, 109,107, 109,108, 108,109, 108,110, 107,111, 106,112, 106,113, 105,113, 104,114, 103,114, 102,114, 101,115, 100,115, 99,116, 98,116, 97,117, 97,118, 97,119, 97,120, 97,121, 97,122, 98,123, 99,123, 100,123, 101,123, 102,122, 103,121, 104,121, 105,121, 106,121, 107,121, 107,122, 107,123, 106,124, 105,125, 105,126, 106,127, 107,128, 108,128, 108,129, 109,130, 110,130, 111,130, 112,131, 113,131, 114,131, 115,131, 116,131, 117,132, 118,131, 119,131, 120,130, 121,129, 122,129, 123,129, 124,130, 125,131, 125,132, 125,133, 125,134, 125,135, 125,136, 125,137, 126,138, 126,139, 127,140, 128,140, 129,139, 130,139, 131,139, 132,138, 133,138, 134,138, 135,139, 136,140, 136,141, 136,142, 136,143, 136,144, 136,145, 137,146, 138,147, 137,148, 138,149, 138,150, 138,151, 138,152, 138,153, 137,154, 137,155, 136,156, 135,157, 135,158, 134,158, 133,159, 132,159, 131,158, 130,157, 129,158, 129,159, 130,160, 131,161, 132,162, 132,163, 133,164, 132,165, 132,166, 132,167, 131,168, 132,169, 132,170, 133,171, 133,172, 133,173, 134,174, 135,174, 136,174, 137,174, 138,174, 139,174, 140,173, 139,172, 138,172, 137,172, 136,171, 135,170, 135,169, 135,168, 135,167, 135,166, 135,165, 135,164, 136,163, 137,163, 138,162, 139,161, 140,160, 141,159, 142,158, 143,158, 144,157, 145,158, 146,159, 147,160, 147,161, 148,162, 149,162, 150,162, 151,161, 150,160, 150,159, 150,158, 149,157, 149,156, 149,155, 148,154, 148,153, 147,152, 146,151, 146,150, 145,149, 145,148, 145,147, 145,146, 144,145, 144,144, 145,143, 145,142, 145,141, 146,140, 146,139, 145,138, 146,137, 147,136, 148,135, 149,135, 150,135, 151,135, 152,134, 152,133, 153,132, 154,131, 155,130, 155,129, 156,129, 157,128, 157,127, 156,126, 155,126, 154,126, 153,126, 152,125, 152,124, 152,123, 152,122, 152,121, 151,120, 150,119, 150,118, 150,117, 151,116, 151,115, 151,114, 152,113, 153,112, 154,112, 155,112, 156,111, 157,111, 158,111, 159,111, 160,111, 160,112, 160,113, 159,114, 158,115, 158,116, 157,117, 158,118, 159,118, 159,119, 159,120, 160,121, 161,121, 162,120, 162,119, 163,118, 164,118, 165,117, 166,116, 166,115, 166,114, 167,113, 167,112, 167,111, 167,110, 167,109, 167,108, 167,107, 168,106, 169,105, 170,105, 171,105, 172,106, 173,107, 174,108, 175,108, 176,109, 176,110, 176,111, 175,112, 174,113, 173,114, 172,114, 171,115, 171,116, 171,117, 171,118, 171,119, 170,120, 170,121, 170,122, 169,123, 169,124, 168,125, 167,125, 166,125, 165,126, 164,126, 163,126, 162,127, 161,128, 161,129, 160,129, 159,129, 158,129, 157,129, 156,129, 155,130, 155,131, 154,132, 153,133, 152,134, 152,135, 152,136, 153,137, 152,138, 151,139, 151,140, 151,141, 150,142, 149,143, 150,144, 151,144, 152,145, 152,146, 152,147, 152,148, 152,149, 152,150, 153,151, 154,152, 155,153, 155,154, 155,155, 154,156, 154,157, 155,158, 155,159, 155,160, 155,161, 154,162, 153,162, 152,163, 153,164, 153,165, 153,166, 154,167, 155,168, 156,168, 157,167, 158,167, 159,167, 160,167, 161,167, 162,168, 163,169, 164,169, 165,168, 166,168, 167,169, 168,169, 169,169, 170,169, 171,170, 170,171, 169,172, 168,173, 168,174, 169,175, 169,176, 170,177, 170,178, 170,179, 170,180, 169,180, 168,180, 167,180, 166,180, 165,180, 164,180, 163,179, 163,178, 163,177, 162,176, 161,176, 160,176, 159,175, 158,174, 158,173, 157,172, 156,172, 156,171, 155,170, 155,169, 154,168, 153,169, 152,169, 151,170, 151,171, 151,172, 151,173, 150,174, 149,174, 148,174, 147,174, 146,174, 145,173, 144,173, 143,174, 143,175, 144,176, 145,176, 146,176, 147,176, 148,176, 149,176, 150,176, 151,176, 152,176, 153,177, 154,177, 154,178, 154,179, 154,180, 153,181, 152,181, 151,181, 150,181, 149,180, 148,180, 147,180, 146,180, 145,180, 144,180, 143,180, 142,181, 141,181, 140,181, 139,181, 138,180, 137,179, 136,179, 135,180, 134,180, 133,180, 132,179, 132,178, 132,177, 132,176, 131,175, 130,175, 129,175, 128,175, 127,174, 126,173, 126,172, 126,171, 126,170, 126,169, 125,168, 124,167, 123,166, 122,165, 121,164, 120,164, 119,163, 119,162, 118,161, 117,160, 117,159, 117,158, 117,157, 117,156, 117,155, 117,154, 117,153, 117,152, 117,151, 118,150, 119,149, 118,148, 119,147, 120,146, 120,145, 119,144, 118,144, 117,143, 116,143, 115,143, 114,144, 113,145, 112,146, 111,147, 111,148, 111,149, 111,150, 111,151, 111,152, 111,153, 111,154, 111,155, 111,156, 111,157, 111,158, 110,159, 109,159, 108,159, 107,159, 106,159, 105,160, 104,160, 103,160, 102,159, 101,159, 100,159, 99,159, 98,159, 98,158, 97,157, 96,158, 95,159, 94,159, 93,159, 92,159, 91,159, 90,158, 89,157, 88,157, 87,156, 86,155, 86,154, 86,153, 86,152, 86,151, 86,150, 86,149, 87,148, 86,147, 85,147, 84,146, 83,145, 82,146, 81,147, 80,148, 79,148, 78,149, 77,149, 76,150, 75,150, 74,151, 73,151, 72,152, 71,153, 70,153, 69,153, 68,153, 68,152, 67,151, 67,150, 66,149, 66,148, 65,147, 65,146, 64,145, 64,144, 63,143, 63,142, 63,141, 63,140, 63,139, 62,138, 62,137, 61,136, 61,135, 60,134, 60,133, 59,132, 58,131, 59,130, 60,129, 61,128, 62,127, 61,126, 60,126, 59,127, 59,128, 58,129, 57,128, 57,127, 58,126, 59,125, 59,124, 59,123, 59,122, 58,121, 57,121, 56,121, 55,121, 54,121, 53,121, 52,121, 51,121, 51,120, 51,119, 50,118, 50,117, 49,116, 48,117, 48,118, 48,119, 48,120, 48,121, 48,122, 47,122, 46,122, 45,121, 44,120, 44,119, 43,118, 43,117, 43,116, 44,115, 44,114, 44,113, 45,112, 45,111, 45,110, 46,110, 47,109, 48,109, 49,109, 50,109, 51,109, 51,110, 51,111, 52,112, 53,113, 54,114, 55,114, 56,114, 57,113, 58,113, 59,113, 60,113, 61,113, 62,113, 63,113, 64,113, 65,113, 66,113, 67,113, 68,113, 69,113, 70,113, 71,113, 71,114, 71,115, 71,116, 72,117, 73,116, 74,116, 75,116, 75,117, 76,118, 77,119, 78,119, 79,118, 78,117, 78,116, 78,115, 77,114, 77,113, 76,112, 75,111, 75,110, 75,109, 76,108, 77,107, 77,106, 76,105, 75,106, 74,106, 73,106, 72,105, 72,104, 71,103, 71,102, 71,101, 71,100, 71,99, 72,99, 73,98, 74,98, 75,98, 76,98, 77,97, 78,97, 79,97, 80,98, 81,99, 82,98, 83,98, 84,98, 85,99, 86,98, 86,97, 86,96, 86,95, 86,94, 86,93, 86,92, 87,92, 88,92, 89,92, 90,92, 91,92, 92,92, 93,92">');

		document.write('<area alt="中国" href="#cityGuide-06" onclick=\'cg.createList("china", "infoCityBlockChina");\' shape="poly" ');
		document.write('coords="146,93, 147,93, 148,93, 149,93, 150,93, 151,93, 152,93, 153,94, 154,95, 155,96, 156,96, 157,97, 157,98, 157,99, 157,100, 158,101, 159,101, 160,102, 161,102, 162,102, 163,102, 163,103, 164,104, 164,105, 165,106, 165,107, 164,108, 163,108, 162,109, 161,110, 160,111, 160,112, 160,113, 159,113, 158,114, 157,114, 156,114, 155,114, 154,115, 153,116, 153,117, 152,118, 152,119, 152,120, 152,121, 152,122, 151,123, 150,124, 151,125, 151,126, 152,127, 152,128, 152,129, 152,130, 152,131, 152,132, 151,133, 151,134, 150,135, 149,136, 148,137, 147,138, 146,139, 145,140, 144,140, 143,141, 143,142, 142,143, 141,144, 140,145, 140,146, 139,146, 138,147, 137,147, 136,146, 135,146, 134,145, 133,145, 133,144, 133,143, 133,142, 132,141, 131,141, 130,142, 129,142, 128,143, 127,143, 126,143, 125,142, 124,141, 124,140, 123,139, 123,138, 123,137, 123,136, 123,135, 123,134, 123,133, 122,132, 121,132, 120,133, 119,134, 118,134, 117,134, 116,134, 115,134, 114,134, 113,133, 112,133, 111,133, 110,132, 109,132, 108,132, 107,132, 106,131, 105,130, 104,129, 104,128, 103,127, 103,126, 103,125, 102,124, 101,124, 100,125, 99,125, 98,125, 97,125, 96,125, 95,124, 95,123, 95,122, 94,121, 93,121, 92,120, 91,119, 91,118, 91,117, 91,116, 91,115, 91,114, 92,113, 93,113, 94,113, 95,113, 96,114, 97,114, 98,113, 99,113, 100,113, 101,112, 102,112, 103,112, 104,111, 104,110, 105,109, 105,108, 106,107, 107,106, 107,105, 107,104, 108,103, 109,103, 110,102, 110,101, 110,100, 111,100, 112,99, 113,99, 114,100, 115,100, 116,100, 116,101, 117,102, 117,103, 117,104, 118,105, 118,106, 119,107, 120,107, 121,107, 122,107, 122,108, 123,109, 124,109, 125,109, 126,109, 127,109, 128,109, 129,109, 130,109, 131,110, 132,110, 133,110, 134,110, 135,109, 136,109, 137,108, 138,107, 139,107, 140,106, 141,105, 142,104, 141,103, 141,102, 141,101, 142,100, 143,100, 144,99, 144,98, 144,97, 145,96, 145,95, 145,94">');

		document.write('</map>');
		document.write('<!-- /クリッカブルマップ -->');

		// 全地域
		cg.writeMap('cityGuide-01', 'cityGuide pseudo-current', '/jalmap/img/pic_cityinfo-index_map_001.gif', 'frmCityInfoAll', 'infoCityBlockAll');
		
		// 北米・中南米
		cg.writeMap('cityGuide-02', 'cityGuide', '/jalmap/img/pic_cityinfo-index_map_002.gif', 'frmCityInfoAmerica', 'infoCityBlockAmerica');
		
		// ハワイ
		cg.writeMap('cityGuide-03', 'cityGuide', '/jalmap/img/pic_cityinfo-index_map_003.gif', 'frmCityInfoHawaii', 'infoCityBlockHawaii');
		
		// ヨーロッパ・アフリカ
		cg.writeMap('cityGuide-04', 'cityGuide', '/jalmap/img/pic_cityinfo-index_map_004.gif', 'frmCityInfoEuro', 'infoCityBlockEuro');
		
		// アジア・中近東 
		cg.writeMap('cityGuide-05', 'cityGuide', '/jalmap/img/pic_cityinfo-index_map_005.gif', 'frmCityInfoAsia', 'infoCityBlockAsia');
		
		// 中国
		cg.writeMap('cityGuide-06', 'cityGuide', '/jalmap/img/pic_cityinfo-index_map_006.gif', 'frmCityInfoChina', 'infoCityBlockChina');

	}, 

	/**
	 * マップを出力する
	 */
	writeMap : function(divId, divClass, imgSrc, formName, selectId) {

		document.write('<div id="' + divId + '" class="' + divClass + '">');
		document.write('<div class="map"><img src="' + cg.BASE_HREF + imgSrc + '" width="375" height="240" alt="" usemap="#worldMap"></div>');
		document.write('<form name="' + formName + '">');
		document.write('<table border="0" cellpadding="0" cellspacing="0">');
		document.write('<tr>');
		document.write('<td>');
		document.write('<div id="' + selectId + '"><!--都市プルダウン--></div>');
		document.write('<input type="hidden" name="cityCode" value=""></td>');
		//document.write('<td><input type="image" src="' + cg.BASE_HREF + '/common/img/btn_search_001.gif" width="70" height="24" alt="検索する"></a></td>');
		document.write('<td><a href="#"><img src="' + cg.BASE_HREF + '/common/img/btn_search_001.gif" width="70" height="24" alt="検索する" onClick="cg.listCheck( document.' + formName + ' ); return false;"></a></td>');
		document.write('</tr>');
		document.write('</table>');
		document.write('</form>');
		document.write('</div>');
	},

	/**
	 * プルダウンデータ初期設定
	 */ 
	intCitySetupOnload : function () {
		cg.createList("", "infoCityBlockAll");
	},

	/**
	 * マップの切り替え処理
	 */
	toggleCurrentPane : function (id) {
		var curPaneClassName = 'pseudo-current';

		// 全域マップを非表示
		JLJS.classAttr.remove(document.getElementById("cityGuide-01"), curPaneClassName);

		// 表示マップを設定
		for (var i = 0; i < cg.MAP_NODES.length; i++) {
			var node = cg.MAP_NODES[i];
			if (id == JLJS.getAttr(node, "id")) {
				JLJS.classAttr.add(node, curPaneClassName);
			} else {
				JLJS.classAttr.remove(node, curPaneClassName);
			}
		}
	},

	/**
	 * マップのクリック処理を設定
	 */
	JLJS_ReserveTabPanes_init : function() {
		var containerNode = document.getElementById('headLineB01_2_HTML');
		var areaNodes = (containerNode) ? JLJS.getElementsByTagName('area', containerNode) : [];
		var idAttrName = "cityGuideId";
		for (var i = 0; i < areaNodes.length; i++) {
			var href = JLJS.getAttr(areaNodes[i], 'href');
			var id   = (href) ? href.split('#')[1]          : nul;
			var node = (id)   ? document.getElementById(id) : null;
			if(node) {
				// クリック処理追加
				JLJS.setAttr(areaNodes[i], JLJS.prfx.jalattrs + idAttrName, id);
				JLJS.addEvent(areaNodes[i], 'click', function (e) {
					e.preventDefault();
					cg.toggleCurrentPane(JLJS.getAttr(e.currentTarget, JLJS.prfx.jalattrs + idAttrName));
				});
				cg.MAP_NODES[cg.MAP_NODES.length] = node;
			}
			if (JLJS.env.isSafari) {
				JLJS.setAttr(areaNodes[i], 'href', '#');
			}
		}
	},

	/*
	jumpPulldown : function ( citySelNode ) {
		var c = citySelNode.value;
		if( c ) document.location.href = cg.BASE_HREF + c;
		else alert( "エリアと都市を選んでください" );
	},
	*/
	
	/**
	 * JALMAPの都市リストを作成します。
	 * intCityList.js の都市名に「JALMAP」と記述されているものが対象となります。
	 * 引数 areaCode が偽の場合、全エリアの都市が入ります。
	 * areaCode エリアコード
	 * divId リストがはいるdivタグのID
	 */
	createList : function (areaCode, divId) {
		var list = intCityList;
		
		var area = document.getElementById(divId);
		var str;
		for(var i = 0; i < list.length; i++) {
			// 取得したエリアに文字列「JALMAP」がないか選択したエリアでない場合、スキップ
			if(!(list[i].toString()).match(/JALMAP/) || (areaCode && areaCode != list[i][0])) {
				continue;
			}
			
			// 全エリアの場合、セパレータとエリア名称が入る
			if(!areaCode) {
				str += '<option value="">---------------------</option>';
				str += '<option value="">＜' + list[i][1] + '＞</option>';
			}
			
			// 都市名に文字列「JALMAP」が入っているもののみ対象
			for(var j = 0; j < list[i][2].length; j++) {
				if(!list[i][2][j][1].match(/JALMAP/)) {
					continue;
				}
				str += '<option value="' + list[i][2][j][0] + '">' + list[i][2][j][1].replace(/.JALMAP./, "") + '</option>';
			}
		}
		
		if(!areaCode) {
			str = '<option value="">都市を選択してください</option>' + str;	
		}
		
		str = "<select name=\"areaList\">" + str + "</select>";
		
		area.innerHTML = str;
	},
	
	listCheck : function(frm) {
		if(!frm.areaList.value) {
			alert( "エリアと都市を選んでください" );
			return;
		}
		
		myScreenSize("http://di.jal.co.jp/jalmap/?cityCode=" + frm.areaList.value.toUpperCase())
	}

};

var cg = new cityGuide();

// 都市ガイド初期処理
//JLJS.addOnload(cg.intCitySetupOnload );
//JLJS.addEvent( window, 'unload', cg.intCitySetupOnload );
JLJS.addOnload(cg.JLJS_ReserveTabPanes_init);
