
var prefs=["ASIA", "AMERICA", "EUROPE", "OCEANIA", "BEACH", "LATIN AMERICA", "MIDDLE EAST", "AFRICA"];
var cities=[
	["Seoul", "Pusan", "Cheju", "Bangkok", "Hong Kong", "Singapore", "Taipei", "Manila", "Kuala Lumpur", "Denpasar", "Ho Chi Minh", "Hanoi", "Delhi", "Mumbai", "Colombo", "Karachi", "Dacca", "Kathmandu", "Shanghai", "Beijing"], 
	["Los Angeles", "New York", "Boston", "San Francisco", "Miami", "Seattle", "Las Vegas", "USA Other Cities", "USA Multi-Stops", "Vancouver", "Toronto", "Montreal", "Ottawa", "Canada Multi-Stops", "Mexico City", "One Way"],
	["London", "Paris", "Rome", "Frankfurt", "Other Major Gateways", "Istanbul", "Moscow", "One Way"],
	["Sydney", "Brisbane", "Melbourne", "Cairns", "Perth", "Gold Coast", "Auckland", "Christchurch", "Wellington", "One Way"],
	["Honolulu", "Guam", "Saipan", "Bali", "Cebu", "Phuket", "Lang Kawi", "Penan", "Male", "Cancun", "New Caredonia"],
	["Sao Paulo", "Rio De Janeiro", "Lima", "Buenos Aires", "Santiago"],
	["Jeddah", "Dubai", "Cairo"],
	["Johannesburg", "Cape Town", "Nairobi", "Dar Es Salaam"],
];

var c=[
	["index-asia.htm#sel", "index-asia.htm#pus", "index-asia.htm#cju", "index-asia.htm#bkk", "index-asia.htm#hkg", "index-asia.htm#sin", "index-asia.htm#tpe", "index-asia.htm#mnl", "index-asia.htm#kul", "index-asia.htm#dps", "index-asia.htm#sgn", "index-asia.htm#han", "index-asia.htm#del", "index-asia.htm#bom", "index-asia.htm#cmb", "index-asia.htm#khi", "index-asia.htm#dac", "index-asia.htm#ktm", "index-asia.htm#sha", "index-asia.htm#pek"],
	["index-america.htm#lax", "index-america.htm#nyc", "index-america.htm#bos", "index-america.htm#sfo", "index-america.htm#mia", "index-america.htm#sea", "index-america.htm#las", "index-america.htm#other", "index-america.htm#multi", "index-america.htm#yvr", "index-america.htm#yyz", "index-america.htm#yul", "index-america.htm#yul", "index-america.htm#canmulti", "index-america.htm#mex", "index-america.htm#hav", "index-ow.htm"],
	["index-europe.htm#lon", "index-europe.htm#par", "index-europe.htm#rom", "index-europe.htm#fra", "index-europe.htm#indirect", "index-europe.htm#ist", "index-europe.htm#mow", "index-ow.htm"],
	["index-oceania.htm#syd", "index-oceania.htm#bne", "index-oceania.htm#mel", "index-oceania.htm#cns", "index-oceania.htm#per", "index-oceania.htm#ool", "index-oceania.htm#akl", "index-oceania.htm#chc", "index-oceania.htm#wlg", "index-ow.htm"],
	["index-beach.htm#hnl", "index-beach.htm#gum", "index-beach.htm#spn", "index-beach.htm#dps", "index-beach.htm#ceb", "index-beach.htm#hkt", "index-beach.htm#lgk", "index-beach.htm#lgk", "index-beach.htm#mle", "index-beach.htm#cun", "index-beach.htm#nou"],
	["index-latin.htm#sao", "index-latin.htm#rio", "index-latin.htm#lim", "index-latin.htm#bue", "index-latin.htm#scl"],
	["index-latin.htm#jed", "index-latin.htm#dxb", "index-latin.htm#cai"],
	["index-latin.htm#jnb", "index-latin.htm#cpt", "index-latin.htm#nbo", "index-latin.htm#dar"],
];

function funcMain(ind) {
	document.formMain.city.length = 1;
	document.formMain.city.selectedIndex = 0;
	document.formMain.price.value= "";
	if (ind==0) return;
	var city = cities[ind - 1];
	document.formMain.city.length = city.length + 1;
	for (var i = 0; i < city.length; i++) document.formMain.city.options[i + 1]=new Option(city[i],i);
}

function setPrice(ind) {
	if (ind==0) {
		document.formMain.price.value="";
		return;
	}
	document.formMain.price.value=c[document.formMain.pref.selectedIndex-1][ind-1];
}

function menulink(jump) {
	var che=0;
	if (document.formMain.price.value != "") {
		che= document.formMain.price.value.indexOf('+');
		if (che==-1) {
			var url = jump;
			document.formMain.pref.selectedIndex = 0;
			document.formMain.city.selectedIndex = 0;
			document.formMain.price.value= "";
//			parent.body.location.href=url;
//			document.formMain.pref.selectedIndex = 0;
//			document.formMain.city.selectedIndex = 0;
//			document.formMain.price.value= "";
//			document.formMain.city.length = 1;
			document.location.href=url;
		} else {
		}
	} else {
		alert("Please select your destination AREA and CITY.")
	}
}

function func() {
	document.formMain.pref.selectedIndex = 0;
	document.formMain.city.selectedIndex = 0;
	document.formMain.price.value= "";
	document.formMain.city.length = 1;
}

function change() {
	index = document.forms['menu'].elements['pull'].selectedIndex;
	url = document.forms['menu'].elements['pull'].options[index].value;
//	parent.body.location.href=url;
//	document.forms['menu'].elements['pull'].selectedIndex = 0; 
	document.location.href=url;
}

function HpbImgPreload() {
	var appVer=parseInt(navigator.appVersion);
	var isNC=(document.layers && (appVer >= 4));
	var isIE=(document.all    && (appVer >= 4));
	if (isNC || isIE) {
		if (document.images) {
			var imgName = HpbImgPreload.arguments[0];
			var cnt;
			swImg[imgName] = new Array;
			for (cnt = 1; cnt < HpbImgPreload.arguments.length; cnt++) {
				swImg[imgName][HpbImgPreload.arguments[cnt]] = new Image();
				swImg[imgName][HpbImgPreload.arguments[cnt]].src = HpbImgPreload.arguments[cnt];
			}
		}
	}
}

function HpbImgFind(doc, imgName) {
	for (var i=0; i < doc.layers.length; i++) {
		var img = doc.layers[i].document.images[imgName];
		if (!img) img = HpbImgFind(doc.layers[i], imgName);
		if (img) return img;
	}
	return null;
}

function HpbImgSwap(imgName, imgSrc) {
	var appVer=parseInt(navigator.appVersion);
	var isNC=(document.layers && (appVer >= 4));
	var isIE=(document.all    && (appVer >= 4));
	if (isNC || isIE) {
		if (document.images) {
			var img = document.images[imgName];
			if (!img) img = HpbImgFind(document, imgName);
			if (img) img.src = imgSrc;
		}
	}
}

var swImg; swImg=new Array;
//HpbImgPreload('_HPB_ROLLOVER1', '../gif/kansai02.gif', '../gif/kansai.gif');
//HpbImgPreload('_HPB_ROLLOVER3', '../gif/kansai02.gif', '../gif/kansai.gif');
HpbImgPreload('_HPB_ROLLOVER1', '../gif/tyo01.gif', '../gif/tyo02.gif');
HpbImgPreload('_HPB_ROLLOVER2', '../gif/ngo01.gif', '../gif/ngo02.gif');
HpbImgPreload('_HPB_ROLLOVER3', '../gif/fuk01.gif', '../gif/fuk02.gif');

//ウィンドウを開く
function detailWin(url, w, h) {
	NewWindow = window.open(url,"_blank","width="+ w +",height="+ h +",left=0,top=0,scrollbars=yes,menubar=yes,status=yes,resizable=no");
	NewWindow.focus()
}

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_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_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_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];}
}

