function MM_showHideLayers() { //v9.0
	var i,p,v,obj,args=MM_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) 
	with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
			if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
			obj.visibility=v; }
}

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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//플래시 스크립트
function embedFlash(src, width, height, id, alt, img)
{
	var content ="";
	content="<object id=\""+id+"\" type=\"application/x-shockwave-flash\" data=\""+src+"\" alt=\""+alt+"\" height=\""+height+"\" width=\""+width+"\">"+
			"<param name=\"quality\" value=\"best\" />"+
			"<param name=\"movie\" value=\""+src+"\" height=\""+height+"\" width=\""+width+"\">"+
			"<param name=\"wmode\" value=\"transparent\" /> "+
			"<img id=\""+id+"\" src=\""+img+"\" alt=\""+alt+"\">"+
			"</object>";
	document.write(content);
}
/*
function embedFlash(src, width, height, id)
{
	var content ="";
	content="<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+"' height='"+height+"' id='"+id+"' alt='"+alt+"'>"+
			"<param name='movie' value='"+src+"'>"+ 
			"<param name='wmode' value='transparent'>"+
			"<param name='quality' value='high'>"+
			"<embed src='"+src+"' wmode='transparent' quality='high' "+
			"pluginspage='http://www.macromedia.com/go/getflashplayer' "+
			"type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed>"+
			"</object>";
	document.write(content);
}
*/

function embedMovie(src, width, height)
{
	content="<OBJECT ID='MediaPlayer' align='middle' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'"+
			"codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' "+
			"standby='Loading Microsoft Windows Media Player components...' "+
			"type='application/x-oleobject' width='"+width+"' height='"+height+"'>\n"+ 
			"		<param name='Filename' value='"+src+"'>\n"+
			"		<param NAME='AudioStream' VALUE='-1'>\n"+
			"		<param NAME='loop' VALUE='true'>\n"+
			"		<param NAME='AutoSize' VALUE='0'>\n"+
			"		<param NAME='AutoStart' VALUE='-1'>\n"+
			"		<param NAME='AnimationAtStart' VALUE='-1'>\n"+
			"		<param NAME='AllowScan' VALUE='-1'>\n"+
			"		<param NAME='AllowChangeDisplaySize' VALUE='-1'>\n"+
			"		<param NAME='AutoRewind' VALUE='-1'>\n"+
			"		<param NAME='Balance' VALUE='0'>\n"+
			"		<param NAME='BaseURL' VALUE>\n"+
			"		<param NAME='BufferingTime' VALUE='7'>\n"+
			"		<param NAME='CaptioningID' VALUE>\n"+
			"		<param NAME='ClickToPlay' VALUE='-1'>\n"+
			"		<param NAME='CursorType' VALUE='0'>\n"+
			"		<param NAME='CurrentPosition' VALUE='-1'>\n"+
			"		<param NAME='CurrentMarker' VALUE='-1'>\n"+  
			"		<param NAME='DefaultFrame' VALUE='1'>\n"+
			"		<param NAME='DisplayBackColor' VALUE='0'>\n"+
			"		<param NAME='DisplayForeColor' VALUE='16777215'>\n"+
			"		<param NAME='DisplayMode' VALUE='1'>\n"+
			"		<param NAME='DisplaySize' VALUE='2'>\n"+	//<!-- 창 크기 -->\n"+
			"		<param NAME='Enabled' VALUE='-1'>\n"+
			"		<param NAME='EnableContextMenu' VALUE='1'>\n"+
			"		<param NAME='EnablePositionControls' VALUE='-1'>\n"+
			"		<param NAME='EnableFullScreenControls' VALUE='0'>\n"+
			"		<param NAME='EnableTracker' VALUE='-1'>\n"+
			"		<param NAME='InvokeURLs' VALUE='-1'>\n"+
			"		<param NAME='Language' VALUE='-1'>\n"+
			"		<param NAME='Mute' VALUE='0'>\n"+
			"		<param NAME='PlayCount' VALUE='1'>\n"+
			"		<param NAME='PreviewMode' VALUE='0'>\n"+
			"		<param NAME='Rate' VALUE='1'>\n"+
			"		<param NAME='SAMILang' VALUE>\n"+
			"		<param NAME='SAMIStyle' VALUE>\n"+
			"		<param NAME='SAMIFileName' VALUE>\n"+
			"		<param NAME='SelectionStart' VALUE='-1'>\n"+
			"		<param NAME='SelectionEnd' VALUE='-1'>\n"+
			"		<param NAME='SendOpenStateChangeEvents' VALUE='-1'>\n"+
			"		<param NAME='SendWarningEvents' VALUE='-1'>\n"+
			"		<param NAME='SendErrorEvents' VALUE='-1'>\n"+
			"		<param NAME='SendKeyboardEvents' VALUE='0'>\n"+
			"		<param NAME='SendMouseClickEvents' VALUE='0'>\n"+
			"		<param NAME='SendMouseMoveEvents' VALUE='0'>\n"+
			"		<param NAME='SendPlayStateChangeEvents' VALUE='-1'>\n"+
			"		<param NAME='ShowCaptioning' VALUE='0'>\n"+
			"		<param NAME='ShowControls' VALUE='1'>\n"+
			"		<param NAME='ShowAudioControls' VALUE='1'>\n"+
			"		<param NAME='ShowDisplay' VALUE='0'>\n"+  //<!-- 쇼, 클립, 만든이, 저작권 표시  -->\n"+
			"		<param NAME='ShowGotoBar' VALUE='0'>\n"+  //<!-- 재생, 정지메뉴 밑의 '바' 없애기 -->\n"+
			"		<param NAME='ShowPositionControls' VALUE='1'>\n"+
			"		<param NAME='ShowStatusBar' VALUE='1'>\n"+
			"		<param NAME='ShowTracker' VALUE='1'>\n"+
			"		<param NAME='TransparentAtStart' VALUE='1'>\n"+
			"		<param NAME='VideoBorderWidth' VALUE='0'>\n"+
			"		<param NAME='VideoBorderColor' VALUE='0'>\n"+
			"		<param NAME='VideoBorder3D' VALUE='0'>\n"+
			"		<param NAME='Volume' VALUE='-200'>\n"+
			"		<param NAME='WindowlessVideo' VALUE='0'>\n"+ //<!-- 화면 재생 여부 -->\n"+			
			"		<EMBED type='application/x-MediaPlayer12' "+
					"pluginspage = 'http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'	"+
					"src=''	name='MediaPlayer' width='"+width+"' height='"+height+"' ShowControls='0'>\n"+
			"		</EMBED>\n"+
			"	</object>"; 
	document.write(content);
}

var swapBod	= "";
function swapImage(a) {
	if(swapBod != "" || swapBod == null) {
		swapImgRestore(swapBod);
	}
	document.getElementById(a).src = "/S0001/img/main/"+a+"_on.gif";
	swapBod = a;
}
function swapImgRestore(id) {
	document.getElementById(id).src = "/S0001/img/main/"+id+"_off.gif";
}

/*  UTF-8 인코딩 */
function encodeURL(str){
    var s0, i, s, u;
    s0 = "";                // encoded str
    for (i = 0; i < str.length; i++){   // scan the source
        s = str.charAt(i);
        u = str.charCodeAt(i);          // get unicode of the char
        if (s == " "){s0 += "+";}       // SP should be converted to "+"
        else {
            if ( u == 0x2a || u == 0x2d || u == 0x2e || u == 0x5f || ((u >= 0x30) && (u <= 0x39)) || ((u >= 0x41) && (u <= 0x5a)) || ((u >= 0x61) && (u <= 0x7a))){       // check for escape
                s0 = s0 + s;            // don't escape
            }
            else {                  // escape
                if ((u >= 0x0) && (u <= 0x7f)){     // single byte format
                    s = "0"+u.toString(16);
                    s0 += "%"+ s.substr(s.length-2);
                }
                else if (u > 0x1fffff){     // quaternary byte format (extended)
                    s0 += "%" + (oxf0 + ((u & 0x1c0000) >> 18)).toString(16);
                    s0 += "%" + (0x80 + ((u & 0x3f000) >> 12)).toString(16);
                    s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
                }
                else if (u > 0x7ff){        // triple byte format
                    s0 += "%" + (0xe0 + ((u & 0xf000) >> 12)).toString(16);
                    s0 += "%" + (0x80 + ((u & 0xfc0) >> 6)).toString(16);
                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
                }
                else {                      // double byte format
                    s0 += "%" + (0xc0 + ((u & 0x7c0) >> 6)).toString(16);
                    s0 += "%" + (0x80 + (u & 0x3f)).toString(16);
                }
            }
        }
    }
    return s0;
}

/*  UTF-8 디코딩 */
function decodeURL(str){
    var s0, i, j, s, ss, u, n, f;
    s0 = "";                // decoded str
    for (i = 0; i < str.length; i++){   // scan the source str
        s = str.charAt(i);
        if (s == "+"){s0 += " ";}       // "+" should be changed to SP
        else {
            if (s != "%"){s0 += s;}     // add an unescaped char
            else{               // escape sequence decoding
                u = 0;          // unicode of the character
                f = 1;          // escape flag, zero means end of this sequence
                while (true) {
                    ss = "";        // local str to parse as int
                        for (j = 0; j < 2; j++ ) {  // get two maximum hex characters for parse
                            sss = str.charAt(++i);
                            if (((sss >= "0") && (sss <= "9")) || ((sss >= "a") && (sss <= "f"))  || ((sss >= "A") && (sss <= "F"))) {
                                ss += sss;      // if hex, add the hex character
                            } else {--i; break;}    // not a hex char., exit the loop
                        }
                    n = parseInt(ss, 16);           // parse the hex str as byte
                    if (n <= 0x7f){u = n; f = 1;}   // single byte format
                    if ((n >= 0xc0) && (n <= 0xdf)){u = n & 0x1f; f = 2;}   // double byte format
                    if ((n >= 0xe0) && (n <= 0xef)){u = n & 0x0f; f = 3;}   // triple byte format
                    if ((n >= 0xf0) && (n <= 0xf7)){u = n & 0x07; f = 4;}   // quaternary byte format (extended)
                    if ((n >= 0x80) && (n <= 0xbf)){u = (u << 6) + (n & 0x3f); --f;}         // not a first, shift and add 6 lower bits
                    if (f <= 1){break;}         // end of the utf byte sequence
                    if (str.charAt(i + 1) == "%"){ i++ ;}                   // test for the next shift byte
                    else {break;}                   // abnormal, format error
                }
            s0 += String.fromCharCode(u);           // add the escaped character
            }
        }
    }
    return s0;
}

/* IP 유효성 체크 */
function validateIP(src)
{
	var partten = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/;
	var arrayMatch = src.match(partten);

	if(arrayMatch == null) return false;

	for(i=0;i<arrayMatch.length;i++)
	{
		if(arrayMatch[i] > 254) return false;
	}

	return true;
}

/* 페이지이동 */
function movePage(pageNo)
{
	document.frm.action	="?pageNo="+pageNo;
	document.frm.submit();
}

/* 아이디 찾기 */
function searchID()
{
	window.open("/common/memSearchID.jsp", "_searchID", "toolbar=no,locationbar=no");
}

/* 우편번호 찾기 */
function searchZipcode(frmNm)
{
	window.open("/common/searchZipcode.jsp?frmNm="+frmNm, "_searchZip", "toolbar=no,locationbar=no");
}

function popupOpen(url,vscrollbars,vtoolbar,vmenubar,vlocation,vwidth,vheight){		

	window.open(url,'_PopUp','scrollbars='+vscrollbars+',toolbar='+vtoolbar+',menubar='+vmenubar+',location='+vlocation+',width='+vwidth+',height='+vheight+',location=no')

}

/* 팝업창 위치 잡기 */
function setPosition(valueW, valueH)
{
	if(navigator.appVersion.indexOf("MSIE 7.0") > 0) {
		valueW = valueW;
		valueH = valueH + 21;
	} else {
		valueW = valueW;
		valueH = valueH - 1;
	}

	var height	= screen.height;
	var width	= screen.width;
	var leftpos = width / 2 - valueW / 2;
	var toppos	= height / 2 - valueH / 2;

	self.resizeTo(valueW, valueH);
	self.moveTo(leftpos, toppos);
	self.resizeTo(valueW, valueH);		// 이유없다 resize잘안되어서 한번더 call
}

function getCookie( name ){ 
	var nameOfCookie = name + "="; 
	var x = 0; 
	while ( x <= document.cookie.length ) 
	{ 
			var y = (x+nameOfCookie.length); 
			if ( document.cookie.substring( x, y ) == nameOfCookie ) { 
					if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) 
							endOfCookie = document.cookie.length; 
					return unescape( document.cookie.substring( y, endOfCookie ) ); 
			} 
			x = document.cookie.indexOf( " ", x ) + 1; 
			if ( x == 0 ) 
					break; 
	} 
	return ""; 
}

function setCookie(name, value, expiredays)
{
	var today = new Date();
	today.setDate( today.getDate() + expiredays );
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
}

function viewPopup(pop_uid) 
{
	var objPop = document.all["popup_" + pop_uid];
	if(objPop.style.display == "none") {
		objPop.style.display = "block";
	} else if (objPop.style.display == "block") {
		objPop.style.display = "none";
	}
}

function closewin(pop_uid)
{
	setCookie(pop_uid, "popChk", 1);
	//viewPopup(pop_uid);
}


/* editor 입력 체크 */
function validateContent(obj)
{
	if(FCKeditorAPI.GetInstance(obj).GetXHTML() == "") {
		return false;
	}
	return true;
}

/* 레이어 리사이즈 */
function divResize()
{
	document.getElementById("LIST").style.height = document.body.clientHeight - document.getElementById("TBL").clientHeight;
}

/* 첨부파일 체크 */
function checkFile(formName)
{
	var	formName	= eval(formName);
	if(checkImgExt(formName.value) == false && formName.value.replace(/ /g, "").length != 0) {
		alert("이미지파일만 허용됩니다.");
		formName.select();
		document.selection.clear();
		return false;
	}
	return true;
}


/* 확장자 검사 */
function checkImgExt(str) {
	// 확장자 비교 
	compStr = new Array("gif","jpg","jpeg","bmp","png"); 
	
	// 확장자 가져오기 
	idx = str.lastIndexOf('.'); 
	if( idx != -1 ) { 
		ext = str.substring( idx+1, str.len ); 
	} else { 
		ext = ""; 
	} 
	
	if(ext != "") {
		for (var i = 0; i < compStr.length; i++) {
			if (compStr[i] == ext.toLowerCase()) { 
				return true; 
				break; 
			}
		}
	}
	return false;
}

/*png이미지 쓰기*/
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 ''; 
}

//수동 탭메뉴 처리
var preTabpage = "";
function showTabPage(tabID) {
	var tabPage		= document.getElementById("tab_"+tabID);

	if(preTabpage != tabPage) {
		if(preTabpage != "") {
			preTabpage.style.display	= "none";
		}else{
			document.getElementById("tab_1").style.display	= "none";
		}
		tabPage.style.display	= "block";
		preTabpage					= tabPage;
	}
	/*
	else{
		preTabpage.style.display	= "none";
		preTabpage					= "";
	}
	*/
}

/* 네비게이션 서브메뉴 */
var preNaviID	= "";
var preOver		= "";
var preSub		= "";
function showSubNavi(naviID) {
	var over	= document.getElementById("over"+naviID);
	var sub		= document.getElementById("sub"+naviID);

	if(preNaviID != naviID || preNaviID == "") {
		if(preNaviID != "" || preNaviID == null) {
			document.getElementById("over"+preNaviID).style.display	= "none";
			document.getElementById("sub"+preNaviID).style.display	= "none";
		}
		over.style.display	= "block";
		sub.style.display	= "block";
		preNaviID			= naviID;
	}

}

function showSubSiteNavi(naviID) {
	var sub		= document.getElementById(naviID);
	if(preNaviID != naviID || preNaviID == "") {
		if(preNaviID != "" || preNaviID == null) {
			document.getElementById(preNaviID).style.visibility	= "hidden";
		}
		sub.style.visibility	= "visible";
		preNaviID				= naviID;
	}

}

/* 서브 사이트 레프트 메뉴 */
var oldObj	= "";
var oldImg	= "";
function subSiteviewMenu(menuID) 
{
	var objMenu		= document.getElementById(menuID);

	if(oldObj != objMenu) {
		if(oldObj != "") {
			oldObj.style.display	= "none";
		}
		objMenu.style.display	= "block";
		oldObj					= objMenu;
	}else{
		oldObj.style.display	= "none";
		oldObj					= "";
	}
}

/* 라디오박스 체크 */
function ValidateForm(theForm){
	is_checked = false;
	if(theForm.length > 1) {
		for (i=0;i<theForm.length;i++) {
			if (theForm[i].checked) {
				is_checked = true;
				break;
			}
		} 
	}else{
		if (theForm.checked) {
			is_checked = true;
		}
	}
	return is_checked;
}

/* 부서팝업 */
function showDeptInfo(dept_id) {
	popupOpen("/common/deptInfoView.jsp?dept_id="+dept_id,1,0,0,0,800,650);
}

/* 이전게시판 팝업 */
function showSjBoard(bid) {
	popupOpen("/common/board.jsp?bid="+bid,1,0,0,0,650,650);
}

/* 이미지 뷰어 팝업 */
function viewImage(imgPath, imgFile) {
	popupOpen("/common/imgView.jsp?imgPath="+imgPath+"&imgFile="+imgFile,0,0,0,0,1,1);
}

/* 오류 게시판 */
function bugBoard(bugTit) {
	window.open("https://www.sj.go.kr/common/nameCheck.jsp?winOpt=1&rtnUrl="+encodeURL(bugTit), "_gPinLoginWin", "width=350,height=270,scrollbars=1");
	//popupOpen("/common/bugBoard/bugBoard.jsp?site_id=S0001&mnu_uid=1218&bubTit="+encodeURL(bugTit),1,0,0,0,700,650);
}

/* 오류 게시판 */
function bugBoardGo() {
	window.open('', '_bugBod','width=350, height=270, scrollbars=yes');
	document.frmMnuGra.target = "_bugBod";
	document.frmMnuGra.action = "https://www.sj.go.kr/common/nameCheck.jsp?winOpt=1";
	document.frmMnuGra.submit();
}


/* G-PIN 인증 */
function nameCheckPopup(rtnUrl) {
	window.open("https://www.sj.go.kr/common/certificate.jsp?rtnUrl="+encodeURL(rtnUrl), "_gPinLoginWin", "width=350,height=332,scrollbars=no");
}

/* 참외 축제 참여 신청 */
function chamoeRequest(req_ty) {
	var Url;
	if(req_ty != 7){
		Url = "/common/chamoe/chamoeReq.jsp?req_ty="+req_ty;
	}else{
		Url = "/common/chamoe/chamoeIdea.jsp?req_ty=7";
	}
	//var Url = "/common/chamoe/chamoeReq.jsp?req_ty="+req_ty;
	window.open("/common/chamoe/chamoeNameChk.jsp?req_ty="+req_ty+"&winOpt=2&rtnUrl="+encodeURL(Url), "_chamoe", "width=350,height=340,scrollbars=1");
}

/* send mail */
function sendMail(emp_uid) {
	window.open("/common/webmail.jsp?emp_uid="+emp_uid, "_webmail", "width=400,height=450,scrollbars=no");
}


//문자 일정일기 채우기 */
function getStrLpad(n, inval)
{
	var tmp = "00000" + inval;
	var len = tmp.length;
	return (tmp.substring(len - n, len));
}

/* 클립보드 복사 */
function CopyClibboard(link)
{
    if(window.clipboardData.setData('Text', link)){
		alert("주소가 복사되었습니다");
	}
}

/* 글짜크기 크게 작게 */
function getFontCookie() { 
	var fontSize = getCookie("font_size"); 
	try { 
		if ( fontSize == null ) return 16; 
		if ( fontSize.length ) return parseInt(fontSize); else return 16; 
	} catch (e) { 
		return 16; 
	} 
} 
var fontSize = getFontCookie(); 

function scaleFont(val) { 
	var content, lineHeight; 
	var oldContent = document.getElementById("oldCnt"); 
	content = document.getElementById("ctn"); 
	
	if (oldContent != null) 
		content = oldContent; 
		if (val > 0) { 
			if (fontSize <= 18) { 
				fontSize = fontSize + val; 
				lineHeight = fontSize+Math.round(1.1*fontSize); 
				content.style.fontSize = fontSize + "px"; 
			} 
		} else { 
			if (fontSize > 12) { 
				fontSize = fontSize + val; 
				lineHeight = fontSize+Math.round(1.1*fontSize); 
				content.style.fontSize = fontSize + "px"; 
			} else { 
				lineHeight = fontSize+Math.round(1.1*fontSize); 
				content.style.fontSize = fontSize + "px"; 
			} 
		} 
	var mydate = new Date; mydate.setDate(mydate.getDate()+1000); 
	setCookie("font_size", fontSize, mydate); 
}

/* 페이지 프린트 */
function printPage()
{
    printFrame.printContent ( ctn.innerHTML );
    return;
}
function printBoard()
{
    printBoardFrame.printContent ( board_cnt.innerHTML );
    return;
}

function goSelectUrl(type) {
	var selectID = document.getElementById(type);
	if(selectID.value == ""){
		alert("목록을 선택하십시요.");
		selectID.focus();
		return false;
	}else{
		window.open(selectID.value, "_blank");
	}
}

function goSelectUrlSelf(type) {
	var selectID = document.getElementById(type);
	if(selectID.value == ""){
		alert("목록을 선택하십시요.");
		selectID.focus();
		return false;
	}else{
		location.href = selectID.value;
		//window.open(selectID.value, "_blank");
	}
}
/* Ebook open */
function openEbook(link) {
	var height = screen.height;
	var width = screen.width;
	window.open(link, "_viewEbook", "width="+width+",height="+height+",scrollbars=no");
}

function menuGratify(mnu_uid) 
{
	var objFrm = document.frmMnuGra.mnuGraPioint;
	if(!ValidateForm(objFrm)) {
		alert("점수를 선택해주세요");
		objFrm[0].focus();
		return false;
	}

	for (i=0;i<objFrm.length;i++) {
		if(objFrm[i].checked == true) {
			chkValue = objFrm[i].value;
		}
	}

	mnuGraFrame.location.href="/common/page/pageGratifyAction.jsp?mnu_uid="+mnu_uid+"&value="+chkValue;
}

function kwdImg(obj) 
{ 
 if(obj.style.backgroundImage == "") return; 
 
 obj.style.backgroundImage=""; 
} 



function kwdSearch(type)
{
	var where = document.srcResultFrm.where.value;
	var kwd = document.srcResultFrm.kwd.value;
	if (document.srcResultFrm.kwd.value == "") {
		alert("검색할 키워드를 입력하세요");
		document.srcResultFrm.kwd.focus();
		return false;
	}
	if(type == 1) {
		window.open("/common/search/search.jsp?where="+where+"&kwd="+encodeURI(kwd));
	}else{
		document.srcResultFrm.action="?where="+where+"&kwd="+encodeURI(kwd);
		//document.srcResultFrm.kwd.value=encodeURI(kwd);
		document.srcResultFrm.submit();
	}
	return true;
}
function gotoPage(num)
{
	document.srcResultFrm.pageNum.value = num;
	document.srcResultFrm.submit();
}

//총검색건수 더하기
function addTotalNum(num){
	var totNum = document.srcResultFrm.num.value;
	num = parseInt(totNum) + parseInt(num);

	document.srcResultFrm.num.value = num;
}

//검색건수 표시하기
function getTotalNum()
{
	var spanID	="totalNum";
	var span	=document.getElementById(spanID)
	var total	=document.srcResultFrm.num.value;
	span.innerText = total;
}

/* 아이프레임 높이 설정 */
function resizeIframe(fr) { 
	fr.setExpression('height',newsFrm.document.body.scrollHeight); 
} 

function moveFocus(self, cnt, obj){
	//alert("self.value.length = " + self.value.length);
	if (self.value.length == cnt)
	{
		obj.focus();
	}
}


//문자만 입력 받을수 있게
function setChar(obj){

	val=obj.value;
	re=/\d/gi;
	obj.value=val.replace(re,"");

}

//숫자만 입력 받을수 있게
function setNum(obj){
	val=obj.value;
	re=/[^0-9]/gi;
	obj.value=val.replace(re,"");

}

//png 이미지 쓰기
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 ''; 
} 

function birth_calculation(){
	var birth_yy, birth_mm, birth_dd;

	if(document.frmBir.yy.value.replace(/ /g, "").length == 0) {
		alert("년도를 입력하세요");
		document.frmBir.yy.focus();
		return false;
	}
	if(document.frmBir.mm.value.replace(/ /g, "").length == 0) {
		alert("월을 입력하세요");
		document.frmBir.mm.focus();
		return false;
	}
	if(document.frmBir.dd.value.replace(/ /g, "").length == 0) {
		alert("일자를 입력하세요");
		document.frmBir.dd.focus();
		return false;
	}

	var lastdate = new Date(document.frmBir.yy.value, document.frmBir.mm.value, document.frmBir.dd.value);

	birth_dd = lastdate.getDate() + 7;
	if(birth_mm > 3){
		birth_yy = lastdate.getYear() + 1;
		birth_mm = lastdate.getMonth() - 3;
	}
	else{
		birth_yy = lastdate.getYear();
		birth_mm = lastdate.getMonth() + 9;
	}
	var birthday = new Date(birth_yy, birth_mm, birth_dd);
	var mmStr = birthday.getMonth();
	if(mmStr == 0) {
		mmStr = 12;
	}
	var resultStr = "출산예정일은 " + birthday.getYear() + "년 " +mmStr + "월 " + birthday.getDate() + "일입니다.";
	document.getElementById("resultDate").innerHTML = resultStr;

}