
function checkBrowser(){var uAnt=navigator.userAgent;if(uAnt.indexOf("Safari")> -1)return"SF";if(uAnt.indexOf("Opera")> -1)return"OP";if(uAnt.indexOf("Firefox")> -1)return"FF";if(uAnt.indexOf("MSIE")> -1)return"IE";if(document.layers)return"NN4";if(document.getElementById&&!document.all)return"NN6";return"OT";}
function versionCheck(){return navigator.userAgent;}
function mailSave_Send(mode){thisMovie("RImain").mailReload(mode);}
function thisMovie(movieName){if(navigator.appName.indexOf("Microsoft")!= -1){return window[movieName]}
else{return document[movieName]}}
function MailPrint(){parent.prints.focus();parent.prints.print();}
function jsFunction(code){document.getElementById("MailBody").innerHTML=code}
function on_loadedXML(oj){var res=oj.responseXML
var resText=oj.responseText
var bomailbody = true
var bodyMode;
var bbodycut = 0;
var tex="";var errorXML=res.getElementsByTagName("errormessage")
if(errorXML[0]!=null){tex=errorXML[0].firstChild.nodeValue}else{var resXML=res.getElementsByTagName("body")
var edithtmlXML=res.getElementsByTagName("edithtml")
bodyMode=res.getElementsByTagName("bodymode");bbodycut=res.getElementsByTagName("bodycut");
if(edithtmlXML[0]!=null){tex=edithtmlXML[0].firstChild.nodeValue}else if(resXML[0]!=null && resXML[0].firstChild){tex=resXML[0].firstChild.nodeValue;
if (bodyMode[0].firstChild.nodeValue!=2){
tex=tex.split("<").join("&lt;").split(">").join("&gt;")
tex=tex.split("\r\n").join("<br>").split("\r").join("<br>").split("\n\n").join("<br>").split("\n").join("<br>")
}
}else{bomailbody=false}}
if (bomailbody) {
if(tex==""){temp=resText.split("<edithtml><![CDATA[")[1].split("]]></edithtml>")[0]
if(temp==""){tex=resText.split("<body><![CDATA[")[1].split("]]></body>")[0]}else{tex=temp}}}
if (bbodycut[0].firstChild.nodeValue==1){tex=tex+"<br><br>"+"<font color=\"red\">...表示サイズを超えたので切り捨てました</font>";}
document.getElementById("MailBody").innerHTML=tex}
function loadFile(url,PostData,bencode){sendRequest(on_loadedXML,PostData,'POST',url,true,true,bencode)}
function ServerCommandSet(CommandVal){if(ServarType=="WIN"){return	CommandVal+".exe"}else{return	CommandVal+".cgi"}}
function getFlashObj(name){if(document.all)
return document.all[name];else if(document.layers){return document[name];}
else{alert("対応していないブラウザです");return null;}}
function RImain_DoFSCommand(command,args){if(command=="BodySet"){args=args.split("\n")
args=args.join("<br>")
document.getElementById("MailBody").innerHTML=args}}
function resizeToLAYER(layName,Width,Height,Y,X){Width=Width+16
if(navigator.userAgent.search("Opera(\ |\/)6")!= -1){document.getElementById(layName).style.pixelWidth=Width
document.getElementById(layName).style.pixelHeight=Height
document.getElementById(layName).style.left=X
document.getElementById(layName).style.top=Y}else if(document.getElementById){document.getElementById(layName).style.width=Width+'px'
document.getElementById(layName).style.height=Height+'px'
document.getElementById(layName).style.left=X+'px'
document.getElementById(layName).style.top=Y+'px'}else if(document.all){document.all(layName).style.pixelWidth=Width
document.all(layName).style.pixelHeight=Height
document.all(layName).style.left=X
document.all(layName).style.top=Y}else if(document.layers){document.layers[layName].resizeTo(Width,Height)}}
function ShowHide(layName,Vis){if(document.all)document.all(layName).style.visibility=Vis
else if(document.layers)document.layers[layName].visibility=Vis
else if(document.getElementById)
document.getElementById(layName).style.visibility=Vis;}
function TextDataAdd(TextName,Val){document.form[TextName].value+=Val}
function MM_reloadPage(init){if(init==true)with(navigator){if((appName=="Netscape")&&(parseInt(appVersion)==4)){document.MM_pgW=innerWidth;document.MM_pgH=innerHeight;onresize=MM_reloadPage;}}
else if(innerWidth!=document.MM_pgW||innerHeight!=document.MM_pgH)location.reload();}
MM_reloadPage(true);function MailPopup(URL){Wid=650
Hei=600
mailWindow=window.open(URL,"mail","width="+Wid+",height="+Hei+",scrollbars=yes,resizable=yes,status=no");mailWindow.focus();}
PopupWindow=new Array()
function MailPopup2(URL,Wid,Hei){window.open(URL,"","width="+Wid+",height="+Hei+",scrollbars=yes,resizable=yes");}
function WindowPopup(URL,Wid,Hei,windowName){PopupWindow[windowName]=window.open(URL,windowName,"width="+Wid+",height="+Hei+",scrollbars=no,resizable=no,status=no");PopupWindow[windowName].focus();}
function WinPopup(URL,Name,Wid,Hei){PopupWindow[Name]=window.open(URL,Name,"width="+Wid+",height="+Hei+",scrollbars=yes,resizable=yes,status=no");PopupWindow[Name].focus();}
function WinPopupOpener(URL,Name,Wid,Hei){window.opener.WinPopup(URL,Name,Wid,Hei)}
function WinClose(windowName){PopupWindow[windowName].close();}

function chkAjaBrowser()
{var a,ua=navigator.userAgent;this.bw={safari:((a=ua.split('AppleWebKit/')[1])?a.split('(')[0]:0)>=124,konqueror:((a=ua.split('Konqueror/')[1])?a.split(';')[0]:0)>=3.3,mozes:((a=ua.split('Gecko/')[1])?a.split(" ")[0]:0)>=20011128,opera:(!!window.opera)&&((typeof XMLHttpRequest)=='function'),msie:(!!window.ActiveXObject)?(!!createHttpRequest()):false}
return(this.bw.safari||this.bw.konqueror||this.bw.mozes||this.bw.opera||this.bw.msie)}
function createHttpRequest()
{if(window.ActiveXObject){try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){return null;}}}else if(window.XMLHttpRequest){return new XMLHttpRequest();}else{return null;}}
function sendRequest(callback,data,method,url,async,sload,user,password,bisencode)
{var oj=createHttpRequest();if(oj==null)return null;var sload=(!!sendRequest.arguments[5])?sload:false;
if(sload||method.toUpperCase()=='GET')url+="?";if(sload)url=url+"t="+(new Date()).getTime();var bwoj=new chkAjaBrowser();
var opera=bwoj.bw.opera;var safari=bwoj.bw.safari;var konqueror=bwoj.bw.konqueror;var mozes=bwoj.bw.mozes;
if(opera||safari||mozes){oj.onload=function(){callback(oj);}}else{oj.onreadystatechange=function(){if(oj.readyState==4){callback(oj);
}}}if (bisencode==false)
data=uriEncode(data)
if(method.toUpperCase()=='GET'){url+=data}
oj.open(method,url,async,user,password);setEncHeader(oj)
oj.send(data);function setEncHeader(oj){var contentTypeUrlenc='application/x-www-form-urlencoded; charset=UTF-8';if(!window.opera){oj.setRequestHeader('Content-Type',contentTypeUrlenc);}else{if((typeof oj.setRequestHeader)=='function')
oj.setRequestHeader('Content-Type',contentTypeUrlenc);}
return oj}
function uriEncode(data){if(data!=""){var encdata='';var datas=data.split('&');for(i=1;i<datas.length;i++)
{var dataq=datas[i].split('=');encdata+='&'+encodeURIComponent(dataq[0])+'='+encodeURIComponent(dataq[1]);}}else{encdata="";}
return encdata;}
return oj}
