if(ENTRY_USE){var STR_DELETE='Delete';var STR_EXCLUDE='*Exclusion';}else{var STR_DELETE='削除';var STR_EXCLUDE='×除外';}
function addAddrList(){var SEND_MAIL_LIMIT=30;if(document.sendmail.addrListNum.value==0){mailaddr=document.sendmail.elements["to_mail[]"].value;name=document.sendmail.elements["to_name[]"].value;}else{mailaddr=document.sendmail.elements["to_mail[]"][0].value;name=document.sendmail.elements["to_name[]"][0].value;}
if(document.sendmail.addrListNum.value>=SEND_MAIL_LIMIT){if(ENTRY_USE){alert('You can enter up to '+SEND_MAIL_LIMIT+' destination address.');}else{alert('宛先は一回'+SEND_MAIL_LIMIT+'ヵ所までお願い致します。');}}else if(mailaddr==""){if(ENTRY_USE){alert('Enter a email address');}else{alert('メールアドレスを入力してください。');}}else if(!chMail(mailaddr)){if(ENTRY_USE){alert('Email address is incorrect');}else{alert('メールアドレスが不正です。');}}else{var result=document.getElementById("address_list");html="";html+="";html_tmp=htmlspecialchars(name)+"("+htmlspecialchars(mailaddr)+") ";do_flg=0;for(i=1;i<=document.sendmail.addrListNum.value;i++){if(document.getElementById("address"+i)==null){html+=""+STR_EXCLUDE+" ";html+=html_tmp;html="
";if(document.body.insertAdjacentHTML){result.insertAdjacentHTML('BeforeEnd',html);}else{var r=document.createRange();r.selectNode(result);var t=r.createContextualFragment(html);result.appendChild(t);}}
document.sendmail.addrListNum.value=num;document.sendmail.elements["to_mail[]"][0].value="";document.sendmail.elements["to_name[]"][0].value="";if(num==SEND_MAIL_LIMIT){document.sendmail.elements["to_mail[]"][0].disabled=true;document.sendmail.elements["to_name[]"][0].disabled=true;}}}
function addAddrListCc(){var SEND_MAIL_LIMIT=30;if(document.sendmail.addrListNum_cc.value==0){mailaddr=document.sendmail.elements["to_mail_cc[]"].value;name=document.sendmail.elements["to_name_cc[]"].value;}else{mailaddr=document.sendmail.elements["to_mail_cc[]"][0].value;name=document.sendmail.elements["to_name_cc[]"][0].value;}
if(document.sendmail.addrListNum_cc.value>=SEND_MAIL_LIMIT){if(ENTRY_USE){alert('You can enter up to '+SEND_MAIL_LIMIT+' email address (Cc.).');}else{alert('Cc.は一回'+SEND_MAIL_LIMIT+'ヵ所までお願い致します。');}}else if(mailaddr==""){if(ENTRY_USE){alert('Enter a email address');}else{alert('メールアドレスを入力してください。');}}else if(!chMail(mailaddr)){if(ENTRY_USE){alert('Email address is incorrect');}else{alert('メールアドレスが不正です。');}}else{var result=document.getElementById("address_list_cc");html="";html+="";html_tmp=htmlspecialchars(name)+"("+htmlspecialchars(mailaddr)+") ";do_flg=0;for(i=1;i<=document.sendmail.addrListNum_cc.value;i++){if(document.getElementById("address_cc"+i)==null){html+=""+STR_EXCLUDE+" ";html+=html_tmp;html="
";if(document.body.insertAdjacentHTML){result.insertAdjacentHTML('BeforeEnd',html);}else{var r=document.createRange();r.selectNode(result);var t=r.createContextualFragment(html);result.appendChild(t);}}
document.sendmail.addrListNum_cc.value=num;document.sendmail.elements["to_mail_cc[]"][0].value="";document.sendmail.elements["to_name_cc[]"][0].value="";if(num==SEND_MAIL_LIMIT){document.sendmail.elements["to_mail_cc[]"][0].disabled=true;document.sendmail.elements["to_name_cc[]"][0].disabled=true;}}}
function addAddrListBcc(){var SEND_MAIL_LIMIT=30;if(document.sendmail.addrListNum_bcc.value==0){mailaddr=document.sendmail.elements["to_mail_bcc[]"].value;name=document.sendmail.elements["to_name_bcc[]"].value;}else{mailaddr=document.sendmail.elements["to_mail_bcc[]"][0].value;name=document.sendmail.elements["to_name_bcc[]"][0].value;}
if(document.sendmail.addrListNum_bcc.value>=SEND_MAIL_LIMIT){if(ENTRY_USE){alert('You can enter up to '+SEND_MAIL_LIMIT+' destination address (Bcc.).');}else{alert('Bcc.は一回'+SEND_MAIL+LIMIT+'ヵ所までお願い致します。');}}else if(mailaddr==""){if(ENTRY_USE){alert('Enter a email address');}else{alert('メールアドレスを入力してください。');}}else if(!chMail(mailaddr)){if(ENTRY_USE){alert('Email address is incorrect');}else{alert('メールアドレスが不正です。');}}else{var result=document.getElementById("address_list_bcc");html="";html+="";html_tmp=htmlspecialchars(name)+"("+htmlspecialchars(mailaddr)+") ";do_flg=0;for(i=1;i<=document.sendmail.addrListNum_bcc.value;i++){if(document.getElementById("address_bcc"+i)==null){html+=""+STR_EXCLUDE+" ";html+=html_tmp;html="
";if(document.body.insertAdjacentHTML){result.insertAdjacentHTML('BeforeEnd',html);}else{var r=document.createRange();r.selectNode(result);var t=r.createContextualFragment(html);result.appendChild(t);}}
document.sendmail.addrListNum_bcc.value=num;document.sendmail.elements["to_mail_bcc[]"][0].value="";document.sendmail.elements["to_name_bcc[]"][0].value="";if(num==SEND_MAIL_LIMIT){document.sendmail.elements["to_mail_bcc[]"][0].disabled=true;document.sendmail.elements["to_name_bcc[]"][0].disabled=true;}}}
function delAddrList(n){var SEND_MAIL_LIMIT=30;var result=document.getElementById("address"+n);var agt=navigator.userAgent.toLowerCase();if(document.body.removeNode&&!(agt.indexOf("opera")!=-1)){result.removeNode('true');}else{p=result.parentNode;p.removeChild(result);}
document.sendmail.addrListNum.value=eval(document.sendmail.addrListNum.value)-1;if(eval(document.sendmail.addrListNum.value)0){document.sendmail.elements["to_mail[]"][0].disabled=false;document.sendmail.elements["to_name[]"][0].disabled=false;}}
function delAddrListCc(n){var SEND_MAIL_LIMIT=30;var result=document.getElementById("address_cc"+n);var agt=navigator.userAgent.toLowerCase();if(document.body.removeNode&&!(agt.indexOf("opera")!=-1)){result.removeNode('true');}else{p=result.parentNode;p.removeChild(result);}
document.sendmail.addrListNum_cc.value=eval(document.sendmail.addrListNum_cc.value)-1;if(eval(document.sendmail.addrListNum_cc.value)0){document.sendmail.elements["to_mail_cc[]"][0].disabled=false;document.sendmail.elements["to_name_cc[]"][0].disabled=false;}}
function delAddrListBcc(n){var SEND_MAIL_LIMIT=30;var result=document.getElementById("address_bcc"+n);var agt=navigator.userAgent.toLowerCase();if(document.body.removeNode&&!(agt.indexOf("opera")!=-1)){result.removeNode('true');}else{p=result.parentNode;p.removeChild(result);}
document.sendmail.addrListNum_bcc.value=eval(document.sendmail.addrListNum_bcc.value)-1;if(eval(document.sendmail.addrListNum_bcc.value)0){document.sendmail.elements["to_mail_bcc[]"][0].disabled=false;document.sendmail.elements["to_name_bcc[]"][0].disabled=false;}}
function chMail(mf){ml=/^[a-zA-Z0-9\"\._\?\+\/-]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;if(!mf.match(ml)){return false;}
return true;}
function insertAdd(name,mailaddr,opt){var overerr=0;var SEND_MAIL_LIMIT=30;if(parent.parent.document.sendmail.addrListNum.value>=SEND_MAIL_LIMIT){if(ENTRY_USE){alert('You can enter up to '+SEND_MAIL_LIMIT+' destination address.');overerr=1;}else{alert('宛先は一回'+SEND_MAIL_LIMIT+'ヵ所までお願い致します。');overerr=1;}}else{var result=parent.parent.document.getElementById("address_list");html="";html+="";html+=htmlspecialchars(name)+"("+htmlspecialchars(mailaddr)+")";do_flg=0;for(i=1;i<=parent.parent.document.sendmail.addrListNum.value;i++){if(parent.parent.document.getElementById("address"+i)==null){html+=""+STR_EXCLUDE+" ";html="
";if(parent.parent.document.body.insertAdjacentHTML){result.insertAdjacentHTML('BeforeEnd',html);}else{var r=parent.parent.document.createRange();r.selectNode(result);var t=r.createContextualFragment(html);result.appendChild(t);}}
parent.parent.document.sendmail.addrListNum.value=num;if(num==SEND_MAIL_LIMIT){parent.parent.document.sendmail.elements["to_mail[]"][0].value="";parent.parent.document.sendmail.elements["to_name[]"][0].value="";parent.parent.document.sendmail.elements["to_mail[]"][0].disabled=true;parent.parent.document.sendmail.elements["to_name[]"][0].disabled=true;}}
if(opt==0){parent.parent.GB_hide();}else{return overerr;}}
function insertAddcc(name,mailaddr,opt){var overerr=0;var SEND_MAIL_LIMIT=30;if(parent.parent.document.sendmail.addrListNum_cc.value>=SEND_MAIL_LIMIT){if(ENTRY_USE){alert('You can enter up to '+SEND_MAIL_LIMIT+' email address (Cc.).');overerr=1;}else{alert('Cc.は一回'+SEND_MAIL_LIMIT+'ヵ所までお願い致します。');overerr=1;}}else{var result=parent.parent.document.getElementById("address_list_cc");html="";html+="";html+=htmlspecialchars(name)+"("+htmlspecialchars(mailaddr)+")";do_flg=0;for(i=1;i<=parent.parent.document.sendmail.addrListNum_cc.value;i++){if(parent.parent.document.getElementById("address_cc"+i)==null){html+=""+STR_EXCLUDE+" ";html="
";if(parent.parent.document.body.insertAdjacentHTML){result.insertAdjacentHTML('BeforeEnd',html);}else{var r=parent.parent.document.createRange();r.selectNode(result);var t=r.createContextualFragment(html);result.appendChild(t);}}
parent.parent.document.sendmail.addrListNum_cc.value=num;if(num==SEND_MAIL_LIMIT){parent.parent.document.sendmail.elements["to_mail_cc[]"][0].value="";parent.parent.document.sendmail.elements["to_name_cc[]"][0].value="";parent.parent.document.sendmail.elements["to_mail_cc[]"][0].disabled=true;parent.parent.document.sendmail.elements["to_name_cc[]"][0].disabled=true;}}
if(opt==0){parent.parent.GB_hide();}else{return overerr;}}
function insertAddbcc(name,mailaddr,opt){var overerr=0;var SEND_MAIL_LIMIT=30;if(parent.parent.document.sendmail.addrListNum_bcc.value>=SEND_MAIL_LIMIT){if(ENTRY_USE){alert('You can enter up to '+SEND_MAIL_LIMIT+' destination address (Bcc.).');overerr=1;}else{alert('Bcc.は一回'+SEND_MAIL_LIMIT+'ヵ所までお願い致します。');overerr=1;}}else{var result=parent.parent.document.getElementById("address_list_bcc");html="";html+="";html+=htmlspecialchars(name)+"("+htmlspecialchars(mailaddr)+")";do_flg=0;for(i=1;i<=parent.parent.document.sendmail.addrListNum_bcc.value;i++){if(parent.parent.document.getElementById("address_bcc"+i)==null){html+=""+STR_EXCLUDE+" ";html="
";if(parent.parent.document.body.insertAdjacentHTML){result.insertAdjacentHTML('BeforeEnd',html);}else{var r=parent.parent.document.createRange();r.selectNode(result);var t=r.createContextualFragment(html);result.appendChild(t);}}
parent.parent.document.sendmail.addrListNum_bcc.value=num;if(num==10){parent.parent.document.sendmail.elements["to_mail_bcc[]"][0].value="";parent.parent.document.sendmail.elements["to_name_bcc[]"][0].value="";parent.parent.document.sendmail.elements["to_mail_bcc[]"][0].disabled=true;parent.parent.document.sendmail.elements["to_name_bcc[]"][0].disabled=true;}}
if(opt==0){parent.parent.GB_hide();}else{return overerr;}}
function send_address_num(){var SEND_MAIL_LIMIT=30;if(eval(document.sendmail.addrListNum.value)>=SEND_MAIL_LIMIT){document.sendmail.elements["to_mail[]"][0].disabled=true;document.sendmail.elements["to_name[]"][0].disabled=true;}}
function addFileSpace(flg){if(flg=="upload"){var LIMIT_VAL=30;}else if(flg=="collect"){var LIMIT_VAL=10;}
var result=document.getElementById("file_list");if(document.upload.filenum.value>=LIMIT_VAL){if(ENTRY_USE){alert('You can upload up to '+LIMIT_VAL+' files.');}else{alert('アップロードは1回'+LIMIT_VAL+'ファイル以内でお願い致します。');}}else{html="";do_flg=0;for(i=1;i<=document.upload.filenum.value;i++){if(document.getElementById("uploadfile"+i)==null){html="
';$(this).removeClass("trSelected");$(this).removeClass("trSelected2");$("input:checkbox",this).attr('checked','');++i;}else{$(this).removeClass("trSelected");$(this).removeClass("trSelected2");$("input:checkbox",this).attr('checked','');}
var chkflg=$("#checkedFlg");if(chkflg.val())$("input:checkbox[@name='addrAllCheck']").attr("checked",false);});list.append(html);}}}
function appendAddress(type){if(type=='mailer'){var addr_type=new Array('','_cc',"_bcc");}else{var addr_type=new Array('');}
var res=false;for(i=0;i0)res=true;}
if(!res){if(ENTRY_USE){alert("Please select the address.");}else{alert("アドレスを選択してください。");}
return false;}else{for(i=0;i';html+=list.html();html+='';var p_node=parent.parent.$("#address_list"+addr_type[i]);p_node.replaceWith(html);parent.parent.$("input:hidden[name=addrListNum"+addr_type[i]+"]").val($('div',list).size());}
parent.parent.GB_hide();}}
function htmlspecialchars(ch){ch=ch.replace(/&/g,"&");ch=ch.replace(/&/g,"&");ch=ch.replace(/"/g,""");ch=ch.replace(/'/g,"'");ch=ch.replace(//g,">");return ch;}
function escapeslash(ch){ch=ch.replace("'","\\'");return ch;}
function escapejavascript(ch){ch=ch.replace(/\\/g,"\\\\");ch=ch.replace(/"/g,"\\\"");ch=ch.replace(/'/g,"\\'");ch=ch.replace(/\//g,"\\/");ch=ch.replace(//g,"\x3e");ch=ch.replace(/0x0D/g,"\r");ch=ch.replace(/0x0A/g,"\n");return ch;}