 function Onclick_collsel() {
    var node;

	node = document.getElementById('coll_list');

	if(node.style.display == "") {
	   node.style.display = "none";
	} else {
	   node.style.display = "";
	}

	document.getElementById('s_list').style.display = "none";
	document.getElementById('d_list').style.display = "none";
 }

 function Onclick_seasonsel() {
    var node;

	node = document.getElementById('s_list');

	if(node.style.display == "") {
	   node.style.display = "none";
	} else {
	   node.style.display = "";
	}

	document.getElementById('coll_list').style.display = "none";
	document.getElementById('d_list').style.display = "none";
 }

 function Onclick_designersel() {
    var node;

	node = document.getElementById('d_list');
	
	if(node.style.display == "") {
	   node.style.display = "none";
	} else {
	   node.style.display = "";
	}

	document.getElementById('coll_list').style.display = "none";
	document.getElementById('s_list').style.display = "none";
 }

 function Onclick_collectlist(nLen,nID,stype,menu_id) {
    var node1, node2, i, s_type, coll_type;
   
    coll_type = CollSearchStatForm.coll_type.value;
	node1 = document.getElementById('coll_'+nID);
	node2 = document.getElementById('coll_'+coll_type);
	if(node1 != node2) {
	   for(i=0;i<nLen;i++) {
	       if(i==nID) {
		      document.getElementById('coll_'+i).className = "coll_sel";
		   } else {
		      document.getElementById('coll_'+i).className = "";
		   }
	   }

	   document.getElementById('c_select').innerText = node1.innerText
	}

	document.getElementById('coll_list').style.display = "none";
	document.getElementById('c_select').style.display = "";
    CollSearchStatForm.coll_type.value = nID;
    
	s_type = CollSearchForm.s_type.value;
    if(stype != s_type) {
	   CollSearchForm.s_type.value = stype;

	   if(stype != "") {
		  CollSearchForm.menu_id.value = menu_id;
	      CollSearchForm.f_name.value = "SearchSeason"
		  CollSearchForm.method = "post"
          CollSearchForm.action = "/style/collection/ajax/fashion_module.asp"
          GetAjaxInfoB(true,CollSearchForm,"SearchSeason_result")
	   } 

       InitSeasonSelect()
       DeleteSeasonList()

	   InitDesignerSelect()
	   DeleteDesignerList()

	   if(stype == "") {
	      CreateEmptySeason();
		  CreateEmptyDesigner();
	   }
	}
	CollSearchStatForm.season_type.value = 0;
	CollSearchStatForm.designer_type.value = 0;
 }

 function onover_collectlist(obj) {
	var coll_type, obj2;

	coll_type = CollSearchStatForm.coll_type.value;
	obj2 = document.getElementById("coll_"+coll_type);

	if(obj==obj2) {
	   return;
	}

    obj.className = "coll_over";
 }

 function onout_collectlist(obj) {
	var coll_type, obj2;

	coll_type = CollSearchStatForm.coll_type.value;
	obj2 = document.getElementById("coll_"+coll_type);

	if(obj==obj2) {
	   return;
	}

    obj.className = "";
 }

 function Onclick_seasonlist(nLen,nID,scode) {
    var node1, node2, i, s_code, season_type;

    season_type = CollSearchStatForm.season_type.value;
	node1 = document.getElementById('season_'+nID);
	node2 = document.getElementById('season_'+season_type);

	if(node1 != node2) {
	   for(i=0;i<nLen;i++) {
	       if(i==nID) {
		      document.getElementById('season_'+i).className = "coll_sel";
		   } else {
		      document.getElementById('season_'+i).className = "";
		   }
	   }

	   document.getElementById('s_select').innerText = node1.innerText
	}

	document.getElementById('s_list').style.display = "none";
	document.getElementById('s_select').style.display = "";
    CollSearchStatForm.season_type.value = nID;

	s_code = CollSearchForm.s_code.value;
    if(scode != s_code) {
	   CollSearchForm.s_code.value = scode;
	   
	   if(scode != "") {
	      CollSearchForm.f_name.value = "SearchDesigner"
		  CollSearchForm.method = "post"
          CollSearchForm.action = "/style/collection/ajax/fashion_module.asp"
          GetAjaxInfoB(true,CollSearchForm,"SearchDesigner_result")
       }

       InitDesignerSelect()
       DeleteDesignerList()

	   if(scode == "") {
	      CreateEmptyDesigner()
	   }
	}
	CollSearchStatForm.designer_type.value = 0;
 }

 function onover_seasonlist(obj) {
	var season_type, obj2;

	season_type = CollSearchStatForm.season_type.value;
	obj2 = document.getElementById("season_"+season_type);

	if(obj==obj2) {
	   return;
	}

    obj.className = "coll_over";
 }

 function onout_seasonlist(obj) {
	var season_type, obj2;

	season_type = CollSearchStatForm.season_type.value;
	obj2 = document.getElementById("season_"+season_type);

	if(obj==obj2) {
	   return;
	}

    obj.className = "";
 }

 function Onclick_designerlist(nLen,nID,dcode) {
    var node1, node2, i, d_code, designer_type;

    designer_type = CollSearchStatForm.designer_type.value;
	node1 = document.getElementById('designer_'+nID);
	node2 = document.getElementById('designer_'+designer_type);

	if(node1 != node2) {
	   for(i=0;i<nLen;i++) {
	       if(i==nID) {
		      document.getElementById('designer_'+i).className = "coll_sel";
		   } else {
		      document.getElementById('designer_'+i).className = "";
		   }
	   }

	   document.getElementById('d_select').innerText = node1.innerText
	}

	document.getElementById('d_list').style.display = "none";
	document.getElementById('d_select').style.display = "";
    CollSearchStatForm.designer_type.value = nID;

	d_code = CollSearchForm.d_code.value;
    if(dcode != d_code) {
	   CollSearchForm.d_code.value = dcode;
	}
 }

 function onover_designerlist(obj) {
	var designer_type, obj2;

	designer_type = CollSearchStatForm.designer_type.value;
	obj2 = document.getElementById("designer_"+designer_type);

	if(obj==obj2) {
	   return;
	}

    obj.className = "coll_over";
 }

 function onout_designerlist(obj) {
	var designer_type, obj2;

	designer_type = CollSearchStatForm.designer_type.value;
	obj2 = document.getElementById("designer_"+designer_type);

	if(obj==obj2) {
	   return;
	}

    obj.className = "";
 }

 function SearchSeason_result(msg) {
    var arrValue;

	arrValue = msg.split("[sp]")
	if(parseInt(arrValue[0]) <= 0) {
	   alert(arrValue[1]);
	   return
	}

	CreateSeasonList(arrValue)
	
 }

 function SearchDesigner_result(msg) {
    var arrValue;

	arrValue = msg.split("[sp]")
	if(parseInt(arrValue[0]) <= 0) {
	   alert(arrValue[1]);
	   return
	}

	CreateDesignerList(arrValue)
	
 }

 function CreateSeasonList(arrData) {
    var i, nLen, n_count, node;
    var arrValue, li_node, li_text;

    if(arrData.length <= 0) {
	   return;
	}
    if(arrData[0] != "1") {
	   return;
	}

    node = document.getElementById('s_list');

	n_count = parseInt(arrData[1]);
	if(n_count==0) {
	   li_node = document.createElement("li");
       li_node.setAttribute("id","season_0");
	   li_node.setAttribute("className","coll_sel");
	   li_node.innerText = "시즌 선택";
	   li_node.onclick = Function("Onclick_seasonlist(2,0,'')");
	   li_node.onmouseover = Function("onover_seasonlist(this)");
	   li_node.onmouseout = Function("onout_seasonlist(this)");
       node.appendChild(li_node)

	   li_node = document.createElement("li");
	   li_node.setAttribute("id","season_1")
	   li_node.innerText = "데이터가 없습니다."
	   node.appendChild(li_node)
	} else {
	   li_node = document.createElement("li");
       li_node.setAttribute("id","season_0");
	   li_node.setAttribute("className","coll_sel");
	   li_node.innerText = "시즌 선택";
	   li_node.onclick = Function("Onclick_seasonlist("+(n_count+1)+",0,'')");
	   li_node.onmouseover = Function("onover_seasonlist(this)");
	   li_node.onmouseout = Function("onout_seasonlist(this)");
       node.appendChild(li_node)

	   for(i=0;i<n_count;i++) {
		   arrValue = arrData[2+i].split("[sp2]");
	       li_node = document.createElement("li");
	       li_node.setAttribute("id","season_"+(i+1));
		   li_node.innerText = arrValue[1];
		   li_node.onclick = Function("Onclick_seasonlist("+(n_count+1)+","+(i+1)+",'"+arrValue[0]+"')");
	       li_node.onmouseover = Function("onover_seasonlist(this)");
	       li_node.onmouseout = Function("onout_seasonlist(this)");
		   node.appendChild(li_node);
	   }
	}
 }

 function CreateDesignerList(arrData) {
    var i, nLen, n_count, node;
    var arrValue, li_node, li_text;

    if(arrData.length <= 0) {
	   return;
	}
    if(arrData[0] != "1") {
	   return;
	}

    node = document.getElementById('d_list');

	n_count = parseInt(arrData[1]);
	if(n_count==0) {
	   li_node = document.createElement("li");
       li_node.setAttribute("id","designer_0");
	   li_node.setAttribute("className","coll_sel");
	   li_node.innerText = "디자이너 선택";
	   li_node.onclick = Function("Onclick_designerlist(2,0,'')");
	   li_node.onmouseover = Function("onover_designerlist(this)");
	   li_node.onmouseout = Function("onout_designerlist(this)");
       node.appendChild(li_node)

	   li_node = document.createElement("li");
	   li_node.setAttribute("id","designer_1")
	   li_node.innerText = "데이터가 없습니다."
	   node.appendChild(li_node)
	} else {
	   li_node = document.createElement("li");
       li_node.setAttribute("id","designer_0");
	   li_node.setAttribute("className","coll_sel");
	   li_node.innerText = "디자이너 선택";
	   li_node.onclick = Function("Onclick_designerlist("+(n_count+1)+",0,'')");
	   li_node.onmouseover = Function("onover_designerlist(this)");
	   li_node.onmouseout = Function("onout_designerlist(this)");
       node.appendChild(li_node)

	   for(i=0;i<n_count;i++) {
		   arrValue = arrData[2+i].split("[sp2]");
	       li_node = document.createElement("li");
	       li_node.setAttribute("id","designer_"+(i+1));
		   li_node.innerText = arrValue[1];
		   li_node.onclick = Function("Onclick_designerlist("+(n_count+1)+","+(i+1)+",'"+arrValue[0]+"')");
	       li_node.onmouseover = Function("onover_designerlist(this)");
	       li_node.onmouseout = Function("onout_designerlist(this)");
		   node.appendChild(li_node);
	   }
	}
 }

 function InitSeasonSelect() {
	document.getElementById('s_select').innerText = "시즌 선택";
    CollSearchForm.s_code.value = ""
 }

 function InitDesignerSelect() {
	document.getElementById('d_select').innerText = "디자이너 선택";
	CollSearchForm.d_code.value = ""
 }

 function DeleteSeasonList() {
	var li_node, node, node2, i, nLen;

	node = document.getElementById('s_list');
	nLen = node.childNodes.length;
	for(i=nLen-1;i>=0;i--) {
		node2 = node.childNodes[i];
	    node.removeChild(node2);
	}
 }

 function DeleteDesignerList() {
	var node, node2, i, nLen;

	node = document.getElementById('d_list');
	nLen = node.childNodes.length;
	for(i=nLen-1;i>=0;i--) {
		node2 = node.childNodes[i];
	    node.removeChild(node2);
	}
 }

 function CreateEmptySeason() {
	var node, li_node;

	node = document.getElementById('s_list');

    li_node = document.createElement("li");
    li_node.setAttribute("id","season_0");
    li_node.setAttribute("className","coll_sel");
    li_node.innerText = "시즌 선택";
    li_node.onclick = Function("Onclick_seasonlist(1,0,'')");
    node.appendChild(li_node);
 }

 function CreateEmptyDesigner() {
	var node, li_node;

	node = document.getElementById('d_list');

    li_node = document.createElement("li");
    li_node.setAttribute("id","designer_0");
    li_node.setAttribute("className","coll_sel");
    li_node.innerText = "디자이너 선택";
    li_node.onclick = Function("Onclick_designerlist(1,0,'')");
    node.appendChild(li_node);
 }

 function SearchIt() {
	var s_type, s_code, d_code

    s_type = CollSearchForm.s_type.value
	if(s_type == "") {
	   alert("컬렉션을 선택해 주세요.")
	   return
	}

	s_code = CollSearchForm.s_code.value
	if(s_code == "") {
	   alert("시즌을 선택해 주세요.")
       return
	}

    d_code = CollSearchForm.d_code.value

    CollSearchForm.method = "get"
	if(d_code == "") {
       CollSearchForm.action = MInfo.list_link.value
	} else {
	   CollSearchForm.action = MInfo.view_link.value
	}

	CollSearchForm.target = "_blank";
	CollSearchForm.submit()
 }

 function ViewBest(d_code) {
    CollSearchForm.d_code.value = d_code;

    CollSearchForm.method = "get"
	if(d_code == "") {
       CollSearchForm.action = MInfo.list_link.value
	} else {
	   CollSearchForm.action = MInfo.view_link.value
	}

	CollSearchForm.submit()
 }

 function onover_season_list(obj) {
	var season_type, obj2;

	season_type = CollSearchStatForm.season_type.value;
	obj2 = document.getElementById("season_"+season_type);

	if(obj==obj2) {
	   return;
	}

    obj.className = "coll_over";
 }

 function onout_season_list(obj) {
	var season_type, obj2;

	season_type = CollSearchStatForm.season_type.value;
	obj2 = document.getElementById("season_"+season_type);

	if(obj==obj2) {
	   return;
	}

    obj.className = "";
 }
