﻿// 에러메시지 포멧 정의 ///
var NO_BLANK = "{name+을를} 입력(선택)해주세요";
var NOT_VALID = "{name+이가} 올바르지 않습니다";
var TOO_LONG = "{name}의 길이가 초과되었습니다 (최대 {maxbyte}바이트)";
var STRING_FR  = 6
var STRING_TO  = 10
var old_menu = '';
var old_cell = '';

/// 스트링 객체에 메소드 추가 ///
String.prototype.trim = function(str) {
	str = this != window ? this : str;
	return str.replace(/^\s+/g,'').replace(/\s+$/g,'');
}





String.prototype.hasFinalConsonant = function(str) {
	str = this != window ? this : str;
	var strTemp = str.substr(str.length-1);
	return ((strTemp.charCodeAt(0)-16)%28!=0);
}





String.prototype.bytes = function(str) {
	str = this != window ? this : str;
  var len = 0;
  for(j=0; j<str.length; j++) {
		var chr = str.charAt(j);
		len += (chr.charCodeAt() > 128) ? 2 : 1
	}
	return len;
}



/// 실질적 폼체크 함수 ///
function validate(form) {

	for (i = 0; i < form.elements.length; i++ ) {
		var el = form.elements[i];
		if (el.tagName == "FIELDSET") continue;
		el.value = el.value.trim();
		var minbyte = el.getAttribute("MINBYTE");
		var maxbyte = el.getAttribute("MAXBYTE");
		var option = el.getAttribute("OPTION");
		var match = el.getAttribute("MATCH");
		var glue = el.getAttribute('GLUE');

		if (el.getAttribute("REQUIRED") != null) {	//필수 사항에 대한 처리

			if (el.value == null || el.value == "") {
				return doError(el,NO_BLANK);
			}
		}



		if (minbyte != null) { //문자열 길이 체크
			if (el.value.bytes() < parseInt(minbyte)) {
				return doError(el,"{name+은는} 최소 "+minbyte+"바이트 이상 입력해야 합니다.");
			}
		}





		if (maxbyte != null && el.value != "") { //문자열 길이 체크
			var len = 0;
			if (el.value.bytes() > parseInt(maxbyte)) {
				return doError(el,"{name}의 길이가 초과되었습니다 (최대 "+maxbyte+"바이트)");
			}
		}

		if (match && (el.value != form.elements[match].value)) return doError(el,"{name+이가} 일치하지 않습니다");  //두개의 문자열 일치 체크

		if (option != null) {   /// 특수 패턴 검사 함수 포워딩 ///

			if (el.getAttribute('SPAN') != null) {

				var _value = new Array();
				for (span=0; span<el.getAttribute('SPAN');span++ ) {
					_value[span] = form.elements[i+span].value;
				}


				var value = _value.join(glue == null ? '' : glue);
				if (!funcs[option](el,value)) return false;
			} else {
				if (!funcs[option](el)) return false;
			}
		}
	}
	return true;
}


// Textarea 글자수 조절
// 입력예제 <textarea onKeyPress="fnChkRemark(this,'50')">  -- fnChkRemark(텍스트값, 자릿수)
function fnChkRemark(obj, strCnt) {

	var strtempRemark = obj.value;
	var len = 0;
	var tString = '';
	for(j=0; j< strtempRemark.length; j++) {
		var chr = strtempRemark.charAt(j);
		len += (chr.charCodeAt() > 128) ? 2 : 1;
		if (len <= strCnt)
			tString += chr;
	}


	if (len >= strCnt) {
		alert('영문은 ' + strCnt + '자 이하, 한글은 '+ strCnt/2 + '자 이하로 입력해 주세요. ');
		obj.focus();
		obj.value = tString;
		return false;
	}

}





// Textarea 글자수 조절

// submit하기 전에 사용할때

// 입력예제

//	if(!ChkByte(form.contents,'1300')) -- ChkByte(텍스트값,'1300')

//	{

//		return;

//	}

function ChkByte(objname,maxlength) { 
 var objstr = objname.value;											// 입력된 문자열을 담을 변수 
 var objstrlen = objstr.length;											// 전체길이 



 // 변수초기화 
 var maxlen = maxlength;														// 제한할 글자수 최대크기 
 var i = 0;																		// for문에 사용 
 var bytesize = 0;																// 바이트크기 
 var strlen = 0;																// 입력된 문자열의 크기
 var onechar = "";																// char단위로 추출시 필요한 변수 
 var objstr2 = "";																// 허용된 글자수까지만 포함한 최종문자열
 // 입력된 문자열의 총바이트수 구하기

 for(i=0; i< objstrlen; i++) {
 // 한글자추출 
  onechar = objstr.charAt(i); 
  if (escape(onechar).length > 4) {
   bytesize += 2;																	// 한글이면 2를 더한다. 
  } else {  
   bytesize++;																		// 그밗의 경우는 1을 더한다.
  } 

  

  if(bytesize <= maxlen)  {												// 전체 크기가 maxlen를 넘지않으면 
   strlen = i + 1;														// 1씩 증가
  }
 }

 // 총바이트수가 허용된 문자열의 최대값을 초과하면 
 if(bytesize > maxlen) { 
	alert('영문은 2000자 이하, 한글은 1000자 이하로 입력해 주세요. ');
  objstr2 = objstr.substr(0, strlen);
  objname.value = objstr2;
	return false;
 } 
 objname.focus();
 return true;
}


function josa(str,tail) {
	return (str.hasFinalConsonant()) ? tail.substring(0,1) : tail.substring(1,2);
}





function doError(el,type,action) { //에러 처리 함수
	var pattern = /{([a-zA-Z0-9_]+)\+?([가-힝]{2})?}/;
	var name = (hname = el.getAttribute("HNAME")) ? hname : el.getAttribute("NAME");
	pattern.exec(type);
	var tail = (RegExp.$2) ? josa(eval(RegExp.$1),RegExp.$2) : "";
	alert(type.replace(pattern,eval(RegExp.$1) + tail));
	if (action == "sel") {
		el.select();
	} else if (action == "del")	{
		el.value = "";
	}


  try
  {
    el.focus();
  } catch (e) { }
	return false;
}





/// 특수 패턴 검사 함수 매핑 ///
var funcs = new Array();
funcs['email'] = isValidEmail;
funcs['phone'] = isValidPhone;
funcs['userid'] = isValidUserid;
funcs['pass'] = isValidPass;
funcs['hangul'] = hasHangul;
funcs['number'] = isNumeric;
funcs['engonly'] = alphaOnly;
funcs['jumin'] = isValidJumin;
funcs['bizno'] = isValidBizNo;
funcs['domain'] = isValidDomain;

funcs['nohangul'] = noHangul; // 한글 첨부파일 방지용



/// 패턴 검사 함수들 ///
function isValidEmail(el,value) {
	var value = value ? value : el.value;
	var pattern = /^[_a-zA-Z0-9-\.]+@[\.a-zA-Z0-9-]+\.[a-zA-Z]+$/;
	return (pattern.test(value)) ? true : doError(el,NOT_VALID);
}





function isValidUserid(el) {
	var pattern = /^[a-zA-Z]{1}[a-zA-Z0-9_]{3,7}$/;
	return (pattern.test(el.value)) ? true : doError(el,"{name+은는} 4자이상 8자 이하이어야 하고,\n\n영문 또는 영문/숫자 조합이어야 합니다");
}


function isValidPass(el) {
	var pattern = /^[a-zA-Z0-9]{1}[a-zA-Z0-9]{3,7}$/;
	return (pattern.test(el.value)) ? true : doError(el,"{name+은는} 4자이상 8자 이하이어야 하고,\n\n영문이나 숫자 영문/숫자 조합이어야 합니다");
}





function hasHangul(el) {
	var pattern = /^[가-힝]+$/;
	return (pattern.test(el.value)) ? true : doError(el,"{name+은는} 반드시 한글로만 입력해야 합니다");
}





function alphaOnly(el) {
	var pattern = /^[a-zA-Z/ ]+$/;
	return (pattern.test(el.value)) ? true : doError(el,"{name+은는} 반드시 영문으로만 입력해야 합니다");
}





function noHangul(el) { // 한글 첨부파일 방지용
	var pattern = /[ㄱ-ㅎ|ㅏ-ㅣ|가-힝]/;
	var str = comChk_mExtract_FileName(el.value);
	return (!pattern.test(str)) ? true : doError(el,"{name+은는} 한글파일명을 사용할 수 없습니다.");
}

function isNumeric(el) {
	var pattern = /^[0-9]+$/;
	return (pattern.test(el.value)) ? true : doError(el,"{name+은는} 반드시 숫자로만 입력해야 합니다");
}




//전체경로에서.. 파일명만 추출.
function comChk_mExtract_FileName( str ){
   var len = str.length;
   var last = str.lastIndexOf("\\"); //파일명 추출
   var ext = str.substring(last + 1, len);  //파일명 추출 ( 제외)

   return ext;
}//mExtractFileName

function isValidJumin(el,value) { //주민번호 체크
    var pattern = /^([0-9]{6})-?([0-9]{7})$/;
	var num = value ? value : el.value;
    if (!pattern.test(num)) return doError(el,NOT_VALID);
    num = RegExp.$1 + RegExp.$2;

	var sum = 0;
	var last = num.charCodeAt(12) - 0x30;
	var bases = "234567892345";
	for (var i=0; i<12; i++) {
		if (isNaN(num.substring(i,i+1))) return doError(el,NOT_VALID);
		sum += (num.charCodeAt(i) - 0x30) * (bases.charCodeAt(i) - 0x30);
	}


	var mod = sum % 11;
	return ((11 - mod) % 10 == last) ? true : doError(el,NOT_VALID);
}





function isValidBizNo(el, value) { //사업번호 체크
    var pattern = /([0-9]{3})-?([0-9]{2})-?([0-9]{5})/;
	var num = value ? value : el.value;
    if (!pattern.test(num)) return doError(el,NOT_VALID);
    num = RegExp.$1 + RegExp.$2 + RegExp.$3;
    var cVal = 0;
    for (var i=0; i<8; i++) {
        var cKeyNum = parseInt(((_tmp = i % 3) == 0) ? 1 : ( _tmp  == 1 ) ? 3 : 7);
        cVal += (parseFloat(num.substring(i,i+1)) * cKeyNum) % 10;
    }


    var li_temp = parseFloat(num.substring(i,i+1)) * 5 + '0';
    cVal += parseFloat(li_temp.substring(0,1)) + parseFloat(li_temp.substring(1,2));
    return (parseInt(num.substring(9,10)) == 10-(cVal % 10)%10) ? true : doError(el,NOT_VALID);
}





function isValidPhone(el,value) {//전화번호
	var pattern = /^[0-9]+$/;
	var num = value ? value : el.value;
	if (num == null || num == "") {
		return doError(el,NO_BLANK);
	}
	else {
	return (pattern.test(num)) ? true : doError(el,"{name+은는} 반드시 숫자로만 입력해야 합니다");
	}
}




function isValidDomain(el) { //도메인 체크
	var pattern = /^.+(\.[a-zA-Z]{2,3})$/;
	return (pattern.test(el.value)) ? true : doError(el,NOT_VALID);
}





function isValidDomain(el,value) { //도메인 체크
	var value = value ? value : el.value;
	var pattern = new RegExp("^(http://)?(www\.)?([가-힝a-zA-Z0-9-]+\.[a-zA-Z]{2,3}$)","i");
	if (pattern.test(value)) {
		el.value = RegExp.$3;
		return true;
	} else {
		return doError(el,NOT_VALID);
	}
}





function onlyNumber(){             /* 숫자 체크 함수 */
	var e1 = event.srcElement;
	var num ="0123456789";
	event.returnValue = true;

	for (var i=0;i< e1.value.length;i++)
	{
		if(-1 == num.indexOf(e1.value.charAt(i)))
		event.returnValue = false;
	}


	if (!event.returnValue)
	e1.value="";
}

	



function chk_focus(){
	if(document.chk_member.cu_jmno1.value.length == 6){
	document.chk_member.cu_jmno2.focus();
	}
}








function menuclick( submenu, cellbar, tbl, seq )
{

  if( old_menu != submenu ) {
    if( old_menu !='' ) {
      old_menu.style.display = 'none';
	  //old_cell.src= 'images/plus.gif';
    }


    submenu.style.display = 'block';
    //cellbar.src = 'images/act.gif';

    old_menu = submenu;
    old_cell = cellbar;

  } else {
    submenu.style.display = 'none';
    //cellbar.src= 'images/plus.gif';
    old_menu = '';
    old_cell = '';
  }


 showreLayer('/customer/count_upd.ts',2000,2000,tbl,seq);

}


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


function moveLayer(strlayer, left, top) {
	var theObj;
	if (navigator.appName == 'Netscape' && document.layers != null)
		theObj = eval("document.layers['" + strlayer + "']");
	else if (document.all != null) //IE
		theObj = eval("document.all['" + strlayer + "'].style");

	if(theObj) {
		theObj.left = left;
		theObj.top = top;
	}
}


function showLayer(strlayer, left, top) {
	moveLayer(strlayer, left, top);
	MM_showHideLayers(strlayer, "show");
}


function hideLayer(strlayer) {
	MM_showHideLayers(strlayer, "hide");
}





function showreLayer(url, left, top, tbl, seq) {
	if(document.all['LayerA'].style.visibility=="visible")
		hideLayer('LayerA');
	else
		openLayer(reLayer, url+"?tbl="+tbl+"&seq="+seq, 'LayerA', left, top);
}


function openLayer(win, url, strlayer, left, top) {
	win.location.href=url
	moveLayer(strlayer, left, top);
	MM_showHideLayers(strlayer, "show");
}








//회원 인증 관련 스크립트//
function log_yn(f_url){
	answer = confirm("해당 서비스는 인증된 고객 전용입니다.\n\n로그인 하시겠습니까?");
	if(answer == true){
	location.href='/other/login.asp?f_url='+f_url;
	}
}





function find_id01() {
	var form = document.form1;
	if(form.cu_id.value == ""){
	alert("사용하실 ID를 먼저 입력하세요");
	form.cu_id.focus();
	return;
	}


	if((form.cu_id.value.length<4)||(form.cu_id.value.length>8)){
		alert("사용하실 아이디는 4자 이상 8자 이하입니다.")
		form.cu_id.select();
		return;
	}
	else {
	window.open("/ordinary/tabi_regi_pop04.ts?cu_id=" + form.cu_id.value,"fdid","width=400,height=174,left=400,top=380");
	}
	return;
}








function setday(year,mon) {
		var day;
		if (mon==1 || mon==3 || mon==5 || mon==7 || mon==8 || mon==10 || mon==12) day=31;
		else if (mon==2) { if (year%4==0) day=29; else day=28; } // 2월처리
		else day=30;
			opt = "<option value=''>일</option>"
			for (var i=1; i<=day; i++) {
			  var opt = opt + "<option ";
				if (i < 10){
					opt = opt + "value='0" + i + "'>" + i + "</option>";
				}else{
					opt = opt + "value='" + i + "'>" + i + "</option>";
				}
			}


		ChgDay.innerHTML="<select name=day class='input'>" + opt + "</select>";
}


function setday1(year,mon) {
		var day;
		if (mon==1 || mon==3 || mon==5 || mon==7 || mon==8 || mon==10 || mon==12) day=31;
		else if (mon==2) { if (year%4==0) day=29; else day=28; } // 2월처리
		else day=30;
			opt = "<option value=''>일</option>"
			for (var i=1; i<=day; i++) {
			  var opt = opt + "<option ";
				if (i < 10){
					opt = opt + "value='0" + i + "'>" + i + "</option>";
				}else{
					opt = opt + "value='" + i + "'>" + i + "</option>";
				}
			}
		ChgDay1.innerHTML="<select name=pp_dd class='input'>" + opt + "</select>";
}





function setday_now() {
	var now=new Date()
	var year=now.getYear()
	var dd=now.getDate()
	var mon=now.getMonth()+1


	if (mon==1 || mon==3 || mon==5 || mon==7 || mon==8 || mon==10 || mon==12) day=31;
	else if (mon==2) { if (year%4==0) day=29; else day=28; } // 2월처리
	else day=30;
		opt = "<option value=''>일</option>"
		for (var i=1; i<=day; i++) {
		  var opt = opt + "<option ";
		  if (i==dd) opt = opt ;
				if (i < 10){
					//i = "0" + i;
					opt = opt + "value='0" + i + "'>" + i + "</option>";
				}else{
					opt = opt + "value='" + i + "'>" + i + "</option>";
				}
		}
	ChgDay.innerHTML="<select name=day class='input'>" + opt + "</select>";
}


function setday_now1() {
	var now=new Date()
	var year=now.getYear()
	var dd=now.getDate()
	var mon=now.getMonth()+1


	if (mon==1 || mon==3 || mon==5 || mon==7 || mon==8 || mon==10 || mon==12) day=31;
	else if (mon==2) { if (year%4==0) day=29; else day=28; } // 2월처리
	else day=30;
		opt = "<option value=''>일</option>"
		for (var i=1; i<=day; i++) {
		  var opt = opt + "<option ";
		  if (i==dd) opt = opt ;
				if (i < 10){
					//i = "0" + i;
					opt = opt + "value='0" + i + "'>" + i + "</option>";
				}else{
					opt = opt + "value='" + i + "'>" + i + "</option>";

				}

		}
	ChgDay1.innerHTML="<select name=pp_dd class='input'>" + opt + "</select>";

}


function check_box() {
	var count;
	var form = document.chk_insert;
	count = 0;
	var choice = form.elements.length;


	for (var i=0; i<= choice - 1; i++) {
		if (form.elements[i].checked==true) {
		   count++;
		}

	}


	if (count <= 0) {
		alert("   이용약관에 동의하셔야 합니다 !   ");
		return false;
	}
	form.submit();

}


//set todays date
Now = new Date();
NowDay = Now.getDate();
NowMonth = Now.getMonth();
NowYear = Now.getYear();
if (NowYear < 2000) NowYear += 1900; //for Netscape


//윤년을 포함하여 각 월의 날 수 계산하는 함수
function DaysInMonth(WhichMonth, WhichYear)
{
  var DaysInMonth = 31;
  if (WhichMonth == "4" || WhichMonth == "6" || WhichMonth == "9" || WhichMonth == "11") DaysInMonth = 30;
  if (WhichMonth == "2" && (WhichYear/4) != Math.floor(WhichYear/4))	DaysInMonth = 28;
  if (WhichMonth == "2" && (WhichYear/4) == Math.floor(WhichYear/4))	DaysInMonth = 29;
  return DaysInMonth;
}





//각 월에서 사용 가능한 날짜로 변경
function ChangeOptionDays(Which)
{
  DaysObject = eval("document.incentive." + Which + "day");
  MonthObject = eval("document.incentive." + Which + "month");
  YearObject = eval("document.incentive." + Which + "year");


  Month = MonthObject[MonthObject.selectedIndex].text;
  Year = YearObject[YearObject.selectedIndex].text;


  DaysForThisSelection = DaysInMonth(Month, Year);
  CurrentDaysInSelection = DaysObject.length;

  if (CurrentDaysInSelection > DaysForThisSelection)
  {
    for (i=0; i<(CurrentDaysInSelection-DaysForThisSelection); i++)
    {
      DaysObject.options[DaysObject.options.length - 1] = null
    }
  }


  if (DaysForThisSelection > CurrentDaysInSelection)
  {
    for (i=0; i<(DaysForThisSelection-CurrentDaysInSelection); i++)
    {

      NewOption = new Option(DaysObject.options.length + 1);
      DaysObject.add(NewOption);
    }

  }

    if (DaysObject.selectedIndex < 0) DaysObject.selectedIndex == 0;
}





//현재 날짜로 셋팅
function SetToToday(Which)
{
  DaysObject = eval("document.incentive." + Which + "day");
  MonthObject = eval("document.incentive." + Which + "month");
  YearObject = eval("document.incentive." + Which + "year");

  YearObject[0].selected = true;
  MonthObject[NowMonth].selected = true;
  ChangeOptionDays(Which);

  DaysObject[NowDay-1].selected = true;
}





//option years를 지정한 만큼 작성하는 함수
function WriteYearOptions(YearsAhead)
{
  line = "";
  for (i=0; i<YearsAhead; i++)
  {
    line += "<OPTION>";
    line += NowYear + i;
  }
  return line;
}


function ch_evDay(){
	var form    = document.incentive ;
	if (form.ev_day_cnt1.value > form.ev_day_cnt2.value) {
		form.ev_day_cnt2.value = Number(form.ev_day_cnt1.value) + 1
	}
}


function moveFocus(num,fromform,toform){
	var str = fromform.value.length;
	if(str == num)
	toform.focus();
}


//스카이 스크랩퍼 함수
function CheckUIElements(){
        var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
        if ( bNetscape4plus ) {
                yMenuFrom   = document["divMenu"].top;
                yMenuTo     = top.pageYOffset + 62;
        }


        else if ( bExplorer4plus ) {
                yMenuFrom   = parseInt (divMenu.style.top, 10);
				if (document.body.scrollTop<700)
	                yMenuTo     = document.body.scrollTop + 253;	//<-----실제 높이 위치 조정
        }

        timeoutNextCheck = 200;
        if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
                setTimeout ("CheckUIElements()", timeoutNextCheck);
                return;
        }





        if ( yButtonFrom != yButtonTo ) {
                yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
                if ( yButtonTo < yButtonFrom )
                        yOffset = -yOffset;

                if ( bNetscape4plus )
                        document["divLinkButton"].top += yOffset;
                else if ( bExplorer4plus )
                        divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }


        if ( yMenuFrom != yMenuTo ) {
                yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
                if ( yMenuTo < yMenuFrom )
                        yOffset = -yOffset;


                if ( bNetscape4plus )
                        document["divMenu"].top += yOffset;
                else if ( bExplorer4plus )
					if (document.body.scrollTop<700)
                        divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;

                timeoutNextCheck = 10;
        }

        setTimeout ("CheckUIElements()", timeoutNextCheck);
}








function winPop(pPage,name,wid,hei)
{
	var winl = (screen.width - wid) / 2;
	var wint = (screen.height - hei) / 2;
	var popUpWin;

	winprops = 'height='+hei+',width='+wid+',top='+wint+',left='+winl
	popUpWin = window.open(pPage,name,winprops);
	if (parseInt(navigator.appVersion) >= 4) { popUpWin.window.focus(); }
	popUpWin.focus();
}





function Win_pop(newwin,w,h) {
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',resizable=no,scrollbars=no,status=no,menu=no';
  win = window.open(newwin, "PopWin01", winprops)
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}





function SWin_pop(newwin,name,w,h) {
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = 'width='+w+',height='+h+',top='+wint+',left='+winl+',resizable=no,scrollbars=yes,status=no,menu=no';
  win = window.open(newwin, name, winprops)
  if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}	





function fncImagePopup(image)
{
	var winImagePopup = window.open("", "winImagePopup","location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=no,toolbar=no")
	winImagePopup.focus();
	winImagePopup.document.open();
	winImagePopup.document.write("<HTML><HEAD>");
	winImagePopup.document.write("<TITLE>이미지보기</TITLE>");
	winImagePopup.document.write("</HEAD><BODY topmargin=\"0\" leftmargin=\"0\">");
	winImagePopup.document.write("<img src=\"" + encodeURI(decodeURI(image)) + "\" id=\"ImagePopup\" onLoad=\"window.resizeBy(Math.min(this.width,screen.availWidth-70)-document.body.clientWidth,Math.min(document.body.scrollHeight,screen.availHeight-70)-document.body.clientHeight);window.resizeBy(0,Math.min(document.body.scrollHeight,screen.availHeight-70)-document.body.clientHeight);window.moveBy(Math.min(0,screen.availWidth-(window.screenLeft+document.body.clientWidth+30)),Math.min(0,screen.availHeight-(window.screenTop+document.body.clientHeight+30)));\" onClick=\"window.close()\">");
	winImagePopup.document.write("</BODY></HTML>");
	winImagePopup.document.close();
}





// 설정된 특수문자일 경우 true, 아니면 false 
function isSpecial(strID){
  var spc="!@#$%^&*()-=[]\;',./_+{}|:<>?";
  var matchCnt = 0;

  for(var i=0;i<spc.length;i++){
    for(var j=0;j<strID.length;j++){
      if(spc.charAt(i) == strID.charAt(j)){
        matchCnt++;
      } 
    }
  }


  if(matchCnt == strID.length){
    return true;
  }else{
    return false;
  }
}





// 특수문자 체크( 정규식 이용 )
function inputCheckSpecial( str ){
	var strobj = str ; 
	re = /[\\~!@\#|$%^&*\()\-=+_,.\'"{}"]/gi;
	if(re.test(str)){
		alert("특수문자는 입력하실수 없습니다.");
		return false;
	}
	return true;
}





function UrlEncoding(form){
	for (i = 0; i < form.elements.length; i++ ) {
			var el = form.elements[i];
			el.value = encodeURIComponent(el.value);
	}
}
