// listtype = Á¾·ù (RB: ¶óµð¿À¹öÆ°, SB: ¼¿·ºÆ®¹Ú½º, CB: Ã¼Å©¹Ú½º)
// arr = new Array('A|hana|B', 'A|hana|B'); ÀÌ·±½ÄÀ¸·Î ±¸¼º (value, name)
function makeSearchOption(strListType, arr, strClickValue, strOptionName, strClickEvent) 
{
	var tmpStr;

	for(var i=0; i<arr.length; i++){
		tmpStr = arr[i].split("|");
		tmplen = tmpStr.length;
		str = "";

		switch(strListType)
		{
			// ¶óµð¿À¹öÆ°
			case "RB" :
				if(tmpStr[0] == strClickValue)
					str =" checked";	
				document.write("<input type=radio name='" + strOptionName +"' value='" + tmpStr[0] +"' " + str +" " + strClickEvent + ">" + tmpStr[1] + "</option>");
				break;
			// ¼¿·ºÆ®¹Ú½º
			case "SB" :
				if (i == 0) {
					document.write("<select name='" + strOptionName +"' class='select' " + strClickEvent + ">");
					document.write("<option value=''>- " + strClickValue +" -</option>");
				}
				document.write("<option value='" + tmpStr[0] + "' >" + tmpStr[1] + "</option>");
				if (i == arr.length-1) 
					document.write("</select> ");
				break;

			// Ã¼Å©¹Ú½º
			case "CB" :
				document.write("<input type=checkbox name='" + strOptionName +"' value='" + tmpStr[0] +"' " + str +" " + strClickEvent + ">" + tmpStr[1] + "</option>");
				break;
		}
	}

}

function makeSearchOption2(strListType, arr, strAll, strClickValue, strOptionName, strClickEvent, strCondition) 
{
	var tmpStr;

	var tmpArCondition;
	var tmpMatchFlag = true;
	var tmpSelectKind = "select";

	if ( (strListType == "RB") || (strListType == "CB"))
		document.write("<table width=100%  ><tr>");

	if (strCondition != "")
		tmpArCondition = strCondition.split("|");

	for(var i=0; i<arr.length; i++){
		tmpStr = arr[i].split("|");
		tmplen = tmpStr.length;
		str = "";

		if (( (strListType == "RB") || (strListType == "CB")) && (i%parseInt(strCondition) == 0))
			document.write("</tr><tr>");

		switch(strListType)
		{
			// ¼¿·ºÆ®¹Ú½ºÂªÀº°Å
			case "SBS" :
				tmpSelectKind = "select_s";
				break;
			// ¼¿·ºÆ®¹Ú½º
			case "SB" :
				tmpSelectKind = "select";
				break;
			// ¼¿·ºÆ®¹Ú½º (Áß°£)
			case "SBM" :
				tmpSelectKind = "select_m";
				break;
			// ¼¿·ºÆ®¹Ú½º (³»¿ëÀÌ ±ä°Å)
			case "SBL" :
				tmpSelectKind = "select_l";
				break;
		}
		switch(strListType)
		{
			// ¶óµð¿À¹öÆ°
			case "RB" :
				if(tmpStr[0] == strClickValue)
					str =" checked";	
				document.write("<td><input type=radio name='" + strOptionName +"' value='" + tmpStr[0] +"' " + str +" " + strClickEvent + ">" + tmpStr[1] + "</option></td>");
				break;
			// ¼¿·ºÆ®¹Ú½ºÂªÀº°Å
			case "SBS" :
			// ¼¿·ºÆ®¹Ú½º (³»¿ëÀÌ ±ä°Å)
			case "SBL" :
			// ¼¿·ºÆ®¹Ú½º (Áß°£)
			case "SBM" :
			// ¼¿·ºÆ®¹Ú½º
			case "SB" :
				if (i == 0) {
					document.write("<select name='" + strOptionName +"' class='" + tmpSelectKind + "' " + strClickEvent + ">");
					if (strAll != "")
					{
						document.write("<option value=''>:: " + strAll +" ::</option>");
					}
				}
				if (strCondition != "") {
					tmpMatchFlag = false;
					for (j=0; j<tmpArCondition.length; j++)
					{
						if (tmpArCondition[j] == tmpStr[0])
						{
							tmpMatchFlag = true;
						}
					}
				}
				if (tmpMatchFlag)
				{
					document.write("<option value='" + tmpStr[0] + "'  ");
					if (tmpStr[0] == strClickValue)
					{
						document.write(" selected ");
					}
					document.write(">" + tmpStr[1] + "</option>");
					if (i == arr.length-1) 
						document.write("</select> ");
				}
				break;

			// Ã¼Å©¹Ú½º
			case "CB" :
				document.write("<td><input type=checkbox name='" + strOptionName +"' value='" + tmpStr[0] +"' " + str +" " + strClickEvent + ">" + tmpStr[1] + "</option></td>");
				break;
		}
	}

	if ( (strListType == "RB") || (strListType == "CB"))
		document.write("</tr></table>");
}


