﻿function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ChkNumber(Object,Name) {
	var strReg = /^[0-9]{1,}$/;

	if (strReg.test(Object.value)==false) {		
		alert(Name);
		eval(Object.focus());
		return false;		
	}
}

function ChkInput(Object,Name) {
	if (typeof(Object)!="undefined") {
		if(Object.value=="") {
			alert(Name);
			eval(Object.focus());
			return false;
		}
	}
}

function ChkSelect(Object,Name) {
	if(!Object.options[Object.selectedIndex].value) {
		alert(Name);
		eval(Object.focus());
		return false;
	}
}

function ChkArray(Object,Name) {
	var Key=0;

	if (Object!=null && isNaN(Object.length)) {
		if (!Object.checked) {
			alert(Name);
			return false;
		}
	} else {

        if(Object!=null) {
    		for(i=0;i<Object.length;i++) if(!Object[i].checked) Key++;
    		if(Key==Object.length){
    			alert(Name);
    			return false;
    		}
    	} else {
    	    alert("자료가 없습니다.");
    	    return false;   
    	}
	}
}

function Validchar(g,str){
	for( var i=0 ; i < g.length; i++ ){
		if( str.indexOf(g.charAt(i)) == -1 ) return g.charAt(i);
	}
	return true;
}


/* Email Validation */
function Check_Email_Rule(strEmail) {
	return strEmail.search(/^\s*[\w\~\-\.]+\@[\w\~\-]+(\.[\w\~\-]+)+\s*$/g)>=0;
}

/* InputBox Number Check */
function OnlyNumber( Ev ){ 

    var evCode = ( window.netscape ) ? Ev.which : event.keyCode ; 
	
    /* FF일 경우 Ev.which 값을, 
        IE을 경우 event.keyCode 값을 evCode에 대입 */ 
    if ( ! ( evCode == 0 || evCode == 8 || ( evCode > 47 && evCode < 58 ) ) ) { 
    /* 눌러진 키 코드가 숫자가 아닌 경우 
        ( '0'은 FF에서 Tab 키, 
          '8'은 FF에서 BackSpace가 먹히지 않아 삽입)    */ 
        if ( window.netscape ) {        // FF일 경우 
            Ev.preventDefault() ;        // 이벤트 무효화 
        } else {                                // IE일 경우 
            event.returnValue=false;    // 이벤트 무효화 
        } 
    } 
}


//스크롤 TOP버튼

function initMoving(target, position, topLimit, btmLimit) {
	if (!target)
		return false;

	var obj = target;
	obj.initTop = position;
	obj.topLimit = topLimit;
	obj.bottomLimit = document.documentElement.scrollHeight - btmLimit;

	obj.style.position = "absolute";
	obj.top = obj.initTop;
	obj.left = obj.initLeft;

	if (typeof(window.pageYOffset) == "number") {
		obj.getTop = function() {
			return window.pageYOffset;
		}
	} else if (typeof(document.documentElement.scrollTop) == "number") {
		obj.getTop = function() {
			return document.documentElement.scrollTop;
		}
	} else {
		obj.getTop = function() {
			return 0;
		}
	}

	if (self.innerHeight) {
		obj.getHeight = function() {
			return self.innerHeight;
		}
	} else if(document.documentElement.clientHeight) {
		obj.getHeight = function() {
			return document.documentElement.clientHeight;
		}
	} else {
		obj.getHeight = function() {
			return 500;
		}
	}

	obj.move = setInterval(function() {
		
		if (obj.initTop > 0) {
			pos = obj.getTop() + obj.initTop;
		} else {
			pos = obj.getTop() + obj.getHeight() + obj.initTop;
			//pos = obj.getTop() + obj.getHeight() / 2 - 15;
		}
		
		//09.10.16 hby
		//if (pos > obj.bottomLimit)
		//	pos = obj.bottomLimit;
		if (pos < obj.topLimit)
			pos = obj.topLimit;

		interval = obj.top - pos;
		obj.top = obj.top - interval / 3;
		obj.style.top = obj.top + "px";
	},30)
}



/* 레이어팝업 */
/* layer_marginLeft , layer_marginTop */
var layer_marginLeft = 200;
var layer_marginTop  = 50;
function CallPageLayer() {
	document.write("<div id='BGLayer' style='position:absolute;left:0px;top:0px;width:100%;height:100%;-moz-opacity:0.5;filter:alpha(opacity=60);display:none;z-index:99;background-color: #CCCCCC;' onClick='ClosePageLayer()'></div>");
	document.write("<div style='text-align:center;position:absolute;width:100%;height:100%;top:" + layer_marginTop + "px;display:none;z-index:100;' id='Layer' name='Layer' onClick='ClosePageLayer()'>");
	document.write("<table border='0' bgcolor='#CCCCCC'>");
	document.write("  <tr>");
	document.write("	<td align='center'>");
	document.write("	  <table id='layerTable' width='100%' cellpadding='2' cellspacing='1' border='0' bgcolor='#666666' style='zindex: 1;'>");
	document.write("		<tr>");
	document.write("		  <td bgcolor='white'><iframe src='' width='495' height='250' frameborder='0' id='frame' name='frame'></iframe></td>");
	document.write("		</tr>");
	document.write("	  </table>");
	document.write("	</td>");
	document.write("  </tr>");
	document.write("</table>");
	document.write("</div>");
}
function OpenPageLayer(url, width, height) {
	var obj = document.getElementById("Layer");
	obj.style.top = document.body.scrollTop + 10;
	if(obj.style.display == "none") {
		obj.style.display = "";
		var objBg = document.getElementById("BGLayer");
		if(objBg!=null) {
			objBg.style.display = "";
			/*if(objBg.scrollHeight > 0)
				objBg.style.height = objBg.scrollHeight;
			else
				objBg.style.height = objBg.offsetHeight;
			*/
			//objBg.style.width  = objBg.offsetWidth + 20;
			document.body.width = '100%';
			objBg.style.width = document.body.offsetWidth - 17;
		}
		var tableObj = document.getElementById("layerTable");
		if(tableObj!=null)
			tableObj.width = width;
		var frameObj = document.getElementById("frame");
		if(frameObj!=null) {
			frameObj.width = width;
			frameObj.height = height;
			frameObj.src = url;
		}

		objBg.style.height = document.body.scrollHeight + 30;
	}

}
function ClosePageLayer() {
	var obj = document.getElementById("Layer");
	if(obj!=null) {
		var objBg = document.getElementById("BGLayer");
		obj.style.display = "none";
		obj.style.height = 100;
		if(objBg!=null) {
			objBg.style.display = "none";
			objBg.style.height = 100;
		}
		var frameObj = document.getElementById("frame");
		if(frameObj!=null) {
			frameObj.src = '/blank.asp';
		}
	}
}
function PopupClose() {
	if(parent!=null && parent.document.getElementById('layer')!=null) {
		parent.ClosePageLayer();
	}else
		window.close();
}
function DisplayWriteLine(width) {
	if(width==null || width=="")
		width = "400";

	document.write("	  <table cellpadding='0' cellspacing='0' border='0' width='" + width + "'>");
	document.write("		<tr>");
	document.write("          <td height='6'></td>");
	document.write("        </tr>");
	document.write("		<tr>");
	document.write("          <td height='4' bgcolor='#EEEEEE'></td>");
	document.write("        </tr>");
	document.write("		<tr>");
	document.write("          <td height='6'></td>");
	document.write("        </tr>");
	document.write("	  </table>");
}

function Left(str, n){
	if (n <= 0)
		return "";
	else if (n > String(str).length)
		return str;
	else
		return String(str).substring(0,n);
} 

/***********************************
설명 : 이미지파일체크
***********************************/
function ImageCheck(obj){	
	if (/[jpg|gif|png|bmp]/.test(toLowerCase(obj.value)) == false) {
		alert("이미지 포맷만 등록가능합니다. (JPG, GIF, PNG, BMP)");
		obj.focus();
		return false;
	}	
	return true;
}

/***********************************
설명 : 아이디(문자숫자혼합)체크
***********************************/
function CheckID(obj){	
	if (/[a-zA-Z]/.test(obj.value) == false || obj.value.length < 4 || obj.value.length > 12) {
		alert("영문,숫자포함 4~12자로 입력하세요.");
		obj.focus();
		return false;
	}	
	return true;
}

/***********************************
설명 : 비밀번호(문자숫자혼합)체크
***********************************/
function CheckPWD(obj){
	
	if (/[a-zA-Z]/.test(obj.value) == false  || obj.value.length < 8 || obj.value.length > 15) {
		alert("영문,숫자포함 8~15자로 입력하세요.");
		obj.focus();
		return false;
	}	
	return true;
}

function fnChkImageFile(arg) {
	imgFile = arg.value;
	if(imgFile) {
		var extArray = new Array(".gif", ".jpg", ".jpeg", ".png", ".bmp");
		while (imgFile.indexOf("\\") != -1)
			imgFile = imgFile.slice(imgFile.indexOf("\\") + 1);

		ext = imgFile.slice(imgFile.lastIndexOf(".")).toLowerCase();

		isImage = false;

		for (var i = 0; i < extArray.length; i++) {
			if (extArray[i] == ext) { 
				isImage = true; 
				break; 
			}
		}
		return isImage
	}
}


function fnChkExtFile(arg,gubun) {
	
	imgFile = arg.value;
	if(imgFile) {
		var extArray = new Array();
		for (var i=0;i<gubun.split(",").length;i++) {
			extArray[i] = gubun.split(",")[i]
		}
		while (imgFile.indexOf("\\") != -1)
			imgFile = imgFile.slice(imgFile.indexOf("\\") + 1);

		ext = imgFile.slice(imgFile.lastIndexOf(".")).toLowerCase();
		isImage = false;

		for (var i = 0; i < extArray.length; i++) {
			if (extArray[i] == ext) { 
				isImage = true; 
				break; 
			}
		}
		
		return isImage
	}
}


function strTwoLen(str) {
	var txt = str;
	if(str.length == 1)
		txt = "0"+str;
	return txt;
}



function swf_include(url,widthNum,hightNum,Access,bgColor,wMode,vars){
	var codeStr = "";
	codeStr += "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96B8-444553540000\"";
	codeStr += "codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.47.0\" width=\""+widthNum+"\" height=\""+hightNum+"\">";
	codeStr += "<param name=\"allowScriptAccess\" value=\""+Access+"\" />";
	codeStr += "<param name=\"movie\" value=\""+url+"\" />";
	codeStr += "<param name=\"flashvars\" value=\""+vars+"\" />";	
	codeStr += "<param name=\"menu\" value=\"false\" />";
	codeStr += "<param name=\"quality\" value=\"high\" />";
	codeStr += "<param name=\"wmode\" value=\""+wMode+"\" />";
	codeStr += "<param name=\"bgcolor\" value=\""+bgColor+"\" />";
	codeStr += "<embed src=\""+url+"\" flashvars=\""+vars+"\" allowScriptAccess=\""+Access+"\" menu=\"false\" quality=\"high\" wmode=\""+wMode+"\"";
	codeStr += "devicefont=\"true\" bgcolor=\""+bgColor+"\"  width=\""+widthNum+"\" height=\""+hightNum+"\" align=\"middle\" type=\"application/x-shockwave-flash\"";
	codeStr += "pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\">";
	codeStr += "</embed>";
	codeStr += "</object>";
	document.write(codeStr);
}

// 페이지 세로 사이즈
function setScroll(n){
	document.getElementById("contents_h").height=n;
}

function boardgo(url, seq) {
	var obj = document.mainForm;
	obj.seq.value = seq;
	obj.action = url;
	obj.submit();
}



/**************************************************************************************************************************
추가 javascript
**************************************************************************************************************************/
//자동 블러 : a, img, input type=image 태그일 경우
function bluring()
{
	if (event.srcElement.tagName.toUpperCase() == "A" || event.srcElement.tagName.toUpperCase() == "IMG")
		document.body.focus();
	else if (event.srcElement.tagName.toUpperCase() == "INPUT")
		if (event.srcElement.type.toUpperCase() == "IMAGE")
		document.body.focus();
}
document.onfocusin = bluring;


//Replace
String.prototype.Replace = function(string, changeString)
{
	return this.replace(new RegExp(string, "g"), changeString);
}

//Trimming
String.prototype.Trim = function()
{
	return this.replace(/^\s+|\s+$/g, '');
}

//Insert character(s)
String.prototype.Insert = function(index, value)
{
	if (this.length - 1 < index)
		return this;

	return this.substr(0, index) + value + this.substr(index - 1 + value.length);
}

//문자열 뒤에 존재하는 지정문자를 모두 trim
function TrimEnd(str, trimChar)
{
	var sReturn = str;
	if (sReturn.lastIndexOf(trimChar) > -1)
	{
		var sLastChar = sReturn.substr(sReturn.length - trimChar.length);
		while (sLastChar == trimChar)
		{
			sReturn = sReturn.substr(0, sReturn.length - trimChar.length);
			sLastChar = sReturn.substr(sReturn.length - trimChar.length);
		}
	}

	return sReturn;
}

//Padding Left
function PadLeft(oValue, iLength, sPadding)
{
	var sValue = String(oValue);

	if (sValue.length >= iLength)
		return oValue;
	else
	{
		while (sValue.length < iLength)
			sValue = sPadding + sValue;

		return sValue;
	}
}

//Padding Right
function PadRight(oValue, iLength, sPadding)
{
	var sValue = String(oValue);

	if (sValue.length >= iLength)
		return oValue;
	else
	{
		while (sValue.length < iLength)
			sValue = sValue + sPadding;

		return sValue;
	}
}


/**
셀렉트 박스, 콤보 박스 초기화

selectBoxID : 셀렉트 객체 ID
*/
function ClearSelectBox(selectBoxID)
{
	var objSelBox = document.getElementById(selectBoxID);

	while (objSelBox.length > 0)
		objSelBox.options[0] = null;
}

/**
셀렉트 박스, 콤보 박스 추가

selectBoxID : 셀렉트 객체 ID
textString : 텍스트
valueString : 값
isInitiate : true, false : 초기화 여부
isDefaultSelect : true, flase : 기본 선택 여부
*/
function AddSelectBox(selectBoxID, textString, valueString, isInitiate, isDefaultSelect)
{
	var objSelBox = document.getElementById(selectBoxID);

	if (isInitiate)
		ClearSelectBox(selectBoxID);

	var idx = objSelBox.length;

	if (isDefaultSelect)
		objSelBox.options[idx] = new Option(textString, valueString, true, false);
	else
		objSelBox.options[idx] = new Option(textString, valueString, false, false);
}

//개체의 Top 
function OffSetTop(obj)
{
	var Parent = obj.offsetParent;

	var objTop;

	if (obj.offsetParent)
	{
		var objY = obj.offsetTop;
		while (obj = obj.offsetParent)
			objY += obj.offsetTop;
	}

	return objY;
}

//개체의 Left
function OffsetLeft(obj)
{
	var Parent = obj.offsetParent;

	var objTop;
	if (obj.offsetParent)
	{
		var objY = obj.offsetLeft;
		while (obj = obj.offsetParent)
			objY += obj.offsetLeft;
	}

	return objY;
}

function OffsetWidth(obj)
{
	return obj.offsetWidth;
}

function OffsetHeight(obj)
{
	return obj.offsetHeight;
}

//Modal
function OpenModalDialog(URL, arguments, width, height)
{
	var modal = window.showModalDialog(URL, arguments, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;center=2;status=no;help=no");
	return modal;
}

//Popup
function OpenPopWindow(URL, windowName, width, height, isScroll, isResizable)
{
	if (width == null)
		width = 300;
	if (height == null)
		height = 300;

	var iLeft = (screen.availWidth - width) / 2;
	var iTop = (screen.availHeight - height) / 2;

	isScroll = isScroll == null ? false : isScroll;
	var sScroll = isScroll ? "yes" : "no";

	isResizable = isResizable == null ? false : isResizable;
	var sResizable = isResizable ? "yes" : "no";

	if (isScroll == null)
		isScroll = false;
	if (isResizable == null)
		isResizable = false;
	/*
	location : 주소표시줄 
	directories : 연결 
	resizable : 크기조절 
	status : 상태표시줄 
	toolbar : 표시단추 
	memubar : 메뉴 
	width : 새창 너비 
	height : 새창 높이 
	left : 새창 왼쪽 위치 
	top : 새창 위쪽 위치 
	*/
	var params = "width=" + width + ",height=" + height + ",left=" + iLeft + ",top=" + iTop + ",menubar=no,status=no,toolbar=no,titlebar=no,location=no,resizable=" + sResizable + ",scrollbars=" + sScroll;

	var win = window.open(URL, windowName, params);
	return win;
}

//플래쉬 출력
function SpriteFlash(swfPath, width, height, param1, param2)
{
	var strFlash = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"" + width + "px\" height=\"" + height + "px\">";
	strFlash += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
	strFlash += "<param name=\"movie\" value=\"" + swfPath + "\" />";
	strFlash += "<param name=\"quality\" value=\"high\" />";
	strFlash += "<param name=\"wmode\" value=\"transparent\" />";
	if (param1 != null && param1 != "")
		strFlash += "<param name=\"FlashVars\" VALUE=\"" + param1 + "&" + param2 + "\" />";
	else
		strFlash += "<param name=\"FlashVars\" VALUE=\"\" />";

	strFlash += "<embed src=\"" + swfPath + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" width=\"" + width + "px\" height=\"" + height + "px\"></embed>";
	strFlash += "</object>";

	document.write(strFlash);
}


/**
* keyCode 값을 가져온다.
*
* @param e event 객체
* @return 키코드값
*/
function getKeyCode(e)
{
	if (window.event) // IE
	{
		return e.keyCode;
	}
	else if (e.which) // Firefox
	{
		return e.which;
	}
	else
	{
		return 0;
	}
}

function openPop(param, gubun, formObj) {
    // gubun 을 중심으로 popUpWin 값을 세팅하고 호출한다.
    switch (gubun) {
        case 'Editor_Preview':
        	popUpWin("/inc/fckeditor/editor/fckeditor.html" + param, gubun, 670, 550, 0, 0, "yes", "no", true);
            break;
		case 'top5_popup':
			popUpWinSumit("/pages/popup/faq-top5.asp" + param, gubun, 800, 600, 0, 0, "yes", "no", true, formObj);
			break;
		case 'Admin_Edit':
			popUpWin("/pages/popup/admin-edit.asp" + param, gubun, 800, 600, 0, 0, "yes", "yes", true);
			break;
        case 'STANDARD':
            popUpWin("/pages/popup/standard-list.asp" + param, gubun, 800, 600, 0, 0, "yes", "yes", true);
            break;
        case 'STANDARD_EDIT':
            popUpWin("/pages/popup/standard-edit.asp" + param, gubun, 800, 600, 0, 0, "yes", "yes", true);
            break;
		case 'QNA_EDIT':
           	popUpWin("/pages/popup/qna-edit.asp" + param, gubun, 600, 700, 0, 0, "yes", "yes", true);
           	break;
        case 'CORRECT_EDIT':
            popUpWin("/pages/popup/correct-edit.asp" + param, gubun, 650, 700, 0, 0, "yes", "yes", true);
            break;
        case 'VOCA_EDIT':
            popUpWin("/pages/popup/voca-edit.asp" + param, gubun, 650, 700, 0, 0, "yes", "yes", true);
            break; 
        case 'Category1_Info':
           	popUpWin("/pages/popup/dictionary-category1-info.asp" + param, gubun, 610, 150, 0, 0, "no", "no", true);
           	break;
        case 'Category2_Info':
           	popUpWin("/pages/popup/dictionary-category2-info.asp" + param, gubun, 610, 200, 0, 0, "no", "no", true);
           	break;
		case 'Category3_Info':
			popUpWin("/pages/popup/dictionary-category3-info.asp" + param, gubun, 610, 500, 0, 0, "no", "no", true);
			break;
        case 'EXAMPLE_OTHER_LIST':
            popUpWin("/pages/popup/example-other-list.asp" + param, gubun, 610, 500, 0, 0, "no", "no", true);
            break;
        case 'EXPRESS_EDIT':
            popUpWin("/pages/popup/example-edit.asp" + param, gubun, 750, 800, 0, 0, "yes", "no", true);
            break;
        case 'CORRECT_EDIT_EXAMPLE':
            popUpWin("/pages/popup/correct-example-edit.asp" + param, gubun, 750, 800, 0, 0, "yes", "no", true);
            break;
        case 'CORRECT_EDIT_DIALOGUE':
            popUpWin("/pages/popup/correct-dialogue-edit.asp" + param, gubun, 750, 800, 0, 0, "yes", "no", true);
            break;	                                    	
		case 'ViewImage':
			popUpWin("/pages/popup/view-image.asp" + param, gubun, 300, 300, 0, 0, "yes", "yes", true);
			break;
        case 'ExampleEdit':
            popUpWin("/pages/popup/example-edit.asp" + param, gubun, 507, 505, 0, 0, "yes", "yes", true); // 2009-12-08 설미현 560 - 505로 수정 
            break;
		case 'FindExampleSentences':
			popUpWin("/pages/popup/pop-search-example.asp" + param, gubun, 540, 700, 0, 0, "yes", "yes", true);
           	break;
        case 'POP_TTS':
            popUpWin("/pages/popup/pop-tts.asp" + param, gubun, 300, 210, 0, 0, "no", "no", true);
            break;
        case 'POP_SPELL':
            popUpWin("/pages/popup/pop-spell.asp" + param, gubun, 410, 450, 0, 0, "no", "no", true);
            break;
        case 'POP_WORD':
            popUpWin("/pages/popup/pop-word.asp" + param, gubun, 305, 190, 0, 0, "no", "no", true);
            break;
        case 'POP_SCRAP':
            popUpWin("/pages/popup/pop-scrap.asp" + param, gubun, 300, 185, 0, 0, "no", "no", true);
            break;                 
        case 'MINI_SEARCH':
            //if ($F('search_word') == "") {
            //    return;
            //}
            param = "?search_word=" + escape($F('search_word'));
            popUpWin("/pages/popup/minisearch.asp" + param, gubun, 690, 550, 0, 0, "no", "no", true);
            break;               
		default:
    }
}

/**
* 팝업창을 띄운다.
*
* @param urlWin 경로
* @param winName 팝업명
* @param widthWin 팝업의 폭
* @param heightWin 팝업의 높이
* @param topWind 팝업의 상단위치
* @param leftWin 팝업의 좌측위치
* @param scrollbarsWin 스크롤(yes, no, auto)
* @param resizableWin 리사이즈(yes, no)
* @param centerFlag 팝업창 중앙위치(true, false)
*/
function popUpWin(urlWin, winName, widthWin, heightWin, topWind, leftWin, scrollbarsWin, resizableWin, centerFlag) {
    var x;
    var y;

    var nameWin = (winName != null && winName.length > 0) ? winName : 'winPop1';

    //nameWin += getYear() + getMonth() + getDay() + getHour() + getMinute() + getSecond() + getMillisecond();

    if (centerFlag == true) {
        x = (screen.availWidth - widthWin) / 2;
        y = (screen.availHeight - heightWin) / 2;
    }
    else {
        x = leftWin;
        y = topWind;
    }

    var _popWindObj = window.open(urlWin, nameWin, 'top=' + y + ',left=' + x + ',width=' + widthWin + ",height=" + heightWin + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbarsWin + ',resizable=' + resizableWin + ',copyhistory=no');
    _popWindObj.focus();
}

/**
* 팝업창을 띄운다. (폼을 submit 한다)
*
* @param urlWin 경로
* @param winName 팝업명
* @param widthWin 팝업의 폭
* @param heightWin 팝업의 높이
* @param topWind 팝업의 상단위치
* @param leftWin 팝업의 좌측위치
* @param scrollbarsWin 스크롤(yes, no, auto)
* @param resizableWin 리사이즈(yes, no)
* @param centerFlag 팝업창 중앙위치(true, false)
* @param formObj 폼 객
*/
function popUpWinSumit(urlWin, winName, widthWin, heightWin, topWind, leftWin, scrollbarsWin, resizableWin, centerFlag, formObj) {
    var x;
    var y;

    var nameWin = (winName != null && winName.length > 0) ? winName : 'winPop2';

    //nameWin += getYear() + getMonth() + getDay() + getHour() + getMinute() + getSecond() + getMillisecond();

    if (centerFlag == true) {
        x = (screen.availWidth - widthWin) / 2;
        y = (screen.availHeight - heightWin) / 2;
    }
    else {
        x = leftWin;
        y = topWind;
    }

    var _popWindObj = window.open('', nameWin, 'top=' + y + ',left=' + x + ',width=' + widthWin + ",height=" + heightWin + ',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbarsWin + ',resizable=' + resizableWin + ',copyhistory=no');

    formObj.target = nameWin;
    formObj.action = urlWin;
    formObj.submit();

    _popWindObj.focus();
}

/**
* 년도 4자리를 얻는다
*/
function getYear() {
    var today = new Date();

    return today.getFullYear().toString();
}

/**
* 월 2자리를 얻는다
*/
function getMonth() {
    var today = new Date();

    if ((today.getMonth() + 1) < 10) {
        return ('0' + (today.getMonth() + 1));
    }
    else {
        return (today.getMonth() + 1).toString();
    }
}

/**
* 일 2자리를 얻는다.
*/
function getDay() {
    var today = new Date();
    var d = '';

    if (today.getDate() < 10) {
        return ('0' + today.getDate());
    }
    else {
        return today.getDate().toString();
    }
}

/**
* 요일정보를 얻는다.
*/
function getWeek() {
    var today = new Date();
    var week = "";

    if (parseInt(today.getDay()) == 0) {
        week = "일";
    }
    else if (parseInt(today.getDay()) == 1) {
        week = "월";
    }
    else if (parseInt(today.getDay()) == 2) {
        week = "화";
    }
    else if (parseInt(today.getDay()) == 3) {
        week = "수";
    }
    else if (parseInt(today.getDay()) == 4) {
        week = "목";
    }
    else if (parseInt(today.getDay()) == 5) {
        week = "금";
    }
    else if (parseInt(today.getDay()) == 6) {
        week = "토";
    }

    return week;
}

/**
* 년월일을 구부자로 분리하여 얻는다
*
* @param gubun 구분자
*/
function getDate(gubun) {
    if (gubun != null && gubun != '') {
        return (getYear() + gubun + getMonth() + gubun + getDay());
    }
    else {
        return (getYear() + "" + getMonth() + "" + getDay());
    }
}

/**
* 0~23 사이의 시간정보 2자리를 얻는다.
*/
function getHour() {
    var today = new Date();

    if (today.getHours() < 10) {
        return ('0' + today.getHours());
    }
    else {
        return today.getHours().toString();
    }
}

/**
* 0~59 사이의 분정보 2자리를 얻는다.
*/
function getMinute() {
    var today = new Date();

    if (today.getMinutes() < 10) {
        return ('0' + today.getMinutes());
    }
    else {
        return today.getMinutes().toString();
    }
}

/**
* 0~59 사이의 초정보 2자리를 얻는다.
*/
function getSecond() {
    var today = new Date();

    if (today.getSeconds() < 10) {
        return ('0' + today.getSeconds());
    }
    else {
        return today.getSeconds().toString();
    }
}

/**
* 100분의 1초 3자리를 얻는다.
*/
function getMillisecond() {
    var today = new Date();
    var ms = today.getMilliseconds().toString();

    if (ms.length == 0) {
        return '000';
    }
    else if (ms.length == 1) {
        return ('00' + ms);
    }
    else if (ms.length == 2) {
        return ('0' + ms);
    }
    else {
        return ms;
    }
}

/**
* 타이머로 Opacity값 조정
*
* @param opacityValue Opacity값 (parseFloat(1.0))
* @param interval 타이머호출간격
* @param callFunc 타이머 호출시 호출되는 함수
* @param resultFunc 타이머 완료시 호출되는 함수
* @param str 문자열
*/
function itemDeleteOpacity(opacityValue, interval, callFunc, resultFunc, str) {
    var opacity = opacityValue - 0.1;

    if (opacity >= 0) {
        if (callFunc) {
            callFunc(opacity, str);
        }

        setTimeout("itemDeleteOpacity(" + opacity + ", " + interval + ", " + callFunc + ", " + resultFunc + ", '" + str + "')", interval);
    }
    else {
        if (resultFunc) {
            resultFunc(str);
        }
    }
}

/**
* 파일문자열에서 확장자를 얻는다.
*
* @param strFile 문자열
* @param rtnType 'L'->소문자, 'U'->대문자
* @return 파일확장자
*/
function getFileExt(strFile, rtnType) {
    if (rtnType != "L" && rtnType != "U") {
        rtnType = "L";
    }

    if (rtnType == "L") {
        return ((strFile.indexOf(".") < 0) ? "" : strFile.substring(strFile.lastIndexOf(".") + 1, strFile.length).toLowerCase())
    }
    else if (rtnType == "U") {
        return ((strFile.indexOf(".") < 0) ? "" : strFile.substring(strFile.lastIndexOf(".") + 1, strFile.length).toUpperCase())
    }
}

/**
* 입력 받은 두 날짜의 차이를 리턴한다.
* 시작 time1 형식 yyyy&MM&dd
* 종료 time2 형식 yyyy&MM&dd
* 분할문자 splitStr 위 &에 해당하는 분할 문자
* return 두 날짜의 차이 일수
*/
function getDayInterval(time1, time2, splitStr) {
    var i = 0;
    var j = 0;
    var end = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);

    if (time1.length != 10 || time2.length != 10) {
        return 0;
    }

    var sTimeArr = time1.split(splitStr);
    var eTimeArr = time2.split(splitStr);

    if (sTimeArr.length != 3 || eTimeArr.length != 3) {
        return 0;
    }

    var sDate = new Date(sTimeArr[0], (eval(sTimeArr[1]) - 1), sTimeArr[2]);
    var eDate = new Date(eTimeArr[0], (eval(eTimeArr[1]) - 1), eTimeArr[2]);
    //var sDate = new Date(eval(sTimeArr[0])-1,(eval(sTimeArr[1])-1),eval(sTimeArr[2])-1);
    //var eDate = new Date(eval(eTimeArr[0])-1,(eval(eTimeArr[1])-1),eval(eTimeArr[2])-1)
    var sDate = new Date(eval(sTimeArr[0]), (eval(sTimeArr[1]) - 1), eval(sTimeArr[2]) - 1);
    var eDate = new Date(eval(eTimeArr[0]), (eval(eTimeArr[1]) - 1), eval(eTimeArr[2]) - 1); ;
    var day = 1000 * 3600 * 24; //24시간

    return Math.ceil(eval((eDate.getTime() - sDate.getTime()) / day));
}

function getCookieVal(offset) {
    var endstr = document.cookie.indexOf(";", offset);

    if (endstr == -1) {
        endstr = document.cookie.length;
    }

    return unencodeURIComponent(document.cookie.substring(offset, endstr));
}

function GetCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;

    while (i < clen) {
        var j = i + alen;

        if (document.cookie.substring(i, j) == arg) {
            return getCookieVal(j);
        }

        i = document.cookie.indexOf(" ", i) + 1;

        if (i == 0) {
            break;
        }
    }

    return null;
}

function SetCookie(name, value, expires, path, domain, secure) 
{
    var argv = SetCookie.arguments;
    var argc = SetCookie.arguments.length;
    /*
    var expires = (2 < argc) ? argv[2] : null;
    var path = (3 < argc) ? argv[3] : null;
    var domain = (4 < argc) ? argv[4] : null;
    var secure = (5 < argc) ? argv[5] : false;
    */
    document.cookie = name + "=" + encodeURIComponent(value) +
      ((expires == null) ? "" :
         ("; expires=" + expires.toGMTString())) +
      ((path == null) ? "" : ("; path=" + path)) +
      ((domain == null) ? "" : ("; domain=" + domain)) +
      ((secure == true) ? "; secure" : "");
}

function DelCookie(name)
{
	document.cookie = name + "=;expires=0";
}

//*****************************************************************************
//Description : 특정값 페턴 체크
//Parameter:
//Return:
//Usage:
//*****************************************************************************
function chkPattern(str, type)	//형식 체크
{
    switch (type) {
        case "NUM": //숫자만
            pattern = /^[0-9]+$/;
            break;

        case "PHONE": 	// 전화번호
            pattern = /^[0-9]{2,4}-[0-9]{3,4}-[0-9]{4}$/;
            break;

        case "MOBILE": 	// 휴대전화
            pattern = /^0[0-9]{2,3}-[0-9]{3,4}-[0-9]{4}$/;
            break;

        case "ZIPCODE": // 우편번호
            pattern = /^[0-9]{3}-[0-9]{3}$/;
            break;

        case "EMAIL": //메일
            pattern = /^[a-zA-Z0-9._-]+@([a-zA-Z0-9.-]+\.)+[a-zA-Z]{2,4}$/;
            break;

        case "DOMAIN": //영자 숫자와	.	다음도 영자
            pattern = /^[.a-zA-Z0-9-]+.[a-zA-Z]+$/;
            break;

        case "ENG": //영자만
            pattern = /^[a-zA-Z]+$/;
            break;

        case "ENGNUM": //영자와	숫자
            pattern = /^[a-zA-Z0-9]+$/;
            break;

        case "ACCOUNT": //숫자	와 '-'
            pattern = /^[0-9-]+$/;
            break;

        case "HOST": //영자	와 '-'
            pattern = /^[a-zA-Z-]+$/;
            break;

        case "ID": //첫글자는 영자 그 뒤엔 영어숫자 4이상 15자리	이하
            pattern = /^[a-zA-Z]{1}[a-zA-Z0-9]{4,15}$/;
            break;

        case "ID2": //첫글자는	영자 그뒤엔	영어숫자 4이상 15자리	이하
            pattern = /^[a-zA-Z0-9._-]+$/;
            break;

        case "DATE": //	형식 : 2002-08-15
            pattern = /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/;
            break;

        case "JUMIN": 	// 주민등록번호
            pattern = /^[0-9]{13}$/;
            break;

        default:
            return false;
    }

    return pattern.test(str);
}


//*****************************************************************************
//Description : 유효성 체크
//Parameter:
//Return:
//Usage:
//*****************************************************************************
function CheckValid(String, space) {
    var retvalue = false;
    for (var i = 0; i < String.length; i++) {		//String이 0(""	이나 null)이면 무조건	false
        if (space == true) {
            if (String.charAt(i) == ' ') {			//String이 0이 아닐때	space가	있어야만 true(valid)
                retvalue = true;
                break;
            }
        } else {
            if (String.charAt(i) != ' ') {			//string이 0이 아닐때	space가	아닌 글자가	있어야만 true(valid)
                retvalue = true;
                break;
            }
        }
    }
    return retvalue;
}

//*****************************************************************************
//Description : 항목이	비어있는지 체크
//Parameter: isFocus:객체에 focusing여부
//Return:
//Usage:
//*****************************************************************************
function isEmpty(field, error_msg, isFocus) {
    // error_msg가 ""이면	alert와	focusing을 하지않는다
    if (error_msg == "") {
        if (!CheckValid(field.value, false)) {
            return true;
        } else {
            return false;
        }
    } else {
        if (!CheckValid(field.value, false)) {
            alert(error_msg);
            if (isFocus != false) field.focus();
            return true;
        } else {
            return false;
        }
    }
}

//*****************************************************************************
//Description : 메세지 처리후 focusing
//Parameter:
//Return:
//Usage:
//*****************************************************************************
function altFocus(field, error_msg, isFocus) {
    alert(error_msg);
    if (isFocus != false) field.focus();
    return false;
}


/**
* 날짜로 조회시 오늘날짜 기준으로 선택한 일수에 따른 날자를 뽑는다.
* 
* @param dt_val 일수
* @return 날짜
* 
* 사용방법: dsunfold_util_getPrevDate(0)->당일, dsunfold_util_getPrevDate(-7)->7일, dsunfold_util_getPrevDate(-30)->3개월
*/
function dsunfold_util_getPrevDate(dt_val) {

    var newdate = new Date();
    var nowdate = new Date();
    var mm;
    var dd;

    var newtimes = newdate.getTime() + (parseInt(dt_val) * 24 * 60 * 60 * 1000);
    newdate.setTime(newtimes);

    if (newdate.getMonth() < 9) {
        mm = "0" + (newdate.getMonth() + 1).toString();

    } else {
        mm = (newdate.getMonth() + 1).toString();
    }

    if (newdate.getDate() < 10) {
        dd = "0" + newdate.getDate().toString();
    } else {
        dd = newdate.getDate().toString();
    }

    return newdate.getYear() + "-" + mm + "-" + dd;
}

//플래시 파일 로드
function setFlash(src, w, h, id, vars) {
    var Flash_html = "";
    Flash_html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="' + id + '" width="' + w + '" height="' + h + '">';
    Flash_html += '<param name="movie" value="' + src + '">';
    Flash_html += '<param name="quality" value="high">';
    Flash_html += '<param name="wmode" value="transparent">';
    Flash_html += '<param name="FlashVars" value="' + vars + '">';
    Flash_html += '<param name="swliveconnect" value="true">';
    Flash_html += '<embed src="' + src + '" quality=high wmode="transparent" FlashVars="' + vars + '" width="' + w + '" height="' + h + '" swliveconnect="true" id="' + id + '" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
    Flash_html += '</object>';
    document.write(Flash_html);
}


function downLoad(gubun, seq, index) {
    $('action').src = '/download.jsp?gubun=' + gubun + '&seq=' + seq + '&index=' + index;
}

function checkAll(select) {
    if (!select.checked) {
        $('select_all').checked = false;
    }
}

// 선택검색 전체 선택시
function checkAllItem(select) {
    var checkItem = document.getElementsByName('select_value');
    var index = 0;
    //if (select.checked) {
        for (index = 0; index < checkItem.length; index++) {
            checkItem[index].checked = select.checked;
        }
    //}        
}

// 질문,답변 펼쳐보이기
var old = '';
function onView(id, name) {
    submenu = document.getElementById(id + "_" + name);
    var appname = navigator.appName;

    if (old != submenu) {
        if (old != '') {
            old.style.display = 'none';
        }
        if (appname == "Netscape") {
            submenu.style.display = "table-row";
        } else {
            submenu.style.display = "block";
        }
        old = submenu;
    } else {
        submenu.style.display = 'none';
        old = '';
    }
}

// 퀵메뉴 펼치기
function startCateScrollScroll() {
    setTimeout("slideCateScroll()", 8);
}

function slideCateScroll() {
    var Sel_Height = 100;
    el = document.getElementById("scroll-list");

    if (el.heightPos == null || (el.isDone && el.isOn == false)) {
        el.isDone = false;
        el.heightPos = 1;
        el.heightTo = Sel_Height;
    } else if (el.isDone && el.isOn) {
        el.isDone = false;
        el.heightTo = 1;
    }
    if (Math.abs(el.heightTo - el.heightPos) > 1) {
        el.heightPos += (el.heightTo - el.heightPos) / 8;
        el.style.height = el.heightPos + "px";
        startCateScrollScroll();
    } else {
        if (el.heightTo == Sel_Height) {
            el.isOn = true;
        } else {
            el.isOn = false;
        }
        el.heightPos = el.heightTo;
        el.style.height = el.heightPos + "px";
        el.isDone = true;
    }
}

function encodingURL() {

    if (document.getElementById("search_word").value == "") {
        return false;
    }

    return true;
    
}


/********************************************************************************
From Design
********************************************************************************/
//Element ID 불러쓰기
function dEI(elementID)
{
	return document.getElementById(elementID);
}
// Tab Content
function tabCheck(dotabid, num)
{
	var inum = parseInt(num) - 1;
	var linkTab = dEI(dotabid).getElementsByTagName("a");
	for (i = 0; i < linkTab.length; i++)
	{
		var tabimg = linkTab.item(i).getElementsByTagName("img").item(0);
		var tabContents = dEI(dotabid + (1 + i));
		if (i == inum)
		{
			if (tabContents.style.display != "block")
			{
				tabimg.src = tabimg.src.replace("_off.gif", "_on.gif");
				tabContents.style.display = "block";
			}
		} else
		{
			tabimg.src = tabimg.src.replace("_on.gif", "_off.gif");
			tabContents.style.display = "none";
		}
	}
}

function changeBestList(div_id) {
    if (div_id == "best_qna_read") {
        document.getElementById(div_id).style.display = "block";
        document.getElementById('best_qna_point').style.display = "none";

        document.getElementById('best_qna_read_img').src = "/img/qna/btn_best_tab01_on.gif";
        document.getElementById('best_qna_point_img').src = "/img/qna/btn_best_tab02_off.gif";
    }
    else if (div_id == "best_qna_point") {
        document.getElementById(div_id).style.display = "block";
        document.getElementById('best_qna_read').style.display = "none";

        document.getElementById('best_qna_read_img').src = "/img/qna/btn_best_tab01_off.gif";
        document.getElementById('best_qna_point_img').src = "/img/qna/btn_best_tab02_on.gif";
    }
}

// 검색 엔진 자동 완성 관련....

var bDebugMode = false;
//var nCurMenu	= 0;
//var nMenuLength = 0;
var nHeightPerLine = 14;
//var rMenu;
var bAutoRequest = false;
var sSentQuery = "";
var sLastReceived = "default";
var sMenuColor = "#FFFFFF";
var sMenuColorSelected = "#cfcfcf";
var isKeyEvent = false;

var xmlHttp;
var convertHttp;
var simpleHttp;
var checkFirst = false;
var lastKeyword = "";
var loopSendKeyword = false;
var isConvertChecked = true;
var is_convert = "";
var first = 15; 	// 노출 수 : 앞 단어 일치
var last = 3; 	// 노출 수 : 뒤 단어 일치

var nCurMenu = 0;
var nMenuLength = 0;

function startSuggest() {
    if (checkFirst == false) {
        setTimeout("sendKeyword();", 40);
        loopSendKeyword = true; // 0.2초 후에 sendKeyword()함수를 실행
    }
    checkFirst = true;
}

//검색 엔진에 입력된 키워드 내용 전달 - 데이터 요청
//displayResult method로 연결됨
function sendKeyword() {
    if (loopSendKeyword == false)
        return;

    var keyword = document.getElementById("search_word").value;

    var isRight = injectionValidate(keyword);
    if (!isRight)
    {
    	alert("금지된 단어입니다.");
    	document.getElementById("search_word").value = "";
    	sendKeyword();
    	return;
    }
    
    if (keyword == "") {
        var listView = document.getElementById('lSuggestResult');
        listView.innerHTML = "";
        lastKeyword = "";
        mMenuLength = 0;
        nCurMenu = 0;
        isConvertChecked = true;
        hide('lSuggestResult');
        document.getElementById('simpleResult').style.display = "none";
        document.getElementById('simpleClose').style.display = "none";
        //parent.document.getElementById('hFrame').style.display = "none";
        //document.getElementById('suggest').style.display = "none";
    }
    else if (keyword != lastKeyword && isKeyEvent == true)
    {
    	lastKeyword = keyword;

        if (keyword != "") {
            xmlHttp = GetXmlHttpObject();

            if (xmlHttp == null) {
                alert("Your browser does not support AJAX!");
                return;
            }

            first = 15; 	// 노출 수 : 앞 단어 일치
            last = 3; 	// 노출 수 : 뒤 단어 일치            
            
            var url = "/pages/search/autoComplete.asp?q=" + encodeURIComponent(keyword) + "&first=" + encodeURIComponent(first) + "&last=" + encodeURIComponent(last);
            //var url = "http://164.125.36.41/innerXML/new/autoComplete.asp";
            
            xmlHttp.open("GET", url, true);
            xmlHttp.onreadystatechange = displayResult;
            xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
            //xmlHttp.send("q=" + encodeURIComponent(keyword) + "&first=" + encodeURIComponent(first) + "&last=" + encodeURIComponent(last));
            xmlHttp.send(null);
        }
        else {
            isConvertChecked = true;
            var listView = document.getElementById('lSuggestResult');
            listView.innerHTML = "";
            mMenuLength = 0;
            nCurMenu = 0;
            hide('lSuggestResult');
            document.getElementById('simpleResult').style.display = "none";
            //parent.document.getElementById('hFrame').style.display = "none";
            //document.getElementById('suggest').style.display = "none";
        }
    }
    setTimeout("sendKeyword();", 40);
}


//자동완성 내용 표시 처리
function displayResult(responseHttpObj) {
    if (xmlHttp.readyState == 4) {
        if (xmlHttp.status == 200) {
            var resultText = xmlHttp.responseText;
            var isConvert = resultText.split('@@');
            var resultList = isConvert[0].split('##');
            //alert(isConvert[1]);
            //if(resultList.length > 0)
            if (resultText != "Search Fail") {
                var sList = "";
                var i = 1;
                var j = 1;
                var k = 1;
                var l = 1;

                for (l = 0; l < resultList.length; l++) {
                    if (resultList[l].substring(0, 1) == "F") {
                        var firstResult = resultList[l].substring(1, resultList[l].length);
                        var keywordList = firstResult.split('||');
                        nMenuLength = 0;
                        if (keywordList.length > 0) {
                            nCurMenu = 0;
                            nMenuLength = keywordList.length;

                            if (keywordList[0] != "") {
                                sList += "<div>"
                                for (i = 1; i <= keywordList.length; i++) {
                                    var sIndex = "";
                                    var sWord = "";
                                    var sWeight = "";
                                    var index_word = keywordList[i - 1].split('&&');
                                    //2009-10-19 : 자바스크립트 변경 요청, is_hangul() 메서드는 추가 요청
                                    //var firstWord = index_word[1].split(',');
                                    var firstWord = "";
                                    if (is_hangul(index_word[1]))
                                    	firstWord = (index_word[1].split(','))[0];
                                    else
                                    	firstWord = index_word[1];

                                    
                                    
                                    sIndex = index_word[0];
                                    sWord = index_word[1];
                                    if (index_word[1].length > 30) {
                                        sWord = index_word[1].substring(0, 30) + "...";
                                    }

                                    sWord = highlightCheck(sWord);
                                    sList += "<ul class=\"cul\" id='menu" + i + "' onmouseover='onMouseOverKeyword(" + i + ")' onmouseout='onMouseOutKeyword(" + i + ")'>";
                                    sList += "<li class=\"cword\" onclick='javascript:SelectIndex(" + i + ");'>" + sWord + "</li>";
                                    sList += "<input type=\"hidden\" name='hindex" + i + "' id='hindex" + i + "' value=\"" + sIndex + "\">";
                                    sList += "<input type=\"hidden\" name='hmenu" + i + "' id='hmenu" + i + "' value=\"" + firstWord + "\">";
                                    sList += "</ul>";
                                }
                                sList += "</div>";
                            }
                        }
                    }
                    else if (resultList[l].substring(0, 1) == "L") {
                        var lastResult = resultList[l].substring(1, resultList[l].length);
                        var rKeywordList = lastResult.split('||');
                        if (rKeywordList.length > 0) {
                            nCurMenu = 0;
                            nMenuLength += rKeywordList.length;

                            sList += "<div class=\"creverse\">";
                            for (j = 1; j <= rKeywordList.length; j++) {
                                var sIndex = "";
                                var sWord = "";
                                var sWeight = "";
                                var rIndex_word = rKeywordList[j - 1].split('&&');
                                
                                //2009-10-19 : 자바스크립트 변경 요청, is_hangul() 메서드는 추가 요청
                                //var rFirstWord = rIndex_word[1].split(',');
                                var rFirstWord = "";
                                if (is_hangul(rIndex_word[1]))
                                	rFirstWord = (rIndex_word[1].split(','))[0];
                                else
                                	rFirstWord = rIndex_word[1];

                                
                                sIndex = rIndex_word[0];
                                sWord = rIndex_word[1];
                                if (rIndex_word[1].length > 45) {
                                    sWord = rIndex_word[1].substring(0, 45) + "...";
                                }

                                sWord = highlightrCheck(sWord);
                                sList += "<ul class=\"cul\" id='menu" + i + "' onmouseover='onMouseOverKeyword(" + i + ")' onmouseout='onMouseOutKeyword(" + i + ")'>";
                                sList += "<li class=\"cword\" onclick='javascript:SelectIndex(" + i + ");'>" + sWord + "</li>";
                                sList += "<input type=\"hidden\" name='hindex" + i + "' id='hindex" + i + "' value=\"" + sIndex + "\">";
                                sList += "<input type=\"hidden\" name='hmenu" + i + "' id='hmenu" + i + "' value=\"" + rFirstWord + "\">";
                                sList += "</ul>";
                                i++;
                            }
                            sList += "</div>";
                        }
                    }
                    else {
                        // 첫 단어 일치는 없지만, 중간 또는 뒷 단어 일치가 있는 경우
                        continue;
                    }
                }
                var listView = document.getElementById('lSuggestResult');
                listView.innerHTML = sList;
                show('lSuggestResult');
                document.getElementById('simpleResult').style.display = "none";
                //parent.document.getElementById('hFrame').style.display = "block";
                //document.getElementById('suggest').style.display = "block";
                if (nMenuLength > 0) {
                    var autoIndex = document.getElementById('hindex1').value;
                    sendSimple(autoIndex);
                }
            }
            else {
                //hide('suggest');
                var listView = document.getElementById('lSuggestResult');
                listView.innerHTML = "";
                mMenuLength = 0;
                nCurMenu = 0;
                hide('lSuggestResult');
                document.getElementById('simpleResult').style.display = "none";
                //parent.document.getElementById('hFrame').style.display = "none";
                //document.getElementById('suggest').style.display = "none";
            }
            if (isConvert[1] == "E") {
                is_convert = "E";
                sendConvert();
            }
            else if (isConvert[1] == "K") {
                is_convert = "K";
                //sendConvert();
            }
        }
        else {
            // FIXME: 종훈 - 실제 사용될 때는 이를 죽여놔야 한다.
            /*
            if (xmlHttp.status == 500) {
                //alert(xmlHttp.responseText);
                alert("[Debug Mode] 500 Error. displayResult 페이지를 Refresh 해 주세요.");
            }
            else {
                //alert("[Debug Mode] 에러 발생 displayResult : " + xmlHttp.status);
            }
            */
        }
    }
}

function sendConvert() {
    /*
    //var convert_checkbox = parent.document.getElementById("check_convert");
    //if (convert_checkbox.checked == true && isConvertChecked == true) {
        var keyword = parent.document.getElementById("search_word").value;

        convertHttp = GetXmlHttpObject();

        if (convertHttp == null) {
            alert("Your browser does not support AJAX!");
            return;
        }
        var url = "/pages/search/Convert.asp";

        convertHttp.open("POST", url, true);
        convertHttp.onreadystatechange = convertResult;
        convertHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
        convertHttp.send("q=" + encodeURIComponent(keyword));

        //		isConvertChecked = false;
    //}
    */
}

function sendSimple(simple_index) {
    if (simple_index != "") {
        simpleHttp = GetXmlHttpObject();

        if (simpleHttp == null) {
            alert("Your browser does not support AJAX!");
            return;
        }
        var url = "/pages/search/SimpleResult.asp";

        simpleHttp.open("POST", url, true);
        simpleHttp.onreadystatechange = simpleResult;
        simpleHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
        simpleHttp.send("q=" + encodeURIComponent(simple_index));
    }
}

function simpleResult() {
    if (simpleHttp.readyState == 4) {
        if (simpleHttp.status == 200) {
            var simpleInnerText = "<div>";
            simpleInnerText += simpleHttp.responseText;
            simpleInnerText += "</div>";
            //alert(simpleInnerText);
            simpleElement = document.getElementById("simpleResult");
            simpleElement.innerHTML = simpleInnerText;
            simpleElement.style.display = "block";
            document.getElementById('simpleClose').style.display = "block";
        }
        else {
            // FIXME: 종훈 - 실제 사용될 때는 이를 죽여놔야 한다.
            if (simpleHttp.status == 500) {
                alert("[Debug Mode] 500 Error. simpleResult 페이지를 Refresh 합니다.");
                window.location = "/search.asp";
            }
            else {
                //alert("[Debug Mode] 에러 발생 simpleResult : " + simpleHttp.status);
            }
        }
    }
}

function convertResult() {
    if (convertHttp.readyState == 4) {
        if (convertHttp.status == 200) {
            //var convert_checkbox = parent.document.getElementById("check_convert");
            var keyword_textbox = document.getElementById("search_word");
            //if (keyword_textbox.value.length > 1 && convert_checkbox.checked == true && isConvertChecked == true) {
                if (is_convert == "E") {
                    keyword_textbox.blur();
                    keyword_textbox.focus();
                    keyword_textbox.value = convertHttp.responseText;
                    keyword_textbox.blur();
                    keyword_textbox.focus();
                    keyword_textbox.style.imeMode = "inactive";

                    isConvertChecked = false;
                }
                else if (is_convert == "K") {
                    var i = 1;
                    var do_covert = false;
                    var convertText = convertHttp.responseText;

                    for (i = 1; i <= nMenuLength; i++) {
                        if (document.getElementById("hmenu" + i).value == convertText) {
                            do_convert = true;
                            break;
                        }
                        do_convert = false;
                    }
                    if (do_convert == true) {
                        keyword_textbox.blur();
                        keyword_textbox.focus();
                        keyword_textbox.value = convertText;
                        keyword_textbox.blur();
                        keyword_textbox.focus();
                        keyword_textbox.style.imeMode = "active";

                        isConvertChecked = false;
                    }
                }
                else {
                    //alert("convert error");
                    isConvertChecked = false;
                    // error
                }
            //}
        }
        else {
            // FIXME: 종훈 - 실제 사용될 때는 이를 죽여놔야 한다.
            if (convertHttp.status == 500) {
                //alert(convertHttp.responseText);
                //alert("[Debug Mode] 500 Error. convertResult 페이지를 Refresh 합니다.");
                //window.location = "/search.asp";
            }
            else {
                //alert("[Debug Mode] 에러 발생 convertResult : " + convertHttp.status);
            }
        }
    }
}

function GetXmlHttpObject() {
    var xmlHttp = null;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}

function show(elementId) {
    var element = document.getElementById(elementId);
    if (element) {
        element.style.display = 'block';
    }
}

function hide(elementId) {
    var element = document.getElementById(elementId);
    if (element) {
        element.style.display = 'none';
    }
}

function toggleSelectSearch() {

    Element.toggle($('select_search'));

    if ($('select_search').style.display == "none") {
        $('select_search_img').src = "/img/common/btn_high_search.gif";
    }
    else {
        $('select_search_img').src = "/img/common/btn_high_search_c.gif";
    }
    //alert($('select_search_img').src);        
    hideAll(); hideRecent();
}

function hideAll() {
    document.getElementById('simpleResult').style.display = "none";
    document.getElementById('lSuggestResult').style.display = 'none';
    document.getElementById('simpleClose').style.display = 'none';
}

function hideRecent() {
	document.getElementById('recent_search').style.display = "none";
	document.getElementById('recent_result').style.display = "none";
	document.getElementById('recent_close').style.display = "none";
}

function clearCursorPos() {
    for (var i = 1; i <= nMenuLength; i++) {
        var element = document.getElementById("menu" + i);
        if (element) {
            element.style.backgroundColor = sMenuColor;
        }
    }
}

//마우스 오버
function onMouseOverKeyword(curSorNum) {
    clearCursorPos();
    curCursorPos = curSorNum;
    var element = document.getElementById("menu" + curCursorPos);
    if (element) {
        element.style.backgroundColor = sMenuColorSelected;
        nCurMenu = curCursorPos;
        var autoIndex = document.getElementById('hindex' + nCurMenu).value;
        sendSimple(autoIndex);

        //var simpleInnerText = "<div>";
        //simpleInnerText += "<b>" + document.getElementById("hmenu"+curCursorPos).value + "</b><p>";
        //simpleInnerText += document.getElementById("hsimple"+curCursorPos).value + "</div>";
        //simpleElement = document.getElementById("simpleResult");
        //simpleElement.innerHTML = simpleInnerText;
        //simpleElement.style.display = "block";
    }
}

//마우스 아웃
function onMouseOutKeyword(curSorNum) {
    curCursorPos = curSorNum;
    var element = document.getElementById("menu" + curCursorPos);
    if (element) {
        element.style.backgroundColor = sMenuColor;
    }
}

//자동완성 내용을 마우스로 클릭시
function SelectIndex(curSorNum)
{
	curCursorPos = curSorNum;
    var element = document.getElementById("hmenu" + curCursorPos);
    if (element) {
        document.getElementById('search_word').value = element.value;

        loopSendKeyword = false;
        checkFirst = false;

        var listView = document.getElementById('lSuggestResult');
        listView.innerHTML = "";
        mMenuLength = 0;
        nCurMenu = 0;
        hide('lSuggestResult');
        document.getElementById('simpleResult').style.display = "none";
        document.getElementById('simpleClose').style.display = "none";
        document.search.submit();
    }
}

function highlightCheck(str) {
    var rtStr = "";
    var revertQuery = document.getElementById('search_word').value;
    var _str = str;
    var _userKeyword = revertQuery;
    _str = _str.toLowerCase();
    _userKeyword = _userKeyword.toLowerCase();

    startPosition = -1;
    while (true) {
        if (_userKeyword == _str.substring(startPosition + 1, startPosition + 1 + _userKeyword.length)) {
            rtStr += _str.substring(0, startPosition + 1);
            rtStr += "<font color='#eb550c'>";
            rtStr += _str.substring(startPosition + 1, startPosition + 1 + _userKeyword.length);
            rtStr += "</font>";
            rtStr += _str.substring(startPosition + 1 + _userKeyword.length, _str.length);
            break;
        }
        startPosition = _str.indexOf(" ", startPosition + 1);
        if (startPosition == -1) {
            break;
        }
    }
    if (rtStr == "") {
        rtStr += str;
    }

    return rtStr;
}

function highlightrCheck(str) {
    var rtStr = "";
    var revertQuery = document.getElementById('search_word').value;
    var _str = str.replace(/ /g, "");
    var _userKeyword = revertQuery.replace(/ /g, "");
    _str = _str.toLowerCase();
    _userKeyword = _userKeyword.toLowerCase();
    if (_userKeyword == _str.substring(_str.length - _userKeyword.length)) {
        for (var i = 0, j = 0; j < _str.length - _userKeyword.length; i++) {
            if (str.substring(i, i + 1) != " ") j++;
            rtStr += str.substring(i, i + 1);
        }
        rtStr += "<font color='#eb550c'>";

        for (var k = i, l = 0; l < _userKeyword.length; k++) {
            if (str.substring(k, k + 1) != " ") l++;
            rtStr += str.substring(k, k + 1);
        }
        rtStr += "</font>";
    } else {
        rtStr += str;
    }
    return rtStr;
}

function getById(id, where) {
    if (where == null)
        return document.getElementById(id);
    else
        return eval(where + ".document.getElementById('" + id + "')");
}

function hideSelectSearch() {
    $('select_search').style.display = 'none';
}

function hideRecent() {
    $('recent_close').style.display = 'none';
    $('recent_search').style.display = 'none';
    $('recent_result').style.display = 'none';        
}

function searchRecent(e, eventObj) {
    if (!e)
        e = top.window.event;

    var oLayerSuggest = getById('recent_search');
    
    hideAll();
    hideSelectSearch();

    new Ajax.Updater("recent_search", "/pages/ajax/recent-search.asp", {
        method: 'GET',
        evalScripts: true,
        parameters: 'type=recent'
    });
	
    /*
	oLayerSuggest.style.display = "block";
    getById('recent_close').style.display = "block";
	*/

	if(oLayerSuggest.style.display=="none"){
		oLayerSuggest.style.display = "block";
		getById('recent_close').style.display = "block";
		$('select_search_img_his').src = "/img/common/btn_his_search_c.gif";
	}else{
		$('select_search_img_his').src = "/img/common/btn_his_search.gif";
		hideRecent();
	}
}

/*
function searchRecentDetail(e, eventObj, word)
{
	if (!e)
		e = top.window.event;

	var oLayerSuggest = getById('recent_result');
	
	word = decodeURIComponent(word);				//지난검색어에서 단어를 넘길 때 URLEncoding을 해서 넘기므로 다시 풀어준다.
	
	$('lSuggestResult').style.display = "none";
	$('simpleResult').style.display = "none";

	new Ajax.Updater("recent_result", "/pages/ajax/recent-search.asp", {
		method: 'GET',
		evalScripts: true,
		parameters: 'type=recentDetail&word=' + encodeURIComponent(word)
	});

	oLayerSuggest.style.display = "block";
}
*/
function searchRecentDetail(e, eventObj, word)
{
	if (!e)
		e = top.window.event;

	var oLayerSuggest = getById('recent_result');

	//주의 : 빈 칸은 +문자열로 치환되어 넘어오게 됨 : 다시 복원해야 함.
	word = decodeURIComponent(word); 			//지난검색어에서 단어를 넘길 때 URLEncoding을 해서 넘기므로 다시 풀어준다.
	while (word.indexOf("+") > -1)
		word = word.replace(/[\+]/, " ");

	//alert(word);
	
	$('lSuggestResult').style.display = "none";
	$('simpleResult').style.display = "none";

	new Ajax.Updater("recent_result", "/pages/ajax/recent-search.asp", {
		method: 'GET',
		evalScripts: true,
		parameters: 'type=recentDetail&word=' + encodeURIComponent(word)
	});

	oLayerSuggest.style.display = "block";
}


function searchDown(e, eventObj) {
    if (!e)
        e = top.window.event;
        
    var oP = getById('search_word');
    var oLayerSuggest = getById('lSuggestResult');

    hideRecent();
    hideSelectSearch();

    var nKeyCode = e.keyCode;

    switch (nKeyCode) {
        /*case 13:
        if (nCurMenu != 0) {
        bAutoRequest = false;
        oP.value = rMenu[nCurMenu-1];
        oPLayerSuggest.style.display='none';
        nCurMenu = 0;
        return false;
        }
        break;*/ 
        case 40: // down arrow
            if (nMenuLength > 0 && oP.value != "") {
                if (nCurMenu != nMenuLength && nCurMenu != 0) {
                    getById('menu' + nCurMenu).style.background = sMenuColor;
                }
                nCurMenu++;
                if (nCurMenu >= nMenuLength)
                    nCurMenu = nMenuLength;
                isKeyEvent = false;
                getById('menu' + nCurMenu).style.background = sMenuColorSelected;
                getById('menu' + nCurMenu).focus();
                getById('search_word').value = getById('hmenu' + nCurMenu).value;

                var autoIndex = document.getElementById('hindex' + nCurMenu).value;
                sendSimple(autoIndex);
                //var simpleInnerText = "<div>";
                //simpleInnerText += "<b>" + document.getElementById("hmenu"+nCurMenu).value + "</b><p>";
                //simpleInnerText += document.getElementById("hsimple"+nCurMenu).value + "</div>";
                //simpleElement = document.getElementById("simpleResult");
                //simpleElement.innerHTML = simpleInnerText;
                //simpleElement.style.display = "block";

                if (!(
						oLayerSuggest.scrollTop > ((nCurMenu - 8) * nHeightPerLine)
						&&
						oLayerSuggest.scrollTop < ((nCurMenu - 8) * nHeightPerLine) + (nHeightPerLine * 7)
						)) {
                    if ((oLayerSuggest.scrollTop + nHeightPerLine) == ((nCurMenu - 8) * nHeightPerLine))
                        oLayerSuggest.scrollTop = oLayerSuggest.scrollTop - nHeightPerLine;
                    else
                        oLayerSuggest.scrollTop = (nCurMenu - 7) * nHeightPerLine;
                }
            }
            cancelEvent(e);
            break;
        case 38: // up arrow
            if (nMenuLength > 0 && oP.value != "") {
                if (nCurMenu != 0) {
                    getById('menu' + nCurMenu).style.background = sMenuColor;
                }
                nCurMenu--;
                if (nCurMenu <= 0)
                    nCurMenu = 1;
                isKeyEvent = false;
                getById('menu' + nCurMenu).style.background = sMenuColorSelected;
                getById('search_word').value = getById('hmenu' + nCurMenu).value;

                var autoIndex = document.getElementById('hindex' + nCurMenu).value;
                sendSimple(autoIndex);

                //var simpleInnerText = "<div>";
                //simpleInnerText += "<b>" + document.getElementById("hmenu"+nCurMenu).value + "</b><p>";
                //simpleInnerText += document.getElementById("hsimple"+nCurMenu).value + "</div>";
                //simpleElement = document.getElementById("simpleResult");
                //simpleElement.innerHTML = simpleInnerText;
                //simpleElement.style.display = "block";

                if (!(
						oLayerSuggest.scrollTop > ((nCurMenu - 8) * nHeightPerLine)
						&&
						oLayerSuggest.scrollTop < ((nCurMenu - 8) * nHeightPerLine) + (nHeightPerLine * 7)
						)) {
                    if ((oLayerSuggest.scrollTop + nHeightPerLine) == ((nCurMenu - 8) * nHeightPerLine))
                        oLayerSuggest.scrollTop = oLayerSuggest.scrollTop - nHeightPerLine;
                    else
                        oLayerSuggest.scrollTop = (nCurMenu - 7) * nHeightPerLine;
                }
            }
            cancelEvent(e);
            break;
        default:
            bAutoRequest = false;
            startSuggest();
            isKeyEvent = true;
    }
}

function cancelEvent(e) {
    e.returnValue = false;
    if (e && e.preventDefault) e.preventDefault();
}

var replay = 0;

function fnc_listen(murl) {
    $('player').sendEvent("LOAD", murl);
    setTimeout("onMoviePlay()", 1000);
}

function onMoviePlay() {
    try {
        document.getElementById('player').sendEvent("PLAY", "true");
    } catch (Error) {
        if (replay < 3) {
            setTimeout("onMoviePlay()", 500);
            replay++;
        }
    }
}

function onMovieStop() {
    var Player = document.getElementById("musicPlayer");

    if (Player.controls.isAvailable('Stop')) {
        Player.controls.stop();
    }
}


//아이디 유효성
function fnc_checkID(objID)
{
	var obj = document.getElementById(objID);
	var isID = /^[a-zA-Z0-9_]{4,16}$/;

	if (!isID.test(obj.value))
	{
		alert("아이디는 4~16자의 영문자와 숫자,특수기호(_)만 사용할 수 있습니다.");
		obj.focus();
		return false;
	}

	return true;
}

//2009-10-19 : 자바스크립트 변경 요청
//			   추가 요청
function is_hangul(str)
{
	var check = /[ㄱ-ㅎ|ㅏ-ㅣ|가-힣]/;
	if (check.test(str)) return true;
	return false;
}



function loginConfirm() 
{
    if (__userID == "") 
    {
        if (confirm("로그인이 필요한 페이지 입니다.\n로그인 하시겠습니까?")) 
        {
            redirectLogin('', true);
        }
        return;
    }
}

function chgimgov(cimg,chimg)
{
	cimg.src = cimg.src.replace("."+ chimg +"", "_ov."+ chimg +"");
}

function chgimgout(cimg,chimg)
{
	cimg.src = cimg.src.replace("_ov."+ chimg +"", "."+ chimg +"");
}


function chgimgon(cimg,chimg)
{
	cimg.src = cimg.src.replace("_off."+ chimg +"", "_on."+ chimg +"");
}

function chgimgoff(cimg,chimg)
{
	cimg.src = cimg.src.replace("_on."+ chimg +"", "_off."+ chimg +"");
}

function setPng24(obj)
{
	obj.width = obj.height = 1;
	obj.className = obj.className.replace(/\bpng24\b/i,'');
	obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
	obj.src = '';
	return '';

}

//바이트 계산 및 표시
//displayTagID : 현재 바이트 값을 표시할 태그(span)
//maxBytesTagID : 최대 바이트 기준 태그(span)
function checkBytes(evt, maxBytes)
{
	var objMessage;
	if (evt.srcElement)
		objMessage = evt.srcElement;
	else
		objMessage = evt.target;

	var iMaxBytes = 200;
	if (maxBytes != null && !isNaN(maxBytes))
		iMaxBytes = maxBytes;
		
	//var objCurrentBytes = document.getElementById(displayTagID);
	var iCurrentBytes = 0;

	for (var i = 0; i < objMessage.value.length; i++)
	{
		var c = escape(objMessage.value.charAt(i)); 	//char를 escape하면 유니코드로 변환됨

		iCurrentBytes += c.length > 4 ? 2 : 1;

		if (iCurrentBytes > iMaxBytes)
		{	
			if (objMessage.name=="k2e_title"){
				alert("최대 입력 문자수 한글 " + iMaxBytes/2 + "자를 넘어갈 수 없습니다.");
			}else if(objMessage.name=="e2k_title"){
				alert("최대 입력 문자수 영문 " + iMaxBytes + "자를 넘어갈 수 없습니다.");
			}else{
				alert("최대 입력 문자수 한글 "+iMaxBytes/2+"자, 영문 " + iMaxBytes + "자를 넘어갈 수 없습니다.");
			}
			objMessage.value = objMessage.value.substr(0, i);
			iCurrentBytes -= c.length > 4 ? 2 : 1;
			break;
		}
	}

	//objCurrentBytes.innerHTML = iCurrentBytes;
}

function checkBytesWithdenyAlphabet(evt, maxBytes)
{
	denyAlphabet(evt);
	checkBytes(evt, maxBytes);
}

function denyAlphabet(evt)
{
	var objMessage;
	if (evt.srcElement)
		objMessage = evt.srcElement;
	else
		objMessage = evt.target;

	var evCode = (window.netscape) ? evt.which : event.keyCode;
	if (evCode >= 65 && evCode <= 90)
	{
		if (window.netscape)
			evt.preventDefault();
		else
			evt.returnValue = false;

		alert("한글만 입력 가능합니다.");
	}
}

function checkBytesWithdenyUnicode(evt, maxBytes)
{
	denyUnicode(evt);
	checkBytes(evt, maxBytes);
}

function denyUnicode(evt)
{
	var objMessage;
	if (evt.srcElement)
		objMessage = evt.srcElement;
	else
		objMessage = evt.target;
		
	for (var i = 0; i < objMessage.value.length; i++)
	{
		var c = escape(objMessage.value.charAt(i)); 	//char를 escape하면 유니코드로 변환됨

		if (c.length > 4)
		{
			if (window.netscape)
				evt.preventDefault();
			else
				evt.returnValue = false;

			alert("영문으로만 입력 가능합니다.");
		}
	}
}


function injectionValidate(word)
{
	var isRight = true;

	if (word.Trim() == "")
		return isRight;

	var sPattern = /delete[\s]?\*[\s]?from/gi;
	if (sPattern.test(word))
		isRight = false;
	else
		isRight = true;

	if (isRight)
	{
		sPattern = /\<\%[\=]*/;
		if (sPattern.test(word))
			isRight = false;
		else
			isRight = true;
	}

	if (isRight)
	{
		sPattern = /\<[\/]?script/gi;
		if (sPattern.test(word))
			isRight = false;
		else
			isRight = true;
	}

	if (isRight)
	{
		sPattern = /\<[\/]?iframe/gi;
		if (sPattern.test(word))
			isRight = false;
		else
			isRight = true;
	}
	
	return isRight;
}


//sso 링크 보내기(2009/12/22 장은진 추가)
function fnc_ssoURL(url) {
	if(url!=""){
		var ssowin = window.open('https://members.neungyule.com/pages/t_member/bridge.asp?PURL=' + url);
		ssowin.focus();
	}
}
//sso 링크 보내기(2009/12/22 장은진 추가)
