    /**
      * ÀÛ¼ºÀÚ: ÇÔÁ¤¼·
      * ÀÛ¼ºÀÏ: 2006.08.31(¸ñ)
      * ±â´É: ½ÃµµÀÇ °¢ ÇÐ±³±Þ ½ºÅ©¸³Æ® ¹èÆ÷¹öÀü v1.0
      *
    */
    var EDUNET_SEARCH_URL = "http://www.edunet4u.net";
        
    function search_doGlobalSearch() {
        var form = document.globalSearchForm;
        
        if(isTextEmpty(form.searchWord)) {
            alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¿© ÁÖ¼¼¿ä");
            form.searchWord.focus();
            return;
        }
        
        if(!isValidSearchWord(form.searchWord)) {
            form.searchWord.focus();
            return;
        }
        
        var searchPage = "globalSearch.do";
        if(form.groups.value != "") {
        	searchPage = form.groups.value +"List.do";
        }
        
		var url = "";
		for(var i=0; i < form.gubun.length; i++)
		{
			if(form.gubun[i].checked == true) 
				url = form.gubun[i].value;
		}
        //ecrm ÄÜÅÙÃ÷ ÄÚµå
        var contentCode = getContentCode(searchPage);
        form.org_cd.value = contentCode.ORG_CD;
        form.data_no.value = contentCode.DATA_NO;
        form.seq_no.value = contentCode.SEQ_NO;
        //½ÃµµºÐ·ù°Ë»ö Á¤º¸
		form.schdata_no.value = contentCode.DATA_NO;
        
		/*
        form.action = EDUNET_SEARCH_URL +"/"+ searchPage;
        //form.target = "_top";
        var wstate = 'scrollbars=yes,status=no,resizable=no,location=no,width=820,height=768,left=20,top=20,toolbar=yes,,toolbar=yes,resizable=yes';
        */
		form.action = EDUNET_SEARCH_URL +"/"+ url +"/"+ searchPage;
        //form.target = "_top";
        var wstate1 = 'scrollbars=yes,status=no,resizable=no,location=no,width=990,height=400,left=20,top=20,toolbar=no,resizable=yes';
		var wstate2 = 'scrollbars=yes,status=no,resizable=no,location=no,width=820,height=768,left=20,top=20,toolbar=no,resizable=yes';
        var wstate;
		if(url=='tsearch')
			wstate=wstate1
		else
			wstate=wstate2
		
		
		var res = window.open('','edunetsearch',wstate);
        res.name = '_popup';
        form.target = '_popup';
        form.method = "get";
        form.submit();
    }
    
    function search_doKeyDown() {
        if(event.keyCode == 13) {
            window.event.returnValue = false;
            search_doGlobalSearch();
        }
    }
    
    function search_doKeywordSearch(searchWord) {
        var form = document.globalSearchForm;
        form.searchWord.value = searchWord;
        search_doGlobalSearch();
    }
    
    function search_goDetailSearch() {
        var form = document.globalSearchForm;
        
        //ecrm ÄÜÅÙÃ÷ ÄÚµå
        var contentCode = getContentCode("goDetailSearch.do");
        form.org_cd.value = contentCode.ORG_CD;
        form.data_no.value = contentCode.DATA_NO;
        form.seq_no.value = contentCode.SEQ_NO;
        
        form.action = EDUNET_SEARCH_URL +"/goDetailSearch.do";
        form.target = "_top";
        form.method = "get";
        form.submit();
    }
    
    function search_goEnvironment() {
        var form = document.globalSearchForm;
        
        //ecrm ÄÜÅÙÃ÷ ÄÚµå
        var contentCode = getContentCode("goEnvironment.do");
        form.org_cd.value = contentCode.ORG_CD;
        form.data_no.value = contentCode.DATA_NO;
        form.seq_no.value = contentCode.SEQ_NO;
        
        form.action = EDUNET_SEARCH_URL +"/goEnvironment.do";
        form.target = "_top";
        form.method = "get";
        form.submit();
    }
    
    //°ø¹é ÀÌ¿ÜÀÇ ÀÇ¹ÌÀÖ´Â °ªÀÌ ÀÖÀ¸¸é false
    function isTextEmpty(obj) {
        if(obj.value == null || obj.value.trim() == "") {
            return true;
        }
    
        return false;
    }
    
    //°Ë»ö¾îÀÇ À¯È¿¼º Ã¼Å©
    function isValidSearchWord(objText) {
        if(objText.value.trim().toUpperCase() == "AND" || objText.value.trim().toUpperCase() == "OR") {
            alert("°Ë»ö¿¡ »ç¿ëÇÒ ¼ö ¾ø´Â ´Ü¾î ÀÔ´Ï´Ù.");
            return false;
        }
        
        if(hasChars(objText, "<>()[];=,!@#$%^&*?")) {
            alert("°Ë»ö¾î¿¡ Æ¯¼ö¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.");
            return false;
        }
        
        return true;
    }
    
    //¹®ÀÚ ¾ÕµÚÀÇ °ø¹éÁ¦°Å
    String.prototype.trim = function() {
        return this.replace(/(^\s*)|(\s*$)/g, "");
    }
    
    //¹®ÀÚ ¾ÕµÚÀÇ °ø¹éÁ¦°Å
    function trim(str) {
        return str.replace(/(^\s*)|(\s*$)/g, "");
    }
    
    //Æ¯Á¤ ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖÀ¸¸é true
    function hasChars(obj, chars) {
        for(var i = 0; i < obj.value.length; i++) {
           if (chars.indexOf(obj.value.charAt(i)) != -1) {
               return true;
           }
        }
        
        return false;
    }
    
    
    ////////////////////////////////////////////
    // eCRMÀÇ ÄÜÅÙÃ÷ ÄÚµå
    ////////////////////////////////////////////
    function contentCode(path, org_cd, data_no, seq_no) {
    	this.PATH = path;
    	this.ORG_CD = org_cd;
    	this.DATA_NO = data_no;
    	this.SEQ_NO = seq_no;
    }
    
    function getContentCode(path) {

		// 2006-06-20, Ã¤³Îº° ÅëÇÕ°Ë»öÀ¸·Î ÀÌµ¿ Åë°è¸¦ »êÃâ, KERIS ¾ÈÈ¿·û ¼±»ý, SKC&C ±è°Ç¿ì
        var form = document.globalSearchForm;
		var chan = form.channel.value;

		if (chan == "main" && path == "globalSearch.do") {
			return contentCodes[49];
		} else if (chan == "teacher" && path == "globalSearch.do") {
			return contentCodes[50];
		} else if (chan == "student" && path == "globalSearch.do") {
			return contentCodes[51];
		} else if (chan == "community" && path == "globalSearch.do") {
			return contentCodes[52];
		}
		// 2006-06-20


    	for(var i = 0; i < contentCodes.length; i++) {
    		contentCode = contentCodes[i];
    		if(path == contentCode.PATH) {
				return contentCode;
    		}
    	}
    	
    	return new contentCode(path, "", "", "");
    }
    
    function getContentQuery(path) {
	    contentCode = getContentCode(path);
	    var query = "org_cd="+ contentCode.ORG_CD +"&data_no="+ contentCode.DATA_NO +"&seq_no="+ contentCode.SEQ_NO;
	    return query;
    }
    
    var contentCodes = new Array();
    contentCodes[0]  = new contentCode("globalSearch.do",         "SVCZ000001", "10907", "1");		//°Ë»ö > ÅëÇÕ°Ë»ö
    contentCodes[1]  = new contentCode("detailSearch.do",         "SVCZ000001", "10908", "1");		//°Ë»ö > »ó¼¼°Ë»ö
    contentCodes[2]  = new contentCode("similaritySearch.do",     "SVCZ000001", "10909", "1");		//°Ë»ö > À¯»ç¹®¼­°Ë»ö
    contentCodes[3]  = new contentCode("britannicaGroupList.do",  "SVCZ000001", "10910", "1");		//°Ë»ö > ±×·ì°Ë»ö(ÇÐ½À»çÀü)
    contentCodes[4]  = new contentCode("newsGroupList.do",        "SVCZ000001", "10911", "1");		//°Ë»ö > ±×·ì°Ë»ö(°ü·Ã¼Ò½Ä)
    contentCodes[5]  = new contentCode("prostudataGroupList.do",  "SVCZ000001", "10912", "1");		//°Ë»ö > ±×·ì°Ë»ö(±³¼öÇÐ½ÀÀÚ·á)
    contentCodes[6]  = new contentCode("prostuconGroupList.do",   "SVCZ000001", "10913", "1");		//°Ë»ö > ±×·ì°Ë»ö(±³¼öÇÐ½À»ó´ã)
    contentCodes[7]  = new contentCode("encresmanGroupList.do",   "SVCZ000001", "10914", "1");		//°Ë»ö > ±×·ì°Ë»ö(ÀåÇÐ/¿¬±¸/°æ¿µ)
    contentCodes[8]  = new contentCode("librissGroupList.do",     "SVCZ000001", "10915", "1");		//°Ë»ö > ±×·ì°Ë»ö(µµ¼­/³í¹®)
    contentCodes[9]  = new contentCode("communityGroupList.do",   "SVCZ000001", "10916", "1");		//°Ë»ö > ±×·ì°Ë»ö(Ä¿¹Â´ÏÆ¼)
    contentCodes[10] = new contentCode("britannicaList.do",       "SVCZ000001", "10917", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(ÇÐ½À»çÀü)
    contentCodes[11] = new contentCode("bundleList.do",           "SVCZ000001", "10918", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(²Ù·¯¹Ì¼ö¾÷ÀÚ·á)
    contentCodes[12] = new contentCode("classmanageList.do",      "SVCZ000001", "10919", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(°æ¿µ)
    contentCodes[13] = new contentCode("communityList.do",        "SVCZ000001", "10920", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(Ä¿¹Â´ÏÆ¼)
    contentCodes[14] = new contentCode("knowList.do",             "SVCZ000001", "10921", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(¼ö¾÷ÄÁ¼³ÆÃ)
    contentCodes[15] = new contentCode("encourageList.do",        "SVCZ000001", "10922", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(ÀåÇÐ)
    contentCodes[16] = new contentCode("estimateList.do",         "SVCZ000001", "10923", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(Æò°¡ÀÚ·á)
    contentCodes[17] = new contentCode("libraryList.do",          "SVCZ000001", "10924", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(µµ¼­ÀÚ·á)
    contentCodes[18] = new contentCode("multimediaList.do",       "SVCZ000001", "10925", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(¸ÖÆ¼¹Ìµð¾îÀÚ·á)
    contentCodes[19] = new contentCode("processList.do",          "SVCZ000001", "10926", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(±³¼öÇÐ½À°úÁ¤¾È)
    contentCodes[20] = new contentCode("questionList.do",         "SVCZ000001", "10927", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(Áú¹®ÀÖ¾î¿ä)
    contentCodes[21] = new contentCode("referenceList.do",        "SVCZ000001", "10928", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(ÇÐ½ÀÂü°íÀÚ·á)
    contentCodes[22] = new contentCode("researchList.do",         "SVCZ000001", "10929", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(¿¬±¸)
    contentCodes[23] = new contentCode("rissList.do",             "SVCZ000001", "10930", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(³í¹®)
    contentCodes[24] = new contentCode("bbsList.do",              "SVCZ000001", "10931", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(ÀÚ·á³ª´®ÅÍ)
    contentCodes[25] = new contentCode("softwareList.do",         "SVCZ000001", "10932", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(±³À°¿ëS/W)
    contentCodes[26] = new contentCode("specialList.do",          "SVCZ000001", "10933", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(Æ¯º°/Àç·®È°µ¿)
    contentCodes[27] = new contentCode("newsList.do",             "SVCZ000001", "10934", "1");		//°Ë»ö > Ä«Å×°í¸®°Ë»ö(°ü·Ã¼Ò½Ä)
    contentCodes[28] = new contentCode("goDetailSearch.do",       "SVCZ000001", "10935", "1");		//°øÅë > »ó¼¼°Ë»ö ÀÌµ¿
    contentCodes[29] = new contentCode("goEnvironment.do",        "SVCZ000001", "10936", "1");		//°øÅë > È¯°æ¼³Á¤ ÀÌµ¿
    contentCodes[30] = new contentCode("environmentSet.do",       "SVCZ000001", "10937", "1");		//°øÅë > È¯°æ¼³Á¤
    contentCodes[31] = new contentCode("recommend.do",            "SVCZ000001", "10938", "1");		//°øÅë > ÃßÃµÇÏ±â
    contentCodes[32] = new contentCode("ranking.do",              "SVCZ000001", "10939", "1");		//°øÅë > ÀÎ±âÄÜÅÙÃ÷ ÃÊ±âÈ­¸é
    contentCodes[33] = new contentCode("downRankingMore.do",      "SVCZ000001", "10940", "1");		//°øÅë > ÀÎ±âÄÜÅÙÃ÷ ´õº¸±â
    contentCodes[34] = new contentCode("latestNewsList.do",       "SVCZ000001", "10941", "1");		//°øÅë > ÃÖ±Ù±³À°¼Ò½Ä °Ë»ö
    contentCodes[35] = new contentCode("userChasiList.do",        "SVCZ000001", "10942", "1");		//°øÅë > Â÷½ÃÀÚ·á °Ë»ö
    contentCodes[36] = new contentCode("userChasiManage.do",      "SVCZ000001", "10943", "1");		//°øÅë > Â÷½ÃÁ¤º¸ °ü¸®
    contentCodes[37] = new contentCode("metaData.do",             "SVCZ000001", "10944", "1");		//ÀÌµ¿ > »ó¼¼º¸±â(KEM)
    contentCodes[38] = new contentCode("goDetailBbs.jsp",         "SVCZ000001", "10945", "1");		//ÀÌµ¿ > »ó¼¼º¸±â(ÀÚ·á³ª´®ÅÍ)
    contentCodes[39] = new contentCode("goDetailBundle.jsp",      "SVCZ000001", "10946", "1");		//ÀÌµ¿ > »ó¼¼º¸±â(²Ù·¯¹Ì¼ö¾÷ÀÚ·á)
    contentCodes[40] = new contentCode("goDetailCommunity.jsp",   "SVCZ000001", "10947", "1");		//ÀÌµ¿ > »ó¼¼º¸±â(Ä¿¹Â´ÏÆ¼)
    contentCodes[41] = new contentCode("goDetailKnow.jsp",        "SVCZ000001", "10948", "1");		//ÀÌµ¿ > »ó¼¼º¸±â(¼ö¾÷ÄÁ¼³ÆÃ)
    contentCodes[42] = new contentCode("goDetailQuestion.jsp",    "SVCZ000001", "10949", "1");		//ÀÌµ¿ > »ó¼¼º¸±â(ÇÐ½À»ó´ã)
    contentCodes[43] = new contentCode("goDetailRiss.jsp",        "SVCZ000001", "10950", "1");		//ÀÌµ¿ > »ó¼¼º¸±â(³í¹®)
    contentCodes[44] = new contentCode("britannicaDetail.do",     "SVCZ000001", "10951", "1");		//ÀÌµ¿ > »ó¼¼º¸±â(ÇÐ½À»çÀü)
    contentCodes[45] = new contentCode("britannicaIllust.do",     "SVCZ000001", "10952", "1");		//ÀÌµ¿ > »ó¼¼º¸±â(ÇÐ½À»çÀü_¸ÖÆ¼¹Ìµð¾î)
    contentCodes[46] = new contentCode("britannicaMain.do",       "SVCZ000001", "10953", "1");		//ÇÐ½À»çÀü > ÃÊ±âÈ­¸é
    contentCodes[47] = new contentCode("britannicaEvent.do",      "SVCZ000001", "10954", "1");		//ÇÐ½À»çÀü > ÄûÁîÀÌº¥Æ®1
    contentCodes[48] = new contentCode("event.do",                "SVCZ000001", "10955", "1");		//ÇÐ½À»çÀü > ÄûÁîÀÌº¥Æ®2


    // 2006-06-20, Ã¤³Îº° ÅëÇÕ°Ë»öÀ¸·Î ÀÌµ¿ Åë°è¸¦ »êÃâ, KERIS ¾ÈÈ¿·û ¼±»ý, SKC&C ±è°Ç¿ì
    contentCodes[49]  = new contentCode("globalSearch.do",         "SVCZ000001", "11010", "1");		// ¸ÞÀÎ > ÅëÇÕ°Ë»ö
    contentCodes[50]  = new contentCode("globalSearch.do",         "SVCZ000001", "11011", "1");		// ±³»ç > ÅëÇÕ°Ë»ö
    contentCodes[51]  = new contentCode("globalSearch.do",         "SVCZ000001", "11012", "1");		// ÇÐ»ý > ÅëÇÕ°Ë»ö
    contentCodes[52]  = new contentCode("globalSearch.do",         "SVCZ000001", "11013", "1");		// Ä¿¹Â´ÏÆ¼ > ÅëÇÕ°Ë»ö
    // 2006-06-20

	
    function show(cityschl,schurl,border,tw,td1,td2,txt,bg)		
    {		
		var str = ""; 
		str  = "<table width=336 border=0 cellspacing=0 cellpadding=0>";
		str  += "<form name='globalSearchForm'>";
		str  += "<input type='hidden' name='cityschl' value='"+cityschl+"'>";
		str  += "<input type='hidden' name='schurl' value='"+schurl+"'>";	
		str  += "<input type='hidden' name='schdata_no'>";
		str  += "<input type='hidden' name='groups'>";
		str  += "<input type='hidden' name='org_cd'>";
		str  += "<input type='hidden' name='data_no'>";
		str  += "<input type='hidden' name='seq_no'>";
		str  += "<input type='hidden' name='mode value=''>";
		str  += "<input type='hidden' name='channel' value='teacher'>";
		str  += "<input type='hidden' name='category' value=''>";
		str  += "<input type='hidden' name='groupcategory' value=''>";
		str  += "<input type='hidden' name='search_re' value=''>";
		str  += "<tr>";
		str  += "<td width=122 class=sedocu>";
		str  += "<input type='radio' name='gubun' value='tsearch' checked>±³»ç¿ë";
		str  += "<input type='radio' name='gubun' value='ssearch'>ÇÐ»ý¿ë";
		str  += "</td>";
		str  += "<td width=170>";
		str  += "<input type='text' name='searchWord' size='40' style='font-family:Dotum,Dotumche,verdana;color:#868686;font-size:12px;SOLID #C9C9C9;width:160px;' onkeydown='search_doKeyDown();'></td>";
		str  += "<td width=44>";
		str  += "<a href='JavaScript:search_doGlobalSearch();'><img src='http://www.edunet4u.net/ksearch/common/imgs/share_search_btn.gif' width='44' height='21' border='0'></a></td>";
		str  += "</tr>";
		str  += "</form>";
		str  += "</table>";													
		document.write(str);		
    }
      

