// 2003.09.22 K.Sato 共通画面オープン処理
var ChildWin;
function selCorp(NO){
	var xSize;
	var ySize;
	var x     = (screen.width  - 500) / 2;
	var y     = (screen.height - 140) / 2;
	var wName = "sub";
	var wURL  = "";
	var wParm;

	switch(NO){
		case 1:	// 出発日（カレンダー）astralbb016
			xSize = 400;
			ySize = 350;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb016/astralbb016s001.html";
			break;
		case 2:	// 出発地/到着地（空港・都市コード）astralbb01*
			xSize = 600;
			ySize = 500;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb01*/astralbb01*s001.html";
			break;
		case 3:	// 航空会社コード　astralbb015
			xSize = 600;
			ySize = 500;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb015/astralbb015s001.html";
			break;
		case 4:	// ノーマル詳細　astralbb022→astralbb018
			//ySize = 500;0525 500→520へ修正	form WAG
			xSize = 600
			ySize = 520;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb018/astralbb018s001.html";
			break;
		case 5:	// ペックス詳細　astralbb020　
			xSize = 600;
			ySize = 500;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb020/astralbb020s001.html";
			break;
		case 6: // ＴＡＸ astralbb007
			xSize = 600;
			ySize = 500;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb007/astralbb007s001.html";
			break;
		case 7: // ＩＴ運賃表 astralbb022
			xSize = 600;
			ySize = 500;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb022/astralbb022s001.html";
			break;
		case 8: // 連絡先 ChildWindow0008
			//ySize = 500;0531 500→525へ修正	form WAG
			xSize = 600;
			ySize = 525;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb007/astralbb007s003.html";
			break;
		case 9: // その他 ChildWindow009
			//ySize = 500;0531 500→525へ修正	form WAG
			xSize = 600;
			ySize = 525;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb007/astralbb007s004.html";
			break;
		case 10:// マイレージ ChildWindow010
			//ySize = 500;0531 500→525へ修正	form WAG
			xSize = 600;
			ySize = 525;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb007/astralbb007s005.html";
			break;
		case 11:// 備考 ChildWindow011
			//ySize = 500;0531 500→525へ修正	form WAG
			xSize = 600;
			ySize = 525;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb007/astralbb007s006.html";
			break;
           case 12:// 空席照会詳細 astralbb016
			//xSize = 600;0508 600→800へ修正
			//ySize = 500;0525 500→520へ修正	form WAG
			xSize = 800;
			ySize = 520;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb016/astralbb016s001.html";
			break;
                case 13:// IT商品詳細 astralbb020→astralbb017へ修正
			//xSize = 600;0508 600→1000へ修正
			//ySize = 500;0525 500→570へ修正	form WAG
			xSize = 1000;
			ySize = 570;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb017/astralbb017s001.html";
			break;
case 14:// ノーマル運賃表 astralbb022
			xSize = 600;
			ySize = 500;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb022/astralbb022s002.html";
			break;
case 15:// ペックス運賃表 astralbb022→astralbb007→astralbb020へ修正
			//ySize = 500;0531 500→525へ修正	form WAG
			xSize = 600;
			ySize = 525;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb020/astralbb020s001.html";
			break;
		case 16:	// 航空会社コード　astralbbw015→astralbbw022へ変更
			xSize = 600;
			ySize = 500;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbbw022/astralbbw022s001.html";
			break;
case 17:	// エリアコード　astralbbw018→astralbbw023へ変更
			xSize = 600;
			ySize = 500;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbbw023/astralbbw023s001.html";
			break;
case 18:// フライト詳細 astralbb019
			//ySize = 500;0525 500→520へ修正	form WAG
			xSize = 800;
			ySize = 520;
			x     = (screen.width  - xSize) / 2;
			y     = (screen.height - ySize) / 2;
			wURL  = "../astralbb019/astralbb019s001.html";		
	}

	wParm = "left=" + x + ",top=" + y;
	wParm += ",width=" + xSize + ",height=" + ySize;
	wParm += ",resizable=no,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no";

	if(typeof(ChildWin)=="object"){
		ChildWin.close();
	}

	ChildWin = window.open(wURL,wName,wParm); 


}

/* ウィンドウサイズ、位置の指定 */
function win_locate(winSize, winPos){

	// 変数宣言
	var size_x, size_y, pos_x, pos_y;

	// サイズの取得
	switch(winSize){
		case "MAIN":
			size_x = 1000;
			size_y = 750;
			break;
		case "SUB1":
			size_x = 800;
			size_y = 600;
			break;
		case "SUB2":
			size_x = 550;
			size_y = 650;
			break;
		case "SUB3":
			size_x = 600;
			size_y = 330;
			break;
		case "SUB4":
			size_x = 550;
			size_y = 400;
			break;
	}

	// 座標の取得
	switch(winPos){
		case "LEFT":
			pos_x = 0;
			pos_y = 0;
			break;
		case "CENTER":
			pos_x = (screen.width  - size_x) / 2;
			pos_y = (screen.height - size_y) / 2;
			break;
		case "RIGHT":
			pos_x = screen.width  - size_x;
			pos_y = screen.height - size_y;
			break;
	}

	// ウィンドウサイズと位置の指定
	parent.window.moveTo(pos_x, pos_y);
	parent.window.resizeTo(size_x, size_y);
}


/* ウィンドウクローズ */
function winClose(cFlag){
	switch(cFlag){
		case 1:		// フレーム無し
			window.close();
//			window.opener.parent.frames[0].focus();
			break;
		case 2:		// フレームアリ
			parent.window.close();
//			parent.window.opener.parent.frames[0].focus();
			break;
		case 3:		// 元画面(フレームアリ)
			parent.window.close();
			break;
		case 4:		// 元画面(フレーム無し)
			window.close();
			break;
	}
}



//-------------------------------------------------------------------------------------
/* ロールオーバー表示 SCRIPT*/
//-------------------------------------------------------------------------------------
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

