<?php include_once( "../../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_default.tpl}
{module:member.mail.reject.LoadList}
{module:member.mail.template.Form}
{preset:page_title MEMBER_PERSONAL_LABEL . '管理 > メールテンプレート管理 > 作成・編集'}

	<div class="panc">
		<a href="../../../">管理パネルトップ</a>
		&gt; <a href="../../">{write:MEMBER_PERSONAL_LABEL}管理</a>
		&gt; <a href="./">メールテンプレート管理</a>
		{if:strlen(member.mail.template.mail_template_object->'template_number')}
		&gt; {write:member.mail.template.mail_template_object->'template_name'}
		{else}
		&gt; 新規作成
		{/if}
	</div>

	<h1>
		{write:MEMBER_PERSONAL_LABEL}管理
		&gt; メールテンプレート管理
		{if:strlen(member.mail.template.mail_template_object->'template_number')}
		&gt; {write:member.mail.template.mail_template_object->'template_name'}
		{else}
		&gt; 新規作成
		{/if}
	</h1>
	
{if:IS_ERROR}

	<ul class="error">
	{foreach:errors error}
		<li>{write:error}</li>
	{/foreach}
	</ul>

{else}
	<div style="width:96%;margin:0 auto;">
	<form name="mform" action="./confirm.php?tpln={write:member.mail.template.mail_template_object->'template_number'}" method="post" onsubmit="memberMailTemplateBodyChangeOnSubmit()">
	<div id="mail-tab-menu">
		<div id="button-detail" class="active-button"
			>基本情報</div>
		<div id="button-body" class="active-button"
			>メール本文</div>
		<br style="clear:left;" />
	</div><div id="mail-edit-panel">
		<div id="mail-detail-info" class="active-panel">

		<h2>基本設定</h2>
		<table class="detail" style="width:96%;margin:0 auto;">
		<tbody>
		<tr>
			<th style="width:10em;white-space:nowrap;">テンプレートID</th>
			<td>
				{if:strlen(member.mail.template.mail_template_object->'template_number')==0}
				<!-- 新規作成 -->
				<input type="text" size="60" name="template_id" value="{write:member.mail.template.mail_template_object->'template_id'}" />
				{else-if:preg_match('/^MMTP/',member.mail.template.mail_template_object->'template_id')>0}
				<!-- システム以外のテンプレート -->
					{if:system.login.logininformation->getUniqueId() == member.mail.template.mail_template_object->'owner_id'}
					<input type="text" size="60" name="template_id" value="{write:member.mail.template.mail_template_object->'template_id'}" />
					{else}
						<input type="hidden" name="template_id" value="{write:member.mail.template.mail_template_object->'template_id'}" />
						{write:member.mail.template.mail_template_object->'template_id'}
					{/if}
				{else}
					<input type="hidden" name="template_id" value="{write:member.mail.template.mail_template_object->'template_id'}" />
					{write:member.mail.template.mail_template_object->'template_id'}
				{/if}
			</td>
		</tr>
		<tr>
			<th style="width:10em;white-space:nowrap;">テンプレート名</th>
			<td>
				{if:strlen(member.mail.template.mail_template_object->'template_number')==0}
				<!-- 新規作成 -->
				<input type="text" size="60" name="template_name" value="{write:member.mail.template.mail_template_object->'template_name'}" />
				{else-if:preg_match('/^MMTP/',member.mail.template.mail_template_object->'template_id')>0}
				<!-- システム以外のテンプレート -->
					{if:system.login.logininformation->getUniqueId() == member.mail.template.mail_template_object->'owner_id'}
					<input type="text" size="60" name="template_name" value="{write:member.mail.template.mail_template_object->'template_name'}" />
					{else}
						<input type="hidden" name="template_name" value="{write:member.mail.template.mail_template_object->'template_name'}" />
						{write:member.mail.template.mail_template_object->'template_name'}
					{/if}
				{else}
					<input type="hidden" name="template_name" value="{write:member.mail.template.mail_template_object->'template_name'}" />
					{write:member.mail.template.mail_template_object->'template_name'}
				{/if}
			</td>
		</tr>
		<tr>
			<th style="width:10em;white-space:nowrap;">テンプレート種類</th>
			<td>
				{if:strlen(member.mail.template.mail_template_object->'template_number')==0}
				<!-- 新規作成 -->
				<input type="radio" id="template_type_0" name="template_type"
					onclick="memberMailTemplateChangeTemplateType()"
					value="0"{if:member.mail.template.mail_template_object->'template_type'!='1'} checked{/if}
				/><label for="template_type_0" style="cursor:pointer;"> 通常テンプレート</label>
				<input type="radio" id="template_type_1" name="template_type"
					onclick="memberMailTemplateChangeTemplateType()"
					value="1"{if:member.mail.template.mail_template_object->'template_type'=='1'} checked{/if}
				/><label for="template_type_1" style="cursor:pointer;"> 部分テンプレート</label>
				{else}
					{if:member.mail.template.mail_template_object->'template_type'=='1'}部分テンプレート{else}通常テンプレート{/if}
				{/if}
			</td>
		</tr>
		<tr>
			<th style="width:10em;white-space:nowrap;">共有設定</th>
			<td>
				{if:strlen(member.mail.template.mail_template_object->'template_number')==0}
				<!-- 新規作成 -->
				<input type="radio" name="open_flag" value="0"{if:member.mail.template.mail_template_object->'open_flag'!='20'} checked{/if} /> 共有テンプレート
				<input type="radio" name="open_flag" value="20"{if:member.mail.template.mail_template_object->'open_flag'=='20'} checked{/if} /> 個人用テンプレート
				{else-if:preg_match('/^MMTP/',member.mail.template.mail_template_object->'template_id')>0}
				<!-- システム以外のテンプレート -->
					{if:system.login.logininformation->getUniqueId() == member.mail.template.mail_template_object->'owner_id'}
					<input type="radio" name="open_flag" value="0"{if:member.mail.template.mail_template_object->'open_flag'!='20'} checked{/if} /> 共有テンプレート
					<input type="radio" name="open_flag" value="20"{if:member.mail.template.mail_template_object->'open_flag'=='20'} checked{/if} /> 個人用テンプレート
					{else}
						<input type="hidden" name="open_flag" value="{write:member.mail.template.mail_template_object->'open_flag'}" />
						{if:member.mail.template.mail_template_object->'open_flag'!='20'}共有テンプレート{/if}
						{if:member.mail.template.mail_template_object->'open_flag'=='20'}個人用テンプレート{/if}
					{/if}
				{else}
					<input type="hidden" name="open_flag" value="{write:member.mail.template.mail_template_object->'open_flag'}" />
					{if:member.mail.template.mail_template_object->'open_flag'!='20'}共有テンプレート{/if}
					{if:member.mail.template.mail_template_object->'open_flag'=='20'}個人用テンプレート{/if}
				{/if}
			</td>
		</tr>
		<tr>
			<th style="width:10em;white-space:nowrap;">メールマガジン種類</th>
			<td>
			{if:strlen(member.mail.template.mail_template_object->'template_number')==0}
				<div id="panel-mail-magazine-select"><select name="list_id">
					<option value="">-</option>
				{foreach:member.mail.reject.data_array reject_list_object}
					<option value="{write:reject_list_object->'list_id'}"
						{if:reject_list_object->'list_id'==member.mail.template.mail_template_object->'list_id'} selected{/if}
						>{write:reject_list_object->'list_name'}</option>
					{/foreach}
				</select></div>
			{else-if:member.mail.template.mail_template_object->'template_type'!='1'}	
				{if:preg_match('/^MMTP/',member.mail.template.mail_template_object->'template_id')>0}
				<select name="list_id">
					<option value="">-</option>
				{foreach:member.mail.reject.data_array reject_list_object}
					<option value="{write:reject_list_object->'list_id'}"
						{if:reject_list_object->'list_id'==member.mail.template.mail_template_object->'list_id'} selected{/if}
						>{write:reject_list_object->'list_name'}</option>
					{/foreach}
				</select>
				{else}
				-
				<input type="hidden" name="list_id" value="{write:member.mail.template.mail_template_object->'list_id'}" />
				{/if}
			{else}
				-<input type="hidden" name="list_id" value="{write:member.mail.template.mail_template_object->'list_id'}" />
			{/if}
			</td>
		</tr>
		</tbody>
		</table>
		
		{if:strlen(member.mail.template.mail_template_object->'template_number')==0 || member.mail.template.mail_template_object->'template_type'!='1'}
		<div id="panel-mail-headers">
		<h2>メールヘッダ</h2>
		<table class="detail" style="margin:0 auto;width:96%;">
		<tbody>
		<tr>
			<th style="width:10em;white-space:nowrap;">メール件名(PC)<span class="required">※</span></th>
			<td>
				<input type="text" name="subject" size="80" value="{write:member.mail.template.mail_template_object->'subject'}" /><br />
			</td>
		</tr>
		<tr>
			<th style="width:10em;white-space:nowrap;">メール件名(携帯)</th>
			<td>
				<input type="text" name="subject_mobile" size="80" value="{write:member.mail.template.mail_template_object->'subject_mobile'}" /><br />
			</td>
		</tr>
		<tr>
			<th style="width:10em;white-space:nowrap;">送信者名</th>
			<td>
				<input type="text" name="mail_from_name" size="20" value="{write:member.mail.template.mail_template_object->'mail_from_name'}" /><br />
			</td>
		</tr>
		<tr>
			<th style="width:10em;white-space:nowrap;">送信元<br />メールアドレス</th>
			<td>
				<input type="text" name="mail_from_address" size="40" value="{write:member.mail.template.mail_template_object->'mail_from_address'}" /><br />
			</td>
		</tr>
		<tr>
			<th style="width:10em;white-space:nowrap;">返信先<br />メールアドレス</th>
			<td>
				<input type="text" name="mail_reply_address" size="40" value="{write:member.mail.template.mail_template_object->'mail_reply_address'}" /><br />
			</td>
		</tr>
		<tr>
			<th style="width:10em;white-space:nowrap;">エラー戻り先<br />メールアドレス</th>
			<td>
				<input type="text" name="mail_return_path" size="40" value="{write:member.mail.template.mail_template_object->'mail_return_path'}" /><br />
			</td>
		</tr>
		</tbody>
		</table>
		</div>
		{/if}
		
		<h2>付加情報</h2>
		<table class="detail" style="margin:0 auto;width:96%;">
		<tbody>
		<tr>
			<th style="width:10em;white-space:nowrap;">管理メモ</th>
			<td>
				<textarea name="description" cols="50" rows="2"
					>{write:member.mail.template.mail_template_object->'description'}</textarea>
			</td>
		</tr>
		</tbody>
		</table>

		<p style="text-align:center;">
			<input type="button" value="メール本文編集へ" onclick="viewMailBody()"
			/>
		</p>
		</div>

		<!-- 本文編集部分	-->
		<div id="mail-body-form" class="active-panel">
			<table style="width:100%">
			<tbody>
			<tr>
				<td>
					<input type="radio" name="selectbody" value="0" onclick="memberMailTemplateBodyChange(this)" checked />パソコン向けテキスト
					<input type="radio" name="selectbody" value="1" onclick="memberMailTemplateBodyChange(this)" />携帯向けテキスト
					<input type="radio" name="selectbody" value="2" onclick="memberMailTemplateBodyChange(this)" />パソコン向けHTML
					<input type="radio" name="selectbody" value="3" onclick="memberMailTemplateBodyChange(this)" />携帯向けHTML
				</td>
			</tr>
			<tr>
				<td style="text-align:center;">
					<textarea id="mail-body-area" name="body" cols="70" rows="20"
						style="width:99%;font-size:12px;font-family:monospace;"
						>{write:member.mail.template.mail_template_object->'text_body_default'}</textarea>
					<input type="hidden" name="text_body_default" value="{write:member.mail.template.mail_template_object->'text_body_default'}" />
					<input type="hidden" name="text_body_mobile" value="{write:member.mail.template.mail_template_object->'text_body_mobile'}" />
					<input type="hidden" name="html_body_default" value="{write:member.mail.template.mail_template_object->'html_body_default'}" />
					<input type="hidden" name="html_body_mobile" value="{write:member.mail.template.mail_template_object->'html_body_mobile'}" />
				</td>
			</tr>
			</tbody>
			</table>
			<table style="width:100%">
			<tbody>
			<tr>
				<td style="padding:0px;text-align:right;">
					<select name="bgcolor" id="bgcolor" onchange="this.style.backgroundColor=this.options[this.selectedIndex].value;">
						<option value="">背景色</option>
						<option value="#FF0000" style="background-color:#FF0000;"
							{if:member.mail.template.mail_template_object->'bgcolor'=='#FF0000'} selected{/if}
							>#FF0000</option>
						<option value="#000099" style="background-color:#000099;"
							{if:member.mail.template.mail_template_object->'bgcolor'=='#000099'} selected{/if}
							>#000099</option>
						<option value="#FF00FF" style="background-color:#FF00FF;"
							{if:member.mail.template.mail_template_object->'bgcolor'=='#FF00FF'} selected{/if}
							>#FF00FF</option>
						<option value="#009933" style="background-color:#009933;"
							{if:member.mail.template.mail_template_object->'bgcolor'=='#009933'} selected{/if}
							>#009933</option>
						<option value="#CC9900" style="background-color:#CC9900;"
							{if:member.mail.template.mail_template_object->'bgcolor'=='#CC9900'} selected{/if}
							>#CC9900</option>
						<option value="#00FF00" style="background-color:#00FF00;"
							{if:member.mail.template.mail_template_object->'bgcolor'=='#00FF00'} selected{/if}
							>#00FF00</option>
						<option value="#FFFF00" style="background-color:#FFFF00;"
							{if:member.mail.template.mail_template_object->'bgcolor'=='#FFFF00'} selected{/if}
							>#FFFF00</option>
						<option value="#FF6600" style="background-color:#FF6600;"
							{if:member.mail.template.mail_template_object->'bgcolor'=='#FF6600'} selected{/if}
							>#FF6600</option>
						<option value="#00FFFF" style="background-color:#00FFFF;"
							{if:member.mail.template.mail_template_object->'bgcolor'=='#00FFFF'} selected{/if}
							>#00FFFF</option>
						<option value="#000000" style="background-color:#000000;"
							{if:member.mail.template.mail_template_object->'bgcolor'=='#000000'} selected{/if}
							>#000000</option>
					</select>
					<input type="button" value="プレビュー" onclick="preview()" />
				</td>
			</tr>
			</tbody>
			</table>
			<p style="text-align:center;">
				<input type="button" value="送信情報編集へ" onclick="viewMailDetail()"
				/><input type="submit" value="テンプレートを保存する"
				/>
			</p>
		</div>
	</div>	
	</form>
	<form name="previewForm" action="../preview.php" method="post" target="">
	<input type="hidden" name="target_type" value="" />
	<input type="hidden" name="mail_type" value="" />
	<input type="hidden" name="bgcolor" value="" />
	<input type="hidden" name="subject" value="" />
	<input type="hidden" name="body" value="" />
	</form>
	</div>

<style type="text/css"><!--
.active-button {
	float:left;
	width:10em;
	text-align:center;
	padding:3px;
	background-color:#DDDDDD;
	border-style:solid solid none solid;
	border-width:1px 1px 0px 1px;
	border-color: #808080;
}
.active-panel {
	border-style:solid;
	border-width:1px;
	border-color: #808080;
	margin-bottom: 10em;
}
--></style>
<script language="JavaScript" type="text/javascript" src="/js/textformer/textformer.js"></script>
<script language="JavaScript" type="text/javascript"><!--
var templateHttpObject;
var editDetailFormView;
var editBodyFormView;
var textFormerObject;
var isDetail	= true;
if(window.attachEvent){
	window.attachEvent('onload',initializeInputForm);
	window.attachEvent('onload',memberMailTemplateChangeTemplateType);
}else{
	window.addEventListener('DOMContentLoaded',initializeInputForm,false);
	window.addEventListener('DOMContentLoaded',memberMailTemplateChangeTemplateType,false);
}

function initializeInputForm() {
	document.getElementById('button-detail').style.cursor	= 'pointer';
	document.getElementById('button-body').style.cursor		= 'pointer';
	document.getElementById('button-detail').onclick		= function() { viewMailDetail(); };
	document.getElementById('button-body').onclick			= function() { viewMailBody(); };
	document.getElementById('button-detail').clickFunction	= function() { viewMailDetail(); };
	document.getElementById('button-body').clickFunction	= function() { viewMailBody(); };
	
	editDetailFormView		= document.getElementById('mail-detail-info');
	editBodyFormView		= document.getElementById('mail-body-form');
	
	viewMailDetail();
}
function viewMailDetail() {
	editDetailFormView.style.position	= 'static';
	editDetailFormView.style.display	= 'block';
	editDetailFormView.style.visibility	= 'visible';
	editDetailFormView.style.zIndex		= '10';
	editBodyFormView.style.position		= 'absolute';
	editBodyFormView.style.display		= 'none';
	editBodyFormView.style.visibility	= 'hidden';
	editBodyFormView.style.zIndex		= '-9999';
	editBodyFormView.style.top			= '0px';
	editBodyFormView.style.left			= '0px';
	activateBtn( document.getElementById('button-detail') );
	unactivateBtn( document.getElementById('button-body') );
	if( textFormerObject ) {
		textFormerObject.lineCount			= 35;
		textFormerObject.cutdown();
	}
	isDetail	= true;
	memberMailSiteImageRemove();
}
function viewMailBody() {
	editDetailFormView.style.position	= 'absolute';
	editDetailFormView.style.display	= 'none';
	editDetailFormView.style.visibility	= 'hidden';
	editDetailFormView.style.zIndex		= '-9999';
	editDetailFormView.style.top		= '0px';
	editDetailFormView.style.left		= '0px';
	editDetailFormView.style.width		= '99%';
	editBodyFormView.style.position		= 'static';
	editBodyFormView.style.display		= 'block';
	editBodyFormView.style.visibility	= 'visible';
	editBodyFormView.style.zIndex		= '10';
	unactivateBtn( document.getElementById('button-detail') );
	activateBtn( document.getElementById('button-body') );
	if( textFormerObject ){
	} else {
		textFormerObject = new TextFormer(document.getElementById('mail-body-area'),"document.mform.submit()");
	}
	isDetail	= false;
	if( document.mform.mail_type && document.mform.mail_type.selectedIndex == 1 ) {
		memberMailSiteImageReview('/upload');
	} else {
		memberMailSiteImageRemove();
	}
	if( textFormerObject ) {
		textFormerObject.style.width	= '99%';
		textFormerObject.toFitInnerParts();
	}
}
function activateBtn( obj ) {
	obj.style.backgroundColor	= '#FFFFFF';
	obj.style.cursor			= 'nomal';
}
function unactivateBtn( obj ) {
	obj.style.backgroundColor	= '#DDDDDD';
	obj.style.cursor			= 'pointer';
}
function confirmSend() {
	if( confirm('送信情報と本文編集を終えて送信確認画面へ移動します。') ) {
		document.mform.submit();
	}
}
function preview() {
	var targetSelectedNumber	= document.mform.target_type.selectedIndex;
	var targetType				= document.mform.target_type.options[targetSelectedNumber].value;
	var mailSelectedNumber		= document.mform.mail_type.selectedIndex;
	var mailType				= document.mform.mail_type.options[mailSelectedNumber].value;
	var backColorSelectd		= document.mform.bgcolor.selectedIndex;
	var backColor				= document.mform.bgcolor.options[backColorSelectd].value;
	var wWidth	= '420';
	if( 'm' == targetType ) {
		wWidth	= '160';
	}
	var childWindow	= window.open('./form.php','memberMailPreviewBodyTemp','width='+wWidth);
	if( childWindow ) {
		document.previewForm.target				= 'memberMailPreviewBodyTemp';
		document.previewForm.target_type.value	= targetType;
		document.previewForm.mail_type.value	= mailType;
		document.previewForm.bgcolor.value		= backColor;
		document.previewForm.subject.value		= document.mform.subject.value;
		document.previewForm.body.value			= textFormerObject.getText();
		document.previewForm.submit();
	}
}

/**
 * サイドバーに貼り付け可能な画像一覧を表示します
 */
function memberMailSiteImageReview( targetUri ) {
	templateHttpObject	= FormerCommon.createHttpRequest(memberMailSiteImageReviewResult);
	if (templateHttpObject) {
		FormerCommon.displayGrayOut(9999);
		templateHttpObject.open("GET",'../ajax_files.php?ccurf=' + encodeURIComponent(targetUri),true);
		templateHttpObject.send(null);
	}
}
function memberMailSiteImageReviewResult() {
	if ((templateHttpObject.readyState == 4) && (templateHttpObject.status == 200)){
		var targetSidebar	= document.getElementById('mdsm-package-toolbar');
		var imagePanel		= document.getElementById('member-mail-body-images');
		if( imagePanel ) {
		} else {
			imagePanel		= document.createElement('div');
			imagePanel.id	= 'member-mail-body-images';
			if( targetSidebar ) {
				targetSidebar.parentNode.insertBefore(imagePanel,targetSidebar);
			}
		}
		if( imagePanel ) {
			imagePanel.innerHTML	= templateHttpObject.responseText.cr2lf().trim();
		}
		setTimeout(FormerCommon.displayWhiteIn, 100);
	} else if ((templateHttpObject.readyState == 4) && (templateHttpObject.status != 200)){
		alert('画像取得でサーバーと通信できませんでした。');
		setTimeout(FormerCommon.displayWhiteIn, 100);
	}
}
function memberMailSiteImageRemove() {
	var targetSidebar	= document.getElementById('mdsm-package-toolbar');
	var imagePanel		= document.getElementById('member-mail-body-images');
	if( imagePanel && targetSidebar ) {
		targetSidebar.parentNode.removeChild(imagePanel);
	}
}
function memberMailSiteImagePaste(imageUri) {
	var tag = '<img src="' + imageUri + '" />';
	textFormerObject.paste(tag);
}

/**
 * リターンメール処理アドレスの処理を行います
 */
function errorReturnCheck(checkBoxObj) {
	if( document.mform.mail_return_path ) {
		if( checkBoxObj && checkBoxObj.checked ) {
			document.mform.mail_return_path.type	= 'hidden';
			document.mform.mail_return_path.value	= 'system_auto';
		} else {
			document.mform.mail_return_path.type	= 'text';
			document.mform.mail_return_path.value	= '';
		}
	}
}
/**
 * テンプレート種別選択
 */
function memberMailTemplateChangeTemplateType() {
	var panelMagazine	= document.getElementById('panel-mail-magazine-select');
	var panelMailHeader	= document.getElementById('panel-mail-headers');
	var radioType0		= document.getElementById('template_type_0');
	var radioType1		= document.getElementById('template_type_1');
	if( radioType1 && radioType1.checked ) {
		if( panelMagazine ) {
			panelMagazine.style.display		= 'none';
			panelMagazine.style.visibility		= 'hidden';
			panelMagazine.style.position		= 'absolute';
			panelMagazine.style.display			= 'none';
		}
		if( panelMailHeader ) {
			panelMailHeader.style.display	= 'none';
			panelMailHeader.style.visibility	= 'hidden';
			panelMailHeader.style.position		= 'absolute';
			panelMailHeader.style.display			= 'none';
		}
	} else {
		if( panelMagazine ) {
			panelMagazine.style.display		= 'block';
			panelMagazine.style.visibility		= 'visible';
			panelMagazine.style.position		= 'static';
			panelMagazine.style.display			= 'block';
		}
		if( panelMailHeader ) {
			panelMailHeader.style.display	= 'block';
			panelMailHeader.style.visibility	= 'visible';
			panelMailHeader.style.position		= 'static';
			panelMailHeader.style.display		= 'block';
		}
	}
}
/**
 * 本文選択
 */
var memberMailTemplateBodySelected	= '0';
function memberMailTemplateBodyChange(radioObj) {
	if( '3' == memberMailTemplateBodySelected ) {
		document.mform.html_body_mobile.value	= textFormerObject.getText();
	} else if( '2' == memberMailTemplateBodySelected ) {
		document.mform.html_body_default.value	= textFormerObject.getText();
	} else if( '1' == memberMailTemplateBodySelected ) {
		document.mform.text_body_mobile.value	= textFormerObject.getText();
	} else {
		document.mform.text_body_default.value	= textFormerObject.getText();
	}
	if( '3' == radioObj.value ) {
		textFormerObject.setText(document.mform.html_body_mobile.value);
	} else if( '2' == radioObj.value ) {
		textFormerObject.setText(document.mform.html_body_default.value);
	} else if( '1' == radioObj.value ) {
		textFormerObject.setText(document.mform.text_body_mobile.value);
	} else {
		textFormerObject.setText(document.mform.text_body_default.value);
	}
	memberMailTemplateBodySelected	= radioObj.value;
}
function memberMailTemplateBodyChangeOnSubmit() {
	if( '3' == memberMailTemplateBodySelected ) {
		document.mform.html_body_mobile.value	= textFormerObject.getText();
	} else if( '2' == memberMailTemplateBodySelected ) {
		document.mform.html_body_default.value	= textFormerObject.getText();
	} else if( '1' == memberMailTemplateBodySelected ) {
		document.mform.text_body_mobile.value	= textFormerObject.getText();
	} else {
		document.mform.text_body_default.value	= textFormerObject.getText();
	}
}
//--></script>
{/if}
	<hr style="width:96%;margin:0 auto;margin-top:1em;" />
	<div style="width:96%;margin:0 auto;text-align:right;">
		<a href="./">&gt;&gt; メールテンプレート管理へ戻る</a>
		&nbsp;&nbsp;
		<a href="../../">&gt;&gt; {write:MEMBER_PERSONAL_LABEL}管理へ</a>
	</div>