a = new Array(" ","#ffffff","#ffccff","#ff99ff","#ff66ff","#ff33ff","#ff00ff","#ffffcc","#ffcccc","#ff99cc","#ff66cc","#ff33cc","#ff00cc","#ffff99","#ffcc99","#ff9999","#ff6699","#ff3399","#ff0099","#ffff66","#ffcc66","#ff9966","#ff6666","#ff3366","#ff0066","#ffff33","#ffcc33","#ff9933","#ff6633","#ff3333","#ff0033","#ffff00","#ffcc00","#ff9900","#ff6600","#ff3300","#ff0000","#ccffff","#ccccff","#cc99ff","#cc66ff","#cc33ff","#cc00ff","#ccffcc","#cccccc","#cc99cc","#cc66cc","#cc33cc","#cc00cc","#ccff99","#cccc99","#cc9999","#cc6699","#cc3399","#cc0099","#ccff66","#cccc66","#cc9966","#cc6666","#cc3366","#cc0066","#ccff33","#cccc33","#cc9933","#cc6633","#cc3333","#cc0033","#ccff00","#cccc00","#cc9900","#cc6600","#cc3300","#cc0000","#99ffff","#99ccff","#9999ff","#9966ff","#9933ff","#9900ff","#99ffcc","#99cccc","#9999cc","#9966cc","#9933cc","#9900cc","#99ff99","#99cc99","#999999","#996699","#993399","#990099","#99ff66","#99cc66","#999966","#996666","#993366","#990066","#99ff33","#99cc33","#999933","#996633","#993333","#990033","#99ff00","#99cc00","#999900","#996600","#993300","#990000","#66ffff","#66ccff","#6699ff","#6666ff","#6633ff","#6600ff","#66ffcc","#66cccc","#6699cc","#6666cc","#6633cc","#6600cc","#66ff99","#66cc99","#669999","#666699","#663399","#660099","#66ff66","#66cc66","#669966","#666666","#663366","#660066","#66ff33","#66cc33","#669933","#666633","#663333","#660033","#66ff00","#66cc00","#669900","#666600","#663300","#660000","#33ffff","#33ccff","#3399ff","#3366ff","#3333ff","#3300ff","#33ffcc","#33cccc","#3399cc","#3366cc","#3333cc","#3300cc","#33ff99","#33cc99","#339999","#336699","#333399","#330099","#33ff66","#33cc66","#339966","#336666","#333366","#330066","#33ff33","#33cc33","#339933","#336633","#333333","#330033","#33ff00","#33cc00","#339900","#336600","#333300","#330000","#00ffff","#00ccff","#0099ff","#0066ff","#0033ff","#0000ff","#00ffcc","#00cccc","#0099cc","#0066cc","#0033cc","#0000cc","#00ff99","#00cc99","#009999","#006699","#003399","#000099","#00ff66","#00cc66","#009966","#006666","#003366","#000066","#00ff33","#00cc33","#009933","#006633","#003333","#000033","#00ff00","#00cc00","#009900","#006600","#003300","#000000"," "," "," ");

function GetC(Nm) {
	if (document.fm1.ck.checked == true) {
		document.fm1.sc.value=a[Nm];
		document.fm1.sc.style.backgroundColor=a[Nm];
	}
	if (document.fm1.ckb.checked == true) {
		document.fm1.scb.value=a[Nm];
		document.fm1.scb.style.backgroundColor=a[Nm];
	}
	if (document.fm1.ckl.checked == true) {
		document.fm1.scl.value=a[Nm];
		document.fm1.scl.style.backgroundColor=a[Nm];
	}
	if (document.fm1.ckr.checked == true) {
		document.fm1.scr.value=a[Nm];
		document.fm1.scr.style.backgroundColor=a[Nm];
	}
	if (document.fm1.ckt.checked == true) {
		document.fm1.sct.value=a[Nm];
		document.fm1.sct.style.backgroundColor=a[Nm];
	}
}

function ClearTbl() {
	document.fm1.ck.checked = false;
	document.fm1.ckb.checked = false;
	document.fm1.ckl.checked = false;
	document.fm1.ckr.checked = false;
	document.fm1.ckt.checked = false;

	document.fm1.sc.value="";
	document.fm1.scb.value="";
	document.fm1.scl.value="";
	document.fm1.scr.value="";
	document.fm1.sct.value="";

	document.fm1.sc.style.backgroundColor="";
	document.fm1.scb.style.backgroundColor="";
	document.fm1.scl.style.backgroundColor="";
	document.fm1.scr.style.backgroundColor="";
	document.fm1.sct.style.backgroundColor="";

	document.fm1.bs.value="";
	document.fm1.bsb.value="";
	document.fm1.bsl.value="";
	document.fm1.bsr.value="";
	document.fm1.bst.value="";

	document.fm1.wi.value="";
	document.fm1.wib.value="";
	document.fm1.wil.value="";
	document.fm1.wir.value="";
	document.fm1.wit.value="";

	document.fm2.disp1.style.borderColor="";
	document.fm2.disp1.style.borderStyle="";
	document.fm2.disp1.style.borderWidth="";
	document.fm2.disp1.style.borderBottomColor="";
	document.fm2.disp1.style.borderBottomStyle="";
	document.fm2.disp1.style.borderBottomWidth="";
	document.fm2.disp1.style.borderLeftColor="";
	document.fm2.disp1.style.borderLeftStyle="";
	document.fm2.disp1.style.borderLeftWidth="";
	document.fm2.disp1.style.borderRightColor="";
	document.fm2.disp1.style.borderRightStyle="";
	document.fm2.disp1.style.borderRightWidth="";
	document.fm2.disp1.style.borderTopColor="";
	document.fm2.disp1.style.borderTopStyle="";
	document.fm2.disp1.style.borderTopWidth="";
	document.fm2.disp1.value="";
}

function DispTbl() {
	nsc = document.fm1.sc.value;
	nscb = document.fm1.scb.value;
	nscl = document.fm1.scl.value;
	nscr = document.fm1.scr.value;
	nsct = document.fm1.sct.value;
	nbs = document.fm1.bs.value;
	nbsb = document.fm1.bsb.value;
	nbsl = document.fm1.bsl.value;
	nbsr = document.fm1.bsr.value;
	nbst = document.fm1.bst.value;
	nwi = document.fm1.wi.value;
	nwib = document.fm1.wib.value;
	nwil = document.fm1.wil.value;
	nwir = document.fm1.wir.value;
	nwit = document.fm1.wit.value;

	str1 = "<STYLE type=\"text/css\">" + "\n";
	str2 = "<!--" + "\n";
	str3 = "TD {" + "\n";
	if (nsc != "") {
		str4 = "border-color:" + nsc + ";" + "\n";
		document.fm2.disp1.style.borderColor=nsc;
	} else {str4=""};
	if (nbs != "") {
		str5 = "border-style:" + nbs + ";" + "\n";
		document.fm2.disp1.style.borderStyle=nbs;
	} else {str5=""};
	if (nwi != "") {
		str6 = "border-width:" + nwi + ";" + "\n";
		document.fm2.disp1.style.borderWidth=nwi;
	} else {str6=""};
	if (nscb != "") {
		str7 = "border-bottom-color:" + nscb + ";" + "\n";
		document.fm2.disp1.style.borderBottomColor=nscb;
	} else {str7=""};
	if (nbsb != "") {
		str8 = "border-bottom-style:" + nbsb + ";" + "\n";
		document.fm2.disp1.style.borderBottomStyle=nbsb;
	} else {str8=""};
	if (nwib != "") {
		str9 = "border-bottom-width:" + nwib + ";" + "\n";
		document.fm2.disp1.style.borderBottomWidth=nwib;
	} else {str9=""};
	if (nscl != "") {
		str10 = "border-left-color:" + nscl + ";" + "\n";
		document.fm2.disp1.style.borderLeftColor=nscl;
	} else {str10=""};
	if (nbsl != "") {
		str11 = "border-left-style:" + nbsl + ";" + "\n";
		document.fm2.disp1.style.borderLeftStyle=nbsl;
	} else {str11=""};
	if (nwil != "") {
		str12 = "border-left-width:" + nwil + "px" + ";" + "\n";
		document.fm2.disp1.style.borderLeftWidth=nwil;
	} else {str12=""};
	if (nscr != "") {
		str13 = "border-right-color:" + nscr + ";" + "\n";
		document.fm2.disp1.style.borderRightColor=nscr;
	} else {str13=""};
	if (nbsr != "") {
		str14 = "border-right-style:" + nbsr + ";" + "\n";
		document.fm2.disp1.style.borderRightStyle=nbsr;
	} else {str14=""};
	if (nwir != "") {
		str15 = "border-right-width:" + nwir + ";" + "\n";
		document.fm2.disp1.style.borderRightWidth=nwir;
	} else {str15=""};
	if (nsct != "") {
		str16 = "border-top-color:" + nsct + ";" + "\n";
		document.fm2.disp1.style.borderTopColor=nsct;
	} else {str16=""};
	if (nbst != "") {
		str17 = "border-top-style:" + nbst + ";" + "\n";
		document.fm2.disp1.style.borderTopStyle=nbst;
	} else {str17=""};
	if (nwit != "") {
		str18 = "border-top-width:" + nwit + ";" + "\n";
		document.fm2.disp1.style.borderTopWidth=nwit;
	} else {str18=""};
	str19 = "}" + "\n";
	str20 = "-->" + "\n" + "</STYLE>";
	document.fm2.disp1.value=str1 + str2 + str3 + str4 + str5 + str6 + str7 + str8 + str9 + str10 + str11 + str12 + str13 + str14 + str15 + str16 + str17 + str18 + str19 + str20;

}
