<!--
// 로컬 펑션

// 플래쉬 연결 펑션
function MainMenu(menu){
  if (menu=="home"){
    location.href="/main.asp";
  }else if(menu=="bio"){
//	alert("준비중입니다.");    
    location.href = "/b_sub/biography.asp"
  }else if(menu=="disco"){
    location.href = "/disco.asp"
//	alert("준비중입니다.");    
  }else if(menu=="mono"){
    location.href = "/monologue/schedule.asp"
  }else if(menu=="gallery"){
	location.href = "/bbs/gallery/gallery_list.asp"	
//	alert("준비중입니다.");    
  }else if(menu=="schedule"){
    location.href = "/bbs/schedule.asp"
	//alert("준비중입니다.");    
  }else if(menu=="board"){
    location.href = "/bbs/free11/talk_list.asp"
  }else if(menu=="contact"){
    location.href = "mailto:yangpa@fantoment.com"
  }
}

/* 공통펑션 정리 - 사이트의 기본적인 펑션  2005-12-13 김인태
--------------------------------------------------------------------------------------------------------
0.  드림위버 기본 함수
1.  allblur     링크시 생기는 점선라인 없애기
2.  preload     이미지 변경시 사용
3.  imgChg      이미지 변경. 2번과 동일
4.  pub_chkKeyPress     숫자만 입력가능
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.SwapCategory 카테고리 보이기 숨기기
--------------------------------------------------------------------------------------------------------
*/



// ########## 이미지 체인지 ##########
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


/***********************************************************************************/
/**  링크시 생기는 점선라인 없애기 **/
function allblur() {
    for (i = 0; i < document.links.length; i++)
        document.links[i].onfocus = document.links[i].blur;
}




/***********************************************************************************/
/**  왼쪽메뉴 오버 **/
function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

function imgChg(imgObj, imgName) {
	if (document.images) {
		document.images[imgName].src = eval(imgObj+".src")
	}
}




/***********************************************************************************/
// 숫자만 입력가능
// delete control key 와 상하좌우 허용함.
// Delete = 46, BackSpace=8 , Tab=9 , left-right=37-40 Enter = 13
// 사용법 : onKeyDown="pub_chkKeyPress(1)"
function pub_chkKeyPress(chkType){
	if( ((event.keyCode>=37)&&(event.keyCode<=40))||((event.keyCode>=8)&&(event.keyCode<=9))||(event.keyCode==46) ) {
		return true;
	}
	if(chkType==1){
		if( ( (event.keyCode>=48)&&(event.keyCode<=57) ) || ( (event.keyCode>=96)&&(event.keyCode<=105) ) ) {
			return true;
		}
		else{
			event.returnValue=false;
			return false;
		}
	}
}


/***********************************************************************************/
// 숫자체크
function ChkNum(x){ 
    var x; 
    var anum=/(^\d+$)|(^\d+\.\d+$)/ 
    if (anum.test(x)) 
        return true; 
    else{ 
        return false; 
    } 
} 


/***********************************************************************************/
//주민번호체크
function pub_chkJumin(PerNo1,PerNo2){ 
	var check = true; 
	var chk = 0; 
	var i;

	for (i=0; i<6; i++) {
		chk += ( (i+2) * parseInt( PerNo1.charAt(i) ));
	}
	
	for (i=6; i<12; i++) {
		chk += ( (i%8+2) * parseInt( PerNo2.charAt(i-6) ));
	}
	
	chk = 11 - (chk%11);
	chk %= 10;

	if (chk != parseInt( PerNo2.charAt(6))) {
		check=false; 
	}

  return check; 
} 


/***********************************************************************************/
//함수: 사업자번호 형식 체크(10자리) 
function pub_chkSaupNum(no1,no2,no3){
	var chkRule = "137137135";			
						
	// 사업자번호 체크 형식
	var strCorpNum = no1+no2+no3	// 사업자번호 10자리
	if(strCorpNum.length!=10){
		return false;
	}
	var step1, step2, step3, step4, step5, step6, step7;
	
	step1 = 0;		// 초기화			
	
	for (i=0; i<7; i++)
	{
		step1 = step1 + (strCorpNum.substring(i, i+1) * chkRule.substring(i, i+1));
	}

	step2 = step1 % 10;
	step3 = (strCorpNum.substring(7, 8) * chkRule.substring(7, 8)) % 10;
	step4 = strCorpNum.substring(8, 9) * chkRule.substring(8, 9);
	step5 = Math.round(step4 / 10 - 0.5);
	step6 = step4 - (step5 * 10);
	step7 = (10 - ((step2 + step3 + step5 + step6) % 10)) % 10;

	if (strCorpNum.substring(9, 10) != step7)	// 결과 비교 판단	
	{
		return false;
	}
	return true;
} 


/***********************************************************************************/
// 널이거나 공백이면 true 반환
function pub_isNull(str){
	if(str==null || str=="") return true;
	return false;
}


/***********************************************************************************/
// 셀렉트박스 값체크
function pub_isSelectNull(Obj){
	var idx	=Obj.selectedIndex;
	var code=Obj.options[idx].value;
	if(code==null || code=="" || code=="selected") return true;
	return false;
}


/***********************************************************************************/
//
function pub_isRdiEqualVal(Obj,val){
	var iSize=0;
	var bMuti=false;
	if(Obj.length==null){
		iSize=1;
		bMuti=false;
	}else{
		iSize=Obj.length;
		bMuti=true;
	}
	if(bMuti){
		for(var i=0;i<iSize;i++){
			if(Obj[i].checked){
				if(Obj[i].value==val) return true;
			}
		}
	}else{
		if(Obj.checked) return true;
	}
	return false;
}


/***********************************************************************************/
//
function pub_isChkEqualVal(Obj,val){
	var iSize=0;
	var bMuti=false;
	if(Obj.length==null){
		iSize=1;
		bMuti=false;
	}else{
		iSize=Obj.length;
		bMuti=true;
	}
	if(bMuti){
		for(var i=0;i<iSize;i++){
			if(Obj[i].checked){
				if(Obj[i].value==val) return true;
			}
		}
	}else{
		if(Obj.checked) return true;
	}
	return false;	
}


/***********************************************************************************/
//
function pub_isOneMoreChecked(Obj){
	var iSize=0;
	var bMuti=false;
	if(Obj.length==null){
		iSize=1;
		bMuti=false;
	}else{
		iSize=Obj.length;
		bMuti=true;
	}
	if(bMuti){
		for(var i=0;i<iSize;i++){
			if(Obj[i].checked){
				return true;
			}
		}
	}else{
		if(Obj.checked) return true;
	}
	return false;
}


/***********************************************************************************/
//
function pub_chkFormat(input,format) {
    if (input.value.search(format) == -1) {
        return true;
    }
	else if (input.value.charAt(input.value.indexOf('@')+1)=='.')
		return true;
    return false;
}


/***********************************************************************************/
//
function pub_chkEmail(input) {
    var format = /^((\w|[\-\.])+)@((\w|[\-\.])+)\.([A-Za-z]+)$/;
    return pub_chkFormat(input,format);
}


/***********************************************************************************/
//
function pub_isNum(obj){
	var num ="0123456789";
	for (var i=0; i<obj.value.length; i++){
		if(-1 == num.indexOf(obj.value.charAt(i))){
				obj.value = '';
				obj.focus();
				return false;
		}
	}
	return true;
}


/***********************************************************************************/
// 카테고리 보이기 숨기기
function SwapCategory(id) {
    
    obj     = document.all.cate;
    obj2    = document.all.CATEGORY_ID;
        
    total   = obj.length;

    // 모두 숨김
    for(i=0; i<total; i++) {
        obj[i].style.display      = "none";
    }

	/*
    for(i=0; i<obj2.length; i++) {
        obj2[i].style.fontWeight  = "normal";
    }
	*/

    // 선택 보이기
    obj[id].style.display      = "";    
    //obj2[id].style.fontWeight  = "bold";

}


// 컴머 표시
function NumberFormat(num) {
    result  = "";
    n       = 1;
    for(i=num.length-1; i>=0; i--) {
        if(n%3 == 0 && i != 0)  result = "," + num.charAt(i) + result;
        else                    result = num.charAt(i) + result;
        n++;
    }
    return result;
}

/***********************************************************************************/
 /**  이미지 없을때 오류안나게 **/
function img_Error(imageName)
{
	var isName = imageName;
	if(isNaN(isName) = false)
	{
		document.images.isName.src = 'http://img.nowmesa.org/trans.gif';
	}
}

/***********************************************************************************/
 /**  이미지 미리보기(팝업 이미지 보이기) **/
/***********************************************************************************/
function AutoResize(img)
{
	if (img == "")
	{
		alert("이미지를 먼저 선택해 주세요");
	}
	else
	{
		var file_bimg = 'file:///'+img ;

		re = /\\/g;                        //정규식 패턴을 만듭니다.
		img = file_bimg.replace(re, "/");    //"\"를 "/"로 바꿉니다.

		foto1= new Image();
		foto1.src=(img);
		Controlla(img);
	}
}



// 2006-02-02 김인태 - 토글 메뉴
function toggleMenu(currMenu) {
  if (document.all) {
    thisMenu = eval("document.all." + currMenu + ".style");
    if (thisMenu.display == "block") {
      thisMenu.display = "none";
    } else {
      thisMenu.display = "block";
    }
    return ;
  } else {
    return ;
  }
}


// 2006년 3월 3일 금요일 이올라스 IE설계변경에 따른 플래시 표현
// wmode:none, transparent, opaque
function FlashView(url, width, height, wmode) {
  	//"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+ width + "' height='"+ height +"' id='"+id+"' align='middle'>"+
//	"<param name='allowScriptAccess' value='always' />"+
	document.writeln ("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='" + width + "' height='" + height + "'>");
	document.writeln ("<param name='allowScriptAccess' value='always' />");
  document.writeln ("<param name='movie' value='" + url + "'>");
	document.writeln ("<param name=quality value=high>");
	document.writeln ("<param name='menu' value='false'>");
	document.writeln ("<param name='wmode' value='" + wmode + "'>");
	document.writeln ("<embed src='" + url + "' quality=high allowScriptAccess='always' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + width + "' height='" + height + "'></embed>");
	document.writeln ("</object>");
}


// 숫자만 가능하게
function OnlyNumber()
{
  if ((event.keyCode < 48) || (event.keyCode > 57))
    event.returnValue = false;
}



//////////////////////////////////////////////////////////////////////////
/***********************************************************************************/
// 베이직 펑션 시작


//Null Check Function
function fnNullChk(szInputType, szFormName, szInputName, szAlertMsg) {
  var objName = eval(szInputName);
  var blnRet = true;
  var nRadioChkCnt = 0;
  if (szInputType=='select-one' || szInputType=='radio' || szInputType=='checkbox' || szInputType=='file' ) {
    szAlertMsg += ' 항목을 선택해 주십시요.     ';
  }else{
    szAlertMsg += ' 항목을 입력해 주십시요.     ';
  }
  if (szInputType=='select-one'){
    if (objName.selectedIndex < 0)	{
      blnRet = false; 
    }else{
      if ( (objName.options[objName.selectedIndex].value)=='' ) { blnRet = false; } 
    }
  }else if (szInputType=='radio' || szInputType=='checkbox' ){
    for(var j=0; j < objName.length; j++) {
      if( objName[j].checked ) nRadioChkCnt++;
    }
    if( nRadioChkCnt==0 ){ blnRet = false; } 
  }else if ( szInputType=='text' || szInputType=='file' || szInputType=='hidden' || szInputType=='textarea' || szInputType=='password' ){  
    if( fnTrim(objName.value) == '' ){ blnRet = false; }
  }
  if (szInputType=='file' && blnRet == true ) {
    if ( (objName.value.search(':') == -1) ){
      blnRet = false;
      szAlertMsg = '파일 형식이 잘못되었습니다.     ';
    }
  } 
  if ( ! blnRet ){
    fnAlertFocus(szInputType, szFormName, szInputName, szAlertMsg) ;
    return false;
  }
}

//Email Check Function
function fnEmailChk( objEmail ) {
  var objEmail = eval(objEmail) ;
  var szEmail = objEmail.value ;
  var regDoNot = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/;
  var regMust = /^[a-zA-Z0-9\-\.\_]+@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3})$/;
  if ( !regDoNot.test(szEmail) && regMust.test(szEmail) ){
    return true;
  }else{
    alert('잘못된 E-mail입니다.     ');
    objEmail.focus() ;
    return false;
  }
}

//Jumin Number Check Function
function fnJuminChk( objJumin, szJumin ) {
  var objJumin = eval(objJumin) ;
  var nIDtot = 0;
  var szIDAdd = '234567892345';
  if (Number(szJumin)==0) {
    alert('주민등록번호를 입력해 주십시요.     ');
    objJumin.focus() ;
    return false;
  }
  for(var i=0; i < 12; i++) nIDtot = nIDtot + parseInt(szJumin.substring(i, i+1), 10) * parseInt(szIDAdd.substring(i, i+1), 10);
  nIDtot = 11 - ( nIDtot % 11);
  if ( nIDtot == 10) nIDtot = 0;
  else if ( nIDtot == 11) nIDtot = 1;
    if(parseInt(szJumin.substring(12, 13), 10) != nIDtot) {
      alert('잘못된 주민등록번호입니다.     ');
      objJumin.focus() ;
      return false;
    }else{
      return true;
    }
}

//Only Number Check Function
function fnOnlyNumChk( objNum , szAlertMsg ) {
  var objNum = eval(objNum);
  var szValue = objNum.value;
  szValue = szValue.toUpperCase();
  for(var i=0; i < szValue.length; i++) {
    if (szValue.charAt(i) == ' '){
      alert( szAlertMsg+' 항목은 숫자만 입력하셔야 합니다.     ' );
      objNum.focus();
      return false;
    }else if ((szValue.charAt(i) < '0') || (szValue.charAt(i) > '9'))	{
      alert( szAlertMsg+' 항목은 숫자만 입력하셔야 합니다.     ' );
      objNum.focus();
      return false;
    }
  }
}

//Message Length Check Function
function fnMsgLenChk( objMessage, nLimitLen, szAlertMsg ) {
  var nbytes = 0;
  var objMessage = eval(objMessage) ;
  var szMessage = objMessage.value ;
  for (var i=0; i < szMessage.length; i++) {
    var szChr = szMessage.charAt(i);
    if(escape( szChr ).length > 4) {
      nbytes += 2;
    } else if (szChr == '\n') {
      if (szMessage.charAt(i-1) != '\r')    nbytes += 1;
    } else if (szChr == '<' || szChr == '>' ) {
      nbytes += 4;
    } else if (szChr == "'") {
      nbytes += 2;
    } else {
      nbytes += 1;
    }
  }
  if ( nbytes > nLimitLen ){
    alert( szAlertMsg + ' 항목을 너무 길게 입력하셨습니다.     \n영문/숫자는 '+nLimitLen+'자, 한글은 '+nLimitLen/2+'자 이내로 입력해 주십시요.     ');		
    objMessage.focus();
    return false;
  }
}


//Message Length Range Check Function
function fnMsgRangeChk( objMessage, nStart, nEnd, szAlertMsg ) {
  var nbytes = 0;
  var objMessage = eval(objMessage) ;
  var szMessage = objMessage.value ;
  for (var i=0; i < szMessage.length; i++) {
    var szChr = szMessage.charAt(i);
    if(escape( szChr ).length > 4) {
      nbytes += 2;
    } else if (szChr == '\n') {
      if (szMessage.charAt(i-1) != '\r')    nbytes += 1;
    } else if (szChr == '<' || szChr == '>' ) {
      nbytes += 4;
    } else if (szChr == "'") {
      nbytes += 2;
    } else {
      nbytes += 1;
    }
  }
  if ( nbytes < nStart ){
    alert( szAlertMsg + ' 항목을 너무 짧게 입력하셨습니다.     \n영문/숫자는 '+nStart+'자, 한글은 '+nStart/2+'자 이상 입력해 주십시요.     ');		
    objMessage.focus();
    return false;
  }
  if ( nbytes > nEnd ){
    alert( szAlertMsg + ' 항목을 너무 길게 입력하셨습니다.     \n영문/숫자는 '+nEnd+'자, 한글은 '+nEnd/2+'자 이하로 입력해 주십시요.     ');		
    objMessage.focus();
    return false;
  }
}


//Alert & focus Function
function fnAlertFocus(szInputType, szFormName, szInputName, szAlertMsg) {
  if(fnTrim(szAlertMsg)!='') { alert(szAlertMsg); }
  var objName = eval(szInputName);
  if ( (szInputType=='checkbox' || szInputType=='radio') && (objName.length > 0) ){
    objName = eval(szInputName+'[0]');
  }
  objName.focus();
}

//Trim Function
function fnTrim( szValue ) {
  var szRetVal = '';
  if( szValue == '' )  return false;
  for(var i=0;i<szValue.length;i++) {
    if(szValue.charAt(i) != ' ')    szRetVal = szRetVal + szValue.charAt(i);
  }
  return szRetVal;
}


//////////////////////////////////////////////////////////////////////////
/***********************************************************************************/
// 베이직 펑션 종료


// 컴마 및 도트 위치 계산(입력용 소숫점)
function dchk2(num) {
   num = num.toString();
   var dot = 0;
   var dottmp = new Array();
   dot = ( num.indexOf(".") != -1 )? num.length - num.indexOf("."): 0;
   var vlen = num.length - dot ;
   var c = 1;
   var tmp = new Array();
   for ( i = vlen ; i > -1; i-- ) {
      c++;
      tmp[i] = ( ( c%3 == 0 ) && ( i != vlen - 1) )? num.charAt(i) + "," : num.charAt(i);
   }
   if ( dot > 1 ) {
      num = num.split(".");
      if ( num != null ) {
         for ( i = 0; i < tmp.length; i++ ) {
            dottmp[i] = tmp[i];
         }
         dottmp[tmp.length-1] = dottmp[tmp.length-1] + num[1];
         return dottmp ;
      }
   }
   return tmp;
}

function CommaInsTxt(val) {
   var vals = "";
   vals = val.toString();
   if ( vals.indexOf(".") != -1 ) {
      var dotpos = vals.split(".");
      if ( dotpos[1].length > 2 ) {
         vals = vals.substring( 0, vals.length - 1);
         if ( event.type == "keyup" ) alert("소숫점이하 두자리 까지만 입력이 가능합니다.");
         return vals;
      }
   }
   var pas = "";
   comma=/,/gi;
   var sol = dchk2(vals.replace(comma,''));
   for ( i=0; i<sol.length; i++ ) {
      pas += sol[i];
   }
   return pas;
}

// 이미지 미리보기
function photoWin(url){
  window.open("/include/ZoomPhoto.asp?photo="+url, "Photos", "scrollbars=yes");
}

function viewFoto(imgN, url) // 안씀
{ 
	W=imgN.width; 
	H=imgN.height; 
	O="width="+W+",height="+H; 
	imgWin=window.open("","",O); 
	imgWin.document.write("<html><head><title>이미지 미리보기</title></head>");
	imgWin.document.write("<body topmargin=0 leftmargin=0>");
	imgWin.document.write("<img src=\""+url+"\" onclick='self.close()' style='cursor:hand'>");
	imgWin.document.close();
} 

/**********************************************************************************
	popup window
***********************************************************************************/
function popwindow(url,width,height){
	window.open(url,"","left=0, top=0, toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + width +",height=" + height + ";")
}

function popwindowO(url,width,height, nm, option){
	window.open(url,nm,"width=" + width +",height=" + height + option + ";")
}





//---------------------------- 고병호가 만든것임 -------------------------------
// 1.
// 2.
//

		function js_int_key() 
		{
			if((event.keyCode<48) || (event.keyCode>57)) 
			{
				//alert("숫자만 넣어 주세요.");
				event.returnValue = false;
			}
		}
	// -----------------------------------------------------------------------	
		
		function js_float_key()
		{
			if((event.keyCode<48) || (event.keyCode>57)) 
			{
				if( event.keyCode != 46) 
				{
					//alert("숫자와 . 만 넣어 주세요.");
					event.returnValue=false; 
				}
			}
		}
	
	// -----------------------------------------------------------------------

	function popup_search_calendar(inputname, arrayNum)
	{
		var p = window.open("/include/calendar/offer_calendar.asp?inputname="+inputname+"&ArrayNum="+arrayNum, "calendar", "width=200,height=200");	
	}


/**********************************************************************************/
// 2006-07-14 김인태
  function getCookie( C_name ){
    var nameOfCookie = C_name + "=";
    var x = 0;
    while ( x <= document.cookie.length )		{
      var y = (x+nameOfCookie.length);
      if ( document.cookie.substring( x, y ) == nameOfCookie ) {
        if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
          endOfCookie = document.cookie.length;
        return unescape( document.cookie.substring( y, endOfCookie ) );
      }
      x = document.cookie.indexOf( " ", x ) + 1;
      if ( x == 0 )
        break;
    }
    return "";
  }

  function setCookie( C_name, value, expiredays ) 	{
    var todayDate = new Date(); 
    todayDate.setDate( todayDate.getDate() + expiredays ); 
    document.cookie = C_name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
  } 


  // -----------------------------------------------------------------------	
  // app함수 - 화면이동 펑션
  function naviGo( pos, url ) {
    setCookie( "navi", pos , 1);
    location.href = url;
  }



//-->

