﻿/// <REFERENCE path"~/Common/Script/jquery-1.4.1-vsdoc.js" />
/*=================================================
' namespace : Master                                      
' 기  능          : 공통 영역에서 사용되는 prototype
'-------------------- 변경이력 ----------------------------------------------------------
'    작 성 자        소  속         작 성 일               비   고              
’------------------------------------------------------------------------------------------
'  1. PHJ           CVS           2010.01.07         최초 작성                       
'==================================================*/
Master = {

	ID: "#ctl00_ContentPlaceHolder1_",
	/*'==================================================
	' 함수명 : Master.$_(id)
	' 인   수 : id - 서버폼 아이디값
	' 기   능 : ID 해당하는 Form 값을 리턴한다.
	' 리턴값 : ID 해당하는 Form 값을 리턴한다.
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.07         최초 작성                       
	'===================================================*/
	$_: function(id) {
		return $(Master.ID + id);
	},
	/*'==================================================
	' 함수명 : Master.$F(id)
	' 인   수 : id - 서버폼 아이디값
	' 기   능 : ID 해당하는 Value 값을 가지고온다.
	' 리턴값 : ID 해당하는 Value 값을 리턴한다.
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.07         최초 작성                       
	'===================================================*/
	$F: function(id) {
		return $(Master.ID + id).val();
	},
	/*'==================================================
	' 함수명 : Master.Commify(Num)
	' 인   수 : Num - 콤마 표시할 숫자  
	' 기   능 : Num 값 숫자 세자리 마다 콤마를 찍어 넘겨준다.
	' 리턴값 : Num 값에 세자리 마다 콤마를 찍은값
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.07         최초 작성                       
	'===================================================*/
	Commify: function(Num) {
		var reg = /(^[+-]?\d+)(\d{3})/;
		Num += "";
		while (reg.test(Num))
			Num = Num.replace(reg, '$1' + ',' + '$2');
		return Num;
	},
	/*'==================================================
	' 함수명 : Master.numchk(num)
	' 인   수 : num - 콤마가 있는 숫자
	' 기   능 : num 값 에서 콤마를 제거한다.
	' 리턴값 : num 값에 콤마를 제거한 값
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.07         최초 작성                       
	'===================================================*/
	numchk: function(num) {
		num = new String(num);
		num = num.replace(/,/gi, "");
		return num;
	},
	/*'==================================================
	' 함수명 : Master.Comma(form)
	' 인   수 : form - 입력폼
	' 기   능 : 폼값에서 콤마를 붙여서 다시 폼값을 재정의 한다.
	' 리턴값 : form 값을 변경하여 다시 폼값에 변경된 값을 대입한다.
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.07         최초 작성                       
	'===================================================*/
	Comma: function(form) {
		var Num = Master.numchk(form.value);
		form.value = Master.Commify(Num);
	},
	/*'==================================================
	' 함수명 : Master.keyPress()
	' 기  능 :  키보드 입력값을 숫자만 입력될수 있게 한다.
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.07         최초 작성                       
	'===================================================*/
	keyPress: function() {
		if (event != null) {
			var key = event.keyCode;
			if (!(key == 8 || key == 9 || key == 13 || key == 46 || key == 144 ||
              (key >= 48 && key <= 57) || key == 110 || key == 190)) {
				event.returnValue = false;
			}
		}
	},

	/*'==================================================
	' 기  능 : 숫자외 입력시 입력거부(keydown)
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PCS              CVS          2009.09.25            최초 작성                       
	'===================================================*/
	isLicense: function(checkform, mvID) {
		if (checkform == null) {
			checkform = event.srcElement.id;
		} else {
			checkform = checkform.id;
		}
		var str1 = $("#" + checkform).val();
		for (var i = 0; i < str1.length; i++) {
			if (str1.charAt(i) < '0' || str1.charAt(i) > '9') {
				//alert("숫자만 입력해야 합니다.");
				$("#" + checkform).val('');
				$("#" + checkform).focus();
				return false;
				break;
			}
		}
		if (mvID != null && str1.length >= 6) {
			$("#" + mvID).focus();
		}
		return true;
	},

	/*'==================================================
	' 기  능 : 숫자외 입력시 입력거부(keydown)
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PCS              CVS          2009.09.25            최초 작성                       
	'===================================================*/
	isNumber: function(str) {
		var num = "0123456789.";
		var ChkStr = ''
		isNumberFalg = true;
		str = str.toUpperCase();
		if (str == '' || str == null) {
			isNumberFalg = false;
		} else {
			for (var i = 0; i < str.length; i++) {
				ChkStr = num.indexOf(str.charAt(i))
				if (-1 == ChkStr) {
					isNumberFalg = false;
					break;
				}
			}
		}
		return isNumberFalg;
	},

	/**********************************************************************
	이메일 검사
	**********************************************************************/
	isEmail: function(str) {
		// regular expression 지원 여부 점검
		var supported = 0;
		if (window.RegExp) {
			var tempStr = "a";
			var tempReg = new RegExp(tempStr);
			if (tempReg.test(tempStr)) supported = 1;
		}
		if (!supported) {
			return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
		}
		var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)");
		var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$");
		return (!r1.test(str) && r2.test(str));
	},
	/**********************************************************************
	이메일이 맞는 형식인지 알려준다
	**********************************************************************/
	valEmail: function(str) {
		var strEmail = $(str).value;
		if (strEmail.trim() == '') {
			;
		} else {
			if (Master.isEmail(strEmail) == false) {
				alert('이메일 형식이 맞지 않습니다. 다시 입력하여 주십시요.');
				$(str).value = '';
				$(str).focus();
			}
		}
	},

	/*'==================================================
	' 함수명 : Master.Create_Year(id, sYear , eYear, dYear)
	' 인  수 : id        - 년도를 생성할 타겟이 되는 콤보박스 아이디
	'            sYear  - 년도를 생성할 시작년도
	'            eYear  - 년도를 생성할 마지막 년도 ( Null 일경우 현제 현도 기준 + 3년으로 함)
	'            dYear  - 기본값 년도 (Null  일경우 현재 년도를 기본값으로함)
	' 기  능 :  콤보박스 년도 설정
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.08         최초 작성                       
	'===================================================*/
	Create_Year: function(id, sYear, eYear, dYear) {
		var dt = new Date();
		var Y = (eYear == null || eYear == undefined) ? dt.getYear() : eYear;
		var n = 0;
		var combobox = $(id)[0];

		// 년도 생성처리
		for (var i = sYear; i < Y + 3; i++) {
			combobox.add(new Option(i, i), $.browser.msie ? n : combobox.options[n]);
			n++;
		}

		//기본값 설정
		if (dYear != null) {
			$(id).val(dYear);
		}
		else {
			$(id).val(Y);
		}
	},
	/*'==================================================
	' 함수명 : Master.Create_Month(id, m , n)
	' 인  수 : id        - 월을 생성할 타겟이 되는 콤보박스 아이디
	'            m        - 기본 월 Null 일경우 현재 월을 기본값으로 함
	'            n         - max 월값 Null 일경우 최대인 12 개월로 함
	' 기  능 :  콤보박스 월 설정
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.08         최초 작성                       
	'===================================================*/
	Create_Month: function(id, m, n) {
		var dt = new Date();
		var max = (n == null || n == undefined) ? 12 : n;
		var mm = (m == null || m == undefined) ? dt.getMonth() : m;
		var combobox = $(id)[0];
		var month = 1;

		// 월 생성처리
		for (var i = 0; i < max; i++) {
			if (month < 10) {
				combobox.add(new Option("0" + month, "0" + month), $.browser.msie ? i : combobox.options[i]);
			}
			else {
				combobox.add(new Option(month, month), $.browser.msie ? i : combobox.options[i]);
			}
			month++;
		}
		//기본값 설정
		$(id).val(mm);
	},
	/*'==================================================
	' 함수명 : Master.Create_Day(id, d , n)
	' 인  수 : id        - 일 생성할 타겟이 되는 콤보박스 아이디
	'            d        - 기본 일자 Null 일경우 현재 일을 기본값으로 함
	'            n         - max 일값 Null 일경우 최대인 31일로 함
	' 기  능 :  콤보박스 월 설정
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.08         최초 작성                       
	'===================================================*/
	Create_Day: function(id, d, n) {
		var dt = new Date();
		var max = (n == null || n == undefined) ? 31 : n;
		var dd = (d == null || m == undefined) ? dt.getDay() : d;
		var combobox = $(id)[0];
		var day = 1;

		// 일 생성처리
		for (var i = 0; i < max; i++) {
			if (month < 10) {
				combobox.add(new Option("0" + day, "0" + day), $.browser.msie ? i : combobox.options[i]);
			}
			else {
				combobox.add(new Option(day, day), $.browser.msie ? i : combobox.options[i]);
			}
			day++;
		}
		//기본값 설정
		$(id).val(dd);
	},
	/*'==================================================
	' 함수명 : Master.CreateTel(id, ddd)
	' 인  수 : id        - 전화국번을 생성할 타겟이 되는 콤보박스 아이디
	'            ddd    - 기본값이 될 지역번호값 null 허용
	' 기  능 :  콤보박스 전화 지역번호 생성
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.08         최초 작성                       
	'===================================================*/
	CreateTel: function(id, ddd) {

		var combobox = $(id)[0];
		combobox.add(new Option("선택", "0"), $.browser.msie ? 0 : combobox.options[0]);
		combobox.add(new Option("02", "02"), $.browser.msie ? 1 : combobox.options[1]);
		combobox.add(new Option("031", "031"), $.browser.msie ? 2 : combobox.options[2]);
		combobox.add(new Option("032", "032"), $.browser.msie ? 3 : combobox.options[3]);
		combobox.add(new Option("033", "033"), $.browser.msie ? 4 : combobox.options[4]);
		combobox.add(new Option("041", "041"), $.browser.msie ? 5 : combobox.options[5]);
		combobox.add(new Option("042", "042"), $.browser.msie ? 6 : combobox.options[6]);
		combobox.add(new Option("043", "043"), $.browser.msie ? 7 : combobox.options[7]);
		combobox.add(new Option("051", "051"), $.browser.msie ? 8 : combobox.options[8]);
		combobox.add(new Option("052", "052"), $.browser.msie ? 9 : combobox.options[9]);
		combobox.add(new Option("053", "053"), $.browser.msie ? 10 : combobox.options[10]);
		combobox.add(new Option("054", "054"), $.browser.msie ? 11 : combobox.options[11]);
		combobox.add(new Option("055", "055"), $.browser.msie ? 12 : combobox.options[12]);
		combobox.add(new Option("061", "061"), $.browser.msie ? 13 : combobox.options[13]);
		combobox.add(new Option("062", "062"), $.browser.msie ? 14 : combobox.options[14]);
		combobox.add(new Option("063", "063"), $.browser.msie ? 15 : combobox.options[15]);
		combobox.add(new Option("064", "064"), $.browser.msie ? 16 : combobox.options[16]);
		combobox.add(new Option("070", "070"), $.browser.msie ? 17 : combobox.options[17]);
		combobox.add(new Option("0502", "0502"), $.browser.msie ? 18 : combobox.options[18]);
		combobox.add(new Option("0504", "0504"), $.browser.msie ? 19 : combobox.options[19]);
		combobox.add(new Option("0505", "0505"), $.browser.msie ? 20 : combobox.options[20]);
		combobox.add(new Option("0506", "0506"), $.browser.msie ? 21 : combobox.options[21]);

		if (ddd != null) {
			$(id).val(ddd);
		}
	},
	/*'==================================================
	' 함수명 : Master.CreateMobile(id, ddd)
	' 인  수 : id        - 통신사 번호 생성할 타겟이 되는 콤보박스 아이디
	'            ddd    - 기본값이 될 통신사번호 null 허용
	' 기  능 :  콤보박스 이동통신사 번호 생성
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.08         최초 작성                       
	'===================================================*/
	CreateMobile: function(id, ddd) {

		var select = $(id)[0];
		select.add(new Option("선택", "0"), $.browser.msie ? 0 : select.options[0]);
		select.add(new Option("010", "010"), $.browser.msie ? 1 : select.options[1]);
		select.add(new Option("011", "011"), $.browser.msie ? 2 : select.options[2]);
		select.add(new Option("016", "016"), $.browser.msie ? 3 : select.options[3]);
		select.add(new Option("017", "017"), $.browser.msie ? 4 : select.options[4]);
		select.add(new Option("018", "018"), $.browser.msie ? 5 : select.options[5]);
		select.add(new Option("019", "019"), $.browser.msie ? 6 : select.options[6]);

		if (ddd != null) {
			$(id).val(ddd);
		}
	},
	/*'==================================================
	' 함수명 : Master.CreateEMail(id, mail)
	' 인  수 : id        - 이메일 주소 생성할 타겟이 되는 콤보박스 아이디
	'            ddd    - 기본값이 될 이메일 주소 Null 허용
	' 기  능 :  콤보박스 이메일 주소 생성
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.08         최초 작성                       
	'===================================================*/
	CreateEMail: function(id, mail) {

		var select = $(id)[0];
		select.add(new Option("선택", "0"), $.browser.msie ? 0 : select.options[0]);
		select.add(new Option("드림위즈", "dreamwiz.com"), $.browser.msie ? 1 : select.options[1]);
		select.add(new Option("프리챌", "freechal.com"), $.browser.msie ? 2 : select.options[2]);
		select.add(new Option("하나포스", "hananet.net"), $.browser.msie ? 3 : select.options[3]);
		select.add(new Option("다음", "hanmail.net"), $.browser.msie ? 4 : select.options[4]);
		select.add(new Option("한미르", "hanmir.net"), $.browser.msie ? 5 : select.options[5]);
		select.add(new Option("파란", "paran.com"), $.browser.msie ? 6 : select.options[6]);
		select.add(new Option("하이텔", "hitel.net"), $.browser.msie ? 7 : select.options[7]);
		select.add(new Option("핫메일", "hotmail.com"), $.browser.msie ? 8 : select.options[8]);
		select.add(new Option("라이코스", "lycos.co.kr"), $.browser.msie ? 9 : select.options[9]);
		select.add(new Option("네이트", "nate.com"), $.browser.msie ? 10 : select.options[10]);
		select.add(new Option("네이버", "naver.com"), $.browser.msie ? 11 : select.options[11]);
		select.add(new Option("네띠앙", "netian.com"), $.browser.msie ? 12 : select.options[12]);
		select.add(new Option("신비로", "shinbiro.co.kr"), $.browser.msie ? 13 : select.options[13]);
		select.add(new Option("유니텔", "unitel.co.kr"), $.browser.msie ? 14 : select.options[14]);
		select.add(new Option("야후", "yahoo.co.kr"), $.browser.msie ? 15 : select.options[15]);
		select.add(new Option("지메일", "gmail.com"), $.browser.msie ? 16 : select.options[16]);
		select.add(new Option("천리안", "chollian.net"), $.browser.msie ? 17 : select.options[17]);
		select.add(new Option("직접입력", ""), $.browser.msie ? 18 : select.options[18]);

		if (mail != null) {
			$(id).val(mail);
		}
	},
	/*'==============================================================
	' 함수명 : Master.PageCreate(obj)
	' 인  수 : obj.size   - 페이지 사이즈
	'            obj - obj.id1  : 페이지 번호 Element ID
	'            obj - obj.id2  : 페이지카운트 Element ID
	'            obj - obj.id3  : 출력 DIV Element ID
	' 기  능 :  페이지 네비게이션 생성처리
	' 리턴값
	'-------------------- 변경이력 ------------------------------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’--------------------------------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.08         최초 작성                       
	'===============================================================*/
	PageCreate: function(obj) {
		var Total = Number(Master.$F(obj.id2));
		var PageSize = obj.size;
		var Page = Number(Master.$F(obj.id1));
		var Html = "";

		//값이 없는지 여부 체크후 없으면 1 과 0을 부여한당.!!
		if (isNaN(Page)) Page = 1
		if (isNaN(Total)) Total = 0

		var PageCount = Math.ceil(Total / PageSize);
		var iNowBlock = Math.ceil(Page / 10);
		var blockpage = (iNowBlock - 1) * 10 + 1;
		var iLastPage = blockpage + (10 - 1);

		if (blockpage == 1) {
			Html += "<a href='#'><img src='/images/btn/btn_prev01.gif' alt='처음' title='처음' /></a>&nbsp;"
		}
		else {
			//Link = Link + Number(blockpage - 10) + obj.param;
			Html += "<a href='#'><img src='/images/btn/btn_prev01.gif' alt='처음' title='처음'  style='cursor:pointer;' onclick='Pager.changePage(" + Number(blockpage - 10) + ",\"" + obj.id1 + "\")'/></a>&nbsp;";
		}

		Html += "<a href='#'><img src='/images/btn/btn_prev02.gif' aalt='이전' title='이전' onclick='Pager.Prev(\"" + obj.id1 + "\")' style='cursor:pointer;'/></a>&nbsp;";

		if (iLastPage > PageCount) {
			iLastPage = PageCount;
		}

		Html += "<span class='bar'>ㅣ</span>";

		for (i = blockpage; i <= iLastPage; i++) {
			Html += '&nbsp;';
			if (i == Page) {
				Html += "<span class='point'>" + i + "</span>";
			}
			else {
				Html += "<a href='#' onclick=\"Pager.changePage(" + i + ",\'" + obj.id1 + "\')\">" + i + "</a>";
			}
			if (i < iLastPage) {
				Html += "<span class='bar'>ㅣ</span>";
			}
			blockpage = blockpage + 1;
		}

		Html += (Total == 0) ? "1&nbsp;" : "&nbsp;";
		Html += "<span class='bar'>ㅣ</span>";
		Html += "&nbsp;<a href='#'><img src='/images/btn/btn_next02.gif' alt='다음' title='다음' onclick='Pager.Next(\"" + obj.id1 + "\",\"" + obj.id2 + "\")' style='cursor:pointer;' /></a>";
		if (blockpage > PageCount) {
			Html += "&nbsp;<a href='#'><img src='/images/btn/btn_next01.gif' alt='마지막' title='마지막' /></a>"
		}
		else {
			Html += "&nbsp;<a href='#'><img src='/images/btn/btn_next01.gif' alt='마지막' title='마지막' onclick='Pager.changePage(" + blockpage + ",\"" + obj.id1 + "\")' style='curspr:pointer;'/></a>"
		}

		$(obj.id3).html(Html);
	},
	/*'==============================================================
	' 함수명 : Master.PageCreateCms(obj)
	' 인  수 : obj.size   - 페이지 사이즈
	'            obj - obj.id1  : 페이지 번호 Element ID
	'            obj - obj.id2  : 페이지카운트 Element ID
	'            obj - obj.id3  : 출력 DIV Element ID
	' 기  능 :  관리자 페이지 네비게이션 생성처리 
	' 리턴값
	'-------------------- 변경이력 ------------------------------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’--------------------------------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.08         최초 작성                       
	'===============================================================*/
	PageCreateCms: function(obj) {
		var Total = Number(Master.$F(obj.id2));
		var PageSize = obj.size;
		var Page = Number(Master.$F(obj.id1));
		var Html = "";

		//값이 없는지 여부 체크후 없으면 1 과 0을 부여한당.!!
		if (isNaN(Page)) Page = 1
		if (isNaN(Total)) Total = 0

		var PageCount = Math.ceil(Total / PageSize);
		var iNowBlock = Math.ceil(Page / 10);
		var blockpage = (iNowBlock - 1) * 10 + 1;
		var iLastPage = blockpage + (10 - 1);

		if (blockpage == 1) {
			Html += "<a href='#'><img src='/images/cms/btn/btn_prev01.gif' alt='처음' title='처음' /></a> "
		}
		else {
			Html += "<a href='#'><img src='/images/cms/btn/btn_prev01.gif' alt='처음' title='처음'  style='cursor:pointer;' onclick='Pager.changePage(1,\"" + obj.id1 + "\")'/></a> "
		}

		Html += "<a href='#'><img src='/images/cms/btn/btn_prev02.gif' aalt='이전' title='이전' onclick='Pager.Prev(\"" + obj.id1 + "\")' style='cursor:pointer;'/></a>"

		if (iLastPage > PageCount) {
			iLastPage = PageCount;
		}

		Html += "<span class='bar'>ㅣ</span>";

		for (i = blockpage; i <= iLastPage; i++) {
			Html += '&nbsp;';
			if (i == Page) {
				Html += " <span class='point'>" + i + "</span> ";
			}
			else {
				Html += " <a href='#' onclick=\"Pager.changePage(" + i + ",\'" + obj.id1 + "\')\">" + i + "</a> ";
			}
			if (i < iLastPage) {
				Html += " <span class='bar'>ㅣ</span> ";
			}
			blockpage = blockpage + 1;
		}

		Html += (Total == 0) ? "1&nbsp;" : "&nbsp;";
		Html += "<span class='bar'>ㅣ</span>";

		Html += " <a href='#'><img src='/images/cms/btn/btn_next02.gif' alt='다음' title='다음' onclick='Pager.Next(\"" + obj.id1 + "\",\"" + obj.id2 + "\")' style='cursor:pointer;' /></a>";
		if (blockpage > PageCount) {
			Html += " <a href='#'><img src='/images/cms/btn/btn_next01.gif' alt='마지막' title='마지막' /></a>"
		}
		else {
			Html += " <a href='#'><img src='/images/cms/btn/btn_next01.gif' alt='마지막' title='마지막' onclick='Pager.changePage(" + PageCount + ",\"" + obj.id1 + "\")' style='curspr:pointer;'/></a>"
		}

		$(obj.id3).html(Html);
	},
	/*'==============================================================
	' 함수명 : Master.PageCreateSpecial(obj)
	' 인  수 : obj.size   - 페이지 사이즈
	'            obj - obj.id1  : 페이지 번호 Element ID
	'            obj - obj.id2  : 페이지카운트 Element ID
	'            obj - obj.id3  : 출력 DIV Element ID
	' 기  능 :  관리자 페이지 네비게이션 생성처리 
	' 리턴값
	'-------------------- 변경이력 ------------------------------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’--------------------------------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.03.29         최초 작성                       
	'===============================================================*/
	PageCreateSpecial: function(obj) {
	    var Total = Number(Master.$F(obj.id2));
	    var PageSize = obj.size;
	    var Page = Number(Master.$F(obj.id1));
	    var Html = "";

	    //값이 없는지 여부 체크후 없으면 1 과 0을 부여한당.!!
	    if (isNaN(Page)) Page = 1
	    if (isNaN(Total)) Total = 0

	    var PageCount = Math.ceil(Total / PageSize);
	    var iNowBlock = Math.ceil(Page / 10);
	    var blockpage = (iNowBlock - 1) * 10 + 1;
	    var iLastPage = blockpage + (10 - 1);

	    if (blockpage == 1) {
	        Html += "<a href='#'><img src='/special/images/btn/btn_prev01.gif' alt='처음' title='처음' /></a> "
	    }
	    else {
	        Html += "<a href='#'><img src='/special/images/btn/btn_prev01.gif' alt='처음' title='처음'  style='cursor:pointer;' onclick='Pager.changePage(1,\"" + obj.id1 + "\")'/></a> "
	    }

	    Html += "<a href='#'><img src='/special/images/btn/btn_prev02.gif' aalt='이전' title='이전' onclick='Pager.Prev(\"" + obj.id1 + "\")' style='cursor:pointer;'/></a>"

	    if (iLastPage > PageCount) {
	        iLastPage = PageCount;
	    }

	    Html += "<span class='bar'>ㅣ</span>";

	    for (i = blockpage; i <= iLastPage; i++) {
	        Html += '&nbsp;';
	        if (i == Page) {
	            Html += " <span class='point'>" + i + "</span> ";
	        }
	        else {
	            Html += " <a href='#' onclick=\"Pager.changePage(" + i + ",\'" + obj.id1 + "\')\">" + i + "</a> ";
	        }
	        if (i < iLastPage) {
	            Html += " <span class='bar'>ㅣ</span> ";
	        }
	        blockpage = blockpage + 1;
	    }

	    Html += (Total == 0) ? "1&nbsp;" : "&nbsp;";
	    Html += "<span class='bar'>ㅣ</span>";

	    Html += " <a href='#'><img src='/special/images/btn/btn_next02.gif' alt='다음' title='다음' onclick='Pager.Next(\"" + obj.id1 + "\",\"" + obj.id2 + "\")' style='cursor:pointer;' /></a>";
	    if (blockpage > PageCount) {
	        Html += " <a href='#'><img src='/special/images/btn/btn_next01.gif' alt='마지막' title='마지막' /></a>"
	    }
	    else {
	        Html += " <a href='#'><img src='/special/images/btn/btn_next01.gif' alt='마지막' title='마지막' onclick='Pager.changePage(" + PageCount + ",\"" + obj.id1 + "\")' style='curspr:pointer;'/></a>"
	    }

	    $(obj.id3).html(Html);
	},
	/*'==================================================
	' 함수명 : User.OpenCenter(winNM, parm, width, height, popname)
	' 기  능 : 팝업창 중앙에 띄우기
	' 인  수 : winNm : popup Name(팝업며예
	'           param : 파라미터(복수로해서 보낼수 있다.)
	'           width : 팝업창 너비
	'           height : 팝업창 높이
	'           popname : 팝업 이름	
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PCS             CVS          2009.12.22            최초 작성                       
	'===================================================*/
	OpenCenter: function(winNM, parm, width, height, scroll, popname) {
		var sw = screen.availWidth;
		var sh = screen.availHeight;

		px = (sw - width) / 2;
		py = (sh - height) / 2;

		var setting = 'top=' + py + ',left=' + px;
		setting += ',width=' + width + ',height=' + height + ',toolbar=0,resizable=1,status=0,scrollbars=' + scroll;
		winNM = (parm == '' || parm == null) ? winNM : winNM + '?' + parm;
		popNM = popname + "_win";
		popNM = window.open(winNM, popname, setting);
		popNM.focus();
	},

	/*'==================================================
	' 함수명 : Master.calcNewLine(str)
	' 인  수 : str : 문자열
	' 기  능 : 문자열 길이체크
	' 리턴값: 문자열길이를 체크후 길이값을 리턴한다.
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.19         최초 작성                       
	'===================================================*/
	calcNewLine: function(str) {
		var re = /\r\n/g;
		var note = str;
		var newlineCount = 0;

		if (!(re.test(note))) {
			var noteReplace = note.replace(/\n/g, '');
			newlineCount = noteReplace.length;
			newlineCount = note.length - newlineCount;
		}

		return newlineCount;
	},
	/*'==================================================
	' 함수명 : Master.CheckLength(limit, id1, id2)
	' 인  수 : limit : 제한 문자열 길이
	'           id1 - 길이체크할 입력폼 아이디값
	'           id2 - 길이체크값을 표시할 Element ID 
	' 기  능 : 문자열 길이 체크 및 문자열 길이를 표시한다.
	' 리턴값: 문자열길이를 체크후  제한 범위를 넘을 경우 메시지 창을 뛰우고 제한 문자열 길이로 문자열을 자른다.
	'            문자열 길이를 화면에 표시
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.19         최초 작성                       
	'===================================================*/
	CheckLength: function(limit, id1, id2) {
		var re = /\r\n/g;
		var note = $get(id1).value;
		var newlineCount = 0;

		newlineCount = Master.calcNewLine(note);

		if (note.length + newlineCount > limit) {
			alert("글자는 " + limit + "자까지만 입력이 가능합니다.");
			$get(id1).value = note.substring(0, limit - newlineCount);

			newlineCount = Master.calcNewLine($("#" + id1).val());
		}

		$("#" + id2).html($("#" + id1).val().length + newlineCount);
	},

	/*'==================================================
	' 함수명 : Master.submitCheckLength(limit, id1, id2)
	' 인  수 : limit : 제한 문자열 길이
	'           id1 - 길이체크할 입력폼 아이디값
	'           id2 - 길이체크값을 표시할 Element ID 
	' 기  능 : 문자열 길이 체크 및 문자열 길이를 표시한다.
	' 리턴값: 문자열길이를 체크후  제한 범위를 넘을 경우 메시지 창을 뛰우고 제한 문자열 길이로 문자열을 자른다.
	'            문자열길이가 제한범위 를 넘지 않으면 false 넘으면 true 를 리턴한다.
	'-------------------- 변경이력 ------------------------------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고              
	’---------------------------------------------------------------------------------------------
	'  1. PHJ           CVS           2010.01.19         최초 작성                       
	'===================================================*/
	submitCheckLength: function(limit, id1, id2) {
		var re = /\r\n/g;
		var note = $get(id1).value;
		var newlineCount = 0;

		newlineCount = Master.calcNewLine(note);
		if (note.length + newlineCount > limit) {
			alert("글자는 " + limit + "자까지만 입력이 가능합니다.");
			$get(id1).value = note.substring(0, limit - newlineCount);

			newlineCount = Master.calcNewLine($("#" + id1).val());

			$("#" + id2).html($("#" + id1).val().length + newlineCount);
			return false;
		}
		return true;
	},


	/*=========================
	'작성자 : PCS
	'작성일 : 2009.07.03
	'용 도 : 날자를 8자리 정수로(20090703)
	==========================*/
	DateNumber: function(strDate) {
		var arrDate = strDate.split('-');
		var seFullYear = eval(arrDate[0]);
		var seMonth = eval(arrDate[1]) - 1;
		var seDay = eval(arrDate[2]);
		var strDate = new Date(seFullYear, seMonth, seDay);
		var GetYear = strDate.getFullYear();
		var GetMonth = strDate.getMonth() + 1;
		var GetDay = strDate.getDate();
		if (GetMonth <= 9) {
			GetMonth = '0' + GetMonth;
		}
		if (GetDay <= 9) {
			GetDay = '0' + GetDay
		}
		return GetYear + '' + GetMonth + '' + GetDay;
	},

	/*=========================
	'작성자 : PCS
	'작성일 : 2009.07.03
	'용 도 : 8자리 정수를 날짜로(20090703)
	==========================*/
	NumberDate: function(strDate) {
		var ToDay = strDate.toString();
		var GetYear = ToDay.substr(0, 4);
		var GetMonth = ToDay.substr(4, 2);
		var GetDay = ToDay.substr(6, 2);
		ToDay = GetYear + '-' + GetMonth + '-' + GetDay;
		return ToDay;
	},

	Fagechange: function(reg01, reg02) {
		/*'==================================================
		' 함수명 : Master.Fagechange(lno, rno)
		' 인  수 : lno : 주민번호 앞자리
		'           id1 - 주민번호 뒷자리
		' 기  능 : 문자열 길이 체크 및 문자열 길이를 표시한다.
		' 리턴값: 만나이 반환
		'-------------------- 변경이력 ------------------------------------------------------------ 
		'    작 성 자        소  속         작 성 일               비   고              
		’---------------------------------------------------------------------------------------------
		'  1. PHJ           CVS           2010.01.19         최초 작성                       
		'===================================================*/
		var nowDate = new Date();
		var cy = nowDate.getFullYear(); //올해
		var cm = nowDate.getMonth(); //이번달
		var lastNo = reg01.substring(0, 2);
		var gubunNo = reg02.substring(0, 1);

		/**
		Case 0, 9: firstNo = "18"
		Case 1, 2, 5, 6: firstNo = "19"
		Case 3, 4, 7, 8: firstNo = "20"
		*/
		if (gubunNo == "0" || gubunNo == "9") {
			firstNo = "18" + lastNo;
		} else if (gubunNo == "1" || gubunNo == "2" || gubunNo == "5" || gubunNo == "6") {
			firstNo = "19" + lastNo;
		} else if (gubunNo == "3" || gubunNo == "4" || gubunNo == "7" || gubunNo == "8") {
			firstNo = "20" + lastNo;
		}

		var by = Number(firstNo);
		var bm = Number(reg01.substr(2, 4)); //출생 월
		(bm < cm) ? aged = cy - by : aged = cy - by - 1; //생일이 지나지 않으면 1을 뺀다

		return aged; //만나이를 반환한다
	},

	Print: function(DivNm) {
		/*'==================================================
		' 함수명 : Master.Print(DivNm)
		' 인  수 : DivNm : 인쇄할 영역 ID
		' 기  능 : 팝업창으로 인쇄하기
		'-------------------- 변경이력 ------------------------------------------------------------ 
		'    작 성 자        소  속         작 성 일               비   고              
		’---------------------------------------------------------------------------------------------
		'  1. PCS           CVS           2010.02.02         최초 작성                       
		'===================================================*/
		win = window.open('', 'pageprint', 'width=750,height=600,scrollbars=yes');
		win.focus();
		win.document.open();
		win.document.write('<' + 'html' + '><' + 'head' + '>');
		win.document.write('<link rel="stylesheet" type="text/css" href="/common/css/common.css">');
		win.document.write('<' + '/' + 'head' + '><' + 'body><div id="contents" style="padding:10px">');
		win.document.write($(DivNm).html());
		win.document.write('</div><' + '/' + 'body' + '><' + '/' + 'html' + '>');
		win.document.close();
		var Body = win.document.body;
		for (var i = 0; i < Body.getElementsByTagName("DIV").length; i++) {
			divID = Body.getElementsByTagName("DIV");
			if (divID[i].id == "btn_area") {
				divID[i].innerHTML = '';
			}
		}
		win.print();
		win.close();
	},


	/*'=================================================================
	' 함수명 : Master.getCookie()
	' 기  능 : 쿠키값가져오기
	'-------------------- 변경이력 ------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고 
	’-----------------------------------------------------------------
	'  1. PCS              CVS          2009.10.21            최초 작성
	'================================================================*/
	getCookie: function(uName) {
		var flag = document.cookie.indexOf(uName + '=');
		if (flag != -1) {
			flag += uName.length + 1
			end = document.cookie.indexOf(';', flag)
			if (end == -1) end = document.cookie.length
			var CookieValue = unescape(document.cookie.substring(flag, end));
			if (CookieValue == undefined || CookieValue == 'undefined') {
				CookieValue = '';
			}
		} else {
			CookieValue = '';
		}
		return CookieValue;
	},

	/*'=================================================================
	' 함수명 : Master.parseQuery()
	' 기  능 : get 파라미터 추출  
	'-------------------- 변경이력 ------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고 
	’-----------------------------------------------------------------
	'  1. PCS              CVS          2009.10.21            최초 작성
	'================================================================*/
	GET_params: null,
	parseQuery: function() {
		var _params = [];
		var query = location.search;
		if (query) {
			var paramStrs = query.substring(1).split("&");
			for (var i = 0; i < paramStrs.length; i++) {
				var position = paramStrs[i].indexOf("=");
				if (position >= 0) {
					_params[paramStrs[i].substring(0, position)] = paramStrs[i].substring(position + 1);
				}
			}
		}
		if (_params == null) {
			_params = '';
		}

		return _params;
	},

	/*'=================================================================
	' 함수명 : Master.getParameter()
	' 기  능 : get 파라미터 가져오기
	'인  수 : key - 파라미터 이름    
	'-------------------- 변경이력 ------------------------------------ 
	'    작 성 자        소  속         작 성 일               비   고 
	’-----------------------------------------------------------------
	'  1. PCS              CVS          2009.10.21            최초 작성
	'================================================================*/
	getParameter: function(key) {
		Master.GET_params || (Master.GET_params = Master.parseQuery());
		if (Master.GET_params[key] == undefined) {
			Master.GET_params[key] = '';
		}
		return Master.GET_params[key];
	}

}

/*===================================================================
'작성자 : PCH
'작성일 : 2009.05.26
'용  도 : 문자열 자르기
===================================================================*/
/* 
* string String::TextCut(int len)
* 글자를 앞에서부터 원하는 바이트만큼 잘라 리턴합니다.
* 한글의 경우 2바이트로 계산하며, 글자 중간에서 잘리지 않습니다.
*/
String.prototype.TextCut = function(len) {
	var str = this;
	var l = 0;
	for (var i = 0; i < str.length; i++) {
		l += (str.charCodeAt(i) > 128) ? 2 : 1;
		if (l > len) return str.substring(0, i) + "..";
	}
	return str;
}

// 문자열 길이 검사
String.prototype.isLength = function() {
	var varCk = this;
	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);
}

//숫자가 아니경우 parm 값 적용
String.prototype.isNumber = function(parm) {
	var str = this;
	var num = "0123456789.";
	var ChkStr = ''
	isNumberFalg = true;
	str = str.toUpperCase();
	for (var i = 0; i < str.length; i++) {
		ChkStr = num.indexOf(str.charAt(i))
		if (-1 == ChkStr) {
			isNumberFalg = false;
			break;
		}
	}
	if (!isNumberFalg || str == '' || str == null || str == undefined || str == 'undefined') {
		if (parm != null) {
			str = parm;
		} else {
			str = '0';
		}
	}
	return str;
}