<input type="button" name="S1" value="14-必要なデータのインポート" onclick="ShowPage(1)">
<input type="button" name="S2" value="オブジェクト削除その他" onclick="ShowPage(2)">
<input type="button" name="S3" value="オブジェクト削除PK" onclick="ShowPage(3)">
<input type="button" name="S4" value="encode1" onclick="ShowPage(4)">
<input type="button" name="S5" value="encode2" onclick="ShowPage(5)">

<br>
<input type="button" name="S6" value="書き込み" onclick="WritePage()">
<input type="text" name="Save" value="" size="120">

<script>

function WritePage()
{
	var fso, f, r
	var ForReading = 1, ForWriting = 2;
	fso = new ActiveXObject("Scripting.FileSystemObject")
	f = fso.OpenTextFile(document.all.Save.value, 2, true)
	f.Write(parent.main.document.all.tags("BODY")[0].innerText);
	f.Close();


}

function ShowPage(i)
{
	var wfile, dir, tmpdir;
	dir = "C:\\Documents and Settings\\yamazaki\\デスクトップ\\SFCAPP\\Sj4web";

	var fso, f, fc, s;
	fso = new ActiveXObject("Scripting.FileSystemObject");
	f = fso.GetFolder(dir);
	fc = new Enumerator(f.SubFolders);

	for (; !fc.atEnd(); fc.moveNext())
	{
		tmpdir = fc.item();
	}

	wfile = tmpdir + "\\file\\sj3dbmake\\"


	switch(i)
	{
		case 1:
			parent.main.location.href="template-" + document.all["S" + i].value + ".asp";
			document.all.Save.value = wfile + document.all["S" + i].value + ".bat";
		break;
		case 2:
		case 3:
			parent.main.location.href="template-" + document.all["S" + i].value + ".asp";
			document.all.Save.value = wfile + document.all["S" + i].value + ".sql";
		break;
		case 4:
		case 5:
			parent.main.location.href="template-" + document.all["S" + i].value + ".asp";
			document.all.Save.value = "G:\\" + document.all["S" + i].value + ".bat";
		break;


	}


}
</script>