function WinOpenN(){
	var Win_H = (screen.height - 60);
	if (Win_H == 0){Win_H = 650;}
	var Parm = 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,resizable=yes,scrollbars=yes,dependent=yes,'+
				'top=0,left=0,width=790,height='+Win_H;
	var NextWin = window.open("","QRmake",Parm);
	NextWin.focus();
	document.f1.submit();

	return true;
}

function sel_set1(){
	var Wobjct = document.f1.incol;
	document.f1.incol1.value = Wobjct.options[Wobjct.selectedIndex].value;
	col_set1();
}

function col_set1(){
	var Wobjct = document.f1.incol;
	var Wcolor = document.f1.incol1.value;
	var Wcolor1 = document.f1.incol1.value.substr(0,1);
	var Wcolor2 = document.f1.incol1.value.substr(1);
	var Wcolor2n= Wcolor2.match(/[0-9A-F]+/gi)+'';
	if ((Wcolor2 != Wcolor2n)||(Wcolor2n.length!=6)){
		alert("入力の背景色が正しくありません。0～9,A～Fの6桁で入力してください。");
	}
	var wid = document.all.sample_col;
	for (var i=0; i<wid.length ; i++) {
		wid[i].style.backgroundColor = Wcolor;
	}
}

function sel_set2(){
	var Wobjct = document.f1.inbcol;
	document.f1.inbcol1.value = Wobjct.options[Wobjct.selectedIndex].value;
	col_set2();
}

function col_set2(){
	var Wobjct = document.f1.inbcol;
	var Wcolor = document.f1.inbcol1.value;
	var Wcolor1 = document.f1.inbcol1.value.substr(0,1);
	var Wcolor2 = document.f1.inbcol1.value.substr(1);
	var Wcolor2n= Wcolor2.match(/[0-9A-F]+/gi)+'';
	if ((Wcolor2 != Wcolor2n)||(Wcolor2n.length!=6)){
		alert("入力の背景色が正しくありません。0～9,A～Fの6桁で入力してください。");
	}
	var wid = document.all.sample_bcol;
	for (var i=0; i<wid.length ; i++) {
		wid[i].style.backgroundColor = Wcolor;
	}
}

function scol_set(){
	var Wtxt=document.f1.overstr.value;
	var Wcolor=document.f1.infcol1.value;
	document.getElementById('id_scl_sample').innerHTML ='<B><FONT color="'+Wcolor+'">'+Wtxt+'</FONT></B>';
}

function cre_way(wArgKbn){
	// 文字列
	if ((wArgKbn == "CLEAR")||(wArgKbn == "COMBI")){
		document.all.id_instr.style.backgroundColor = "";
		document.all.id_instr.style.border="";
		document.all.id_ginstr.style.display='none';
	}else{
		document.all.id_instr.style.backgroundColor = "#ffffaa";
		document.all.id_instr.style.border='solid 2px #0000ff';
		document.all.id_ginstr.style.display='block';
	}
	// 色
	if (wArgKbn == "COLOR"){
		document.all.id_color.style.backgroundColor = "#ffffaa";
		document.all.id_color.style.border='solid 2px #0000ff';
		document.all.id_gcolor.style.display='block';
	}else{
		document.all.id_color.style.backgroundColor = "";
		document.all.id_color.style.border="";
		document.all.id_gcolor.style.display='none';
	}
	// 重ね文字
	if (wArgKbn == "STRING"){
		document.all.id_overstr.style.backgroundColor = "#ffffaa";
		document.all.id_overstr.style.border='solid 2px #0000ff';
		document.all.id_goverstr.style.display='block';
	}else{
		document.all.id_overstr.style.backgroundColor = "";
		document.all.id_overstr.style.border="";
		document.all.id_goverstr.style.display='none';
	}
	// 重ね画像
	if (wArgKbn == "IMAGE"){
		document.all.id_overimage.style.backgroundColor = "#ffffaa";
		document.all.id_overimage.style.border='solid 2px #0000ff';
		document.all.id_goverimage.style.display='block';
	}else{
		document.all.id_overimage.style.backgroundColor = "";
		document.all.id_overimage.style.border="";
		document.all.id_goverimage.style.display='none';
	}
	// 作成ボタン
	if ((wArgKbn == "CLEAR")||(wArgKbn == "COMBI")){
		document.all.id_crebt.style.backgroundColor = "";
		document.all.id_crebt.style.border="";
		document.all.id_gcrebt.style.display='none';
	}else{
		document.all.id_crebt.style.backgroundColor = "#ffffaa";
		document.all.id_crebt.style.border='solid 2px #0000ff';
		document.all.id_gcrebt.style.display='block';
	}

	var wMid="";
	var wImg=""
	var wMsg="";
	switch ( wArgKbn ) {
	case "BLACK":
		wMid='白黒'; 
		wMsg='「作成する文字列」を入力し、作成ボタンをクリックしてください。<BR>必要に応じ、他の入力も組み合わせできます。'; 
		wImg='<IMG src="image/colorBK.jpe" width="99" height="99" border="0">'; 
		break;
	case "COLOR":
		wMid='カラフル'; 
		wMsg='「作成する文字列」を入力し、「セル色」「背景色」を「変更」ボタンより選択してください。<BR>他の入力も組み合わせできます。'; 
		wImg='<IMG src="image/colorQr.png" width="99" height="99" border="0">'; 
		break;
	case "STRING":
		wMid='文字重ね'; 
		wMsg='「作成する文字列」と「重ね合せる文字」を入力し、「文字色」「サイズ」「位置」を「変更」ボタンより選択してください。<BR>他の入力も組み合わせできます。'; 
		wImg='<IMG src="image/strpos_MM.png" width="99" height="99" border="0">'; 
		break;
	case "IMAGE":
		wMid='画像重ね'; 
		wMsg='「作成する文字列」を入力し、重ね合わせる「画像」「位置」を「変更」ボタンより選択してください。<BR>他の入力も組み合わせできます。'; 
		wImg='<IMG src="image/photo1.png" width="99" height="99" border="0">'; 
		break;
	case "COMBI":
		wMid='組み合わせ'; 
		wMsg='下記の各入力、選択でいろいろなQRコードを作成できます。<BR>お好みに応じいろいろな組み合わせを試して見てください。'; 
		wImg='<IMG src="image/kumiawase.png" width="99" height="99" border="0">'; 
		break;
	case "CLEAR":
		break;
	}
	if (wMid != '')	{
		document.getElementById('id_waymid').innerHTML ='<B>'+wMid+'<BR>QRコード<BR>作成方法</B>';
		document.getElementById('id_waymid').style.backgroundColor="#bbffbb";
		document.getElementById('id_wayimg').innerHTML =wImg; 
		document.getElementById('id_wayimg').style.backgroundColor="#d2ffd2";
		document.getElementById('id_waystr').innerHTML ='<B>'+wMsg+'</B>'; 
		document.getElementById('id_waystr').style.backgroundColor="#d2ffd2";
	}else{
		document.getElementById('id_waymid').innerHTML ='';
		document.getElementById('id_waymid').style.backgroundColor="";
		document.getElementById('id_wayimg').innerHTML =''; 
		document.getElementById('id_wayimg').style.backgroundColor="";
		document.getElementById('id_waystr').innerHTML =''; 
		document.getElementById('id_waystr').style.backgroundColor="";
	}
}

