function on_sch_kw()
{
	document.getElementById('mg_sch_area').style.visibility="";
	return;
}

function out_sch_kw()
{
	document.getElementById('mg_sch_area').style.visibility="hidden";
	return;
}
 
 
 function onclick_head_sch_top() {
    var node;

    node = document.getElementById('type_sch_top_list');

    if(node.style.display == "") {
       node.style.display = "none";
    } else {
       node.style.display = "";
    }
 }

 function onover_cel_sch_top(obj,type_sch_top_value) {
    var select_head;

    select_head = InputForm_TOP.select_head.value

    if(select_head != type_sch_top_value) {
       obj.style.backgroundColor = "#fe88c5";
    }
 }

 function onout_cel_sch_top(obj,type_sch_top_value) {
    var select_head;

    select_head = InputForm_TOP.select_head.value

    if(select_head != type_sch_top_value) {
       obj.style.backgroundColor = "#ffd5ef";
    }
 }

 function onclick_cel_sch_top(obj,type_sch_top_value) {
    var i, arrCode;

    arrCode = type_sch_top_value //def_op_code.split(",");
    InputForm_TOP.select_head.value = type_sch_top_value;

    //for(i=0;i<arrCode.length;i++) {
    //    document.getElementById('type_sch_top_'+arrCode[i]).style.backgroundColor = "#ffffff";
    //}
	document.getElementById('type_sch_top_'+arrCode).style.backgroundColor = "#fe88c5";
    document.getElementById('type_sch_top_'+type_sch_top_value).style.backgroundColor = "#fe88c5";
    document.getElementById('type_sch_top_select').innerText = obj.innerText;
    document.getElementById('type_sch_top_list').style.display = "none";
 }

 ///////////
 function SetHomepage_SCH(obj) {
    obj.style.behavior='url(#default#homepage)';
	obj.SetHomepage_SCH('..');
 }

 function ST_SearchIt_SCH() {
	var select_head, KW;

    select_head = InputForm_TOP.select_head.value
	KW = InputForm_TOP.KW.value

    if(KW == "") {
	   alert("검색어를 입력해 주세요.");
	   InputForm_TOP.KW.focus();
	   return;
	}

    SearchForm_TOP.CH.value = select_head
    SearchForm_TOP.KW.value = KW
	SearchForm_TOP.srh_page.value = ""

    SearchForm_TOP.submit()
 }

 function ST_SearchIn_SCH(frm_obj) {
    var s_intext;

	/*s_intext = frm_obj.s_intext.value;
	if(s_intext == "") {
	   alert("재검색할 검색어를 입력해 주세요.");
       frm_obj.s_intext.focus();
	   return;
	}*/

	SearchForm_TOP.srh_page.value = ""
	SearchForm_TOP.submit();

	return false;
 }

 function ST_SearchMore_SCH(op_code) {
    SearchForm_TOP.MG.value = op_code;
	SearchForm_TOP.submit()
 }

 function ST_SearchKeyword_SCH(keyword) {
    InputForm_TOP.select_head.value = "";
	SearchForm_TOP.CH.value = "T";
	document.getElementById('type_sch_top_select').innerText = "통합검색";
	InputForm_TOP.KW.value = keyword;

	ST_SearchIt_SCH();
 }


 function ST_SearchMore_SCH_ORD(ord_code) {
    SearchForm_TOP.ORD.value = ord_code;
	SearchForm_TOP.srh_page.value = "1"
	SearchForm_TOP.submit()
 }

 function ST_SearchMore_SCH_CH(ch_code) {
    SearchForm_TOP.CH.value = ch_code;
	SearchForm_TOP.ORD.value = "0";
	SearchForm_TOP.MG.value = "";
	SearchForm_TOP.srh_page.value = ""
	SearchForm_TOP.submit()
 }


 function ST_MovePage_SCH(page) {
    SearchForm_TOP.srh_page.value = page
	SearchForm_TOP.submit()
 }

 function ST_AutoEnter1_SCH() {
 	var keycode = event.keyCode;

	if(keycode==13) {
	   ST_SearchIt_SCH()
	   event.returnValue = false;
	}
 }

 function ST_AutoEnter2_SCH(frm_obj) {
 	var keycode = event.keyCode;

	if(keycode==13) {
	   ST_SearchIt_SCH(frm_obj)
	   event.returnValue = false;
	}
 }
/*
 SCH_E_MOUSEOUT = function(e,obj,eid,stat) {
   var t = e ? e.relatedTarget : event.toElement;
   while(t){
    if(t == obj) return;
    t = t.parentNode;
   }
   document.getElementById(eid).style.display = stat;
 }
 */


 var mg_sch_index, mg_sch_tid;
 var mg_sch_stat;

 mg_sch_index = 1;
 mg_sch_stat = 0;

 function onmouseover_sch_top() {
    document.getElementById("mg_sch_area").style.display = "";
	//mg_sch_stop();
 }

 function mg_sch_rolling() {
    var pre_index, next_index, max_index;

	max_index = SchTopForm.max_index.value;

	pre_index = mg_sch_index;
	if(mg_sch_index != max_index) {
	   next_index = mg_sch_index + 1;
	} else {
	   next_index = 1;
	}    

	document.getElementById("mg_sch_"+pre_index).style.display = "none";
	document.getElementById("mg_sch_"+next_index).style.display = "";
    mg_sch_index = next_index;

	mg_sch_tid = setTimeout(mg_sch_rolling,5000);
 }

  function mg_sch_start() {
	var stat;

    if(mg_sch_stat==1) {
	   return;
	}
    
	stat = document.getElementById("mg_sch_area").style.display;
	if(stat=="") {
	   return;
	}

	mg_sch_stat = 1;
    mg_sch_tid = setTimeout(mg_sch_rolling,5000);
 }

  function mg_sch_stop() {
	clearTimeout(mg_sch_tid);
	mg_sch_stat = 0;
 }

 //mg_sch_stat = 1;
 //mg_sch_tid = setTimeout(mg_sch_rolling,5000);
