﻿function get_cookieIndex(name) {
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen) {
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg) {
	offset=j;
		
      if (document.cookie.substring(offset+1, 1) == ";") 
          return null;			
      if (offset+1>clen) 
          return null;			
                    
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1) endstr = document.cookie.length;
	return unescape (document.cookie.substring(offset, endstr));
      }
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
   }
   return null;
}

var mainIndexURL = "" + get_cookieIndex('mainIndexURL');
// 20090507 MARKED COOKIE 判斷 : TPESE柏宜 MAIL 表示日文版功能要返回日文首頁, 日文促銷不會受影響
//if(mainIndexURL=="null" || mainIndexURL=="" || mainIndexURL==null){
	mainIndexURL = "http://www.china-airlines.co.jp/";
//}

/*var mainIndexURL = "http://www.china-airlines.co.jp/";*/

xTempString = mainIndexURL;
xSubstr=xTempString.split("/");
xLan = xSubstr[3];
xSelected = new Array(12);
if(xLan=="ch"){
	xSelected[0] = "selected";
}else if(xLan=="en"){
	xSelected[1] = "selected";	
}else if(xLan=="hk"){
		xSelected[2] = "selected";
}else if(xLan=="uk"){
	xSelected[3] = "selected";	
}else if(xLan=="gate"){
	xSelected[4] = "selected";	
}else if(xLan=="vn"){
	xSelected[5] = "selected";	
}



document.write('<div id="TopLink">');

document.write('						<form method="get"   name="search_form2" >');

document.write('						  <select onchange="MM_jumpMenu(\'parent\',this,0)" name="select" class="inputb">');
document.write('							<option selected>世界のサイト</option>');
document.write('							<option>-----------------------</option>');
document.write('							<option value="http://www.china-airlines.com/ch/index.htm">中文版（繁体字）</option>');
document.write('							<option value="http://gb.china-airlines.com/gate/gb/www.china-airlines.com/ch/index.htm">中文版（簡体字）</option>');
document.write('							<option value="http://www.chinaairlines.com.hk">香港版</option>');
document.write('							<option value="http://www.china-airlines.com/en/index.htm">グローバルサイト（英語）</option>');
document.write('							<option value="http://www.chinaairlines.de">ドイツ</option>');
document.write('							<option value="http://www.china-airlines.nl/">オランダ</option>');
document.write('							<option value="http://www.china-airlines.at/">オーストリア</option>');
document.write('							<option value="http://www.china-airlines.it/">イタリア</option>');
document.write('							<option value="http://www.china-airlines.com/en/promotionen/">北米</option>');
document.write('							<option value="http://www.china-airlines.co.kr/">韓国</option>');


document.write('						  </select>&nbsp;&nbsp;');


document.write('						  <input type="hidden" name="o" value="4">');
document.write('						<input type="hidden" name="v" value="root"> ');
document.write('						<input class="menu1" type="hidden" name="r" value="2">');

document.write('						</form>');

document.write('</div>');

