<%@ page contentType="text/html; charset=Shift_JIS" %>
<%@ page pageEncoding="Windows-31J"%>
<%@ taglib prefix="c" uri="/WEB-INF/tlds/c.tld" %>
<%-- <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %> --%>
<%@ page import="jp.co.orangesoft.xgate.addressbook.AddressBookEntry" %>
<%@ page import="jp.co.orangesoft.xgate.util.MobilePhoneAccessKey" %>
<jsp:useBean id="htmltool" class="jp.co.orangesoft.xgate.util.HtmlTool"/>

<%
	// 宛先入力
	
	String servlet = (String)request.getAttribute("servlet");
	String term = (String)request.getAttribute("term");
	java.util.Locale locale = (java.util.Locale)request.getAttribute("lang");
	String charset = "Windows-31J";
	int lang = locale.equals(java.util.Locale.JAPANESE) ? 0 : 1;

	AddressBookEntry entry = (AddressBookEntry)request.getAttribute("entry");

	String id = htmltool.format(request.getAttribute("id"));
	if(id == null) id = "";

	String adr = htmltool.format(request.getAttribute("adr"));
	if(adr == null) adr = "";
	
	String errmsg = htmltool.format(request.getAttribute("errmsg"));
	if(errmsg == null) errmsg = "";
	if(errmsg.length() > 0) errmsg += "<br>";

	String[] toTitle = {"宛先", "To"};
	String[] backTitle = {"戻る", "Back"};
	
	//chou 20070222
	String cc_bcc = (String)session.getAttribute("cc_bcc");
	if("cc".equals(cc_bcc)){
		toTitle[0]="写し";
		toTitle[1]="Cc";
	}
	
	if("bcc".equals(cc_bcc)){
		toTitle[0]="Bcc";
		toTitle[1]="Bcc";
	}
%>

<%-- ==================================================================================== --%>
<c:choose>

<%-- ==================================================================================== --%>
<c:when test="${term == 'imode' || term == 'astel' || term == 'wml' || term == 'willcom'}">

<% response.setContentType("text/html;charset="+charset); %>

<html>
<body>
  <form method="post" action="<%=servlet%>">
    <input type="hidden" name="cmd" value="MAIL_ADDRESS_SET">
    <input type="hidden" name="id" value="<%=id%>">
    <%=toTitle[lang]%>: <br>
    <input type="text" name="adr" value="<%=adr%>" size=20 istyle="3" maxlength="64"><p>
    <center><input type="submit" value="OK"><br>
    <a href="<%=servlet%>?cmd=SMM"><%=backTitle[lang]%></a>
    </center>
  </form>
</body>
</html>

</c:when>

<%-- ==================================================================================== --%>
<c:when test="${term == 'jphone' || term == 'jsky'}">
	
<% response.setContentType("text/html;charset="+charset); %>

<html>
<body>
<form action="<%=servlet%>">
<input type="hidden" name="cmd" value="MAIL_ADDRESS_SET">
<input type="hidden" name="id" value="<%=id%>">
<%=toTitle[lang]%>: <br>
<input type="text" name="adr" value="<%=adr%>" size="20" maxlength="64" mode="numeric"><p>
<center>
<input type="submit" name="submit" value="OK">
<br>
<a href="<%=servlet%>?cmd=SMM"><%=backTitle[lang]%></a>
</center>
</form>
</body>
</html>

</c:when>

<%-- ==================================================================================== --%>
<c:when test="${term == 'hdml'}">

<% response.setContentType("text/x-hdml;charset="+charset); %>

<HDML VERSION="3.0" TTL=0>
  <ENTRY NAME="edit" KEY="name">
    <ACTION TYPE="ACCEPT" LABEL="登録" TASK=GO DEST="<%=servlet%>?cmd=MAS&id=<%=id%>&adr=$name">
  <%=toTitle[lang]%>：
  </ENTRY>
</HDML>

</c:when>

<%-- ==================================================================================== --%>
<c:when test="${term == 'wml'}">
	<% response.setContentType("text/vnd.wap.wml;charset="+charset); %>

</c:when>

<%-- ==================================================================================== --%>
<c:when test="${term == 'wml_nokia'}">
	<% response.setContentType("text/vnd.wap.wml;charset="+charset); %>

</c:when>

<%-- ==================================================================================== --%>
<c:when test="${term == 'pc'}">
	<% response.setContentType("text/html;charset="+charset); %>

</c:when>

<%-- ==================================================================================== --%>
<c:when test="${term == 'palm'}">
	<% response.setContentType("text/html;charset="+charset); %>

</c:when>

<%-- ==================================================================================== --%>
<c:otherwise>
	
</c:otherwise>

<%-- ==================================================================================== --%>
</c:choose>

<!-- Copyright (c) 2000,2001 Orangesoft Inc. All Rights Reserved. -->
