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');
if(mainIndexURL=="null" || mainIndexURL=="" || mainIndexURL==null){
	mainIndexURL = "http://www.china-airlines.com/en/index.htm";
}

xTempString = mainIndexURL;
xSubstr=xTempString.split("/");
xLan = xSubstr[3];
xSelected = new Array(14);
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";
}else if(xLan=="au"){
	xSelected[6] = "selected";			
}

document.write('			<table width="770" border="0" cellspacing="0" cellpadding="0">');
document.write('			  <tr> ');
document.write('				<td valign="bottom" align="center" width="165"><a href="'+mainIndexURL+'"><img src="/en/imgs/logo.gif" width="150" height="36" border="0"></a></td>');
document.write('				<td valign="top" align="left"> ');
document.write('				  <table width="590" border="0" cellspacing="0" cellpadding="0" height="30">');
document.write('					<tr> ');
document.write('					  <td align="right" valign="middle" class="btntop"> ');
document.write('						<form method="get"   name="search_form2" >');
document.write('						  <a href="http://www.china-airlines.com/en/other/index.htm">FAQ</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.china-airlines.com/en/about/about_ad.htm">Contact us</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.china-airlines.com/en/other/sitemap.htm">SiteMap</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.china-airlines.com/en/check/welcome.htm">Links</a>&nbsp;&nbsp;&nbsp;');
document.write('						  <select onchange="MM_jumpMenu2(\'parent\',this,0)" name="select" class="inputb">');
document.write('							<option selected>Select local website</option>');
document.write('							<option>-----------------------</option>');
document.write('							<option value="http://www.china-airlines.com/au/index.htm" '+xSelected[6]+'>Australia-English</option>');
document.write('							<option value="http://www.china-airlines.at">Austria-Germany</option>');
document.write('							<option value="http://www.china-airlines.fr">France-French</option>');
document.write('							<option value="http://www.chinaairlines.de">German-Germany</option>');
document.write('							<option value="http://www.china-airlines.com/hk/index.htm" '+xSelected[2]+'>Hong Kong-Traditional Chinese</option>');
document.write('							<option value="http://www.china-airlines.it">Italy-Italiano</option>');
document.write('							<option value="http://www.china-airlines.co.jp">Japan-Japanese</option>');
document.write('							<option value="http://www.china-airlines.co.kr">Korea-Korean</option>');
document.write('							<option value="http://www.china-airlines.com/cn/index.htm" '+xSelected[4]+'>Mainland China-Simplified Chinese</option>');
document.write('							<option value="http://www.china-airlines.nl">Netherlands-Dutch</option>');
document.write('							<option value="http://www.china-airlines.com/en/index.htm" '+xSelected[1]+'>North America-English</option>');
document.write('							<option value="http://www.china-airlines.com/ch/index.htm" '+xSelected[0]+'>Taiwan-Traditional Chinese</option>');
document.write('							<option value="http://www.china-airlines.co.th/cal/index.php?action=nextpage&id=1">Thailand-Thai</option>');
document.write('							<option value="http://www.china-airlines.com/uk/index.htm" '+xSelected[3]+'>UK & Ireland-English</option>');
document.write('							<option value="http://www.china-airlines.com/vn/index.htm" '+xSelected[5]+'>Vietnam-Traditional Chinese</option>');
document.write('						  </select>');
document.write('						  <input type="text" name="p" class="inputb" size="8" onblur="if(this.value==\'\') this.value=\'search\'" onfocus="if(this.value==\'search\') this.value=\'\'" value="search">');
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('						  <a href="javascript:SendSearch2()" ><img src="/en/imgs/btn.gif" width="18" height="18" align="absmiddle" border="0"></a> ');
document.write('						</form>');
document.write('					  </td>');
document.write('					</tr>');
document.write('				  </table>');
document.write('				  <table border="0" cellspacing="0" cellpadding="0" width="590">');
document.write('					<tr align="center" valign="middle"> ');
document.write('					  <td width="4"><img src="/en/imgs/menul.gif" width="4" height="23"></td>');
document.write('					  <td bgcolor="#6683D4" class="menu1"><a href="http://www.china-airlines.com/en/club/club_mi_2.htm" onmouseover="MM_showHideLayers(\'m1\',\'\',\'show\',\'m2\',\'\',\'hide\',\'m3\',\'\',\'hide\',\'m4\',\'\',\'hide\',\'m5\',\'\',\'hide\',\'m6\',\'\',\'hide\',\'m7\',\'\',\'hide\',\'m8\',\'\',\'hide\')"'); if(mainItem==1) {document.write('class="now">');}else{document.write('onMouseOut="if(mainItem){MM_showHideLayers(\'m\'+mainItem,\'\',\'show\');}MM_showHideLayers(\'m1\',\'\',\'hide\')">');}document.write('Dynasty Flyer</a></td>');
document.write('					  <td width="2" bgcolor="#6683D4"><img src="/en/imgs/menuline.gif"></td>');
document.write('					  <td bgcolor="#6683D4" class="menu1"><a href="http://dp.china-airlines.com/inbound/ENG/html/index.html" target="_blank" onmouseover="MM_showHideLayers(\'m1\',\'\',\'hide\',\'m3\',\'\',\'hide\',\'m4\',\'\',\'hide\',\'m7\',\'\',\'hide\')"'); if(mainItem==2) {document.write('class="now">');}else{document.write('onMouseOut="if(mainItem){MM_showHideLayers(\'m\'+mainItem,\'\',\'show\');}">');}document.write('Dynasty Package</a></td>');
document.write('					  <td width="2" bgcolor="#6683D4"><img src="/en/imgs/menuline.gif"></td>');
document.write('					  <td bgcolor="#6683D4" class="menu1"><a href="http://www.china-airlines.com/en/check/check_or.htm" onmouseover="MM_showHideLayers(\'m1\',\'\',\'hide\',\'m3\',\'\',\'show\',\'m4\',\'\',\'hide\',\'m7\',\'\',\'hide\')"'); if(mainItem==3) {document.write('class="now">');}else{document.write('onMouseOut="if(mainItem){MM_showHideLayers(\'m\'+mainItem,\'\',\'show\');}MM_showHideLayers(\'m3\',\'\',\'hide\')">');}document.write('At Your Service</a></td>');
document.write('					  <td width="2" bgcolor="#6683D4"><img src="/en/imgs/menuline.gif"></td>');
document.write('					  <td bgcolor="#6683D4" class="menu1"><a href="http://www.china-airlines.com/en/about/about.htm" onmouseover="MM_showHideLayers(\'m1\',\'\',\'hide\',\'m3\',\'\',\'hide\',\'m4\',\'\',\'show\',\'m7\',\'\',\'hide\')"'); if(mainItem==4) {document.write('class="now">');}else{document.write('onMouseOut="if(mainItem){MM_showHideLayers(\'m\'+mainItem,\'\',\'show\');}MM_showHideLayers(\'m4\',\'\',\'hide\')">');}document.write('About CAL</a></td>');
document.write('					  <td width="2" bgcolor="#6683D4"><img src="/en/imgs/menuline.gif"></td>');
document.write('					  <td bgcolor="#6683D4" class="menu1"><a href="http://www.china-airlines.com/en/about/about_career.htm" onmouseover="MM_showHideLayers(\'m1\',\'\',\'hide\',\'m3\',\'\',\'hide\',\'m4\',\'\',\'hide\',\'m7\',\'\',\'hide\')"'); if(mainItem==5) {document.write('class="now">');}else{document.write('onMouseOut="if(mainItem){MM_showHideLayers(\'m\'+mainItem,\'\',\'show\');}">');}document.write('Join Us</a></td>');
document.write('					  <td width="2" bgcolor="#6683D4"><img src="/en/imgs/menuline.gif"></td>');
document.write('					  <td bgcolor="#6683D4" class="menu1"><a href="http://www.china-airlines.com/en/cargo/index.htm" target="_blank" onmouseover="MM_showHideLayers(\'m1\',\'\',\'hide\',\'m3\',\'\',\'hide\',\'m4\',\'\',\'hide\',\'m7\',\'\',\'hide\')"'); if(mainItem==6) {document.write('class="now">');}else{document.write('onMouseOut="if(mainItem){MM_showHideLayers(\'m\'+mainItem,\'\',\'show\');}">');}document.write('Cargo</a></td>');
document.write('					  <td width="2" bgcolor="#6683D4"><img src="/en/imgs/menuline.gif"></td>');
document.write('					  <td bgcolor="#6683D4" class="menu1"><a href="http://www.china-airlines.com/en/interactive/index.htm" onmouseover="MM_showHideLayers(\'m1\',\'\',\'hide\',\'m3\',\'\',\'hide\',\'m4\',\'\',\'hide\',\'m7\',\'\',\'show\')"'); if(mainItem==7) {document.write('class="now">');}else{document.write('onMouseOut="if(mainItem){MM_showHideLayers(\'m\'+mainItem,\'\',\'show\');}MM_showHideLayers(\'m7\',\'\',\'hide\')">');}document.write('Interactive</a></td>');
document.write('					  <td width="4"><img src="/en/imgs/menur.gif" width="4" height="23"></td>');
document.write('					</tr>');
document.write('				  </table>');
document.write('				</td>');
document.write('			  </tr>');
document.write('			</table>');