<%@ LANGUAGE="Jscript" %>
<%Response.Expires=-1;Response.AddHeader("Pragma","No-Cache");%>
<!--#include file="../../Include/CODE.INC"-->
<!--#include file="../../Include/ADOJS.INC"-->

<%path="";pcnt=0;
if(Request("pcnt").Count){
	pcnt=Request("pcnt");
}
if(Request("pathList").Count){
	if(Request("BOPT").Count && Request("BOPT")=="1"){
		editPath = new String(Request("pathList"));
		indx=editPath.lastIndexOf(",");
		path=editPath.substring(0,indx);
	}
	else{
		path=Request("pathList");
	}
}
else{
	path=Request("pathList");
} %>
<SCRIPT LANGUAGE="JavaScript">
<!--
strPath="http://"+document.location.host+"/jmss_web/jmenu/top/";
//-->
</SCRIPT>
<!--original form-->
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>JMenu</title>
<link rel="stylesheet" type="text/css" href="../../include/jmss.css">
<script src="../../include/functions.js"></script>
</head>

<!--body class="data" style="background: #000080"-->

<%Patt=1;%>
<!--#include file="../../Include/Security.INC"-->
<script>
//stock menu path
nestcnt=<%=pcnt%>;
u_list="<%Response.Write(path);//if(path.length){Response.Write(path);}//else{Response.Write("''");}%>";

aok=0;
function array(){
	this.length = array.arguments.length;
	if(this.length)
		aok=1;
	for(var i=0; i<this.length; i++){
		this[i] = array.arguments[i];
	}
}
path = new array(<%Response.Write(path);//if(path.length){Response.Write(path);}else{Response.Write("''");}%>);

function MakeArray(size){

	this.length = size;
	for(i = 1; i <= size; i++){
		this[i] = null;
	}
	return this

}
function Param(jque,jname,jpath,jpara,jexec,jelap,jptyp,jsout,jofil){
	
	this.queu = jque;
	this.name = jname;
	this.path = jpath;
	this.para = jpara;
	this.exec = jexec;
	this.elap = jelap;
	this.ptyp = jptyp;
	this.sout = jsout;
	this.ofil = jofil;

}
//alert("pathinfo=<%=Session("pathinfo")%>PATH_INFO=<%=Request.ServerVariables("PATH_INFO")%>\nPATH_TRANSLATED=<%=Request.ServerVariables("PATH_TRANSLATED")%>\nURL=<%=Request.ServerVariables("URL")%>\n");
</script>

<%
	var stup_mnu="";
	var bgc_r="255";
	var bgc_g="255";
	var bgc_b="255";
	var b_sz_h=100;
	var b_sz_w=100;
	var b_lpart=3; //01.01.29 񒆃{^ɕύX
//	var b_int_lr=32;
//	var b_int_ud=32;
	var bgc_rgb = 0;
	var dlg_dsp = 0;//01.04.04 Dialog On/Off
//ȉDBA
	user_id=lgonuser;//01.02.06 
	connectDB = Server.CreateObject("ADODB.Connection");
	connectDB.Open(Const_ConStr);
	sql = "";
    sql = "select * from jmss_jmenu";
    sql += " where USER_ID='";
    sql += user_id;
    sql += "'";
    sql += " and SERVER_ID='";
    sql += jsrvDef;
    sql += "'";
    sql += " and DEL_FLG=1";
    rsUser = Server.CreateObject("ADODB.Recordset");
    rsUser.Open(sql, connectDB, adOpenStatic, adLockReadOnly);

    if(rsUser.RecordCount >= 1){
		getflg = 1;
		stup_mnu=rsUser("STARTUP_MNU");
		bgc_r=rsUser("BGCOLOR_R");
		bgc_g=rsUser("BGCOLOR_G");
		bgc_b=rsUser("BGCOLOR_B");
		b_sz_h=rsUser("BUTTON_SZ_H");
		b_sz_w=rsUser("BUTTON_SZ_W");
		b_lpart=rsUser("BUTTON_LPART"); //01.01.29 񒆃{^ɕύX
//		b_int_lr=rsUser("BUTTON_INT_LR");
//		b_int_ud=rsUser("BUTTON_INT_UD");
		dlg_dsp=rsUser("START_CHECK");//01.04.04 Dialog On/Off
	}

	bgc_rgb = ( parseInt(bgc_r,10) * ( 256 * 256 ) ) + ( parseInt(bgc_g,10) * 256 ) + parseInt(bgc_b,10);
	j6wbm = Server.CreateObject("JWBMInit.InitInst.1");
	jwbmmenu = Server.CreateObject("JWBMMenu.Menu.1");
	j6wbm.PathConv(Session("pathinfo"),"","0");//01.01.19
//	j6wbm.PathConv(Request.ServerVariables("PATH_TRANSLATED"),Request.ServerVariables("PATH_INFO"),"0");
//01.02.08
	agent_typ=2;//01.03.19 NN default
//	agent_typ=0;
   	str1 = "Netscape6";
   	str11 = "IE";//01.03.19
	str2 = new String(Request.ServerVariables("HTTP_USER_AGENT"));
	if(str2.indexOf(str1)>=0)
		agent_typ=1;
	if(str2.indexOf(str11)>=0)agent_typ=0;//01.03.19
	jwbmmenu.JmwReadFiles(Request("UNM"),bgc_rgb,b_sz_h,b_sz_w,b_lpart,"0",agent_typ,jsrvDef,lgonuser,j6wbm.PathTrans);
	mstatus=jwbmmenu.resultCode;
	if(mstatus==0){
		Response.Write(jwbmmenu.resultJMW);
%>

<script>
function initFormset(theForm,objJInfo){
	bin_cod="0123456789";
	dlg_dsp=0<%=dlg_dsp%>;//01.04.04 Dialog On/Off

	var webType =1;
	if(navigator.appName.charAt(0)=="N")
		webType=0;
	for(cct=0;cct<theForm.elements[0].value.length;cct++){
		for(ict=0;ict<bin_cod.length;ict++){
			if(theForm.elements[0].value.charAt(cct)==bin_cod.charAt(ict)){
				break;
			}
		}
		if(ict>=bin_cod.length){
			alert("ȊO̓͂łB");
			return false;
		}
   	}
	jno = theForm.elements[0].value;
	if((jno == 0) || (jno > objJInfo.length)){
		alert("݂ȂƖACRԍłB");
		return false;
	}
	else{
//01.03.24
		strname="";
		place=0;
		while(objJInfo[jno].name.indexOf("&quot;",place)!=-1){
			strname+=objJInfo[jno].name.substring(place,objJInfo[jno].name.indexOf("&quot;",place));
			strname+="\"";
			place+=objJInfo[jno].name.indexOf("&quot;",place)+6;
		}
		if(strname.length){
			strname+=objJInfo[jno].name.substring(objJInfo[jno].name.lastIndexOf("&quot;")+6,objJInfo[jno].name.length);
		}
		else{
			strname+=objJInfo[jno].name;
		}
		theForm.elements[2].value = strname;
//		theForm.elements[2].value = objJInfo[jno].name;
		strOut = theForm.elements[2].value;
		strOut += "N܂H";
		if(objJInfo[jno].path.indexOf(".jmn")==-1){
//01.04.04
			if( dlg_dsp==0 ){
//
			if( confirm(strOut)==true ){
				theForm.elements[1].value = objJInfo[jno].queu;
				theForm.elements[3].value = objJInfo[jno].path;
				theForm.elements[4].value = objJInfo[jno].para;
				theForm.elements[5].value = objJInfo[jno].exec;
				theForm.elements[6].value = objJInfo[jno].elap;
				theForm.elements[7].value = objJInfo[jno].ptyp;
				theForm.elements[8].value = objJInfo[jno].sout;
				theForm.elements[9].value = objJInfo[jno].ofil;
				theForm.elements[12].value = "<%=Request("UNM")%>";//01.04.18
//01.02.03
				theForm.action=document.location;
				if(0>theForm.action.indexOf("asp"))
				{//01.04.18
					theForm.action+="default.asp";
//
					theForm.action+="?pcnt=<%=pcnt%>&pathList=<%=path%>";//01.04.18
				}//01.04.18
				theForm.target="compocontents";
//01.04.12
				window.open(strPath+"menu.asp?UNM=<%=Request("UNM")%>&pcnt=<%=pcnt%>&pathList=<%=path%>","menu");//reload
//
				return true;
			}
			else
				return false;
//01.04.04
			}
			else{
				theForm.elements[1].value = objJInfo[jno].queu;
				theForm.elements[3].value = objJInfo[jno].path;
				theForm.elements[4].value = objJInfo[jno].para;
				theForm.elements[5].value = objJInfo[jno].exec;
				theForm.elements[6].value = objJInfo[jno].elap;
				theForm.elements[7].value = objJInfo[jno].ptyp;
				theForm.elements[8].value = objJInfo[jno].sout;
				theForm.elements[9].value = objJInfo[jno].ofil;
				theForm.elements[12].value = "<%=Request("UNM")%>";//01.04.18
				theForm.action=document.location;
				if(0>theForm.action.indexOf("asp"))
				{//01.04.18
					theForm.action+="default.asp";
					theForm.action+="?pcnt=<%=pcnt%>&pathList=<%=path%>";//01.04.18
				}//01.04.18
				theForm.target="compocontents";
//01.04.12
				window.open(strPath+"menu.asp?UNM=<%=Request("UNM")%>&pcnt=<%=pcnt%>&pathList=<%=path%>","menu");//reload
//
				return true;
			}
//
		}
		else{
			theForm.elements[10].value = "0";
//01.03.24
			afterstr="";
			for(ic=0;ic<objJInfo[jno].path.length;ic++){
				if(objJInfo[jno].path.charAt(ic)=="&")
					afterstr+="<";
				else if(objJInfo[jno].path.charAt(ic)=="+")
					afterstr+=">";
//01.04.02 %ǉ
				else if(objJInfo[jno].path.charAt(ic)=="%")
					afterstr+="*";
//
				else
					afterstr+=objJInfo[jno].path.charAt(ic);
			}
//
//stock menu path export
			addUnm(afterstr);
			if(nestcnt>=9){
				alert("8Kw𒴂郁j[̑Jڂ͂ł܂B");
				return false;
			}
//01.04.18
			theForm.elements[12].value = afterstr;
			theForm.action=strPath+"default.asp"
//
//			if(webType==1){
//				theForm.action="default.asp?";
//				theForm.action+="UNM=";
//				theForm.action+=afterstr;
//				theForm.action+=objJInfo[jno].path;
//			}
			theForm.action+="?pcnt="+nestcnt+"&pathList="+u_list;//01.04.18
//alert(theForm.action);
			theForm.target="compocontents";
//01.04.12
			window.open(strPath+"menu.asp?UNM="+afterstr+"&pcnt="+nestcnt+"&pathList="+u_list,"menu");//reload
//
			return true;
		}
	}
}

function addUnm(strChr){
	if(u_list.length){
		u_list+=",'"+strChr+"'";
	}
	else{
		u_list="'"+strChr+"'";
	}
	nestcnt++;
	return;

}

var webType =1;
if(navigator.appName.charAt(0)=="N")
//01.03.19
{
//
	webType=0;
//01.03.19
	if(navigator.appVersion.charAt(0)>=5)
		webType=2;
}
//
</script>

  <!-- main -->
  <table border="0" width="100%" cellspacing="0" cellpadding="4">
    <tr>
<script>
		var remand = Bt_Part;
		var i=0;
		for(i=1;i<jobInfo.length+1;i++){
			document.writeln("<TD align=\"center\">");
			if(jobInfo[i].path.indexOf(".jmn")!=-1 && webType==0){
				act_str="default.asp?";
				act_str+="UNM=";
//01.03.24
				afterstr="";
				for(ic=0;ic<jobInfo[i].path.length;ic++){
					if(jobInfo[i].path.charAt(ic)=="&")
						afterstr+="<";
					else if(jobInfo[i].path.charAt(ic)=="+")
						afterstr+=">";
//01.04.02 %ǉ
					else if(jobInfo[i].path.charAt(ic)=="%")
						afterstr+="*";
//
					else
						afterstr+=jobInfo[i].path.charAt(ic);
				}
				act_str+=afterstr;
//				act_str+=jobInfo[i].path;
//
				document.writeln("<FORM METHOD=\"POST\" ACTION=\""+act_str+"\" onSubmit=\"return initFormset(this,jobInfo)\">");
			}
			else
				document.writeln("<FORM METHOD=\"POST\" onSubmit=\"return initFormset(this,jobInfo)\">");
			document.writeln("<TABLE>");
    		document.writeln("<TR><TD>");
  			document.write("<INPUT TYPE=\"hidden\" NAME=\"JOB_NO\" VALUE=\""+""+i+"\">");
	    	document.write("<INPUT TYPE=\"hidden\" NAME=\"QUEUE\" VALUE=\"\">");
	    	document.write("<INPUT TYPE=\"hidden\" NAME=\"NAME\" VALUE=\"\">");
	    	document.write("<INPUT TYPE=\"hidden\" NAME=\"PATH\" VALUE=\"\">");
	    	document.write("<INPUT TYPE=\"hidden\" NAME=\"PARAMETER\" VALUE=\"\">");
	    	document.write("<INPUT TYPE=\"hidden\" NAME=\"EXECDIR\" VALUE=\"\">");
	    	document.write("<INPUT TYPE=\"hidden\" NAME=\"ELAPSE\" VALUE=\"\">");
	    	document.write("<INPUT TYPE=\"hidden\" NAME=\"PTYPE\" VALUE=\"\">");
	    	document.write("<INPUT TYPE=\"hidden\" NAME=\"STDOUT\" VALUE=\"\">");
	    	document.write("<INPUT TYPE=\"hidden\" NAME=\"STDFILE\" VALUE=\"\">");
	    	document.write("<INPUT TYPE=\"hidden\" NAME=\"RETRY\" VALUE=\"1\">");
			document.write("<INPUT TYPE=\"hidden\" NAME=\"DLGTYP\" VALUE=\"1\">");
			document.write("<INPUT TYPE=\"hidden\" NAME=\"UNM\" VALUE=\"\">");//01.04.18
			document.write("<INPUT TYPE=\"IMAGE\" SRC=\"../../Image/JMenu/"+UserDir+FileName+"JB"+""+i+".gif\" BORDER=\"0\" NAME=\""+jobInfo[i].name+"\" ALT=\""+jobInfo[i].name+"\">");
	    	document.writeln("</TD></TR>");
	  		document.writeln("</TABLE>");
			document.writeln("</FORM>");
			document.writeln("</TD>");
			if(remand<i+1){
				document.writeln("<TR>");
				document.writeln("</TR>");
				remand = i+Bt_Part;
			}
		}
//	}
</script>
    </tr>
  </table>
</form>

<%
	}
	else{
		if(mstatus==6){
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
var FileName = "JDefault";
var Bt_Part = 0;
document.writeln("<FONT COLOR='#FF0000' SIZE='5'>\j[o^Ă܂B<BR></FONT>");
document.writeln("<BR><FONT COLOR='#0000ff' SIZE='3'>T[oݒ肩烆[Uݒ聨j[o^<BR></FONT>");
document.writeln("<FONT COLOR='#0000ff' SIZE='3'>\j[t@Co^ĂB<BR></FONT>");
//document.writeln("<FONT COLOR='#FF0000' SIZE='5'>j[o^Ă܂B<BR><BR></FONT>");
//document.writeln("<FONT COLOR='#0000ff' SIZE='3'>T[oݒ肩烆[Uݒ聨j[o^<BR></FONT>");
//document.writeln("<FONT COLOR='#0000ff' SIZE='3'>\j[t@C̓o^mFĂB<BR></FONT>");
//document.writeln("<FONT COLOR='#0000ff' SIZE='3'>t@Co^ĂꍇAڑɃj[<BR></FONT>");
//document.writeln("<FONT COLOR='#0000ff' SIZE='3'>݂邩mFĂB<BR></FONT>");
//-->
</SCRIPT>
<%
		}else{
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
var FileName = "JDefault";
var Bt_Part = 0;
document.writeln("<FONT COLOR='#FF0000' SIZE='5'>j[ǂݍ߂܂B<BR></FONT>");
document.writeln("<BR><FONT COLOR='#0000ff' SIZE='3'>T[oɃj[݂邩mFĂB<BR></FONT>");
//document.writeln("<FONT COLOR='#FF0000' SIZE='5'>j[쐬Ă܂B<BR><BR></FONT>");
//document.writeln("<FONT COLOR='#0000ff' SIZE='3'>T[oݒ肩烆[Uݒ聨j[o^<BR></FONT>");
//document.writeln("<FONT COLOR='#0000ff' SIZE='3'>\j[t@C̓o^mFĂB<BR></FONT>");
//document.writeln("<FONT COLOR='#0000ff' SIZE='3'>t@Co^ĂꍇAڑɃj[<BR></FONT>");
//document.writeln("<FONT COLOR='#0000ff' SIZE='3'>݂邩mFĂB<BR></FONT>");
//-->
</SCRIPT>
<%
		}
	}
//  rsUser.Close();//DBA
%>
<% } %>
</body>

</html>
