﻿
/*******************************************************************************
숫자형식인지 확인
********************************************************************************/ 
String.prototype.isNumeric = function(str) {
	str = this != window ? this : str;
	return (!str.isNull() && !isNaN(str)) ? true : false ;
}

/*******************************************************************************
널값인지 확인
********************************************************************************/ 
String.prototype.isNull = function(str) {
	str = this != window ? this : str;
	return (str.trim().length == 0) ? true : false ;
}

/*******************************************************************************
대상 문자열에서 해당 부분 전체 치환
********************************************************************************/ 
function replaceAll(temp_str, str1, str2) {
	temp_str = Trim(temp_str);
	temp_str = temp_str.replace(eval("/" + str1 + "/gi"), str2);
	return temp_str;
}

/*******************************************************************************
모든 CheckBox Selected
사용법 예 : checkBoxSelectAll(this.form,'ck',this.checked)
********************************************************************************/ 
function checkboxSelectAll(f,fieldName,bool){
	if(typeof(f.elements[fieldName]) == 'undefined') return false;
	if(typeof(f.elements[fieldName].length) == 'undefined'){
		if(bool)f.elements[fieldName].checked = true;
		else f.elements[fieldName].checked = false;
	}else{
		for(i=0;i<f.elements[fieldName].length;i++){
			if(bool)f.elements[fieldName][i].checked = true;
			else f.elements[fieldName][i].checked = false;
		}
	}
}

/*******************************************************************************
	선택된 CheckBox Count
********************************************************************************/ 
function checkboxSelectedCount(f,fieldName){
	if(typeof(f.elements[fieldName]) == 'undefined') return 0;
	if(typeof(f.elements[fieldName].length) == 'undefined') {
		if(f.elements[fieldName].checked) return 1;
		else return 0;
	}else{
		var cnt = 0;
		for(i=0;i<f.elements[fieldName].length;i++) {
			if(f.elements[fieldName][i].checked)
				cnt++;
		}
		return cnt;
	}
}

/*******************************************************************************
	선택된 CheckBox Value 담기
********************************************************************************/ 
function checkboxSelectedValue(f,fieldName){
	if(typeof(f.elements[fieldName]) == 'undefined') return;
	if(typeof(f.elements[fieldName].length) == 'undefined') {
		if(f.elements[fieldName].checked) return f.elements[fieldName].value;
		else return;
	}else{
		var checkedCount = 0;
		var tmp = "";
		for(i=0;i<f.elements[fieldName].length;i++) {
			if(f.elements[fieldName][i].checked) {
				if (checkedCount != 0) tmp += ",";
				tmp += f.elements[fieldName][i].value;
				checkedCount ++;
			}
		}
		return tmp;
	}
}

/*******************************************************************************
숫자만 입력 가능 체크 
********************************************************************************/ 
function CheckNum(objNum,msgStr) {
	if(Trim(objNum.value) != ""){
		var str = objNum.value;
		var machedStr = str.match(/[0123456789]+/);
		
		if ( machedStr == str){
			return true;
		} else {
			alert(msgStr);
			objNum.value = "";
			objNum.focus();
			return false;
		}
	}

	return true;
}

/*******************************************************************************
숫자만 입력 가능 체크(. 포함 가능)
********************************************************************************/ 
function CheckNumAndDot(objNum,msgStr) {
	if(Trim(objNum.value) != ""){
		var str = objNum.value;
		var machedStr = str.match(/[0123456789.]+/);

		if ( machedStr == str){
		    if ( str.indexOf(".") == -1 || (str.indexOf(".") >= 0 && ( str.indexOf(".") == str.lastIndexOf(".") )) ) {
    			return true;
    		}
    		else {
			    alert(".은 한번만 사용가능합니다.");
			    objNum.value = "";
			    objNum.focus();
			    return false;
    		}
		} else {
			alert(msgStr);
			objNum.value = "";
			objNum.focus();
			return false;
		}
	}
	
	return true;
}

/*******************************************************************************
숫자만 입력 가능 체크(. 포함 가능)
********************************************************************************/ 
function CheckNumAndDash(objNum,msgStr) {
	if(Trim(objNum.value) != ""){
		var str = objNum.value;
		var machedStr = str.match(/[0123456789-]+/);
		
		if ( machedStr == str){
			return true;
		} else {
			alert(msgStr);
			objNum.value = "";
			objNum.focus();
			return false;
		}
	}
	
	return true;
}

/*******************************************************************************
정수만 입력
********************************************************************************/ 
function CheckOnlyInt(objINT, msgStr){
    var regExp = /^[0-9]{1,}$/;
	
	if(Trim(objINT.value) != ""){
		var str = objINT.value;
		
		if ( regExp.test(str) ){
			return true;
		} else {
			alert(msgStr);
			objINT.value = "";
			objINT.focus();
			return false;
		}
	}
}

/*******************************************************************************
영문(소문자) & 숫자 & . & - 만 입력 가능 체크
********************************************************************************/ 
function CheckString(objString,msgStr) {
	if(Trim(objString.value) != ""){
		var str = objString.value;
		var machedStr = str.match(/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890.-]+/);
		
		if ( machedStr == str){
			return true;
		} else {
			alert(msgStr);
			objString.value = "";
			objString.focus();
			return false;
		}
	}
	
	return true;
}

/*******************************************************************************
숫자 & / 만 입력 가능 체크
********************************************************************************/ 
function CheckNumAndSlash(objString,msgStr) {
	if(Trim(objString.value) != ""){
		var str = objString.value;
		var machedStr = str.match(/[1234567890/]+/);
		
		if ( machedStr == str){
			return true;
		} else {
			alert(msgStr);
			objString.value = "";
			objString.focus();
			return false;
		}
	}
	
	return true;
}

/*******************************************************************************
공백 입력 체크 
********************************************************************************/ 
function CheckEmpty(objNum,msgStr) {
	if (objNum.value.indexOf(" ") >= 0)	{
	    alert(msgStr);
	    objNum.value = "";
	    objNum.focus();
	    return false;
	}
	return true;
}

/*******************************************************************************
 @param
    v : 체크할 개체
 @return
    날짜 형식은 YYYY/MM/DD 여야만 통과
********************************************************************************/ 
function checkDate(v){

    //month 테이블
    var mt=new Array(31,28,31,30,31,30,31,31,30,31,30,31);

    //오늘 데이트 객체
    var now=new Date();

    var Y=now.getYear(); //년
    var M=now.getMonth()+1; //월
    var D=now.getDate(); //일

    var lim=new Array(Y,12,31); //년,월,일 한계범위설정
    var lim_=new Array('년도','월일','일자'); //년,월,일의 표기 스트링
    var lim__=new Array(4,2,2); //년,월,일의 유효길이

    var a=new Array(); //정수화 포맷을 담을 배열
    var tmp=v.value.split('/'); // /로 나누어 배열로 담는다.
    if(tmp.length!=3){ //배열의 길이가 유효한지 확인.
        alert('유효하지 않은 날짜포맷입니다\nyyyy/mm/dd 형식으로 넣어주세요');
        return;
    } else {
        a[0]=parseInt(tmp[0]); //년
        a[1]=parseInt(tmp[1]); //월
        a[2]=parseInt(tmp[2]); //일자를 정수화하여 담는다.

        for(var i in a){ //배열의 길이만큼 루프를 돈다.
            if(a[i]<0||a[i]>lim[i]||tmp[i].length!=lim__[i]){ //년,월,일별 유효성 체크
                alert(lim_[i]+'를 제대로 입력해 주세요');
                v.focus();
                return;
            }
        }

        if(mt[a[1]-1]<a[2]){ //월별 요일의 범위체크
            alert('일자의 범위가 틀립니다.');   
             v.focus();
             return;
        }
        //alert(a); //걸러진것만 출력
    }
}

/*******************************************************************************
naver.com 일때와 naver.co.kr일때의 형식 체크
********************************************************************************/ 
function EmailValue(objString, msgStr){
  var mail2 = objString.value;
  if(mail2.match(/^(\w+)[.](\w+)$/ig) == null && mail2.match(/^(\w+)[.](\w+)[.](\w+)$/ig) == null){
   alert(msgStr);
   objString.value = "";
   objString.focus();
   return false;
  }else{

   return true;
  }
}

/*******************************************************************************
 공백 제거 처리
********************************************************************************/ 
function Trim(obj1){
	obj1 = obj1.replace(/^(\s+)|(\s+)$/g, "")
	return obj1;
}

/*******************************************************************************
 문자열 총 길이 체크
********************************************************************************/ 
function lenByte(str) {
	var wLen=0;
	for(i=0;i<str.length;i++) {
		ch=str.charAt(i);
		if (escape(ch).length > 4) wLen=wLen+2;
		else wLen=wLen+1;
	}
	return wLen;
}

/*******************************************************************************
 문자열 왼쪽 길이 자름
********************************************************************************/ 
function leftByte(str, len) {
	var wLen=0;
	var buffer="";
	for(i=0;i<str.length;i++) {
		ch=str.charAt(i);
		if (escape(ch).length > 4) wLen=wLen+2;
		else wLen=wLen+1;
		if (wLen>len) { break;	}
		else buffer += ch;
	}
	return buffer;
}

/*******************************************************************************
 입력 문자 길이 체크
//onChange="doInputData(this, 50)" onKeyDown="doInputData(this, 50)" onKeyUp="doInputData(this,50)"
********************************************************************************/ 
function doInputData(obj, name, maxlen) {
	if (lenByte(obj.value) > maxlen) {
		alert(name + "에는 "+(maxlen/2)+"자(한글), "+maxlen+"(영문, 숫자)까지만 입력할 수 있습니다. ");
		obj.value=leftByte(obj.value, maxlen);
		obj.focus();
	}
}

/*******************************************************************************
input box 문자 Null 체크
********************************************************************************/ 
function validFieldText(objInput, msgStr){
	if(Trim(objInput.value) == "") {
		alert(msgStr);
		objInput.focus();
		return false;
	}

	return true;
}

/*******************************************************************************
input box 문자 Null 체크(hidden)
********************************************************************************/ 
function validFieldTextHidden(objInput, msgStr){
	if(Trim(objInput.value) == "") {
		alert(msgStr);
		return false;
	}

	return true;
}

/*******************************************************************************
웹에디터 문자 Null 채크
********************************************************************************/ 

function validFieldWebEdit(objInput, msgStr){
	if(objInput == false) {
		alert(msgStr);
		return false;
	}

	return true;
}

/*******************************************************************************
 삭제 확인
 ********************************************************************************/ 
function deleteProcChk(msgStr) {
	if(confirm(msgStr)){
		return true;
	}
	else {
		return false;
	}
}

/*******************************************************************************
Pass length (above 4~10 letters), alphabet number checking
 ********************************************************************************/ 
function jsLenWodChkPass(field, name)
{
	var eng=/^([a-zA-Z0-9]{4,20})$/

	if(eng.test(field.value)==false){
		alert(name + "에는 4~20자(영문, 숫자)까지만 입력할 수 있습니다.");
		field.focus();
		return false;
	}

	return true;
}

/*******************************************************************************
Pass length (above 4~10 letters), alphabet number checking
 ********************************************************************************/ 
function jsLenWodChkFornPass(field, name)
{
	var eng=/^([a-zA-Z0-9]{4,20})$/

	if(eng.test(field.value)==false){
		alert(name + "Use only four to twenty small letters and numbers.");
		field.focus();
		return false;
	}

	return true;
}

/*******************************************************************************
Pass length (above 3~12 letters), alphabet number checking
 ********************************************************************************/ 
function jsLenIDChk(field, name)
{
	var eng=/^([a-zA-Z0-9_]{3,12})$/

	if(eng.test(field.value)==false){
		alert(name + "에는 3~12자의 영문 소문자, 숫자와 특수기호(_) 만 사용할 수 있습니다.");
		field.focus();
		return false;
	}

	return true;
}

/*******************************************************************************
Pass length (above 3~12 letters), alphabet number checking
 ********************************************************************************/ 
function jsLenFornIDChk(field, name)
{
	var eng=/^([a-zA-Z0-9_]{3,12})$/

	if(eng.test(field.value)==false){
		alert(name + "Use only four to twenty small letters, numbers, and special symbols.");
		field.focus();
		return false;
	}

	return true;
}

/*******************************************************************************
Pass length (above 4~10 letters), alphabet number checking
 ********************************************************************************/ 
function jsBranchIDCheck(field, name)
{
	var eng=/^([a-zA-Z0-9]{4,12})$/

	if(eng.test(field.value)==false){
		alert(name + "에는 4~12자(영문, 숫자)까지만 입력할 수 있습니다.");
		field.focus();
		return false;
	}

	return true;
}

/*******************************************************************************
 쿠키값 가져오기
 ********************************************************************************/ 
function getCookie(key)
{
  var cook = document.cookie + ";";
  var idx =  cook.indexOf(key, 0);
  var val = "";
 
  if(idx != -1)
  {
    cook = cook.substring(idx, cook.length);
    begin = cook.indexOf("=", 0) + 1;
    end = cook.indexOf(";", begin);
    val = unescape( cook.substring(begin, end) );
  }
 
  return val;
}
 
/*******************************************************************************
 쿠키값 설정
 ********************************************************************************/ 

function setCookie(name, value, expiredays)
{
  var today = new Date();
  today.setDate( today.getDate() + expiredays );
  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";"
}



/*******************************************************************************
 IE 버전 체크
 ********************************************************************************/
function browserChk(){
	if(window.navigator.userAgent.indexOf('MSIE 7') != -1){
		return true;
	}else{
		return false;
	}
}


/*******************************************************************************
 * 	화면의 가운데로 새창을 열어줍니다.
 *	@param	String url
 *	@param	String window_name
 *	@param	int width
 *	@param	int height
 *	@param	String scroll 'yes':'no'
 *	@return window
 ********************************************************************************/
function popWindow(url,name,width,height,scroll) {
	var x = (screen.width - width) / 2 - 4;
	var y = (screen.height - height) / 2 - 16;
	var win = window.open(url,name,"left="+x+",top="+y+",width="+width+"px,height="+height+"px,scrollbars="+scroll);
	if (win) {
		win.focus();
		return win;
	}
	else {
		alert("현재 팝업창이 허용되지 않았습니다. 팝업을 보실려면 허용해주세요.");
	}
}

function popWindowModal(url, name, width, height){
    var x = (screen.width - width) / 2 - 4;
	var y = (screen.height - height) / 2 - 16;
	var winModal = showModalDialog(url,name,"dialogWidth:"+width+"px;dialogHeight:"+height+"px;dialogTop:"+x+"px;dialogLeft:"+y+"px;scroll:0;center:0;status:0;resizable:0;help:0;");
	if (winModal) {
		//winModal.focus();
		return winModal;
	}
	else {
		alert("현재 팝업창이 허용되지 않았습니다. 팝업을 보실려면 허용해주세요.");
	}
}

function FullScreenWinPopOpen(Url, popName) {
	var popOpen = window.open(Url,popName,"left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight+",scrollbars="+scroll);

	if ( popOpen == null )
	{
		alert("현재 팝업창이 허용되지 않았습니다. 팝업을 보실려면 허용해주세요.");
	}
}

function FullScreenWinOpen(Url, popName) {
	var popOpen = window.open(Url,popName,"toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+screen.availWidth+",height="+screen.availHeight);

	if ( popOpen == null )
	{
		alert("현재 팝업창이 허용되지 않았습니다. 팝업을 보실려면 허용해주세요.");
	}
}
/*******************************************************************************
 주민번호 체크
********************************************************************************/
function chkresno(val1, val2) {
      resno = val1 + '-' + val2;
      // 주민번호의 형태와 7번째 자리(성별) 유효성 검사
      fmt = /^\d{6}-[1234]\d{6}$/;
      if (!fmt.test(resno)) {
        alert("잘못된 주민등록번호입니다."); return false;
      }

      // 날짜 유효성 검사
      birthYear = (resno.charAt(7) <= "2") ? "19" : "20";
      birthYear += resno.substr(0, 2);
      birthMonth = resno.substr(2, 2) - 1;
      birthDate = resno.substr(4, 2);
      birth = new Date(birthYear, birthMonth, birthDate);

      if ( birth.getYear() % 100 != resno.substr(0, 2) ||
           birth.getMonth() != birthMonth ||
           birth.getDate() != birthDate) {
        alert("잘못된 주민등록번호입니다."); return false;
      }

      // Check Sum 코드의 유효성 검사
      buf = new Array(13);
      for (i = 0; i < 6; i++) buf[i] = parseInt(resno.charAt(i));
      for (i = 6; i < 13; i++) buf[i] = parseInt(resno.charAt(i + 1));

      multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
      for (i = 0, sum = 0; i < 12; i++) sum += (buf[i] *= multipliers[i]);

      if ((11 - (sum % 11)) % 10 != buf[12]) {
        alert("잘못된 주민등록번호입니다."); return false;
      }
    return true;
}
//******************************************************************************************************

/*******************************************************************************
외국인 등록번호 체크 - arguments[0] : 등록번호 구분자    
********************************************************************************/
function chkForeignNo(No){
	var nSum;
	var odd;
	odd= (parseInt(No.charAt(7))*10)+(parseInt(No.charAt(8)))

	if((odd%2) != 0){
		return false;
	}
	if((parseInt(No.charAt(11))!=6) && (parseInt(No.charAt(11))!=7) && (parseInt(No.charAt(11))!=8) && (parseInt(No.charAt(11))!=9)){
		return false;
	}

	nSum=
	(parseInt(No.charAt(0))*2)+
	(parseInt(No.charAt(1))*3)+
	(parseInt(No.charAt(2))*4)+
	(parseInt(No.charAt(3))*5)+
	(parseInt(No.charAt(4))*6)+
	(parseInt(No.charAt(5))*7)+
	(parseInt(No.charAt(6))*8)+
	(parseInt(No.charAt(7))*9)+
	(parseInt(No.charAt(8))*2)+
	(parseInt(No.charAt(9))*3)+
	(parseInt(No.charAt(10))*4)+
	(parseInt(No.charAt(11))*5);

	nSum = 11 - (nSum % 11);
	if(nSum >= 10){
		nSum = nSum - 10;
	}
	nSum = nSum + 2;
	if(nSum >= 10){
		nSum = nSum - 10;
	}
	if(nSum != (parseInt(No.charAt(12)))){
		return false;
	}
	else{
		return true;
	}
}

//외국인 등록번호 check alert포함
function chkForNo(varCk1){
	var varCk = varCk1;
	if ( isInteger(varCk1,"") ) {
		if ( isLength(varCk1)==13 ) {
			//법인번호 check
			if( !chkForeignNo(varCk) ){
				alert("This foreigner registration number is invalid.\nPlease Check foreigner registration number.");
				return false;
			}else{
				return true;
			}
		} else {
			alert("foreigner registration number of ciphers is incorrect.");
			return false;
		}
	}else {
			alert("foreigner registration number have to be number.");
			return false;
	}
	return true;
}
//******************************************************************************************************

/*******************************************************************************
입력 문자열 검사 (숫자/특수문자) 
********************************************************************************/
function isInteger(varCk, charSet) {
	var chk=true;
	for (i=0; i<=varCk.length-1; i++) {
		ch = varCk.substring(i,i+1);
		if (ch>="0" && ch<="9") {
			chk = true;
		} else {
			chk=false;
			for (j=0; j<=charSet.length-1; j++) {
				comp = charSet.substring(j,j+1);
				if (ch==comp) {
					chk = true;
					break;
				}
			}
			if (!chk) 	break;	// 숫자+특수문자외의 문자가 있는 경우만 error 종료 2002.04.08
		}
	}
	return chk;
}

/*******************************************************************************
// 문자열 길이 검사
********************************************************************************/
function isLength(varCk) {
	var varLen = 0;
	var agr = navigator.userAgent;

	for (i=0; i<varCk.length; i++) {
		ch = varCk.charAt(i);
		if ((ch == "\n") || ((ch >= "ㅏ") && (ch <= "히")) || ((ch >="ㄱ") && (ch <="ㅎ")))
			varLen += 2;
		else
			varLen += 1;
	}
	return (varLen);
}


/*************************************************************************************************
SELECT BOX 관련 Function 시작
***************************************************************************************************/
//-----------------------------------------------------------
//Select에 Options 추가
function addSelectOption(oSelect, text, value){
    var oOption = document.createElement("OPTION");
    oOption.text= text;
    oOption.value= value;
    oSelect.options.add(oOption)
}

//Select 의 모든 Option 제거
function delSelectAllOptions(oSelect){
    //현재 Options를 삭제
    for(var i=oSelect.options.length-1;i>=0;i--){
        oSelect.removeChild(oSelect.options[i]);
    }
}

//Select 의 선택 Option 제거
function delSelectOptions(oSelect, value){
    //현재 Options를 삭제
    for(var i=oSelect.options.length-1;i>=0;i--){
        if ( oSelect.options[i].value == value ) {
            oSelect.removeChild(oSelect.options[i]);
        }
    }
}

//Select 선택하기.
function selectedSelectOption(oSelect, value){
    var oOptions = oSelect.options
    for(var i =0 ; i< oOptions.length ; i++){
        if(Trim(oOptions(i).value) == value) oSelect.selectedIndex = i;
    }
}
/*************************************************************************************************
SELECT BOX 관련 Function 끝
***************************************************************************************************/

/***************************************************************************************************
    윤달 포함 날짜 SELECT BOX
***************************************************************************************************/
function dateSelect(selectIndex,yearForm,monthForm,dayForm) {
    watch = new Date(yearForm.options[yearForm.selectedIndex].text, monthForm.options[monthForm.selectedIndex].value,1);
    hourDiffer = watch - 86400000;
    calendar = new Date(hourDiffer);

    var daysInMonth = calendar.getDate();
        for (var i = 0; i < dayForm.length; i++) {
            dayForm.options[0] = null;
        }
        for (var i = 0; i < daysInMonth; i++) {
            if(i < 9) dayForm.options[i] = new Option('0' + (i + 1));
            else dayForm.options[i] = new Option(i+1);
    }
    dayForm.options[0].selected = true;
}

function daySelect(selectIndex,dayForm) {
    dayForm.options[dayForm.selectedIndex].value = dayForm.options[dayForm.selectedIndex].text;
}

// 년, 월, 일 데이터를 셀렉트 컨트롤로 표현.
// (전달받은 날짜를 선택값으로 한다. 단, 전달받은 날짜가 없을경우 현재 날짜를 기준으로 한다.)
function Today(fromyear, yearValue, monValue, dayValue, yearObjName, monObjName, dayObjName, className){    
    var today = new Date();
    var this_year = "";
    var this_month = "";
    var this_day = "";

    if ( yearValue != "" && yearValue != null && yearValue.isNumeric ) {
        this_year = Number(yearValue);
    }
    else {
        this_year = today.getFullYear();
    }

    if ( monValue != "" && monValue != null && monValue.isNumeric ) {
        this_month = Number(monValue);
    }
    else {
        this_month = today.getMonth();
        this_month += 1;
    }
    if ( dayValue != "" && dayValue != null && dayValue.isNumeric ) {
        this_day = Number(dayValue);
    }
    else {
        this_day = today.getDate();
    }

    montharray=new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    maxdays = montharray[this_month-1];

    //아래는 윤달을 구하는 것
    if (this_month==2) {
        if ((this_year/4)!=parseInt(this_year/4)) maxdays=28;
        else maxdays=29;
    }

    document.writeln("<select name='"+yearObjName+"' class='"+className+"' size=1 onChange='dateSelect(this.form."+monObjName+".selectedIndex,this.form."+yearObjName+",this.form."+monObjName+",this.form."+dayObjName+");'>");
        for(i=fromyear;i<(this_year + 5);i++){//현재 년도에서 과거로 5년까지 미래로 5년까지를 표시함
            if(i==this_year) document.writeln("<OPTION VALUE="+i+ " selected='selected' >" +i); 
                else document.writeln("<OPTION VALUE="+i+ ">" +i); 
        }
    document.writeln("</select>년");

    document.writeln("<select name='"+monObjName+"' class='"+className+"' size=1 onChange='dateSelect(this.selectedIndex,this.form."+yearObjName+",this.form."+monObjName+",this.form."+dayObjName+");'>");
         for(i=1;i<=12;i++){
             if(i==this_month) document.writeln("<OPTION VALUE=" + LZeroPad(i) + " selected='selected' >" + LZeroPad(i));
             else document.writeln("<OPTION VALUE=" + LZeroPad(i) + ">" + LZeroPad(i));
        }
    document.writeln("</select>월");

    document.writeln("<select name='"+dayObjName+"' class='"+className+"' size=1 onChange='daySelect(this.selectedIndex,this.form."+dayObjName+");'>");
         for(i=1;i<=maxdays;i++){
             if(i==this_day) document.writeln("<OPTION VALUE=" + LZeroPad(i) + " selected='selected' } >" + LZeroPad(i));
             else document.writeln("<OPTION VALUE=" + LZeroPad(i) + ">" + LZeroPad(i));
        }
    document.writeln("</select>일");
}

// 시, 분 데이터를 셀렉트 컨트롤로 표현.
// (전달받은 시간을 선택값으로 한다. 단, 전달받은 시간이 없을경우 현재 시간을 기준으로 한다.)
function NowTime(hourValue, miniteValue, hourObjName, miniteObjName){
    var today = new Date();

    if ( hourValue != "" && hourValue != null && hourValue.isNumeric ) {
        hourValue = parseInt(hourValue);
    }
    else {
        hourValue = today.getHours();
    }
    if ( miniteValue != "" && miniteValue != null && miniteValue.isNumeric ) {
        miniteValue = parseInt(miniteValue);
    }
    else {
        miniteValue = today.getMinutes();
    }

    document.writeln("<select name='"+hourObjName+"' class='"+className+"' size=1);'>");
         for(i=0; i<=23; i++){
             if(i == hourValue) document.writeln("<option value='" + LZeroPad(i) + "' selected='selected' >" + LZeroPad(i));
             else document.writeln("<option value='" + LZeroPad(i) + "'>" + LZeroPad(i));
        }
    document.writeln("</select>시");

    document.writeln("<select name='"+miniteObjName+"' class='"+className+"' size=1);'>");
         for(i=0; i<=59; i++){
             if(i == miniteValue) document.writeln("<option value='" + LZeroPad(i) + "' selected='selected' } >" + LZeroPad(i));
             else document.writeln("<option value='" + LZeroPad(i) + "'>" + LZeroPad(i));
        }
    document.writeln("</select>분");
}
//******************************************************************************************************

/***************************************************************************************************
    윤달 포함 날짜 SELECT BOX (영문)
***************************************************************************************************/
// 년, 월, 일 데이터를 셀렉트 컨트롤로 표현.
// (전달받은 날짜를 선택값으로 한다. 단, 전달받은 날짜가 없을경우 현재 날짜를 기준으로 한다.)
function TodayEng(fromyear, yearValue, monValue, dayValue, yearObjName, monObjName, dayObjName, className){    
    var today = new Date();
    var this_year = "";
    var this_month = "";
    var this_day = "";

    if ( yearValue != "" && yearValue != null && yearValue.isNumeric ) {
        this_year = Number(yearValue);
    }
    else {
        this_year = today.getFullYear();
    }

    if ( monValue != "" && monValue != null && monValue.isNumeric ) {
        this_month = Number(monValue);
    }
    else {
        this_month = today.getMonth();
        this_month += 1;
    }
    if ( dayValue != "" && dayValue != null && dayValue.isNumeric ) {
        this_day = Number(dayValue);
    }
    else {
        this_day = today.getDate();
    }

    montharray=new Array(31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
    maxdays = montharray[this_month-1];

    //아래는 윤달을 구하는 것
    if (this_month==2) {
        if ((this_year/4)!=parseInt(this_year/4)) maxdays=28;
        else maxdays=29;
    }

    document.writeln("<select name='"+yearObjName+"' class='"+className+"' size=1 onChange='dateSelect(this.form."+monObjName+".selectedIndex,this.form."+yearObjName+",this.form."+monObjName+",this.form."+dayObjName+");'>");
        for(i=fromyear;i<(this_year + 5);i++){//현재 년도에서 과거로 5년까지 미래로 5년까지를 표시함
            if(i==this_year) document.writeln("<OPTION VALUE="+i+ " selected='selected' >" +i); 
                else document.writeln("<OPTION VALUE="+i+ ">" +i); 
        }
    document.writeln("</select>year");

    document.writeln("<select name='"+monObjName+"' class='"+className+"' size=1 onChange='dateSelect(this.selectedIndex,this.form."+yearObjName+",this.form."+monObjName+",this.form."+dayObjName+");'>");
         for(i=1;i<=12;i++){
             if(i==this_month) document.writeln("<OPTION VALUE=" + LZeroPad(i) + " selected='selected' >" + LZeroPad(i));
             else document.writeln("<OPTION VALUE=" + LZeroPad(i) + ">" + LZeroPad(i));
        }
    document.writeln("</select>month");

    document.writeln("<select name='"+dayObjName+"' class='"+className+"' size=1 onChange='daySelect(this.selectedIndex,this.form."+dayObjName+");'>");
         for(i=1;i<=maxdays;i++){
             if(i==this_day) document.writeln("<OPTION VALUE=" + LZeroPad(i) + " selected='selected' } >" + LZeroPad(i));
             else document.writeln("<OPTION VALUE=" + LZeroPad(i) + ">" + LZeroPad(i));
        }
    document.writeln("</select>day");
}

// 시, 분 데이터를 셀렉트 컨트롤로 표현.
// (전달받은 시간을 선택값으로 한다. 단, 전달받은 시간이 없을경우 현재 시간을 기준으로 한다.)
function NowTime(hourValue, miniteValue, hourObjName, miniteObjName){
    var today = new Date();

    if ( hourValue != "" && hourValue != null && hourValue.isNumeric ) {
        hourValue = parseInt(hourValue);
    }
    else {
        hourValue = today.getHours();
    }
    if ( miniteValue != "" && miniteValue != null && miniteValue.isNumeric ) {
        miniteValue = parseInt(miniteValue);
    }
    else {
        miniteValue = today.getMinutes();
    }

    document.writeln("<select name='"+hourObjName+"' class='"+className+"' size=1);'>");
         for(i=0; i<=23; i++){
             if(i == hourValue) document.writeln("<option value='" + LZeroPad(i) + "' selected='selected' >" + LZeroPad(i));
             else document.writeln("<option value='" + LZeroPad(i) + "'>" + LZeroPad(i));
        }
    document.writeln("</select>hour");

    document.writeln("<select name='"+miniteObjName+"' class='"+className+"' size=1);'>");
         for(i=0; i<=59; i++){
             if(i == miniteValue) document.writeln("<option value='" + LZeroPad(i) + "' selected='selected' } >" + LZeroPad(i));
             else document.writeln("<option value='" + LZeroPad(i) + "'>" + LZeroPad(i));
        }
    document.writeln("</select>min");
}
//******************************************************************************************************

/***************************************************************************************************
    이미지 파일인지 체크
    param
        fileFullPath : INPUT TYPE=FILE의 VALUE값
    return
        true : 이미지 파일
        false : 이미지 파일 아님
***************************************************************************************************/
function chkImgFile(fileFullPath) {
    var ext = fileFullPath.slice(fileFullPath.lastIndexOf(".")+1).toLowerCase();

    if ( ext == "gif" || ext == "jpg" || ext == "png" || ext=="swf" ) {
        return true;
    }
    else 
    {
        return false;
    }
}
//******************************************************************************************************

/***************************************************************************************************
    문서 파일인지 체크
    param
        fileFullPath : INPUT TYPE=FILE의 VALUE값
    return
        true : 문서 파일
        false : 문서 파일 아님        
***************************************************************************************************/
function chkDocFile(fileFullPath) {
    var ext = fileFullPath.slice(fileFullPath.lastIndexOf(".")+1).toLowerCase();

    if ( ext == "doc" || ext == "txt" || ext == "hwp" || ext == "gul" || ext == "ppt" || ext == "xls" ) {
        return true;
    }
    else 
    {
        return false;
    }
}

/***************************************************************************************************
    HWP 파일인지 체크
    param
        fileFullPath : INPUT TYPE=FILE의 VALUE값
    return
        true : 문서 파일
        false : 문서 파일 아님        
***************************************************************************************************/
function chkOnlyHwpFile(fileFullPath) {
    var ext = fileFullPath.slice(fileFullPath.lastIndexOf(".")+1).toLowerCase();

    if ( ext == "hwp" ) {
        return true;
    }
    else 
    {
        return false;
    }
}

/***************************************************************************************************
    DOC 파일인지 체크
    param
        fileFullPath : INPUT TYPE=FILE의 VALUE값
    return
        true : 문서 파일
        false : 문서 파일 아님        
***************************************************************************************************/
function chkOnlyDocFile(fileFullPath) {
    var ext = fileFullPath.slice(fileFullPath.lastIndexOf(".")+1).toLowerCase();

    if ( ext == "doc" ) {
        return true;
    }
    else 
    {
        return false;
    }
}

/***************************************************************************************************
    WMV 파일인지 체크
    param
        fileFullPath : INPUT TYPE=FILE의 VALUE값
    return
        true : 문서 파일
        false : 문서 파일 아님        
***************************************************************************************************/
function chkOnlyWmvFile(fileFullPath) {
    var ext = fileFullPath.slice(fileFullPath.lastIndexOf(".")+1).toLowerCase();

    if ( ext == "wmv" ) {
        return true;
    }
    else 
    {
        return false;
    }
}

//******************************************************************************************************

/***************************************************************************************************
    플래시 파일인지 체크
    param
        fileFullPath : INPUT TYPE=FILE의 VALUE값
    return
        true : 문서 파일
        false : 문서 파일 아님        
***************************************************************************************************/
function chkFlashFile(fileFullPath) {
    var ext = fileFullPath.slice(fileFullPath.lastIndexOf(".")+1).toLowerCase();

    if ( ext == "swf" || ext == "flv" ) {
        return true;
    }
    else 
    {
        return false;
    }
}
//******************************************************************************************************

/***************************************************************************************************
    압축 파일인지 체크
    param
        fileFullPath : INPUT TYPE=FILE의 VALUE값
    return
        true : 압축 파일
        false : 압축 파일 아님        
***************************************************************************************************/
function chkZipFile(fileFullPath) {
    var ext = fileFullPath.slice(fileFullPath.lastIndexOf(".")+1).toLowerCase();

    if ( ext == "zip" || ext == "alz" || ext == "rar" ) {
        return true;
    }
    else 
    {
        return false;
    }
}

/***************************************************************************************************
    문서(압축포함) 파일인지 체크
    param
        fileFullPath : INPUT TYPE=FILE의 VALUE값
    return
        true : 문서 파일
        false : 문서 파일 아님        
***************************************************************************************************/
function chkDocZipFile(fileFullPath) {
    var ext = fileFullPath.slice(fileFullPath.lastIndexOf(".")+1).toLowerCase();

    if ( ext == "doc" || ext == "txt" || ext == "hwp" || ext == "gul" || ext == "ppt" || ext == "xls" || ext == "zip" || ext == "alz" || ext == "rar" ) {
        return true;
    }
    else 
    {
        return false;
    }
}

/***************************************************************************************************
    이미지 팝업 오픈
    param
        imgPath : 이미지 파일의 풀경로
    return
***************************************************************************************************/
function popImg(imgPath){ 
    var objImg = new Image();

    objImg.src = imgPath;
 
    if ( objImg.width > 0 && objImg.width > 0 ) {
	    imgWin = popWindow("", "imgPop", objImg.width, objImg.height, "no");

	    if ( imgWin ) {
	        imgWin.document.write("<html><head><title>Image Popup</title></head>\n");
	        imgWin.document.write("<body style='margin-left:0px;margin-top:0px;margin-right:0px;margin-bottom:0px;'>\n");
	        imgWin.document.write("<table border='0'cellspacing='0' cellpadding='0' style='width:" + objImg.width + ";height:" + objImg.height + ";'>\n<tr>\n<td>\n");
	        imgWin.document.write("<img src='" + objImg.src + "' onclick='window.close()' style='cursor:hand;' border='0' width='" + objImg.width + "' height='" + objImg.height + "' />\n");
	        imgWin.document.write("</td>\n</tr>\n</table>\n");
	        imgWin.document.write("</body>\n");
	        imgWin.document.write("</html>");
	        imgWin.document.close();

		    imgWin.focus();
        }
    }
    else {
        alert("잘못된 이미지 경로입니다.");
    }
}
//******************************************************************************************************

/*******************************************************************************
 * 	회원 정보 팝업 오픈
 *	@param	int memPKId
 *	@return window
 ********************************************************************************/
function gotoMemInfoPop(memPKId) {
    if ( memPKId != "" ) {
        win = popWindow("/common/ComMemInfo.aspx?memPKId=" + memPKId, "MemInfo", 460, 285, "no");
    }

	if (win) {
		win.focus();
	}
}
//******************************************************************************************************

/*******************************************************************************************************
 *	금액형식을 체크하여 컴마를 더해준다.<b>
 *	@param el text 필드
 * 	@useage onKeyUp="checkMoneyUpdate(this);"
 *******************************************************************************************************/
function checkMoneyUpdate(el) {
	//37 <- , 39 ->, del 46
//	if (event.keyCode == 38 || event.keyCode == 40) return;
	var num = el.value.trim();
	if (num.length < 1) return;
	num = moneyFormat(num);
	if (num.length < 1) {
		alert("금액형식이 아닙니다!");
		el.value = "";
		el.focus();
		return;
	}else el.value = num;
}

/*******************************************************************************************************
 *	문자열을 체크하여, 컴마를 삽입해 줍니다.
 *	@param str 숫자형 문자
 *	@useage	str = moneyFormat(str);
 *	@주의 : 숫자형 문자가 아닐때는 ""를 리턴합니다.
 *******************************************************************************************************/
function moneyFormat(str) {
	str += "";
	str = str.trim();
	var buho = "";
	if (str.charAt(0) == "-") {
		buho = "-";
		str = str.substring(1,str.length);
	}
	if (str.length < 1) {
		return buho ? buho : "";
	}
    str = str.split(",").join("");
    var pattern = /^(0|-?[1-9][0-9]*)+(.[0-9]{1,2})?$/;
	if (!pattern.test(str)) return "";
    var arr = str.split('.');
    var num = new Array();
    for (i = 0; i <= arr[0].length-1; i++) {
        num[i] = arr[0].substr(arr[0].length-1-i,1);
        if(i%3 == 0 && i != 0) num[i] += ',';
    }
    num = buho + num.reverse().join('');
	return !arr[1] ? num : num+'.'+arr[1];
}

/*******************************************************************************************************
 * 	문자열에서 컴마를 제거한다.
 *	@param	String val
 *	@return String
 *******************************************************************************************************/
function removeComma(str) {
	return str.split(",").join("");
}

/*******************************************************************************************************
 * 	iframe 리사이징 (iframe 영역 scroll Height 만큼 리사이즈)
 *	@param	arg
 *	@return 
 *******************************************************************************************************/
function iframe_resize(arg) 
{
  try
  {
    arg.height=eval(arg.name+".document.body.scrollHeight"); 
  }
  catch(err)
  {
    arg.height=arg.document.body.scrollHeight;
  }

}

/*******************************************************************************************************
 * 	등록/수정에서 취소버튼 클릭시 Confirm 메시지 출력 후 처리
 *	@param
 *      procType    : 처리 방법(1 : history.back, 2 : window.close)
 *	@return 
 *******************************************************************************************************/
function cancelProc(procType) 
{
    if ( confirm("글쓰기를 취소하시겠습니까?") )
    {
        if ( procType == 1 ) {
            history.back(-1);
        }
        else if ( procType == 2 ) {
            window.close();
        }
    }
} 

/*******************************************************************************************************
 * 	관리자 페이지 인쇄하기
 *	@param
 *      strPrintDivId    : 출력할 범위를 감싸고 있는 div object의 ID 값(<div id='a'></div>일 경우 a)
 *	@return
 *******************************************************************************************************/
function printPopOpen(strPrintDivId)
{
    var objDiv = document.getElementById(strPrintDivId);

    if ( objDiv && objDiv.tagName == "DIV" ) {
        printWin = popWindow("", "printPop", 760, 400, "yes");

	    if ( printWin ) {
	        printWin.document.write("<html><head><title>Print Popup</title>");
            printWin.document.write("<link rel='stylesheet' type='text/css' href='/lib/css/base.css' />");
	        printWin.document.write("</head>\n");
	        printWin.document.write("<body>\n");
	        printWin.document.write(objDiv.innerHTML);
	        printWin.document.write("</body>\n");
	        printWin.document.write("</html>");
	        printWin.document.close();

            printWin.window.print();
		    printWin.window.close();
        }
    }
}

/*******************************************************************************************************
 * 	파일 다운로드
 *	@param
 *      filename : 파일명, filepath : 파일 물리 경로
 *	@return 
 *******************************************************************************************************/
function fileDownload(filename, filepath) 
{
    document.location.href = "/common/FileDownload.aspx?filename=" + filename + "&filepath=" + filepath;
}

/*******************************************************************************************************
 * 	오늘 날짜 문자열 획득
 *	@param
 *	@return 
 *      string
 *******************************************************************************************************/
function getCurrentYMD() {
	var currDate = new Date();

	var year = currDate.getFullYear();
	var month = currDate.getMonth() + 1;
	var day = currDate.getDate();

	return year + LZeroPad(month) + LZeroPad(day);
}

function getCurrentYMDHM() {
	var currDate = new Date();

	var year = currDate.getFullYear();
	var month = currDate.getMonth() + 1;
	var day = currDate.getDate();

	return year + LZeroPad(month) + LZeroPad(day) + "00" + "00";
}

/*******************************************************************************************************
 * 	10보다 작은 숫자 앞에 0을 붙여 리턴
 *	@param
 *      number : 검사 대상 숫자 값
 *	@return 
 *      string
 *******************************************************************************************************/
function LZeroPad(number) {
	if (number < 10) return "0" + number
	else return "" + number;
}

/*******************************************************************************************************
 * 	다운로드 모니터 오픈
 *	@param
 *	@return 
 *******************************************************************************************************/
function downloadMonitorOpen() 
{
    win = popWindow('/common/FileDownloadMonitor.aspx' ,'DownMonitor','445','300','no');

    if ( !win ) {
        alert('팝업 차단을 해제해 주세요.');
        window.history.back();
    }
}

/*******************************************************************************
 * 	신고 팝업 오픈
 *	@param	int memPKId
 *	@return window
 ********************************************************************************/
function gotoSMTMPop(strContentsType, intContentsId) {
    if ( strContentsType != "" && intContentsId != "" ) {
        win = popWindow("/common/ComSTMTPop.aspx?strContentsType=" + strContentsType + "&intContentsId=" + intContentsId, "SMTMPop", 360, 351, "no");
    }

    if ( !win ) {
        alert('팝업 차단을 해제해 주세요.');
        win.history.back();
    }
    else {
		win.focus();
	}
}

/*******************************************************************************************************
 * 	미디어 플레이어로 재생
 *	@param
 *      strFullPath : 파일명을 포함한 풀 경로
 *		w : 가로
 *		h : 세로
 *	@return 
 *      string
 *******************************************************************************************************/
 function wMediaPlayer(strFullPath, w, h){
	var objFla = "";
		
	objFla = "<object name='MediaPlayer1' id='MediaPlayer1' width='"+w+"' height='"+h+"' classid='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,7,1112' standby='loading windows media player components...' type='application/x-oleobject'>" +
			"<param name='filename' value='"+strFullPath+"'>" +
			"<param name='autostart' value='true'>" +
			"<param name='sendmouseclickevents' value='false'>" +
			"<param name='allowchangedisplaysize' value='1'>" +
			"<param name='enablefullscreencontrols' value='false'>" +
			"<param name='EnableContextMenu' VALUE='false'>" +
			"<param name='displaysize' value=''>" +
			"<param name='sendmousemoveevents' value='false'>" +
			"<param name='sendmouseclickevents' value='false'>" +
			"<param name='sendkeyboardevents' value='false'>" +
			"<param name='transparentonstop' value='true'>" +
			"<param name='clicktoplay' value='false'>" +
			"<param name='showcontrols' value='1'>" +
			"<param name='showpositioncontrols' value='1'>" +
			"<param name='showstatusbar' value='1'>" +
			"<param name='autosize' value='0'>" +
			"<param name='autoresize' value='0'>" +
			"<param name='animationatstart' value='1'>" +
			"<param name='transparentatstart' value='true'>" +
			"</object>";

	document.write(objFla);	
 }

/*******************************************************************************************************
 * 	미디어 플레이어로 재생(상태바 없음)
 *	@param
 *      strFullPath : 파일명을 포함한 풀 경로
 *		w : 가로
 *		h : 세로
 *	@return 
 *      string
 *******************************************************************************************************/
 function wMediaPlayerNonStatusBar(objName, strFullPath, w, h){
	var objFla = "";

	objFla = "<object id='" + objName + "' classid='CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' standby='Loading Microsoft?Windows?Media Player components...' width='"+w+"' height='"+h+"'>" +
		    "<param name='AutoStart' value='true' />" +
		    "<param name='uiMode' value='none' />" +
		    "<param name='fullScreen' value='false' />" +
		    "<param name='windowlessVideo' value='true' />" +
		    "<param name='stretchToFit' value='true' />" +
		    "<param name='URL' value='"+strFullPath+"' />" +
		    "<embed type='video/x-ms-wmv' pluginspage='http://www.microsoft.com/windows/windowsmedia/download/' width='"+w+"' height='"+h+"' />" +
		    "</object>";

/*
	objFla = "<object name='" + objName + "' id='" + objName + "' width='"+w+"' height='"+h+"' classid='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,7,1112' standby='loading windows media player components...' type='application/x-oleobject'>" +
			"<param name='filename' value='"+strFullPath+"'>" +
			"<param name='autostart' value='1'>" +
			"<param name='sendmouseclickevents' value='false'>" +
			"<param name='allowchangedisplaysize' value='true'>" +
			"<param name='enablefullscreencontrols' value='false'>" +
			"<param name='EnableContextMenu' VALUE='false'>" +
			"<param name='displaysize' value=''>" +
			"<param name='sendmousemoveevents' value='false'>" +
			"<param name='sendmouseclickevents' value='false'>" +
			"<param name='sendkeyboardevents' value='false'>" +
			"<param name='transparentonstop' value='true'>" +
			"<param name='clicktoplay' value='false'>" +
			"<param name='showcontrols' value='false'>" +
			"<param name='showpositioncontrols' value='false'>" +
			"<param name='showstatusbar' value='false'>" +
			"<param name='autosize' value='false'>" +
			"<param name='autoresize' value='false'>" +
			"<param name='animationatstart' value='true'>" +
			"<param name='transparentatstart' value='true'>" +
			"</object>";
*/

	document.write(objFla);	
 }

/*******************************************************************************************************
 * 	미디어 플레이어로 재생(Hidden용 ID를 넘겨받아 처리)
 *	@param
 *      strFullPath : 파일명을 포함한 풀 경로
 *		w : 가로
 *		h : 세로
 *	@return 
 *      string
 *******************************************************************************************************/
 function wMediaPlayerHidden(playerId, strFullPath){
	var objFla = "";

	objFla = "<object name='" + playerId + "' id='" + playerId + "' width='0' height='0' classid='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,7,1112' standby='loading windows media player components...' type='application/x-oleobject'>" +
			"<param name='filename' value='"+strFullPath+"'>" +
			"<param name='autostart' value='1'>" +
			"<param name='sendmouseclickevents' value='false'>" +
			"<param name='allowchangedisplaysize' value='true'>" +
			"<param name='enablefullscreencontrols' value='false'>" +
			"<param name='EnableContextMenu' VALUE='false'>" +
			"<param name='displaysize' value=''>" +
			"<param name='sendmousemoveevents' value='false'>" +
			"<param name='sendmouseclickevents' value='false'>" +
			"<param name='sendkeyboardevents' value='false'>" +
			"<param name='transparentonstop' value='true'>" +
			"<param name='clicktoplay' value='false'>" +
			"<param name='showcontrols' value='false'>" +
			"<param name='showpositioncontrols' value='false'>" +
			"<param name='showstatusbar' value='false'>" +
			"<param name='autosize' value='false'>" +
			"<param name='autoresize' value='false'>" +
			"<param name='animationatstart' value='true'>" +
			"<param name='transparentatstart' value='true'>" +
			"</object>";

	document.write(objFla);	
 }
 
 /*******************************************************************************************************
 * 	미디어 플레이어 재생바 
 *	@param
 *      strFullPath : 파일명을 포함한 풀 경로
 *		w : 가로
 *		h : 세로
 *	@return 
 *      string
 *******************************************************************************************************/
 function wMediaPlayerBar(strFullPath, w, h){
	var objFla = "";
	
	objFla = "<object name='MediaPlayer1' id='MediaPlayer1' width='"+w+"' height='"+h+"' classid='clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95' codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=6,4,7,1112' standby='loading windows media player components...' type='application/x-oleobject'>" +
			"<param name='filename' value='"+strFullPath+"'>" +
			"<param name='autostart' value='false'>" + 
			"<param name='sendmouseclickevents' value='false'>" +
			"<param name='allowchangedisplaysize' value='1'>" +
			"<param name='enablefullscreencontrols' value='false'>" +
			"<param name='EnableContextMenu' VALUE='false'>" +
			"<param name='displaysize' value='0'>" +
			"<param name='sendmousemoveevents' value='false'>" +
			"<param name='sendmouseclickevents' value='false'>" +
			"<param name='sendkeyboardevents' value='false'>" +
			"<param name='transparentonstop' value='true'>" +
			"<param name='clicktoplay' value='false'>" +
			"<param name='showcontrols' value='1'>" +
			"<param name='showpositioncontrols' value='0'>" +
			"<param name='showstatusbar' value='0'>" +
			"<param name='autosize' value='0'>" +
			"<param name='autoresize' value='0'>" +
			"<param name='animationatstart' value='0'>" +
			"<param name='transparentatstart' value='true'>" +
			"</object>";

	document.write(objFla);	
 }

/*******************************************************************************
 * 	미디어 플레이 재생 (hidden)
 *	@param	string strPath 재생파일 Full URL
 *	@return 
 ********************************************************************************/
function fnMediaPlay(strPath){
	    document.all.MediaPlayer1.filename = strPath;
	    document.all.MediaPlayer1.play();
}

/*******************************************************************************
 * 	전체 공통 링크 관련
 ********************************************************************************/
/* 서비스별 도움말 */
function goFAQMain() {
    document.location.href = "http://www.edubox.com/CustomerCenter/ServiceQnA/ServiceQnAMain.aspx";
}

/* 문의하기 */
function goInquireMain() {
    document.location.href = "http://www.edubox.com/CustomerCenter/Inquire/InquireWriteMain.aspx";
}
/*******************************************************************************
 * 	전체 공통 링크 관련
 ********************************************************************************/

/*******************************************************************************
 * 	텍스트의 현재 상태값을 확인하여 bold 처리 한다.(www 용)
 ********************************************************************************/
function changeTextBold(strObjId, intNowNum, intTotalNum) {
	if ( document.getElementById(strObjId+intNowNum).className == 'title on' ) {
		document.getElementById(strObjId+intNowNum).className = 'title';
		return;
	}

	for (i=1; i<=intTotalNum; i++)	{
		if (i==intNowNum)	{
			document.getElementById(strObjId+i).className = 'title on';
		}
		else {
			document.getElementById(strObjId+i).className = 'title';
		}
	}
}

/*******************************************************************************
 * 	전체 카테고리 왼쪽 메뉴 플래시 출력
 ********************************************************************************/
function printMallFlashTag(strFilePath, strParam) {
    document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='550' height='500' id='mallMainFlash' align='middle'>");
    document.write("<param name='allowScriptAccess' value='sameDomain' />");
    document.write("<param name='allowFullScreen' value='false' />");
    document.write("<param name='movie' value='" + strFilePath + strParam +"' />");
    document.write("<param name='quality' value='high' />");
	document.write('<param name="wmode" value="transparent">');
    document.write("<embed src='" + strFilePath + strParam +"' quality='high' wmode='transparent' width='550' height='500' name='mall' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
    document.write("</object>");
}

/*******************************************************************************
 * 	전체 카테고리 왼쪽 메뉴 플래시 출력
 ********************************************************************************/
function printMallSubTopFlashTag(strFilePath, strParam) {
    document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='550' height='25' id='mallTopFlash' align='middle'>");
    document.write("<param name='allowScriptAccess' value='sameDomain' />");
    document.write("<param name='allowFullScreen' value='false' />");
    document.write("<param name='movie' value='" + strFilePath + strParam +"' />");
    document.write("<param name='quality' value='high' />");
	document.write('<param name="wmode" value="transparent">');
    document.write("<embed src='" + strFilePath + strParam +"' quality='high' wmode='transparent' width='550' height='25' name='mall' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
    document.write("</object>");
}

/*******************************************************************************
 * 	전체 카테고리 왼쪽 메뉴 플래시 출력
 ********************************************************************************/
function printMallSubMenuFlashTag(strFilePath, strParam) {
    document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='550' height='200' id='mallSubMenuFlash' align='middle'>");
    document.write("<param name='allowScriptAccess' value='sameDomain' />");
    document.write("<param name='allowFullScreen' value='false' />");
    document.write("<param name='movie' value='" + strFilePath + strParam +"' />");
    document.write("<param name='quality' value='high' />");
	document.write('<param name="wmode" value="transparent">');
    document.write("<embed src='" + strFilePath + strParam +"' quality='high' wmode='transparent' width='550' height='200' name='mall' align='middle' allowScriptAccess='sameDomain' allowFullScreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
    document.write("</object>");
}

/*******************************************************************************
* 	상단 GNB 링크 처리 함수
********************************************************************************/
function fURLMove(mode, url) {
    if ( url != "" )
	    document.location.href = url;
}

/*******************************************************************************
* 	에듀로그 광고 플래시 삽입
********************************************************************************/
function openEdulog() {
    document.write("<div class='toplayer-openedulog' id='opendEdulog' style='display:none;'>");
    document.write("<div class='position'>");
    getFlash('/images/common_flash/etc/eduboxmovie_scene1.swf','975','455','edulogTopFlash','');
    document.write("</div></div>");
}

/*******************************************************************************
* 	에듀로그 광고 플래시 전환
********************************************************************************/
function FBclose02() {
    var obj = document.getElementById("opendEdulog");
    if(obj.style.display != "none") {
        obj.style.display = "none";
    } else {
        obj.style.display = "";
    }
}

/*******************************************************************************
 * 	쪽지쓰기 팝업
 ********************************************************************************/
 function popNoteWrite(intFriendPKID) {
    var url = "/Popup/NoteWritePop.aspx";
    
    if(intFriendPKID != null) {
        url += "?intFriendPKID=" + intFriendPKID;
    }
    
    popWindow(url,"noteWrite", 360, 220, "no");
 }
 
 
 /*******************************************************************************
 * 	친구추가 팝업
 ********************************************************************************/
 function popFriendAdd(intFriendPKID) {
    AjaxProc("/common/AdressBookFriendAddProc.aspx", "intFriendPKID="+intFriendPKID, AjaxSucForAlertAndFunction);
 }
 
/*******************************************************************************
* 	닉네임 레이어 에듀로그 가기
********************************************************************************/
function goEdulogLink(intMemPKId) {
    var url = "http://edulog.edubox.com/goEdulog.aspx?intMemPKId=" + intMemPKId;

    FullScreenWinOpen(url, "Edulog");
}

/*******************************************************************************
* 	닉네임 레이어 이웃추가 팝업
********************************************************************************/
function popFriendAdd(intFriendPKId, intMemPKId) {
    var url = "http://edulog.edubox.com/popup/FriendAddPop.aspx?intFriendPKID=" + intFriendPKId + "&memFSno=" + intMemPKId;
    popWindow(url,"noteWrite", 360, 350, "no");
}

