<%@ page contentType="text/html; charset=Shift_JIS" %>
<%@ page pageEncoding="Shift_JIS"%>
<%@ 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.imode.CHtmlHelper" %>

<jsp:useBean id="converter" class="jp.co.orangesoft.xgate.imode.CHtmlHelper"/>

<%
	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;

	String[] title =  {"本文：", 	"Text:"};
	String[] submit = {"OK", 		"OK"};		//submitボタン
	String[] back =   {"戻る", 		"Back"};	//backボタン

	String body = (String)request.getAttribute("body");
	String method = (String)request.getAttribute("method");
	
    response.setHeader("Cache-Control","no-cache");
	response.setHeader("Pragma","no-cache");
	response.setHeader("Expires","0");
%>

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

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

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

	<head>
	  <meta http-equiv="Cache-Control" content="no-cache">
	</head>

	<html>
	<body>
	  <form method="<%=method%>" action="<%=servlet%>">
	    <input type="hidden" name="cmd" value="MAIL_TEXT_SET">
	    <%=title[lang]%><br>
	    <textarea name="text" rows=5 cols=16><%=CHtmlHelper.escapeText(body)%></textarea><p>
	    <center><input type="submit" value="<%=submit[lang]%>"></center>
	  </form>
	</body>
	</html>

</c:when>

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

	<HDML VERSION="3.0" TTL=0>
	  <ENTRY NAME="text" KEY="text" DEFAULT="<%=body%>">
	    <ACTION TYPE="ACCEPT" TASK=GO DEST="<%=servlet%>" METHOD="POST" POSTDATA="cmd=MTS&text=$text">
	    <%=title[lang]%>
	  </ENTRY>
	</HDML>

</c:when>

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

	<?xml version="1.0"?>
	<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
				"http://www.wapforum.org/DTD/wml_1.1.xml">

	<wml>
	<head>
	  <meta http-equiv="Cache-Control" content="max-age=0"/>
	</head>
	<card id="text">
	  <p>
	  <do type="accept" label="OK">
	    <go href="<%=servlet%>" method="post">
	      <postfield name="cmd" value="MTS"/>
	      <postfield name="text" value="$text"/>
	    </go>
	  </do>
	  <%=title[lang]%><br/>
	  <input name="text" value="<%=body%>"/>
	  </p>
	</card>
	</wml>

</c:when>

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

</c:otherwise>

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

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