//AE￢dCookie
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;
	
      //¨S|3，eRA	
      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;
}


//，N?Xμ{|! , |bunescape≪a，N?XAU-i???a
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 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;

      //¨S|3，eRA
      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;
}



//login.js±M\I
function check1()
{
  var f = document.frm;
  var y = '';
  if (f.dfpcard.value == '') {y+='会員番号が入力されていません。\n';}  
  if (f.pincode.value == '') {y+='パスワードが入力されていません。\n';}
  
  if (y=='')
    {return true;}
  else 
  {
      //y = 'コメントアウトされている。\n\n' + y
      alert(y);
      return false;
  }
}

document.write('			<div id="memberArea">');
document.write('				<!--- ｦpｪG･ｼｵn､Jｶ]ｳoｬq ｶ}ｩl --->');
document.write('				<div style="background:url(../imgs_revamp/membg.gif) no-repeat; width:182px; height:125px;">');
document.write('					<table width="170" border="0" align="center" cellpadding="0" cellspacing="0" style="padding-top: 40px">');
document.write('						<tr>');

var loginyn = get_cookie('clubid');  
if ((loginyn == null) || (loginyn == "")) {  
document.write('							<td valign="top" width="4" align="left">');
document.write('								<form name="frm" method="post" action="https://calec.china-airlines.com/e_club/jp/login_j.asp" onsubmit="return check1();">');
document.write('									<table border="0" cellspacing="2" cellpadding="0">');
document.write('										<tr>');
document.write('											<td>');
document.write('												<input name="dfpcard" type="text" size="9" maxlength="9"  onblur="if(this.value==\'\'){this.value=\'会員番号\'}else{this.value=this.value.toUpperCase();}" onfocus="if(this.value==\'会員番号\') this.value=\'\'" value="会員番号">');
document.write('											</td>');
document.write('										</tr>');
document.write('										<tr>');
document.write('											<td>');
document.write('												<input name="pincode" type="password" size="8" maxlength="9" style="margin-bottom: 2px" onFocus="javascript: if (this.value==\'±K?X\') this.value=\'\';">');
document.write('												<input class="menu1" border="0" type="image" name="sss" src="../imgs_revamp/btn-login.gif" width="66" height="21"></td>');
document.write('										</tr>');
document.write('								</table>');
document.write('					</form>');
document.write('				</td>');
document.write('				<td align="center">');
document.write('					<table border="0" cellspacing="1" cellpadding="0" class="mem">');
document.write('						<tr>');
document.write('							<td width="6" valign="top"><img src="../imgs_revamp/arrow.gif" alt="" /></td>');
document.write('							<td valign="middle" align="left"><p><a href="http://www.china-airlines.co.jp/dfp/index.html">マイレージ</a></p></td>');
document.write('						</tr>');
document.write('						<tr>');
document.write('							<td valign="top"><img src="../imgs_revamp/arrow.gif" alt="" /></td>');
document.write('							<td valign="middle" align="left"><p><a href="https://calec.china-airlines.com/club/jp/clubjo_j.asp">入会申請</a></p></td>');
document.write('						</tr>');
document.write('						<tr>');
document.write('							<td valign="top"><img src="../imgs_revamp/arrow.gif" alt="" /></td>');
document.write('							<td valign="middle" align="left"><p><a href="https://calec.china-airlines.com/e_club/jp/club.asp">会員専用ページ</a></p></td>');
document.write('						</tr>');
document.write('						<tr>');
document.write('							<td valign="top"><img src="../imgs_revamp/arrow.gif" alt="" /></td>');
document.write('							<td valign="middle" align="left"><p><a href="http://www.china-airlines.co.jp/dfp/dfp11.html">プレミアム<br />プログラム</a></p></td>');
document.write('						</tr>');
document.write('					</table><br />');
document.write('				</td>');
} 
else {  
document.write('				<td valign="top">');
document.write('					<table width="100%" border="0" cellspacing="2" cellpadding="0" class="mem">');
document.write('						<tr>');
document.write('							<td><img src="../imgs_revamp/empty.gif" width="1" height="1"></td>');
document.write('							<td class="memberInfo">' + get_cookie2("infoname") + '<br>');
document.write('										Card No. : ' + get_cookie("clubid") + '<br>');
document.write('										Balanced miles : ' + get_cookie("infomileage") + 'miles</td>');
document.write('							<td><img src="../imgs_revamp/empty.gif" width="1" height="1"></td>');
document.write('						</tr>');
document.write('						<tr align="center">');
document.write('							<td colspan="3"><a href="https://calec.china-airlines.com/e_club/jp/logout_j.asp"><img name="Image40" border="0" src="../imgs_revamp/btnBlue.gif" width="45" height="22""><input type="hidden" id="menu9"></a></td>');
document.write('						</tr>');
document.write('					</table>');
document.write('				</td>');
}
document.write('			</tr>');
document.write('		</table>');
document.write('	</div>');
