        String.prototype.trim = function() {
            return this.replace(/(^\s*)|(\s*$)/g, "");
        };
//=========================================================
        // 통합 검색하기
        // 2009-10-23
        // kdonghwa
        //=========================================================
        function doSearchKiwi(){
            var colName = jQuery('input[name=options99]:checked').val();
            var query     = jQuery('#query').val();
            var fm        = jQuery('form[name=fmKiwiTop]');
            var colValue = "";

            if (query.length > 0){
                var re = /[?*,@]/gi; //특수문자
                if(re.test(query)) {
                    alert("검색어에 특수문자( ? * , @ )는 입력할 수 없습니다.");
                    jQuery('input[name=query]').focus();
                    return false ;
                }

              //var pattern = /\b(a|an|and|at|b|by|c|d|e|f|for|from|g|h|i|in|is|it|its|j|k|l|m|n|o|of|on|or|p|q|r|s|t|the|to|u|v|w|with|x|y|z)\b/gi;
                var pattern = "(?i)\\b(a|an|and|at|b|by|c|d|e|f|for|from|g|h|i|in|is|it|its|j|k|l|m|n|o|of|on|or|p|q|r|s|t|the|to|u|v|w|with|x|y|z)\\p{Space}+";
                var temp = query.replace(pattern,"");
                if(temp.trim() == "") {
                    alert("검색어가 알파벳(a~z an at and by for from in is it its on or the with)만으로 이루어져 있습니다. \n다른 검색어를 입력하십시오. ");
                    jQuery('input[name=query]').focus();
                    return false;
                }
                switch (colName) {
                case "openlab":
                    fm.attr('action', '/kiwi/openlab/common/openLabSearch.do');
                    colValue = jQuery('#sltOpenlab').val();
                    break;
                default:
                    fm.attr('action', '/search/Search.do');
                    colValue = jQuery('#sltTotal').val();
                    break;
                }

                jQuery('ul.search_sbox > input[name=colName]').val(colValue);

                return true;
            }
            else{
                alert('검색어를 입력해 주세요!');
                jQuery('input[name=query]').focus();
                return false;
            }

            return false;
        }


        //=========================================================
        // GNB 이미지 선택
        // 2009-10-23
        // kdonghwa
        //=========================================================
        function setGnbImgChange(){
            var url = location.href;
            var idx = 1;


            //지식참여 홈
            if(url.indexOf('/kiwi/index.do') > 0 ) idx = 1;


            //공동강의실 홈
            if(url.indexOf('/kiwi/cm/') > 0 ) idx = 4;
            if(url.indexOf('/kiwi/openlab/') > 0 ) idx = 4;


            //내강의실
            if(url.indexOf('/kiwi/openlab/viewMylab.do') > 0 ) idx = 3;

            //세미나
            if(url.indexOf('/kiwi/seminar/') > 0 ) idx = 5;

            if(url.indexOf('/kiwi/cm/createNode') > 0 ) idx = 2;


            //검색
            if(url.indexOf('/kiwi/openlab/common/openLabSearch.do') > 0 ) idx = 1;

            //상세화면
            if(url.indexOf('/kiwi/openlab/openLabCollView.do') > 0 ) idx = 1;
            if(url.indexOf('/kiwi/openlab/openLabModuleView.do') > 0 ) idx = 1;


            jQuery('#gnbMenu0' + idx).attr('src', jQuery('#gnbMenu0' + idx).attr('src').replace('off.gif', 'on.gif'));
        }

        //=========================================================
        // GNB 이미지 변경
        //=========================================================
        function setGnbImgOn(idx){
            jQuery('#gnbMenu0' + idx).attr('src', jQuery('#gnbMenu0' + idx).attr('src').replace('off.gif', 'on.gif'));
        }

        function setGnbImgOff(idx){
            jQuery('#gnbMenu0' + idx).attr('src', jQuery('#gnbMenu0' + idx).attr('src').replace('on.gif', 'off.gif'));
        }



        //===============================================================================
        // 강의랩자료 검색시 화면 설정
        // 2009-11-20
        // kdonghwa
        //===============================================================================
        function openlabSearchAreaShow(){
            jQuery('li#liTotal').hide();
            jQuery('li#liOpenlab').show();

            jQuery('#sltOpenlab_input').css('width', '75px');
            jQuery('#sltOpenlab_container').css('width', '80px');

            jQuery('div.search_box > ul.search_sbox > li.data input.fsearch').css('width', '143px');
        }


        //===============================================================================
        // 통합자료 검색시 화면 설정
        // 2009-11-20
        // kdonghwa
        //===============================================================================
        function totalSearchAreaShow(){
            jQuery('li#liTotal').show();
            jQuery('li#liOpenlab').hide();

            jQuery('#sltOpenlab_input').css('width', '75px');
            jQuery('#sltOpenlab_container').css('width', '80px');

            jQuery('div.search_box > ul.search_sbox > li.data input.fsearch').css('width', '115px');
        }



        function openLangTrans(){
            //ModalPopup.open('/commons/swf/RissLangTrans.html');
            popupWindow('/commons/swf/RissLangTrans.html','다국어입력기',510,210);
        }


        //화면 가운데로 윈도우를 팝업한다.
        function popupWindow(openUrl,popName,width, height) {
            var winFeature = setCenterReport(width, parseInt( height, 10)) + ",status=no,menubar=no,resizable=yes,scrollbars=yes";
            var obj = window.open(openUrl, popName, winFeature);
            return obj;
        }

        //가로,세로 사이즈에 맞는 센터지점의 속성값을 반환한다.
        function setCenterReport(winwidth, winheight) {
         winx = Math.ceil((screen.availWidth - winwidth) / 2);
         winy = Math.ceil((screen.availHeight - winheight) / 2);
         if (winwidth == screen.availWidth) winwidth = screen.availWidth - 10;
         if (winheight == screen.availHeight) winheight = screen.availHeight - 30;
         return "left=" + winx + ",top=" + winy + ",width=" + winwidth + ",height=" + winheight;
        }
