/**
 * 프로젝트명: ITIS 통합
 * 프로그램명: PersonCustm
 * 기    능 : 해외박람회/교역전목록
 * 작 성 자 : 이정현
 * 작 성 일 : 2007. 07. 18
 *
 * 저 작 권 : Copyright (c) 2004 by CJSystems All rights Reserved
 **/
window.onload=function() {
	
	//select list TIC 지식 구분 1DEPTH
	var class_code1 = new ITISSelect(
		{
			selectElement:$("incentiveDTO.area_codep"),	
			requestURL:"/kor/sigungu.kto?func_name=comboList&lvl=1&jsp_name=bs/marketing/pds/organizations_incentive_programs/SigunguComboListXml",
			firstValue:"total",
			firstText:"전체",
			value:"code",
			text:"code_nm",
			selectedValue:$("srch_region").value,
			ajaxRunning:"false",
			onAfterFillSelect:function () {
				if (class_code1.selectInfo.selectedValue != "") {
					classCode1IFOnChange();
				}
			}
		}
	);

	
	class_code1.fillSelect();
	
	//코드그룹 콤보 선택을 바꾸면 codeGrup 텍스트박스의 값을 바꾼다.
	$("incentiveDTO.area_codep").onchange = classCode1IFOnChange2;
	
	function classCode1IFOnChange() {
		var CodeValue = $("incentiveDTO.area_codep").value;
		if (CodeValue == "total") {
			class_code2.clearSelect();
			$("incentiveDTO.signgu_codep").value = "total";	
		}
		//선택된 구분1이 있으면 그 구분1에 대한 구분2을 선택 할 수 있다.
		else {
			class_code2.selectInfo.requestURL = "/kor/sigungu.kto?func_name=comboList&lvl=2&jsp_name=bs/marketing/pds/organizations_incentive_programs/SigunguComboListXml&region_code=" + CodeValue;
			class_code2.selectInfo.selectedValue = $("srch_nation").value;
			class_code2.fillSelect();
		}
	}

	function classCode1IFOnChange2() {
		var CodeValue = $("incentiveDTO.area_codep").value;
		if (CodeValue == "total") {
			class_code2.clearSelect();
			$("incentiveDTO.signgu_codep").value = "total";
		}
		//선택된 구분1이 있으면 그 구분1에 대한 구분2을 선택 할 수 있다.
		else {
			class_code2.selectInfo.requestURL = "/kor/sigungu.kto?func_name=comboList&lvl=2&jsp_name=bs/marketing/pds/organizations_incentive_programs/SigunguComboListXml&region_code=" + CodeValue;
			class_code2.selectInfo.selectedValue = "total";
			class_code2.fillSelect();
		}
	}

	//select list TIC 지식 구분 2DEPTH
	class_code2 = new ITISSelect(
	{
		selectElement:$("incentiveDTO.signgu_codep"),	
		requestURL:"/kor/sigungu.kto?func_name=comboList&lvl=1&jsp_name=bs/marketing/pds/organizations_incentive_programs/SigunguComboListXml",	
		firstValue:"total",
		firstText:"전체",
		value:"code",
		text:"code_nm",
		selectedValue:$("srch_nation").value,
		onAfterFillSelect:function () {
		}
	});
	
	//코드그룹 콤보 선택을 바꾸면 codeGrup 텍스트박스의 값을 바꾼다.
	$("incentiveDTO.signgu_codep").onchange = function() {}
		
}


