﻿
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 cookiechk(){
var blnCookie = getCookie("menuclip");

	if ( blnCookie ) {
		CallFlash('Y');
	}else{
		CallFlash('N');
	}
}
function CallFlash(msg) {
    // 플래쉬 객체잡기 (플래쉬를 넣은방식에 따라 달라지겠죠?)
    var flash = document.getElementById("flashmenu");
    flash.FlashAction(msg);
}	

function flevDivPositionValue(sDiv, sProperty) { // v2.1, Marja Ribbers-de Vroed, FlevOOware
	this.opera = (window.opera); // Opera 5+
	this.ns4 = (document.layers); // Netscape 4.x
	this.ns6 = (document.getElementById && !document.all && !this.opera); // Netscape 6+
	this.ie = (document.all);  // Internet Explorer 4+
    var sValue = ""; docObj = eval("MM_findObj('" + sDiv + "')"); if (docObj == null) {return 0;}
	if ((sProperty == "left") || (sProperty == "top")) {
		if (!this.ns4) {docObj = docObj.style;} 
		sValue = eval("docObj." + sProperty);
		if ((this.ie) && (sValue == "")) { // IE (on PC) bug with nested layers
			if (sProperty == "top") { sValue = eval(sDiv + ".offsetTop"); } 
			else { sValue = eval(sDiv + ".offsetLeft"); } 
		};
	}
	else {
		if (this.opera) {
			docObj = docObj.style;
			if (sProperty == "height") { sValue = docObj.pixelHeight; } 
			else if (sProperty == "width") { sValue = docObj.pixelWidth; } 
		}
		else if (this.ns4) {sValue = eval("docObj.clip." + sProperty);} 
		else if (this.ns6) {sValue = document.defaultView.getComputedStyle(docObj, "").getPropertyValue(sProperty); } 
	    else if (this.ie) { 
			if (sProperty == "width") { sValue = eval(sDiv + ".offsetWidth"); } 
			else if (sProperty == "height") { sValue = eval(sDiv + ".offsetHeight"); } 
		}
   	}
	sValue = (sValue == "") ? 0 : sValue; 
	if (isNaN(sValue)) { if (sValue.indexOf('px') > 0) { sValue = sValue.substring(0,sValue.indexOf('px')); } } 
	return parseInt(sValue); 
}

function flevPersistentLayer() { // v3.3, Marja Ribbers-de Vroed, FlevOOware
	var sD = arguments[0], oD = eval("MM_findObj('" + sD + "')"), iWW, iWH, iSX, iSY, iT = 10, sS = "";
	if (!document.layers) {oD = oD.style;}
	if (oD.tmpTimeout != null) {clearTimeout(oD.tmpTimeout);}
	var sXL = arguments[1], sXC = arguments[2], sXR = arguments[3], sYT = arguments[4], sYC = arguments[5], sYB = arguments[6];
	var iS = (arguments.length > 7) ? parseInt(arguments[7]) : 0, iPx = (arguments.length > 8) ? parseInt(arguments[8]) : 0;
	if (window.innerWidth) { // NS4, NS6 and Opera
		var oW = window; iWW = oW.innerWidth; iWH = oW.innerHeight; iSX = oW.pageXOffset; iSY = oW.pageYOffset; }
	else if (document.documentElement && document.documentElement.clientWidth) { // IE6 in standards compliant mode
		var oDE = document.documentElement; iWW = oDE.clientWidth; iWH = oDE.clientHeight; iSX = oDE.scrollLeft; iSY = oDE.scrollTop; }
	else if (document.body) { // IE4+
		var oDB = document.body; iWW = oDB.clientWidth; iWH = oDB.clientHeight; iSX = oDB.scrollLeft; iSY = oDB.scrollTop; }
	else {return;}
	var iCX = iNX = flevDivPositionValue(sD, 'left'), iCY = iNY = flevDivPositionValue(sD, 'top');
	if (sXL != "") {iNX = iSX + parseInt(sXL);} 
	else if (sXC != "") {iNX = Math.round(iSX + (iWW/2) - (flevDivPositionValue(sD, 'width')/2));}
	else if (sXR != "") {iNX = iSX + iWW - (flevDivPositionValue(sD, 'width') + parseInt(sXR));}
	if (sYT != "") {iNY = iSY + parseInt(sYT);}
	else if (sYC != "") {iNY = Math.round(iSY + (iWH/2) - (flevDivPositionValue(sD, 'height')/2));}
	else if (sYB != "") {iNY = iSY + (iWH - flevDivPositionValue(sD, 'height') - parseInt(sYB));}
	if ((iCX != iNX) || (iCY != iNY)) {
		if (iS > 0) {
			if (iPx > 0) { iT = iS;
				var iPxX = iPx, iPxY = iPx, iMX = Math.abs(iCX - iNX), iMY = Math.abs(iCY - iNY);
				// take care of diagonal movement
				if (iMX < iMY) {iPxY = (iMX != 0) ? ((iMY/iMX)*iPx) : iPx;}
				else {iPxX = (iMY != 0) ? ((iMX/iMY)*iPx) : iPx;}
				if (iPxX >= iMX) {iPxX = Math.min(Math.ceil(iPxX), iPx);}
				if (iPxY >= iMY) {iPxY = Math.min(Math.ceil(iPxY), iPx);}
				// temporary X/Y coordinates
				if ((iCX < iNX) && (iCX + iPxX < iNX)) {iNX = iCX + iPxX;}
				if ((iCX > iNX) && (iCX - iPxX > iNX)) {iNX = iCX - iPxX;}
				if ((iCY < iNY) && (iCY + iPxY < iNY)) {iNY = iCY + iPxY;}
				if ((iCY > iNY) && (iCY - iPxY > iNY)) {iNY = iCY - iPxY;} }
			else { 
				var iMX = ((iNX - iCX) / iS), iMY = ((iNY - iCY) / iS); 
				iMX = (iMX > 0) ? Math.ceil(iMX) : Math.floor(iMX); iNX = iCX + iMX; 
				iMY = (iMY > 0) ? Math.ceil(iMY) : Math.floor(iMY); iNY = iCY + iMY; } }
		if ((parseInt(navigator.appVersion)>4 || navigator.userAgent.indexOf("MSIE")>-1) && (!window.opera)) {sS="px";}
		if (iMX != 0) {eval("oD.left = '" + iNX + sS + "'");}
		if (iMY != 0) {eval("oD.top = '" + iNY + sS + "'");} }
	var sF = "flevPersistentLayer('" + sD + "','" + sXL + "','" + sXC + "','" + sXR + "','" + sYT + "','" + sYC + "','" + sYB + "'," + iS + "," + iPx + ")";
	oD.tmpTimeout = setTimeout(sF,10);
}

function flevInitPersistentLayer() { // v3.3, Marja Ribbers-de Vroed, FlevOOware
	if (arguments.length < 8) {return;}
	var sD = arguments[0]; if (sD == "") {return;}
	var	oD = eval("MM_findObj('" + sD + "')"); if (!oD) {return;}
	var iCSS = parseInt(arguments[1]);
	var sXL = arguments[2], sXC = arguments[3], sXR = arguments[4], sYT = arguments[5], sYC = arguments[6], sYB = arguments[7];
	var iS = (arguments.length > 8) ? parseInt(arguments[8]) : 0, iPx = (arguments.length > 9) ? parseInt(arguments[9]) : 0;
	if (iCSS != 0) { if (!document.layers) {oD = oD.style;} sXL = parseInt(oD.left), sYT = parseInt(oD.top);}
	var sF = "flevPersistentLayer('" + sD + "','" + sXL + "','" + sXC + "','" + sXR + "','" + sYT + "','" + sYC + "','" + sYB + "'," + iS + "," + iPx + ")";
	eval(sF);
}
//-------------------------------flash js end
//설정한 날짜만큼 쿠키가 유지되게. expiredays가 1 이면 하루동안 유지
/**
* Cookie설정하기
*/
 
function setCookie(name, value, expiredays) {
var expire_date = new Date();
expire_date.setDate(expire_date.getDate() + expiredays );
document.cookie = name + "=" + escape( value ) + "; expires=" + expire_date.toGMTString() + "; path=/";
} 
/**
* Cookie 구하기
*/ 
function getCookie(name) {
	var from_idx = document.cookie.indexOf(name+'=');
	if (from_idx != -1) {
		from_idx += name.length + 1
		to_idx = document.cookie.indexOf(';', from_idx)
		if (to_idx == -1) {
			to_idx = document.cookie.length
		}
		return unescape(document.cookie.substring(from_idx, to_idx))
	}
}

//쿠키 소멸 함수
function clearCookie(name) {
var expire_date = new Date();
//어제 날짜를 쿠키 소멸 날짜로 설정한다.
expire_date.setDate(expire_date.getDate() - 1)
document.cookie = name + "= " + "; expires=" + expire_date.toGMTString() + "; path=/"
}

//체크 상태에 따라 쿠키 생성과 소멸을 제어하는 함수
function controlCookie(objvalue) {
if (objvalue == "Y") {
	//체크 박스를 선택했을 경우 쿠키 생성 함수 호출
	setCookie("menuclip","true", 2);	
}
else {
	//체크 박스를 해제했을 경우 쿠키 소멸 함수 호출
clearCookie("menuclip")
}
return
}


//-------------------------------cookie js end

function client_sw(){
	var screenWidth;
	var screenHeight;
	if (navigator.appName.substring(0,9) != "Microsoft" && navigator.javaEnabled())  {
	var toolkit = java.awt.Toolkit.getDefaultToolkit();
	var screen_size = toolkit.getScreenSize();
	screenWidth = screen_size.width;
	}else { screenWidth = screen.width;}
	return screenWidth;
}
// 캐릭터 타입 검증 'H'-한글, 'E'-영문, 'N'-숫자, 'Z'-기타
function getCharType(pValue){
 var bHan = false;
 var bAlp = false;
 var bNum = false;
 var bEtc = false;
 
 var retStr="";
 
 if(isEmpty(pValue)){
  return "";
 }
 
 for(var idx=0; idx < pValue.length; idx++){
  if (isAlpha(pValue[idx])) {
   bAlp = true;
  }
  else if (isNum(pValue[idx])) {
   bNum = true;
  }
  else if (isHangul(pValue[idx])) {
   bHan = true;
  }
  else {
   bEtc = true;
  }
  
  if (bHan) retStr = retStr + "H";
  if (bAlp) retStr = retStr + "E";
  if (bNum) retStr = retStr + "N";
  if (bEtc) retStr = retStr + "Z";
 }
 
 return retStr;
}
 
//새창 여는 함수
function uf_newWin( url, winName, sizeW, sizeH)
{
 var nLeft  = screen.width/2 - sizeW/2 ;
 var nTop  = screen.height/2 - sizeH/2 ;
 
 opt = ",toolbar=no,menubar=no,location=no,scrollbars=yes,status=no";
 window.open(url, winName, "left=" + nLeft + ",top=" +  nTop + ",width=" + sizeW + ",height=" + sizeH  + opt );
 
}
 

//새창 사이즈 정함 
function uf_reSize ( sizeW, sizeH)
{
 window.resizeTo( sizeW, sizeH );
 
}
 
//옵션이 있는경우
 
function selDataChange(form) {
  var DataIndex=form.url.selectedIndex;
  if (form.url.options[DataIndex].value != null) {
       location=form.url.options[DataIndex].value;
  }
}
 
function selDataChange2(form) {
  var DataIndex=form.url2.selectedIndex;
  if (form.url2.options[DataIndex].value != null) {
       location=form.url2.options[DataIndex].value;
  }
}
 
/**
 * 입력값이 NULL인지 체크
 */
function isNull(input) {
    if (input.value == null || input.value == "") {
        return true;
    }
    return false;
}
 
/**
 * 입력값에 스페이스 이외의 의미있는 값이 있는지 체크
 * ex) if (isEmpty(form.keyword)) {
 *         alert("검색조건을 입력하세요.");
 *     }

function isEmpty(input) {

    if (input.value == null || input.value == "") {
        return true;
    }
    return false;
}
 */ 
/**
 * 입력값에 특정 문자(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;
}
 
/**
 * 입력값이 특정 문자(chars)만으로 되어있는지 체크
 * 특정 문자만 허용하려 할 때 사용
 * ex) if (!containsCharsOnly(form.blood,"ABO")) {
 *         alert("혈액형 필드에는 A,B,O 문자만 사용할 수 있습니다.");
 *     }
 */
function containsCharsOnly(input,chars) {
    for (var inx = 0; inx < input.value.length; inx++) {
       if (chars.indexOf(input.value.charAt(inx)) == -1)
           return false;
    }
    return true;
}
function isStartWith(input,chars) {
    for (var inx = 0; inx < chars.length; inx++) {
       if (chars.indexOf(input.value.charAt(0)) == -1)
           return false;
    }
    return true;
}
/**
 * 입력값이 알파벳인지 체크
 * 아래 isAlphabet() 부터 isNumComma()까지의 메소드가
 * 자주 쓰이는 경우에는 var chars 변수를 
 * global 변수로 선언하고 사용하도록 한다.
 * ex) var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 *     var lowercase = "abcdefghijklmnopqrstuvwxyz"; 
 *     var number    = "0123456789";
 *     function isAlphaNum(input) {
 *         var chars = uppercase + lowercase + number;
 *         return containsCharsOnly(input,chars);
 *     }
 */
function isAlphabet(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
    return containsCharsOnly(input,chars);
}
 
/**
 * 입력값이 알파벳 대문자인지 체크
 */
function isUpperCase(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ";
    return containsCharsOnly(input,chars);
}
 
/**
 * 입력값이 알파벳 소문자인지 체크
 */
function isLowerCase(input) {
    var chars = "abcdefghijklmnopqrstuvwxyz ";
    return containsCharsOnly(input,chars);
}
 
/**
 * 입력값에 숫자만 있는지 체크
 */
function isNumber(input) {
    var chars = "0123456789";
    return containsCharsOnly(input,chars);
}
 
/**
 * 입력값이 알파벳,숫자로 되어있는지 체크
 */
function isAlphaNum(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ";
    return containsCharsOnly(input,chars);
}
 
function isBigAlphaNum(input) {
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ";
    return containsCharsOnly(input,chars);
}
/**
 * 입력값이 숫자,대시(-)로 되어있는지 체크
 */
function isNumDash(input) {
    var chars = "-0123456789";
    return containsCharsOnly(input,chars);
}
 
/**
 * 입력값이 숫자,콤마(,)로 되어있는지 체크
 */
function isNumComma(input) {
    var chars = ",0123456789";
    return containsCharsOnly(input,chars);
}
 
/**
 * 입력값이 사용자가 정의한 포맷 형식인지 체크
 * 자세한 format 형식은 자바스크립트의 'regular expression'을 참조
 */
function isValidFormat(input,format) {
    if (input.value.search(format) != -1) {
        return true; //올바른 포맷 형식
    }
    return false;
}
 
/**
 * 입력값이 이메일 형식인지 체크
 * ex) if (!isValidEmail(form.email)) {
 *         alert("올바른 이메일 주소가 아닙니다.");
 *     }
 */
function isValidEmail(input) {
//    var format = /^(\S+)@(\S+)\.([A-Za-z]+)$/;
    var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
    return isValidFormat(input,format);
}
 
/**
 * 입력값이 전화번호 형식(숫자-숫자-숫자)인지 체크
 */
function isValidPhone(input) {
    var format = /^(\d+)-(\d+)-(\d+)$/;
    return isValidFormat(input,format);
}
 
/**
 * 입력값의 바이트 길이를 리턴
 * ex) if (getByteLength(form.title) > 100) {
 *         alert("제목은 한글 50자(영문 100자) 이상 입력할 수 없습니다.");
 *     }
 */
function getByteLength(input) {
    var byteLength = 0;
    for (var inx = 0; inx < input.value.length; inx++) {
        var oneChar = escape(input.value.charAt(inx));
        if ( oneChar.length == 1 ) {
            byteLength ++;
        } else if (oneChar.indexOf("%u") != -1) {
            byteLength += 2;
        } else if (oneChar.indexOf("%") != -1) {
            byteLength += oneChar.length/3;
        }
    }
    return byteLength;
}
 
/**
 * 입력값에서 콤마를 없앤다.
 */
function removeComma(input) {
    return input.value.replace(/,/gi,"");
}
 
/**
 * 선택된 라디오버튼이 있는지 체크
 */
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 hasCheckedBox(input) {
    return hasCheckedRadio(input);
}
 

/**
 * 선택된 체크박스가  몇개인지  그 개수를 반환
 */
function hasMultiCheckedRadio(input) {
var kkkk = 0;
    if (input.length > 1) {
        for (var inx = 0; inx < input.length; inx++) {
            if (input[inx].checked) {
   kkkk++;
   }
        }
    } else {
   if (input.checked) kkkk=1;
 }
    return kkkk;
}
 
/**
 * 유효한(존재하는) 월(月)인지 체크
 */
function isValidMonth(mm) {
    var m = parseInt(mm,10);
    return (m >= 1 && m <= 12);
}
 
/**
 * 유효한(존재하는) 일(日)인지 체크
 */
function isValidDay(yyyy, mm, dd) {
    var m = parseInt(mm,10) - 1;
    var d = parseInt(dd,10);
 
    var end = new Array(31,28,31,30,31,30,31,31,30,31,30,31);
    if ((yyyy % 4 == 0 && yyyy % 100 != 0) || yyyy % 400 == 0) {
        end[1] = 29;
    }
 
    return (d >= 1 && d <= end[m]);
}
 
/**
 * 유효한(존재하는) 시(時)인지 체크
 */
function isValidHour(hh) {
    var h = parseInt(hh,10);
    return (h >= 1 && h <= 24);
}
 
/**
 * 유효한(존재하는) 분(分)인지 체크
 */
function isValidMin(mi) {
    var m = parseInt(mi,10);
    return (m >= 1 && m <= 60);
}
 
/**
 * Time 형식인지 체크(느슨한 체크)
 */
function isValidTimeFormat(time) {
    return (!isNaN(time) && time.length == 12);
}
 
/**
 * 유효하는(존재하는) Time 인지 체크
 * ex) var time = form.time.value; //'200102310000'
 *     if (!isValidTime(time)) {
 *         alert("올바른 날짜가 아닙니다.");
 *     }
 */
function isValidTime(time) {
    var year  = time.substring(0,4);
    var month = time.substring(4,6);
    var day   = time.substring(6,8);
    var hour  = time.substring(8,10);
    var min   = time.substring(10,12);
 
    if (parseInt(year,10) >= 1900  && isValidMonth(month) &&
        isValidDay(year,month,day) && isValidHour(hour)   &&
        isValidMin(min)) {
        return true;
    }
    return false;
}
 
/**
 * Time 스트링을 자바스크립트 Date 객체로 변환
 * parameter time: Time 형식의 String
 */
function toTimeObject(time) { //parseTime(time)
    var year  = time.substr(0,4);
    var month = time.substr(4,2) - 1; // 1월=0,12월=11
    var day   = time.substr(6,2);
    var hour  = time.substr(8,2);
    var min   = time.substr(10,2);
 
    return new Date(year,month,day,hour,min);
}
 
/**
 * 자바스크립트 Date 객체를 Time 스트링으로 변환
 * parameter date: JavaScript Date Object
 */
function toTimeString(date) { //formatTime(date)
    var year  = date.getFullYear();
    var month = date.getMonth() + 1; // 1월=0,12월=11이므로 1 더함
    var day   = date.getDate();
    var hour  = date.getHours();
    var min   = date.getMinutes();
 
    if (("" + month).length == 1) { month = "0" + month; }
    if (("" + day).length   == 1) { day   = "0" + day;   }
    if (("" + hour).length  == 1) { hour  = "0" + hour;  }
    if (("" + min).length   == 1) { min   = "0" + min;   }
 
    return ("" + year + month + day + hour + min)
}
 
/**
 * Time이 현재시각 이후(미래)인지 체크
 */
function isFutureTime(time) {
    return (toTimeObject(time) > new Date());
}
 
/**
 * Time이 현재시각 이전(과거)인지 체크
 */
function isPastTime(time) {
    return (toTimeObject(time) < new Date());
}
 
/**
 * 주어진 Time 과 y년 m월 d일 h시 차이나는 Time을 리턴
 * ex) var time = form.time.value; //'20000101000'
 *     alert(shiftTime(time,0,0,-100,0));
 *     => 2000/01/01 00:00 으로부터 100일 전 Time
 */
function shiftTime(time,y,m,d,h) { //moveTime(time,y,m,d,h)
    var date = toTimeObject(time);
 
    date.setFullYear(date.getFullYear() + y); //y년을 더함
    date.setMonth(date.getMonth() + m);       //m월을 더함
    date.setDate(date.getDate() + d);         //d일을 더함
    date.setHours(date.getHours() + h);       //h시를 더함
 
    return toTimeString(date);
}
 
/**
 * 두 Time이 몇 개월 차이나는지 구함
 * time1이 time2보다 크면(미래면) minus(-)
 */
function getMonthInterval(time1,time2) { //measureMonthInterval(time1,time2)
    var date1 = toTimeObject(time1);
    var date2 = toTimeObject(time2);
 
    var years  = date2.getFullYear() - date1.getFullYear();
    var months = date2.getMonth() - date1.getMonth();
    var days   = date2.getDate() - date1.getDate();
 
    return (years * 12 + months + (days >= 0 ? 0 : -1) );
}
 
/**
 * 두 Time이 며칠 차이나는지 구함
 * time1이 time2보다 크면(미래면) minus(-)
 */
function getDayInterval(time1,time2) {
    var date1 = toTimeObject(time1);
    var date2 = toTimeObject(time2);
    var day   = 1000 * 3600 * 24; //24시간
 
    return parseInt((date2 - date1) / day, 10);
}
 
/**
 * 두 Time이 몇 시간 차이나는지 구함
 * time1이 time2보다 크면(미래면) minus(-)
 */
function getHourInterval(time1,time2) {
    var date1 = toTimeObject(time1);
    var date2 = toTimeObject(time2);
    var hour  = 1000 * 3600; //1시간
 
    return parseInt((date2 - date1) / hour, 10);
}
 
/**
 * 현재 시각을 Time 형식으로 리턴
 */
function getCurrentTime() {
    return toTimeString(new Date());
}
 
/**
 * 현재 시각과 y년 m월 d일 h시 차이나는 Time을 리턴
 */
function getRelativeTime(y,m,d,h) {
 
    return shiftTime(getCurrentTime(),y,m,d,h);
}
 
/**
 * 현재 年을 YYYY형식으로 리턴
 */
function getYear() {
 
    return getCurrentTime().substr(0,4);
}
 
/**
 * 현재 月을 MM형식으로 리턴
 */
function getMonth() {
 
    return getCurrentTime().substr(4,2);
}
 
/**
 * 현재 日을 DD형식으로 리턴
 */
function getDay() {
 
    return getCurrentTime().substr(6,2);
}
 
/**
 * 현재 時를 HH형식으로 리턴
 */
function getHour() {
 
    return getCurrentTime().substr(8,2);
}
 
/**
 * 오늘이 무슨 요일이야?
 * ex) alert('오늘은 ' + getDayOfWeek() + '요일입니다.');
 */
function getDayOfWeek() {
    var now = new Date();
 
    var day = now.getDay(); //일요일=0,월요일=1,...,토요일=6
    var week = new Array('일','월','화','수','목','금','토');
 
    return week[day];
}
 

/**
 * 특정날짜의 요일을 구한다.
 */
function getDayOfWeek(time) {
    var now = toTimeObject(time);
 
    var day = now.getDay(); //일요일=0,월요일=1,...,토요일=6
    var week = new Array('일','월','화','수','목','금','토');
 
    return week[day];
}
 
 
 
/**
*   문자열의 오른쪽 끝에서 부터 지정된 개수만큼의 문자들을 리턴한다.
*/
 
function substrInverse(str, num)
{
 var len;
 
 len = str.length;
 
 return str.substr(len - num, num);
}
 
/**
*  문자열로의 특정위치로부터 지정된 개수의 문자들을 리턴한다.
*/
function substrMid(str, idx, num)
{
 return str.substr( idx-1, num);
}
 


 
    function Half2Full(HalfVal)
 {
         var arg;
         arg = myHalf2Full(HalfVal);
  return arg;
 }
 
 function myHalf2Full(HalfVal)
 {
   var FullChar = [
                "　", "！","＂","＃","＄","％","＆","＇","（",     //33~
         "）","＊","＋","，","－","．","／","０","１","２",      //41~
         "３","４","５","６","７","８","９","：","；","＜",      //51~
         "＝","＞","？","＠","Ａ","Ｂ","Ｃ","Ｄ","Ｅ","Ｆ",      //61~
         "Ｇ","Ｈ","Ｉ","Ｊ","Ｋ","Ｌ","Ｍ","Ｎ","Ｏ","Ｐ",      //71~
         "Ｑ","Ｒ","Ｓ","Ｔ","Ｕ","Ｖ","Ｗ","Ｘ","Ｙ","Ｚ",      //81~
         "［","￦","］","＾","＿","｀","Ａ","Ｂ","Ｃ","Ｄ",      //91~
         "Ｅ","Ｆ","Ｇ","Ｈ","Ｉ","Ｊ","Ｋ","Ｌ","Ｍ","Ｎ",      //101~
         "Ｏ","Ｐ","Ｑ","Ｒ","Ｓ","Ｔ","Ｕ","Ｖ","Ｗ","Ｘ",      //111~
         "Ｙ","Ｚ","｛","｜","｝","～"                         //121~
         ];
  var stFinal = "";
         var ascii;
         for( i = 0; i < HalfVal.length; i++)
         {
                 ascii = HalfVal.charCodeAt(i);
                 if( (31 < ascii && ascii < 128))
                 {
                   stFinal += FullChar[ascii-32];
                 }
                 else
                 {
                   stFinal += HalfVal.charAt(i);
                 }
         }
         return stFinal;
 }
function frmMoney(input){
 input.value = putComma(input);
}
function unFrmMoney(input){
 input.value = replace(input.value,",","");
}
function frmDate(input){
 if(input.value=="") return 
 input.value = input.value.substring(0,4) + "-" + input.value.substring(4,6) + "-" + input.value.substring(6,8);
}
function unFrmDate(input){
 input.value = replace(input.value,"-","");
}
function frmTime(input){
 input.value = input.value.substring(0,2) + ":" + input.value.substring(2,4) + ":" + input.value.substring(4,6);
}
function unFrmTime(input){
 input.value = replace(input.value,":","");
}
function frmAcct(input){
 input.value = input.value.substring(0,3) + "-" + input.value.substring(3,9) + "-" + input.value.substring(9,14);
}
function unFrmAcct(input){
 input.value = replace(input.value,"-","");
}
 
function setSelect(input,str) {
 for(i=0;i<input.options.length;i++){
  if(input.options[i].value == str)
   input.options[i].selected=true;
 }
}
// 외환에서 특정 통화일때 소수점이하 금액없애기 
function Curr(str1, str2){
 obj1 = eval("frm."+str1+".value")
 obj2 = eval("frm."+str2+".style")
 if(obj1=="JPY"||obj1=="ITL"||obj1=="BEF"||obj1=="KRW"){
  obj2.display = "none"
 }else{
  obj2.display = ""
 }
}
function Curr2(str1, str2, str3){
 obj1 = eval("frm."+str1+".value")
 obj2 = eval("frm."+str2+".style")
 obj3 = eval("frm."+str3+".style")
 if(obj1=="JPY"||obj1=="ITL"||obj1=="BEF"||obj1=="KRW"){
  obj2.display = "none"
  obj3.display = "none"
 }else{
  obj2.display = ""
  obj3.display = ""
 }
}
 
   ////////////////////////////////////////////////////////////////
   // 데이터 전송형태 관련
   ////////////////////////////////////////////////////////////////
   
    // get 방식의 파라미터를 해당폼에 input hidden 객체로 생성한다.
    function get2post(frm,sSearch){ 
     if (sSearch.length > 0) {
     
      var asKeyValues = sSearch.split('&');
      var asKeyValue  = '';
         
      for (var i = 0; i < asKeyValues.length; i++) {
       
       asKeyValue = asKeyValues[i].split('=');
       var e = document.createElement("input");
       e.setAttribute("type","hidden");
       e.setAttribute("name",asKeyValue[0]);
       e.setAttribute("value",asKeyValue[1]);
       e.setAttribute("_temp","true");
       
    //   alert("[" + e.name +"]:[" + e.value +"]");
       
       frm.appendChild(e);
      }
      } 
    //  alert("form 객체 갯수" + frm.elements.length);
    }   
    
    // get2post로 생성한 임시 객체를 파괴한다.  
    function removeTempAttribute(frm){ 
     var idx=0;
     while (idx<frm.elements.length) {
      var obj = frm.elements[idx];
      
      if( obj.getAttribute("_temp") != null && obj.getAttribute("_temp") == "true"){
       frm.removeChild(obj);
       continue;
      }
      idx++;
     }
    }   
    
    
 
   ////////////////////////////////////////////////////////////////
   // checkbox 관련
   ////////////////////////////////////////////////////////////////
   
    // check 한 개수를 리턴한다.
    function getCheckedCount( aElem ) {
     
     var elem = document.all;
     var cnt = 0;
     
     for ( var i=0; i<document.all.length; i++ ) {
      if ( ( elem[i].type == "checkbox" ) && ( elem[i].checked ) && ( elem[i].name == aElem ) ) cnt = cnt + 1;
     }
     
     return cnt;
    }
    
    
    // 지정한 이름을 가진 모든 checkbox를 check 한다.
    function checkAll( aElem ) {
     
     var elem = document.all;
     var cnt = 0;
     
     for ( var i=0; i<document.all.length; i++ ) {
      if ( ( elem[i].type == "checkbox" ) && ( elem[i].name == aElem ) ) elem[i].checked = true;
     }
    }
    
    
    // 지정한 이름을 가진 모든 checkbox의 checked 값을 반전 한다. 
    function invertCheck( aElem ) {
     
     var elem = document.all;
     var cnt = 0;
     
     for ( var i=0; i<document.all.length; i++ ) {
      if ( ( elem[i].type == "checkbox" ) && ( elem[i].name == aElem ) ) {
       if ( elem[i].checked ) {
        elem[i].checked = false;
       }
       else{
        elem[i].checked = true;
       }
      }
     }
    }   
    
 
    
 

    
 

    
       ////////////////////////////////
   // UTIL 함수
   ////////////////////////////////
   
    var isDivEvent = false;
    
    function hideOneNav(){
     if (!isDivEvent) {
      window.account.style.visibility='hidden';
     }
     else{
      isDivEvent = false;
     }
    }
    
    
    function showOneNav(obj){
     isDivEvent = true;
     window.account.style.left = getLeftPos(obj);
     window.account.style.top = getTopPos(obj) + obj.offsetHeight - 8;
     window.account.style.visibility='visible';
     return false;
    }
    
    function getLeftPos(obj){
     var parentObj = null;
     var clientObj = obj;
     var left = obj.offsetLeft + document.body.clientLeft;
     
     while((parentObj=clientObj.offsetParent) != null){
      left = left + parentObj.offsetLeft;
      clientObj = parentObj;
     }
     
     return left;
    }
    
    function getTopPos(obj){
     var parentObj = null;
     var clientObj = obj;
     var top = obj.offsetTop + document.body.clientTop;
     
     while((parentObj=clientObj.offsetParent) != null){
      top = top + parentObj.offsetTop;
      clientObj = parentObj;
     }
     
     return top;
    }
 
    /**
    *  문자열에 있는 특정문자패턴을 다른 문자패턴으로 바꾸는 함수.
    */
    
    function replace(targetStr, searchStr, replaceStr)
    {
     var len, i, tmpstr;
    
     len = targetStr.length;
     tmpstr = "";
    
     for ( i = 0 ; i < len ; i++ ) {
      if ( targetStr.charAt(i) != searchStr ) {
       tmpstr = tmpstr + targetStr.charAt(i);
      }
      else {
       tmpstr = tmpstr + replaceStr;
      }
     }
     return tmpstr;
    }
   
    /**
    *  문자열에서 좌우 공백제거
    */
    
    function trim(str)
    {
     return replace(str," ","");
    }
 
    /**
    * 콤마설정.
    */
    
    function putComma(input) { 
     var num = input;
     
     if (num < 0) { 
      num *= -1; 
      var minus = true
     }else{
      var minus = false
     }
     
     var dotPos = (num+"").split(".")
     var dotU = dotPos[0]
     var dotD = dotPos[1]
     var commaFlag = dotU.length%3
    
     if(commaFlag) {
      var out = dotU.substring(0, commaFlag) 
      if (dotU.length > 3) out += ","
     }
     else var out = ""
    
     for (var i=commaFlag; i < dotU.length; i+=3) {
      out += dotU.substring(i, i+3) 
      if( i < dotU.length-3) out += ","
     }
    
     if(minus) out = "-" + out
     if(dotD) return out + "." + dotD
     else return out 
    }
 
   
    //월의 끝 일자 얻기
    function getEndDate(datestr){
     
     //널인지? 
     if(isEmpty(datestr)){
      return null;
     } 
     
     //숫자인지?
     if(!isNum(datestr)){
      return null;
     }
      
     //길이가 8자리?
     if(datestr.length != 6){
      return null;
     }
     
     var yy = Number(datestr.substring(0,4));
     var mm = Number(datestr.substring(4,6));
     
     //윤년 검증
     var boundDay = "";
   
     if(mm != 2){
      var mon=new Array(31,28,31,30,31,30,31,31,30,31,30,31);
      boundDay = mon[mm-1];
     }
     else{
      if (yy%4 == 0 && yy%100 != 0 || yy%400 == 0){
       boundDay = 29;
      }
      else{
       boundDay = 28;
      }
     }
     
     return boundDay;  
    }
   
    // Left 빈자리 만큼 padStr 을 붙인다.
    function lpad(src, len, padStr){
     var retStr = "";
     var padCnt = Number(len) - String(src).length;
     for(var i=0;i<padCnt;i++) retStr += String(padStr);
     return retStr+src;
    }
   
    // Right 빈자리 만큼 padStr 을 붙인다.
    function rpad(src, len, padStr){
     var retStr = "";
     var padCnt = Number(len) - String(src).length;
     for(var i=0;i<padCnt;i++) retStr += String(padStr);
     return src+retStr;
    }
   
   
    // 전화번호 국번검증
    function isValidDDDPhoneNum(dddphonenum)
    {
    
     // 널인가?
     if (isEmpty(dddphonenum)) {
      return null;
     }
     
       
     if ( dddphonenum != "02" && dddphonenum != "031" && dddphonenum != "032" && dddphonenum != "033" && dddphonenum != "041" &&
          dddphonenum != "042" && dddphonenum != "043" && dddphonenum != "051" && dddphonenum != "052" && dddphonenum != "053" &&
          dddphonenum != "054" && dddphonenum != "055" && dddphonenum != "061" && dddphonenum != "062" && dddphonenum != "063" &&
          dddphonenum != "064" && dddphonenum != "011" && dddphonenum != "016" && dddphonenum != "017" && dddphonenum != "018" && dddphonenum != "019" )
     {
      
      ERR_MSG = "잘못된 전화번호 국번입니다.";
      return false;
     }
     
     return true;
     
    }
   
   
    // 대문자변환
    function toUpperCase(str){ 
     
     if(isEmpty(str)) return str;
     return str.toUpperCase();
    }
   
    
    // 숫자검증
    function isNum(str){ 
     
     if(isEmpty(str)) return false;
     
     for(var idx=0;idx < str.length;idx++){
      if(str.charAt(idx) < '0' || str.charAt(idx) > '9'){
       return false;
      }
     }
     return true;
    }
   
   
    // 영문자검증
    function isAlpha(str){
     
     if(isEmpty(str)) return false;
     
     for(var idx=0;idx < str.length;idx++){
      if(!((str.charAt(idx) >='a' && str <= 'z') || (str.charAt(idx) >= 'A' && str <= 'Z'))){
       return false;
      }
     }
     return true;
    }
   
    function isAlphaNum(str){
     
     if(isEmpty(str)) return false;
     
     for(var idx=0;idx < str.length;idx++){
      if(!((str.charAt(idx) >='a' || str <= 'z') ||  (str.charAt(idx) < '0' || str.charAt(idx) > '9'))){
       return false;
      }
     }
     return true;
    }    // 한글검증
    function isHangul(str){
     
     if(isEmpty(str)) return false;
     
     for(var idx=0;idx < str.length;idx++){
          var c = escape(str.charAt(idx));
          if ( c.indexOf("%u") == -1 ) {
       return false;
      }
     }
     return true;  
    } 
   
    
    // 실제길이 반환( 한글 2byte 계산 ) 
    function getByteLength(s){
     
       var len = 0;
       if ( s == null ) return 0;
       for(var i=0;i<s.length;i++){
          var c = escape(s.charAt(i));
          if ( c.length == 1 ) len ++;
          else if ( c.indexOf("%u") != -1 ) len += 2;
          else if ( c.indexOf("%") != -1 ) len += c.length/3;
       }
       return len;
    }
    
    
    // 빈값인지 리턴한다.

function isEmpty(pValue){
 
 if( (pValue == "") || (pValue == null) ){
  return true;
 }
 return false;
}

    
 
   
    //검색날짜 유효기간 
    function getBoundDate1(yy,mm,dd,stdDate)
    {
     var today = new Date();
     today.setYear(stdDate.substring(0,4));
     today.setMonth(stdDate.substring(4,6)-1);
     today.setDate(stdDate.substring(6,8));
     today.setHours(today.getHours());
     today.setMinutes(today.getMinutes());
     today.setSeconds(today.getSeconds());
     
     yy = Number(yy);
     mm = Number(mm);
     dd = Number(dd);
     
     var date = new Date();
     
     var DAY = 24 * 60 * 60 * 1000;
     
     if ( yy != 0 ){
      date.setTime(today.getTime() + DAY * 365 * yy);
     }
   
     if ( mm != 0 ){
      date.setTime(today.getTime() + DAY * 30 * mm);
     }
     
     if ( dd != 0 ){
      date.setTime(today.getTime() + DAY * dd);
     }
     
     return lpad(new String(date.getYear()),4,'0') + lpad(new String(date.getMonth() + 1),2,'0') + lpad(new String(date.getDate()),2,'0');    
    }   
 
 
 
    function getBoundDate(yy, mm, dd) {
     yy = Number(yy);
     mm = Number(mm);
     dd = Number(dd);
     
     var date = new Date();
     
     var DAY = 24 * 60 * 60 * 1000;
 
     
     if ( yy != 0 ){
      date.setTime(datToday.getTime() + DAY * 365 * yy);
     }
   
     if ( mm != 0 ){
      date.setTime(datToday.getTime() + DAY * 30 * mm);
     }
     
     if ( dd != 0 ){
      date.setTime(datToday.getTime() + DAY * dd);
     }
     
     return lpad(new String(date.getYear()),4,'0') + lpad(new String(date.getMonth() + 1),2,'0') + lpad(new String(date.getDate()),2,'0');
    }   
     
   
    //검색날짜 체크 
    function isVaildTerm(obj,yy,mm,dd)
    {
     var datestr = obj.value;
     
     
     //널인지? 
     if(isEmpty(datestr)){
      return null;
     }
     
     // 날짜 포맷제거
     obj_removeformat(obj);
     
     //8자리인지?
     if (getByteLength(datestr) != 8) {
      alert("날짜는 '-'를 제외한 8자리 숫자로 입력하십시오.");
      return false;
      
     }
   
     
     
     // yy,mm,dd,fromto가 없을 경우
     if (yy == null) yy = 0;
     if (mm == null) mm = 0;
     if (dd == null) dd = 0;
     
     // 검색날짜 유효기간 가져오기
     var boundDate = getBoundDate(yy,mm,dd);
     
     if (yy < 0  || mm < 0  || dd < 0) {
      if ( boundDate > datestr) {
       alert("유효하지 않은 검색날짜입니다.\n유효한 날짜는" + boundDate.substring(0,4) + "년 " + boundDate.substring(4,6) + "월 " + boundDate.substring(6) + "일부터 입니다.");
       obj.select();
       return false;
      }
     } else {
      if ( boundDate < datestr) {
       alert("유효하지 않은 검색날짜입니다.\n유효한 날짜는" + boundDate.substring(0,4) + "년 " + boundDate.substring(4,6) + "월 " + boundDate.substring(6) + "일까지 입니다.");
       obj.select();
       return false;
      }    
     }
      
   
     return true;
    
    }
   
   
   
    //오늘날짜
    function getToDay()
    {
   
        var date = datToday;
   
        var year  = date.getFullYear();
        var month = date.getMonth() + 1; // 1월=0,12월=11이므로 1 더함
        var day   = date.getDate();
    
        if (("" + month).length == 1) { month = "0" + month; }
        if (("" + day).length   == 1) { day   = "0" + day;   }
         
        return ("" + year + month + day)
    
    }
    
    
   
   
 
    
    function selectComboBox(targt, optValue)
    {
     last = targt.length;
     for(var i=0; i<last; i++){
      if(targt.options[i].value == optValue){
       targt.selectedIndex = i;
       targt.options[i].selected;
      }
     }
    }
    
    
    function isExistsComboBoxValue(targt, optValue)
    {
     last = targt.length;
     for(var i=0; i<last; i++){
      if(targt.options[i].value == optValue){
       return true;
      }
     }
     return false;
    }
 
    
    function getCal(aFrm, aObj){
      window.open('/kor/ib/common/msg/cal.jsp?objName=window.opener.'+ aFrm.name +'.' + aObj.name +'&schdate='+ aFrm.name +'.' + aObj.name ,"Window2","status=no,height=150,width=120,resizable=no,left="+x+",top="+y+",scrollbars=no");
    } 
    
    function getCalMonth(aFrm, aObj){
      window.open("/kor/ib/common/msg/calendar_month.jsp?frmName="+aFrm.name + "&obj=" + aObj.name,"calMonth","status=no,height=146,width=255,resizable=no,left="+x+",top="+y+",scrollbars=no");
    } 
 
     
/*
* 전화번호
* 앞에 '0'을 채운다
* by 황상훈 2002-10-23 11:26오후
**/
 
function fill_zero(obj, is4){
 var temp="";
 
 if(obj.value == null || obj.value.length < 1 ) {
  return false;
 }
 
 if (is4 == 'Y' ) {
  return true;
 } else {
  if(obj.value.length != 4 ) {
   for(i=0;i<(4-obj.value.length);i++){
    temp +="0";
   }
   obj.value = temp+obj.value;
  }else{
   obj.value = obj.value;
  } 
 
  return true;
 }
}
/*====================================================
함수명	: mediaSizeSet(value:이미지 객체)
함수설명	: 사진 사이즈 조정하는 함수
====================================================*/
function mediaSizeSet(val) {
//    var width = eval("document."+val+".width");
//    var height = eval("document."+val+".height");
	var width = val.width;
	var height = val.height;
    var temp = 0; 
    var max_width= 110;   // 이미지의 최대 크기     
    
    if ( width > max_width ) {  // 이미지가 600보다 크다면 너비를 600으로 맞우고 비율에 맞춰 세로값을 변경한다.      
       height = height/(width / max_width);
//       eval("document."+val+".width = max_width");     
//       eval("document."+val+".height = height");
		val.width = max_width;
		val.height = height;
    }   
//    if( value.width>newWidth ){
//        value.width = 120;
        val.style.display = '';
//	}
}

/*====================================================
함수명	: fileUploadPreview()
함수설명	: 사진미리보기
====================================================*/
function fileUploadPreview(thisObj, preViewer) {
	if(!/(\.gif|\.jpg|\.jpeg|\.png)$/i.test(thisObj.value)) {
		alert("이미지 형식의 파일을 선택하십시오");
		divPreview.style.display = "none";
		return;
	}
	else{
		divPreview.style.display = "";
	}

	preViewer = (typeof(preViewer) == "object") ? preViewer : document.getElementById(preViewer);
	var ua = window.navigator.userAgent;

	if (ua.indexOf("MSIE") > -1) {
		var img_path = "";
		if (thisObj.value.indexOf("\\fakepath\\") < 0) {
			img_path = thisObj.value;
		} else {
			thisObj.select();
			var selectionRange = document.selection.createRange();
			img_path = selectionRange.text.toString();
			thisObj.blur();
		}

		preViewer.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fi" + "le://" + img_path + "', sizingMethod='scale')";
	} else {
		preViewer.innerHTML = "";
		var W = preViewer.offsetWidth;
		var H = preViewer.offsetHeight;
		var tmpImage = document.createElement("img");
		preViewer.appendChild(tmpImage);

		tmpImage.onerror = function () {
			return preViewer.innerHTML = "";
		}

		tmpImage.onload = function () {
			if (this.width > W) {
				this.height = this.height / (this.width / W);
				this.width = W;
			}
			if (this.height > H) {
				this.width = this.width / (this.height / H);
				this.height = H;
			}
		}
		if (ua.indexOf("Firefox/3") > -1) {
			var picData = thisObj.files.item(0).getAsDataURL();
			tmpImage.src = picData;
		} else {
			tmpImage.src = "file://" + thisObj.value;
		}
	}
}
/* ################### 이미지 파일 업로드 관련 스크립트 끝 ################### */

var csel= '0';
var psel= '0';

function startCateScrollScroll(sel)
{
    setTimeout('slideCateScroll('+sel+')', 10);
}
function slideCateScroll(sel)
{
    csel = sel;
    var Sel_Height=180;
    el = document.getElementById('menu');


    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 = 30;
    }

    if (Math.abs(el.heightTo - el.heightPos) > 1)
    {
        el.heightPos += (el.heightTo - el.heightPos) / 10;
        el.style.height = el.heightPos + 'px';
        startCateScrollScroll(sel);
    }
    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 go_home(){
	location.href="/";
}

function RandomBG(){
var bg_arr = new Array("#E0E0E0","#CCCCCC","#B3B3B3","#999999","#7F7F7F","#666666","#4C4C4C","#333333","#191919","#000000","#FFE600","#FFB300","#FF7F00","#FF4C00","#FF0000","#0190BF","#0571B0","#0B499D","#0F218B","#13007C","#DA027F","#97017E","#76017D","#28007C","#CCE70B","#99BB14","#65B721","#329F2C","#058937","#005C25","#FEF0C6","#FDD6C9","#DBF1C7","#E5D8EA","#CCECF4","#FDD1A7","#A7A6CF","#FDB972","#ADDD95","#FC8B55","#E5D9B3","#E4C1B6","#C6D9B4","#CEC3D3","#B8D5DC","#E4BD97","#9795BB","#E4A667","#9CC886","#E47D4C","#8FD198","#FA7E7D","#F981A0","#8092C4","#857FBB","#C596AD","#50978E","#94AD7B","#2E87A2","#01735A","#72A779","#C86564","#C76780","#66759D","#6B6595","#9D788B","#407871","#768A63","#256C81","#015C48","#47684C","#7D3F3E","#7C4050","#404962","#423F5D","#624B56","#284B47","#4A563D","#174350","#00392D");
var number = Math.round(bg_arr.length * Math.random());
	return bg_arr[number];
}
/*
window.document.oncontextmenu  = new Function("return false;");   //우클릭 메뉴 보이지 않음
window.document.onselectstart  = new Function("return false;");    //더블클릭시 셀선택
window.document.ondragstart  = new Function("return false;");   //드레그 금지
//window.document.onkeydown  = new Function("if ((event.ctrlKey) && (event.keyCode == 78)) return false;"); //컨트롤 n 막
window.document.onkeydown  = function(e) {
if (typeof(e) != "undefined"){
	if ((e.ctrlKey) && (e.keyCode == 78)) return false;
}
else {
	if ((event.ctrlKey) && (event.keyCode == 78)) return false};
}
*/
document.write("<LINK rel='Shortcut Icon' href='http://www.cage4me.co.cc/favicon.ico'>")


function autoImgResize11(obj, maxSize) {
	obj.each(function() {
	var obj = $(this).attr({alt: "클릭하시면 원본 사이즈로 보실 수 있습니다."}).unbind("click").bind("click", function() { window.open(obj.attr("src"), ""); }).css({cursor: "pointer"});
	var width = 0, height = 0;
	width = parseInt(obj.attr("width"), 10) || parseInt(obj.css("width"), 10);
	height = parseInt(obj.attr("height"), 10) || parseInt(obj.css("height"), 10);
	if(width > maxSize) obj.css({width: maxSize+"px", height: Math.round(height * (maxSize / width))+"px"});
	});
}
//autoImgResize11($("#printcts img"), 675);

// 함수 자신의 이름 가져오기 ////////////////////////////////////////////////////////////
function $F(caller) { 
    var f = arguments.callee.caller; 
    if(caller) f = f.caller; 
    var pat = /^function\s+([a-zA-Z0-9_]+)\s*\(/i; 
    pat.exec(f); 

    var func = new Object(); 
    func.name = RegExp.$1; 
    return func; 
} 

function foo(){ 
    var name = $F().name; // 함수 자신의 이름 가져오기 
    alert(name); // 또는 alert($F().name); 
}
// 함수 자신의 이름 가져오기 ////////////////////////////////////////////////////////////

function ck_digit(target){
var f=document.f;
var t = target.value;
var Digit = '1234567890';

	if (Digit.length > 1) {
		for (i=0; i< t.length; i++)
			if(Digit.indexOf(t.substring(i,i+1))<0) {
				alert('숫자만 입력해주세요.');
				target.value="";
				target.select();
				return;
				//break;        
			}
	}  
}

function goSNS(what, url, msg){
		window.document.title = msg;
		if(what == "twit"){
			window.open("http://twitter.com/home?status="+encodeURIComponent(msg+ " #jgah")+" "+url, "_blank");
		}else if(what == "face"){
			window.open("http://www.facebook.com/share.php?u="+encodeURIComponent(url)+"&t="+encodeURIComponent(msg), "_blank");
		}


}
