<!--
function MM_openBrWindow(theURL,winName,features) { 
    window.open(theURL,winName,features);
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_findObj(n, d) { //v4.0
  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 && document.getElementById) x=document.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];}
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_jumpMenu2(targ,selObj,restore){ //v3.0
gb=new Array(17);

gb[2]="http:" + "//www.china-airlines.com/au/index.htm";
gb[3]="http:" + "//www.china-airlines.at"
gb[4]="http:" + "//www.china-airlines.fr"
gb[5]="http:" + "//www.chinaairlines.de"
gb[6]="http:" + "//www.china-airlines.com/hk/index.htm"
gb[7]="http:" + "//www.china-airlines.it"
gb[8]="http:" + "//www.china-airlines.co.jp"
gb[9]="http:" + "//www.china-airlines.co.kr"
gb[10]="http:" + "//www.china-airlines.com/cn/index.htm"
gb[11]="http:" + "//www.china-airlines.nl/"
gb[12]="http:" + "//www.china-airlines.com/en/index.htm"
gb[13]="http:" + "//www.china-airlines.com/ch/index.htm"
gb[14]="http:" + "//www.china-airlines.co.th/"
gb[15]="http:" + "//www.china-airlines.com/uk/index.htm"
gb[16]="http:" + "//www.china-airlines.com/vn/index.htm"

if (selObj.selectedIndex==0 || selObj.selectedIndex==1){return;}
  eval(targ+".location='"+gb[selObj.selectedIndex]+"'");
  if (restore) selObj.selectedIndex=0;
}


function check1() {
  var f = document.form2;
  var y = '';
  if (f.dfpcard.value == ''||f.dfpcard.value == 'Card No.') {y+='You forget to keyin the [Card No.]!\n';}
  if (f.pincode.value == '') {y+='You forget to keyin the [Password]!\n';}
  if (y=='') {
	return true;
  } else {
	alert(y);
	return false;
  }
}

function get_cookie(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;
}

function get_cookie2(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 decodecookie(unescape(document.cookie.substring(offset, endstr)));
	}
	i = document.cookie.indexOf(" ", i) + 1;
	if (i == 0) break;
  }
  return null;
}

function decodecookie(str) {
  var strArr;
  var strRtn="";
  strArr=str.split("a");
  for (var i=strArr.length-1;i>=0;i--) {
    strRtn+=String.fromCharCode(eval(strArr[i]));
  }
  return strRtn;
}

function chkPwdField() {
  var f = document.form2;
  if (document.all['divTxt'].style.display == 'none' & f.pincode.value==''){
  	document.all['divTxt'].style.display = 'block';
  	document.all['divPwd'].style.display = 'none';
  }else if(f.pincode.value==''){
  	document.all['divTxt'].style.display = 'none';
  	document.all['divPwd'].style.display = 'block';
  	f.pincode.focus();
  }else{
  	document.all['divTxt'].style.display = 'none';
  	document.all['divPwd'].style.display = 'block';
  }
}

function SendSearch2() {
  if (document.search_form2.p.value == ""||document.search_form2.p.value == "search") {
	alert("Please fill in the keywords!!");
  } else {
	document.search_form2.action="http://search.china-airlines.com/cgi-bin/tornado/searcher"
	document.search_form2.submit();
  }
}

function IsValidURL(){
	bValid = true
	bFoundSVR = false
	bFoundDIR = false
	bFoundURL = false
	strSVRFilter = "/calec."
	strDIRFilter = "" + 
		".com/club/ .com/e_club/ .com/tir/ .com/teclub/ .com/tclub/ " + 
		".com/echeckin/ " + 
		".com/experience/ " + 
		".com/olb/ " + 
		".com/emenu/ .com/eshopping/"
		
	strURLFilter = ".htm calmiles activation ebqry"
	arSVR = strSVRFilter.split(" ")
	arDIR = strDIRFilter.split(" ")
	arURL = strURLFilter.split(" ")
	
	strURL = location.href.toLowerCase();
	
	for (i=0;i<=arSVR.length-1;i++){
		if (strURL.indexOf(arSVR[i])>0){
			bFoundSVR = true
			break;
		}
	}
	
	if (bFoundSVR){
		for (i=0;i<=arDIR.length-1;i++){
			if (strURL.indexOf(arDIR[i])>0){
				bFoundDIR = true;
				break;
			}
		}
	}
	
	if (bFoundDIR){
		for (i=0;i<=arURL.length-1;i++){
			if (strURL.indexOf(arURL[i])>0){
				bFoundURL = true;
				break;
			}
		}
	}
	
	if (bFoundDIR && !bFoundURL){
		if (strURL.indexOf("https")==-1){
			bValid = false;
		}
	}
	
	return bValid;
}

bOK = IsValidURL()
if (!bOK){
	alert("Sorry. The URL you visited is incorrect. The system will redirect you to the homepage of China Airlines.");
	window.location.href="http://www.china-airlines.com/";
}
//-->