// mouseouver start 
menu_01on = new Image; menu_01on.src = "/images/gmb_menu01_on.gif"; 
menu_02on = new Image; menu_02on.src = "/images/gmb_menu02_on.gif"; 
menu_03on = new Image; menu_03on.src = "/images/gmb_menu03_on.gif"; 
menu_04on = new Image; menu_04on.src = "/images/gmb_menu04_on.gif"; 
menu_05on = new Image; menu_05on.src = "/images/gmb_menu05_on.gif"; 
menu_06on = new Image; menu_06on.src = "/images/gmb_menu06_on.gif"; 
menu_07on = new Image; menu_07on.src = "/images/gmb_menu07_on.gif"; 

menu_01off = new Image; menu_01off.src = "/images/gmb_menu01.gif"; 
menu_02off = new Image; menu_02off.src = "/images/gmb_menu02.gif"; 
menu_03off = new Image; menu_03off.src = "/images/gmb_menu03.gif"; 
menu_04off = new Image; menu_04off.src = "/images/gmb_menu04.gif"; 
menu_05off = new Image; menu_05off.src = "/images/gmb_menu05.gif"; 
menu_06off = new Image; menu_06off.src = "/images/gmb_menu06.gif"; 
menu_07off = new Image; menu_07off.src = "/images/gmb_menu07.gif"; 

util_01on = new Image; util_01on.src = "/images/gmb_util01_on.gif"; 
util_02on = new Image; util_02on.src = "/images/gmb_util02_on.gif"; 
util_03on = new Image; util_03on.src = "/images/gmb_util03_on.gif"; 
util_04on = new Image; util_04on.src = "/images/gmb_util04_on.gif"; 
util_05on = new Image; util_05on.src = "/images/gmb_util05_on.gif"; 
util_06on = new Image; util_06on.src = "/images/gmb_util06_on.gif"; 
util_07on = new Image; util_07on.src = "/images/gmb_util07_off.gif"; 
util_022on = new Image; util_022on.src = "/images/gmb_util022_off.gif"; 

util_01off = new Image; util_01off.src = "/images/gmb_util01.gif"; 
util_02off = new Image; util_02off.src = "/images/gmb_util02.gif"; 
util_03off = new Image; util_03off.src = "/images/gmb_util03.gif"; 
util_04off = new Image; util_04off.src = "/images/gmb_util04.gif"; 
util_05off = new Image; util_05off.src = "/images/gmb_util05.gif"; 
util_06off = new Image; util_06off.src = "/images/gmb_util06.gif"; 
util_07off = new Image; util_07off.src = "/images/gmb_util07_on.gif"; 
util_022off = new Image; util_022off.src = "/images/gmb_util022_on.gif"; 

function img_on(imgName) { imgOn = eval(imgName + "on.src"); document[imgName].src = imgOn; } 
function img_off(imgName) { imgOff = eval(imgName + "off.src"); document[imgName].src = imgOff; } 
// mouseouver end-->  



// popup
function popup(URL,title,features) { 
	window.open(URL,title,features);
}

// javascript:popup('URL','title','scrollbars=yes,resizable=0,width=,height=')

/**
 * 입력값이 특정 문자(chars)만으로 되어있는지 체크
 * 특정 문자만 허용하려 할 때 사용
 * ex) if (!containsCharsOnly(form.blood,"ABO")) {
 *         alert("혈액형 필드에는 A,B,O 문자만 사용할 수 있습니다.");
 *     }
 */

/* ===================================================================
	Function : containsCharsOnly(input,chars)
	Return 	 : 
	Usage 	 :  입력값에 특정 문자(chars)가 있는지 체크
 				특정 문자를 허용하지 않으려 할 때 사용
  				ex) if (containsChars(form.name,"!,*&^%$#@~;")) {
          				alert("이름 필드에는 특수 문자를 사용할 수 없습니다.");
     				 }
======================================================================= */  
function containsChars(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) != -1)
           return true;
    }
    return false;
}

function checkKorean( Char ) {
	var bool = true;
	for (var i=0; i < Char.length; i++) {
		if (Char.charCodeAt(i) > 128) {				
			bool = false;			
			return false;
		}
	}	
	return true;
}
/**
 * 선택된 라디오버튼이 있는지 체크
 */
function hasCheckedRadio(input) {
    if (input.length > 1) {
        for (var inx = 0; inx < input.length; inx++) {
            if (input[inx].checked) return true;
        }
    } else {
        if (input.checked) return true;
    }
    return false;
}
function forceAuthVal(){
	document.frm.auth.value = "2";
}
/**
 * 2004-01-29
 * 한글일 경우에는 2byte를 그외의 문자는 1byte로 계산하여  iCounts에 저장하여 return 해준다.
 *  return iCounts[0] - 입력되기 전 글
 * 		  iCounts[1] - 입력받은 키가 있는 글
 */
function getBLen(obj,sMsgLng) {

	var keyVal=escape(event.keyCode);
	var sKey=String.fromCharCode(event.keyCode);
//alert(keyVal);

//alert(sKey);
	var sCurrMsg  = obj.value;
	var sAddMsg   = null;
	if (!(keyVal == 8||keyVal==9||keyVal==46||keyVal==32||keyVal==37||keyVal==39)) {
		if (keyVal>128) {
			sAddMsg = obj.value+'00';
		}else {
			sAddMsg = obj.value+'0';
		}
	} else {
		sAddMsg = obj.value;
	}

	var sTmpMsg    = '';    //메시지를 임시로 저장하는 변수
	var sTmpMsgLen = 0;     //임시로 저장된 메시지의 길이를 저장하는 변수
	var sOneChar   = '';    //한문자를 저장하는 변수
	var iCounts    = new Array();   //총 바이트와 페이지당 바이트 수를 저장하는 배열

	iCounts[0]=0;   //총 바이트를 저장 하는 변수

	if (sMsgLng != null) {
		sTmpMsg	= new String(sMsgLng);
	}
	else
		sTmpMsg	= new String(sCurrMsg);
	sTmpMsgLen	= sTmpMsg.length;

	for (k = 0 ;k < sTmpMsgLen ;k++) {
		sOneChar = sTmpMsg.charAt(k);
		if (escape(sOneChar) == TOG_WORD) {
			iCounts[0]++;
		}
		else if (escape(sOneChar).length > 4) {
			iCounts[0] += 2;
		}
		else  {
			iCounts[0]++;
		}
	}


	sTmpMsg    = '';    //메시지를 임시로 저장하는 변수
	sTmpMsgLen = 0;     //임시로 저장된 메시지의 길이를 저장하는 변수
	sOneChar   = '';    //한문자를 저장하는 변수

	iCounts[1]=0;   //총 바이트를 저장 하는 변수

	sTmpMsg	= new String(sAddMsg);

	sTmpMsgLen	= sTmpMsg.length;

	for (k = 0 ;k < sTmpMsgLen ;k++) {
		sOneChar = sTmpMsg.charAt(k);
		if (escape(sOneChar) == TOG_WORD) {
			iCounts[1]++;
		}
		else if (escape(sOneChar).length > 4) {
			iCounts[1] += 2;
		}
		else  {
			iCounts[1]++;
		}
	}
	return iCounts;
}

var onum="";
var oname="";

function onTag(){
var obj;
obj=document.getElementsByTagName("div");
if((obj.length-2)>0){
	for(i=0;i<obj.length-2;i++){
		if(obj[i].className=="admin_notice"){
			onum="1";
			oname ="menu"+onum;
			document.getElementById(oname).src="/images/admin/mn"+onum+"_on.gif";
		}
		else if(obj[i].className=="system_ma"){
			onum="2";
			oname ="menu"+onum;
			document.getElementById(oname).src="/images/admin/mn"+onum+"_on.gif";
		}
		else if(obj[i].className=="contents_ma"){
			onum="3";
			oname ="menu"+onum;
			document.getElementById(oname).src="/images/admin/mn"+onum+"_on.gif";
		}
		else if(obj[i].className=="pr_notice"){
			onum="4";
			oname ="menu"+onum;
			document.getElementById(oname).src="/images/admin/mn"+onum+"_on.gif";
		}
		else if(obj[i].className=="cust_notice"){
			onum="5";
			oname ="menu"+onum;
			document.getElementById(oname).src="/images/admin/mn"+onum+"_on.gif";
		}
		else if(obj[i].className=="main_ma"){
			onum="6";
			oname ="menu"+onum;
			document.getElementById(oname).src="/images/admin/mn"+onum+"_on.gif";
		}
		else if(obj[i].className=="event"){
			onum="7";
			oname ="menu"+onum;
			document.getElementById(oname).src="/images/admin/mn"+onum+"_on.gif";
		}
		else if(obj[i].className=="kiosk_notice"){
			onum="8";
			oname ="menu"+onum;
			document.getElementById(oname).src="/images/admin/mn"+onum+"_on.gif";
		}
		else if(obj[i].className=="reservation_ma"){
			onum="9";
			oname ="menu"+onum;
			document.getElementById(oname).src="/images/admin/mn"+onum+"_on.gif";
		}
	}	
	for(j=1; j<10; j++){
		if(j==onum){}
		else if(j==8){/*메뉴 8을 가려놓은 상태라 임시로 넣어 놓음.*/}
		else{
			if(j<10){document.getElementById("menu"+j).src="/images/admin/mn"+j+"_off.gif";}
		}
	}
}
else{}
}

function out(num){
	if(num==onum){
		document.getElementById("menu"+num).src="/images/admin/mn"+num+"_on.gif";
	}
	else{
		document.getElementById("menu"+num).src="/images/admin/mn"+num+"_off.gif";
	}
}

function MenuOver(num){
	var mname = "menu"+num;
	switch(num){
		case 1:
			document.getElementById(mname).src="/images/admin/mn"+num+"_on.gif";
		for(i=1; i<10; i++){
			if(i==num){}
			else if(oname!=""){document.getElementById("menu"+onum).src="/images/admin/mn"+onum+"_on.gif";}
			else{/*document.getElementById("menu"+i).src="/images/admin/mn"+i+"_off.gif";*/}
		}
		break;

		case 2:
			document.getElementById(mname).src="/images/admin/mn"+num+"_on.gif";
		for(i=1; i<10; i++){
			if(i==num){}
			else if(oname!=""){document.getElementById("menu"+onum).src="/images/admin/mn"+onum+"_on.gif";}
			else{/*document.getElementById("menu"+i).src="/images/admin/mn"+i+"_off.gif";*/}
		}
		break;

		case 3:
			document.getElementById(mname).src="/images/admin/mn"+num+"_on.gif";
		for(i=1; i<10; i++){
			if(i==num){}
			else if(oname!=""){document.getElementById("menu"+onum).src="/images/admin/mn"+onum+"_on.gif";}
			else{/*document.getElementById("menu"+i).src="/images/admin/mn"+i+"_off.gif";*/}
		}
		break;

		case 4:
			document.getElementById(mname).src="/images/admin/mn"+num+"_on.gif";
		for(i=1; i<10; i++){
			if(i==num){}
			else if(oname!=""){document.getElementById("menu"+onum).src="/images/admin/mn"+onum+"_on.gif";}
			else{/*	document.getElementById("menu"+i).src="/images/admin/mn"+i+"_off.gif";*/}
		}
		break;

		case 5:
			document.getElementById(mname).src="/images/admin/mn"+num+"_on.gif";
		for(i=1; i<10; i++){
			if(i==num){}
			else if(oname!=""){document.getElementById("menu"+onum).src="/images/admin/mn"+onum+"_on.gif";}
			else{/*	document.getElementById("menu"+i).src="/images/admin/mn"+i+"_off.gif";*/}
		}
		break;

		case 6:
			document.getElementById(mname).src="/images/admin/mn"+num+"_on.gif";
		for(i=1; i<10; i++){
			if(i==num){}
			else if(oname!=""){document.getElementById("menu"+onum).src="/images/admin/mn"+onum+"_on.gif";}
			else{/*document.getElementById("menu"+i).src="/images/admin/mn"+i+"_off.gif";*/	}
		}
		break;

		case 7:
			document.getElementById(mname).src="/images/admin/mn"+num+"_on.gif";
		for(i=1; i<10; i++){
			if(i==num){}
			else if(oname!=""){document.getElementById("menu"+onum).src="/images/admin/mn"+onum+"_on.gif";}
			else{/*document.getElementById("menu"+i).src="/images/admin/mn"+i+"_off.gif";*/	}
		}
		break;

		case 8:
			document.getElementById(mname).src="/images/admin/mn"+num+"_on.gif";
		for(i=1; i<10 ; i++){
			if(i==num){}
			else if(oname!=""){document.getElementById("menu"+onum).src="/images/admin/mn"+onum+"_on.gif";}
			else{/*document.getElementById("menu"+i).src="/images/admin/mn"+i+"_off.gif";*/	}
		}
		break;

		case 9:
			document.getElementById(mname).src="/images/admin/mn"+num+"_on.gif";
		for(i=1; i<10 ; i++){
			if(i==num){}
			else if(oname!=""){document.getElementById("menu"+onum).src="/images/admin/mn"+onum+"_on.gif";}
			else{/*document.getElementById("menu"+i).src="/images/admin/mn"+i+"_off.gif";*/}
		}
		break;
	}
}
//컨텐트관리_이벤트 탭메뉴
function contentsTab(num, num2){
			if(num==1){
				if(num2==1){
				document.getElementById("tab1").style.display="";
				document.getElementById("tab2").style.display="none";
				document.getElementById("tab_menu1").src="/images/admin/Common/btn_list_on.gif";
				document.getElementById("tab_menu2").src="/images/admin/Common/btn_winer_off.gif";
				}
				else{
				document.getElementById("tab1").style.display="none";
				document.getElementById("tab2").style.display="";
				document.getElementById("tab_menu1").src="/images/admin/Common/btn_list_off.gif";
				document.getElementById("tab_menu2").src="/images/admin/Common/btn_winer_on.gif";
				}
			}
			if(num==2){
				if(num2==1){
					document.getElementById("tab1").style.display="";
					document.getElementById("tab2").style.display="none";
					document.getElementById("tab_menu21").src="/images/admin/Common/btn_list_on.gif";
					document.getElementById("tab_menu22").src="/images/admin/Common/btn_use_off.gif";
				}
				else{
					document.getElementById("tab1").style.display="none";
					document.getElementById("tab2").style.display="";
					document.getElementById("tab_menu21").src="/images/admin/Common/btn_list_off.gif";
					document.getElementById("tab_menu22").src="/images/admin/Common/btn_use_on.gif";
				}
			}
		}
//페이지이동
 function skiMove(url){ 
     window.location.href  = url;
      }

//날짜 체크
function f_dateBetween(objStart, objEnd) {
	while(objStart.search("/") != -1){
		  objStart = objStart.replace("/","");
		 }
	while(objEnd.search("/") != -1){
	  objEnd = objEnd.replace("/","");
	 }
	 var strStart = cfGetElementType(objStart)!=null ? document.all.objStart.value : objStart;
	 var strEnd  = cfGetElementType(objEnd)!=null ? document.all.objEnd.value : objEnd;

	 if (strStart.length == 8 && strEnd.length == 8) {
	  if (parseInt(strStart, 10) > parseInt(strEnd, 10)) {
	   alert("시작일자를 종료일자 이전으로 선택[입력]하여 주십시오.");
	   if(cfGetElementType(objStart)!=null) objStart.focus();
	   return false;
	  }
	 } else if (strStart.length == 4 && strEnd.length == 4) {
	  if (parseInt(strStart, 10) > parseInt(strEnd, 10) || parseInt(strStart, 10) == parseInt(strEnd, 10)) {
	   alert("시작시간을 종료시간 이전으로 선택[입력]하여 주십시오.");
	   if(cfGetElementType(objStart)!=null) objStart.focus();
	   return false;
	  }
	 }
	 return true;
	}

/**
 * @type   : function
 * @access : private
 * @desc   : 
 * <pre>
 *      
 *      예)cfGetDate("YYYYMM01")    => return 값은 해당월의 시작일자
 *         cfGetDate("YYYYMMDD")  => return 값은 오늘일자
 *     cfGetDate()      => return 'YYYYMMDD' format의 오늘일자
 * </pre>
 * @sig    : None
 * @param  : 
 * @return : 일자를 리턴한다.
 * @author : 김길명 2006.11.05
 */
function cfGetDate()
{
 var args=cfGetDate.arguments ;
 var res ;
 if (args.length == 1 ){
     var date = SVR_NOW_DATE.toDate('YYYYMMDD') ;
     res = date.format(args[0]) ;
    }else {
     res = SVR_NOW_DATE ;
    }

    return res ;
}

function tableMinSize() {
var minTable = document.getElementById("min_table").style;
if ( document.body.clientWidth <= 1500 ){
minTable.width = "950px";}
else{minTable.width = "100%";}
}

