﻿ClassBaseCheck = function() {
}

ClassBaseCheck.prototype = {
	// 주민번호체크
	Public : function(jumin,msg,obj) {
		bRetrun = false;

		var weight = "234567892345"; // 자리수 weight 지정 
		var val = jumin.replace("-",""); // "-"(하이픈) 제거 
		var sum = 0; 	
		
		if(val.length != 13) { flag = true; } 	

		for(i=0;i<12;i++) { 
			sum += parseInt(val.charAt(i)) * parseInt(weight.charAt(i)); 
		}
		
		var result = (11 - (sum % 11)) % 10; 
		var check_val = parseInt(val.charAt(12)); 	

		if(result != check_val) { 
			bRetrun = true; 
		} 

		if(bRetrun) {
			if(msg.length > 0) {
				alert(msg);
			}
			if(typeof(obj) == "object") {
				obj.focus();
			}
			return false;
		} else {
			return true; 		
		}
	},
	
	// 이메일 형식 체크
	Email : function(email,msg,obj) {
		var pattern =/([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)\.([0-9a-zA-Z_-]+)/; 	
		if(!email.match(pattern)) {
			if(msg.length > 0) {
				alert(msg);
			}
			if(typeof(obj) == "object") {
				obj.focus();
			}
			return false;
		} else {
			return true;
		}
	},
	
	// 숫자만 입력 체크
	OnlyNumber : function(obj) {
		var pattern = /[^0-9]/;
		
		if(obj.value.match(pattern)) {
			obj.value = obj.value.substr(0,obj.value.length-1);
			return false;
		} else {
			return true;
		}
	},
	
	// 텍스트 길이 오류 체크
	Length : function(str,msg,minLen,maxLen,obj) {
		bRetrun = false;

		if(maxLen.length == 0) {
			if(str.length <  minLen) {
				bRetrun = true;				
			}
		} else {
			if(!(str.length >= minLen && str.length <= maxLen)) {
				bRetrun = true;
			}
		} 

		if(bRetrun) {
			if(msg.length > 0) {
				alert(msg);
			}
			if(typeof(obj) == "object") {
				obj.focus();
			}
			return false;			
		} else {
			return true;
		}
	},

	// 핸드폰번호 체크
	HpNumber : function(hp,msg,obj) {
		var pattern = /[0-9]{2,4}-[0-9]{3,4}-[0-9]{4,4}/;
		if(!hp.match(pattern)) {
			if(msg.length > 0) {
				alert(msg);
			}
			if(typeof(obj) == "object") {
				obj.focus();
			}
			return false;
		}
		return true;
	},

	// 전화번호 체크
	TelNumber : function(tel,msg,obj) {
		var pattern = /[0-9]{2,4}-[0-9]{3,4}-[0-9]{4,4}/;
		if(!tel.match(pattern)) {
			if(msg.length > 0) {
				alert(msg);
			}
			if(typeof(obj) == "object") {
				obj.focus();
			}
			return false;
		}
		return true;
	},

	// 우편번호 체크
	Post : function(post,msg,obj) {
		var pattern = /[0-9]{3,3}-[0-9]{3,3}/;
		if(!post.match(pattern)) {
			if(msg.length > 0) {
				alert(msg);
			}
			if(typeof(obj) == "object") {
				obj.focus();
			}
			return false;
		}
		return true;
	},

	// 비밀번호 체크
	Password : function(passwd1,passwd2,minLen,maxLen,msg,obj) {
		bReturn = false;
		if(maxLen.length == 0) {
			if(passwd1.length <  minLen || passwd2.length <  minLen) {
				bReturn = true;				
			}
		} else {
			if(!(passwd1.length >= minLen && passwd1.length <= maxLen) || !(passwd2.length >= minLen && passwd2.length <= maxLen)) {
				bReturn = true;
			}
		}
		if(passwd1 !== passwd2) {
			bReturn = true;
		}
		if(bReturn) {
			if(msg.length > 0) {
				alert(msg);
			}
			if(typeof(obj) == "object") {
				obj.focus();
			}
			return false;
		} else {
			return true;
		}
	},

	// 확장자 체크
	Extention : function(str,arrExt) {
		var ext = str.substring(str.length-4,str.length).replace(".","");
		var flag = false;
		for(var i=0;i<arrExt.length;i++) {
			if(ext.toUpperCase() == arrExt[i].toUpperCase()) {
				flag = true;
			}
		}
		return flag;
	},

	// 텍스트에 해당 단어 체크
	TextInWord : function(text,arrWord) {
		var str = "";
		for(var i=0;i<arrWord.length;i++) {
			if(text.match(RegExp(arrWord[i],""))) {
				if(str.length > 0) {
					str += "\n";
				}
				str += arrWord[i];
			}
		}
		return str;
	},

	// 정규식 처리
	Reg : function(str,reg) {
		var result = str.match(reg)+"";
		if(result.length == str.length) {
			return true;
		} else {
			return false;
		}
	}
}

cBaseCheck = new ClassBaseCheck;
﻿ClassCalendar = function() {
	this.now = new Date();
	this.today = new Date();
	this.action = "";
	this.obj_event = null;
	this.div = null;
}

ClassCalendar.prototype = {
	// 초기화
	Init : function() {
		// 첫날 요일 구하기
		var date = new Date(this.now.getFullYear(),this.now.getMonth(),1);
		this.firstday = date.getDay();
		
		// 마지막 일 구하기
		var date = new Date(this.now.getFullYear(),this.now.getMonth()+1,1);
		date.setTime(date.getTime()-(1000*60*60*24));
		this.lastday = date.getDate();

		// 주의 수 구하기
		this.total = this.firstday+this.lastday;

		// 반복 행 수 구하기
		this.cnt = Math.ceil(this.total/7);

		// 요일 배열 생성
		this.arrDay = new Array("일","월","화","수","목","금","토");

		// 기존 달력 테이블 제거
		if(typeof(this.table) == "object") {
			this.table.parentNode.removeChild(this.table);
		}
	},

	// 네비게이션 생성
	CreateNavigation : function() {
		// 이미지 설정
		var img = document.createElement("img");
		img.src = cCommon.base_url+"/external/JKC_Library_1.0/images/btn_x.gif";
		img.style.cursor = "hand";
		img.onclick = function() {
			cCalendar.Close();
		}

		// 네비게이션바 생성
		var navigation = document.createElement("span");
		var calendar_year = document.createElement("select");
		var calendar_mon = document.createElement("select");
		var table = document.createElement("table");
		var tbody = document.createElement("tbody");
		var tr = document.createElement("tr");
		var td1 = document.createElement("td");
		var td2 = document.createElement("td");

		// 객체 속성 정의
		calendar_year.id = "calendar_year";
		calendar_mon.id = "calendar_mon";

		// 데이트타임 객체 생성
		var cDatetime = new ClassDatetime;
		cDatetime.year = this.now.getFullYear();
		if(this.now.getMonth()+1 < 10) {
			var val = "0"+(this.now.getMonth()+1);
		} else {
			var val = ""+(this.now.getMonth()+1);
		}
		cDatetime.today = this.now.getFullYear()+"-"+val+"-01 00:00:00";
		cDatetime.CreateYear(calendar_year);
		cDatetime.CreateMon(calendar_mon);

		// 셀 내용 처리
		td1.appendChild(calendar_year);
		td1.innerHTML += "년 ";
		td1.appendChild(calendar_mon);
		td1.innerHTML += "월";
		td2.appendChild(img);

		// 테이블 속성 정의
		table.width = "100%";
		table.style.borderBottom = "2px solid #E2E2E2";
		td2.align = "right";

		// 테이블 처리
		tr.appendChild(td1);
		tr.appendChild(td2);
		tbody.appendChild(tr);
		table.appendChild(tbody);
		navigation.appendChild(table);

		// 네비게이션 저장
		this.navigation = navigation;	

		// 네비게이션 추가
		this.div.appendChild(this.navigation);

		if($("calendar_year").value == "") {
			$("calendar_year").value = calendar_year.value;
		}
		if($("calendar_mon").value == "") {
			$("calendar_mon").value = calendar_mon.value;
		}
	},

	// 테이블 생성
	CreateTable : function() {
		// 초기화
		this.Init();

		// 테이블 생성
		var table = document.createElement("table");
		var tbody = document.createElement("tbody");

		// 요일 출력
		var tr = document.createElement("tr");
		for(var i=0;i<7;i++) {
			var td = document.createElement("td");
			td.innerHTML = this.arrDay[i]; // 요일 출력
			td.style.backgroundColor = "#E2E2E2";
			tr.appendChild(td);
		}

		// 테이블에 추가
		tbody.appendChild(tr);

		// 날짜 출력
		var day=1;
		for(var i=0;i<this.cnt;i++) {
			var tr = document.createElement("tr"); // 행 생성

			for(var j=0;j<7;j++) {
				var td = document.createElement("td"); // 셀 생성
				td.style.width = "20px";
				td.style.height = "20px";
				td.style.textAlign = "right";

				// 토,일요일 색상 지정
				if(j == 0) {
					td.style.color = "red";
				}
				if(j == 6) {
					td.style.color = "blue";
				}

				var now = this.now.getFullYear()+"-"+eval(this.now.getMonth()+1)+"-"+day;
				var today = this.today.getFullYear()+"-"+eval(this.today.getMonth()+1)+"-"+eval(this.today.getDate());

				if((i == 0 && this.firstday > j) || day > this.lastday) {
					td.innerHTML = "&nbsp;"; // 공란
				} else {
					if(now == today) {
						td.style.fontWeight = "bold";
						td.style.backgroundColor = "#000000";
						td.style.color = "#FFFFFF";
					} 

					td.innerHTML = "<a href=\"javascript:cCalendar.Select("+day+");\" style=\"color:"+td.style.color+"\">"+day+"</a>"; // 날짜 출력
					day++;
				}

				tr.appendChild(td);
			}
			tbody.appendChild(tr);
		}
		table.appendChild(tbody);

		// 테이블 저장
		this.table = table;

		// 테이블 추가
		this.div.appendChild(this.table);
	},

	// 달력 생성
	Create : function(year,mon,day,mouse_event) {
		// 초기화
		if(this.div !== null) this.Close();

		// 타겟 객체 설정
		this.objYear = year;
		this.objMon = mon;
		this.objDay = day;

		// 기본날짜 지정
		if(year.value.length > 0) {
			this.now.setFullYear(year.value);
		}
		if(mon.value.length > 0) {
			this.now.setMonth(eval(mon.value)-1);
		}
		if(day.value.length > 0) {
			this.now.setDate(eval(day.value));
		}

		// 오늘 저장
		this.today.setFullYear(this.now.getFullYear());
		this.today.setMonth(this.now.getMonth());
		this.today.setDate(this.now.getDate());

		// 달력 틀 생성
		this.div = document.createElement("div");
		this.div.style.position = "absolute";
		this.div.style.backgroundColor = "#FFFFFF";
		if(mouse_event) {
			this.div.style.top = mouse_event.pageY;
			this.div.style.left = mouse_event.pageX;
		} else {
			this.div.style.top = document.body.scrollTop+event.y;
			this.div.style.left = document.body.scrollLeft+event.x;
		}
		this.div.style.width = "160px";
		this.div.style.border = "3px solid #E2E2E2";
		this.div.style.padding = "5px";

		// 레이어 생성
		document.body.appendChild(this.div);

		// 네비게이션 생성
		this.CreateNavigation();

		// 테이블 생성
		this.CreateTable();

		// 이벤트 처리
		$("calendar_year").onchange = function() {
			cCalendar.ChangeYear();
		}
		$("calendar_mon").onchange = function() {
			cCalendar.ChangeMon();
		}
	},

	// 날짜 선택
	Select : function(day) {
		var year = this.now.getFullYear();
		var mon = this.now.getMonth()+1;

		if(mon < 10) {
			mon = "0"+mon;
		} else {
			mon = ""+mon;
		}

		if(day < 10) {
			day = "0"+day;
		} else {
			day = ""+day;
		}
		
		// 값 전송
		this.objYear.value = year;
		this.objMon.value = mon;
		this.objDay.value = day;

		// 달력 끄기
		this.Close();
	},

	// 달력 끄기
	Close : function() {
		this.div.parentNode.removeChild(this.div);
		this.div = null;
	},

	// 연도 변경시
	ChangeYear : function() {
		this.now.setFullYear($("calendar_year").value);
		this.CreateTable();
	},

	// 월 변경시
	ChangeMon : function() {
		this.now.setMonth(eval($("calendar_mon").value)-1);
		this.CreateTable();
	}
}

cCalendar = new ClassCalendar;
﻿ClassColorPicker = function() {
	this.id = null;
	this.color = "";
}

ClassColorPicker.prototype = {
	// 선택
	Select : function(color) {
		this.func(color);
		this.Close();
	},

	// 닫기
	Close : function() {
		$("DivColorPicker"+this.id).removeNode(true);
	},

	// 열기
	Open : function(func) {
		// 이미 열려진 창 닫기
		if($("DivColorPicker"+this.id) !== null) {
			this.Close();
		}

		// 결과 함수
		this.func = func;

		// 칼라 객체 생성
		var div = document.createElement("div");
		var table  = document.createElement("table");
		var input = document.createElement("input");
		var span_preview = document.createElement("span");
		var submit = document.createElement("input");
		var close = document.createElement("input");
		var table_layout  = document.createElement("table");
		var tbody_layout  = document.createElement("tbody");
		var tr_layout  = document.createElement("tr");
		var td1_layout  = document.createElement("td");
		var td2_layout  = document.createElement("td");		
		
		// 직접입력 창 설정
		input.value = this.color;
		input.style.width = "60px";
		input.obj = this;
		input.onkeydown = function() {
			if(event.keyCode == 13) {
				this.obj.Select(this.value);
			}
		}
		
		// 선택 설정
		submit.obj = this;
		submit.type = "submit";
		submit.value = "선택";
		submit.input = input;		
		submit.onclick = function() {
			this.obj.Select(this.input.value);
		}
		
		// 닫기 설정
		close.obj = this;
		close.type = "submit";
		close.value = "닫기";
		close.onclick = function() {
			this.obj.Close();
		}
		
		// 미리보기 창 설정
		span_preview.style.backgroundColor = this.color;
		span_preview.style.width = "60px";
		span_preview.style.height = "20px";
		
		// 도구 테이블 설정
		td1_layout.appendChild(span_preview);
		td2_layout.appendChild(input);
		td2_layout.appendChild(submit);
		td2_layout.appendChild(close);		
		tr_layout.appendChild(td1_layout);
		tr_layout.appendChild(td2_layout);
		tbody_layout.appendChild(tr_layout);
		table_layout.appendChild(tbody_layout);
		
		// 테이블 속성 변경
		table.cellSpacing = "2";
		table.cellPadding = "0";
		
		// 색상 배열 정의
		var arr = new Array("00","33","66","99","cc","ff");
		var cnt = 0;
		for(var i=0;i<arr.length;i++) {
			for(var j=0;j<arr.length;j++) {
				for(var k=0;k<arr.length;k++) {
					// 칼라 정의
					var color = "#"+arr[i]+arr[j]+arr[k];
					
					// 개체 생성
					if(cnt%18 == 0) {
						var tbody = document.createElement("tbody");																				
						var tr = document.createElement("tr");					
					}
					var td = document.createElement("td");	
					
					// 클릭 이벤트
					td.instance = this;
					td.span_preview = span_preview;
					td.input = input;
					td.onclick = function() {
						this.instance.Select(this.style.backgroundColor);
					}
					td.onmouseover = function() {
						this.span_preview.style.backgroundColor = this.style.backgroundColor;
						this.input.value = this.style.backgroundColor;
					}
					
					// 셀 속성 변경
					td.style.backgroundColor = color;
					td.width = "10";
					td.height= "10";
					
					// 개체 삽입
					tr.appendChild(td);
					if(cnt%18 == 0) {
						tbody.appendChild(tr);
						table.appendChild(tbody);
					}	
									
					// 카운팅
					cnt++;
				}				
			}
		}
		
		// 테이블 개체 삽입
		div.appendChild(table_layout);	
		div.appendChild(table);
		div.id = "DivColorPicker"+this.id;
		div.style.position = "absolute";
		div.style.top = document.body.scrollTop+event.y;
		div.style.left = document.body.scrollLeft+event.x;
		div.style.backgroundColor = "#FFFFFF";
		div.style.border = "5px solid #000000";
		
		// 내용 삽입
		document.body.appendChild(div);
	},

	// 생성자
	ClassColorPicker : function(id,color) {
		// 아이디 저장
		this.id = id;
		this.color = color;
	}
}
﻿ClassCommon = function() {
}

ClassCommon.prototype = {
}

cCommon = new ClassCommon;
﻿ClassCookie = function() {
	this.sec = "";
	this.path = "";
}

ClassCookie.prototype = {
	// 쿠키생성
	Set : function(sName, sValue) {
		// 만료날짜 설정
		var date = new Date();
		if(this.sec.length == 0) {
			var sec = 1000*60*60*24*1;
		} else {
			var sec = this.sec;
		}
		var date = new Date(date.getTime()+(sec));
		
		// 경로 설정
		if(this.path.length == 0) {
			var path = "/";
		} else {
			var path = this.path;
		}

		// 쿠키 생성
		document.cookie = sName+"="+escape(sValue)+";path="+path+";";
	},
	
	// 쿠키값 얻어오기
	GetCookie : function(sName) {
		var aCookie = document.cookie.split("; ");
		for (var i=0; i < aCookie.length; i++)	{
			var aCrumb = aCookie[i].split("=");
			if (sName == aCrumb[0]) 
				return unescape(aCrumb[1]);
		}	
		return null;
	}
}

cCookie = new ClassCookie;
﻿ClassDatetime = function() {
	this.year = "2007";
	this.today = "-- ::";
	this.flag = false;
}

ClassDatetime.prototype = {
	CreateYear : function(ObjSelect) {
		var Year = eval(this.year);
		var Option = document.createElement("OPTION");
		Option.innerHTML="----";
		Option.value="";	
		ObjSelect.appendChild(Option);					
		for(var i=Year+5;i>1930;i--) {
			var Option = document.createElement("OPTION");
			Option.innerHTML=i;
			Option.value=i;	
			ObjSelect.appendChild(Option);
			if(i == this.SplitDatetime(this.today)[0]) {
				Option.selected = true;
			}		
		}
	},
	
	CreateMon : function(ObjSelect) {
		var Option = document.createElement("OPTION");
		Option.innerHTML="--";
		Option.value="";	
		ObjSelect.appendChild(Option);				
		for(var i=1;i<=12;i++) {
			if(i<10) {
				var month = "0"+i;
			} else {
				var month = i;		
			}
			var Option = document.createElement("OPTION");
			Option.innerHTML=month;
			Option.value=month;	
			ObjSelect.appendChild(Option);
			
			if(month == this.SplitDatetime(this.today)[1]) {
				Option.selected = true;
			}								
		}		
	},
	
	CreateDay : function(ObjSelect) {
		var Option = document.createElement("OPTION");
		Option.innerHTML="--";
		Option.value="";	
		ObjSelect.appendChild(Option);				
		for(var i=1;i<=31;i++) {
			if(i<10) {
				var day = "0"+i;
			} else {
				var day = i;		
			}
			var Option = document.createElement("OPTION");
			Option.innerHTML=day;
			Option.value=day;	
			ObjSelect.appendChild(Option);
			
			if(day == this.SplitDatetime(this.today)[2]) {
				Option.selected = true;
			}								
		}
	},	

	CreateHour : function(ObjSelect) {
		var Option = document.createElement("OPTION");
		Option.innerHTML="--";
		Option.value="";	
		ObjSelect.appendChild(Option);				
		for(var i=0;i<=23;i++) {
			if(i<10) {
				var day = "0"+i;
			} else {
				var day = i;		
			}
			var Option = document.createElement("OPTION");
			Option.innerHTML=day;
			Option.value=day;	
			ObjSelect.appendChild(Option);
			
			if(day == this.SplitDatetime(this.today)[3]) {
				Option.selected = true;
			}								
		}
	},	
	
	CreateMin : function(ObjSelect) {
		var Option = document.createElement("OPTION");
		Option.innerHTML="--";
		Option.value="";	
		ObjSelect.appendChild(Option);				
		for(var i=0;i<=59;i++) {
			if(i<10) {
				var day = "0"+i;
			} else {
				var day = i;		
			}
			var Option = document.createElement("OPTION");
			Option.innerHTML=day;
			Option.value=day;	
			ObjSelect.appendChild(Option);
			
			if(day == this.SplitDatetime(this.today)[4]) {
				Option.selected = true;
			}								
		}
	},	
	
	CreateSec : function(ObjSelect) {
		var Option = document.createElement("OPTION");
		Option.innerHTML="--";
		Option.value="";	
		ObjSelect.appendChild(Option);				
		for(var i=0;i<=59;i++) {
			if(i<10) {
				var day = "0"+i;
			} else {
				var day = i;		
			}
			var Option = document.createElement("OPTION");
			Option.innerHTML=day;
			Option.value=day;	
			ObjSelect.appendChild(Option);
			
			if(day == this.SplitDatetime(this.today)[5]) {
				Option.selected = true;
			}								
		}
	},
	
	SplitDatetime : function(datetime) {
		if(datetime.length == 0) return "";
		var arrDatetime = datetime.split(" ");
		var arrDate = arrDatetime[0].split("-");
		var arrTime = arrDatetime[1].split(":");
		var arrReturn = new Array();
		arrReturn[0] = arrDate[0];
		arrReturn[1] = arrDate[1];
		arrReturn[2] = arrDate[2];
		arrReturn[3] = arrTime[0];
		arrReturn[4] = arrTime[1];
		arrReturn[5] = arrTime[2];
		return arrReturn;
	},
	
	JoinDatetime : function(year,mon,day,hour,min,sec) {
		return year+"-"+mon+"-"+day+" "+hour+":"+min+":"+sec;
	}	
}

cDatetime = new ClassDatetime;
﻿ClassDebug = function() {
	this.div_id = "DivDebug";
	this.div_x = "0";
	this.div_y = "0";
	this.div_width = "400";
	this.div_height = "400";
	this.div_backgroundColor = "#FFFFFF";
	this.div_border = "2px solid #000000";
	this.div_remove_flag = true;
	this.act = true;
	this.starttime = 0;
	this.endtime = 0;
}

ClassDebug.prototype = {
	// 생성
	Create : function() {
		if(this.act) {
			this.div.style.display = "";
		} else {
			this.div.style.display = "none";			
		}
		
		// 삽입하기
		document.body.appendChild(this.div);
	},
	
	// 소멸
	Remove : function() {
		this.div.removeNode(true);
	},
	
	// 내용 추가
	Insert : function(str) {
		this.div.innerHTML += str+"<br>";
	},

	// 현재 시간 구하기
	GetTime : function(act){
		var today = new Date();
		var time = today.getTime();
		switch(act) {
			case "start":
				this.starttime = time;
				break;
			case "end":
				this.endtime = time;
				break;
		}
	},

	// 처리시간 
	CalcTime : function() {
		return (this.endtime-this.starttime)/1000;
	},
	
	// 생성자
	ClassDebug : function() {
		var div = document.createElement("div");
		div.id = this.div_id;
		div.style.position = "absolute";
		div.style.top = this.div_y;
		div.style.left = this.div_x;
		div.style.width = this.div_width;
		div.style.height = this.div_height;
		div.style.backgroundColor = this.div_backgroundColor;
		div.style.border = this.div_border;
		
		// 이벤트 정의
		div.div_remove_flag = this.div_remove_flag;
		div.debug_class = this;
		div.onclick = function() {
			if(this.div_remove_flag) {
				this.debug_class.Remove();
			}
		}
		
		// 멤버변수로 재정의
		this.div = div;		
	}
}
﻿ClassEditor = function() {
	this.EditorName = "";
	this.iframe = "";
	this.strPrev = "";
	this.styleBase = "<style>p{margin:0px;} body,td,p {font-family: '굴림','arial';font-size:9pt;color:#585858;}</style>";
	this.url_editor = "";
	this.url_upload = "";
	this.mode = "html";
	this.filename = "";
	this.file_media = "";
}

ClassEditor.prototype = {
	Create : function() {
		// 아이프레임명 지정
		this.iframe = "iframeEditor"+this.EditorName;
		
		this.strPrev = $("textareaEditor"+this.EditorName).value;
		
		// 새문서
		this.New();
	},
	
	// 새창 열기
	OpenWindow : function(url,width,height) {
		if(typeof(this.newWindow) == "object") {
			this.newWindow.close();
		}
		this.newWindow = window.open(url,"PopupEditor","width="+width+",height="+height+"");
		//this.newWindow = window.showModalDialog(url,"dialogWidth:"+(width)+"px;dialogHeight:"+(height)+"px;status:no;help:no");
	},
	
	// HTML 붙여넣기
	HTMLPaste : function(val) {
		ostmp = navigator.appName.charAt(0);
		if(ostmp=='M') os = ''; else if(ostmp=='N') os = 1; else os = 2;
		$(this.iframe).contentWindow.focus();			
		if(!os){
			past = $(this.iframe).contentWindow.document.selection.createRange();
			past.pasteHTML(val);
		} else if(os==1) {
			$(this.iframe).contentWindow.document.execCommand("inserthtml",false,val);
		} else {
			return;
		}
	},
	
	// HTML 저장
	HTMLSave : function() {
		if(this.mode == "html") {
			this.content = $(this.iframe).contentWindow.document.body.innerHTML;		
		} else {
			this.content = $("textareaEditor"+this.EditorName).value;		
		}
		return encodeURIComponent(this.content);
	},
	
	// 에디터 모드로 강제 변경
	ChangeEditorMode : function() {
		if(this.mode == "text") this.EditHtml();
	},

	//  새문서
	New : function() {
		this.ChangeEditorMode();
		with($(this.iframe).contentWindow) {
			focus();
			document.open("text/html");
			document.writeln(this.styleBase);
			document.writeln(this.strPrev);
			document.close();
			document.designMode = "on";					
		}
	},
	
	// 잘라내기
	Cut : function() {
		this.ChangeEditorMode();
		$(this.iframe).contentWindow.focus();		
		document.execCommand("cut",false,null);
	},
	
	// 복사
	Copy : function() {
		this.ChangeEditorMode();
		$(this.iframe).contentWindow.focus();		
		document.execCommand("copy",false,null);		
	},
	
	// 붙여넣기
	Paste : function() {
		this.ChangeEditorMode();
		$(this.iframe).contentWindow.focus();		
		document.execCommand("paste",false,null);		
	},
	
	// 내어쓰기
	Outdent : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("outdent",false,null);		
	},
	
	// 들여쓰기
	Indent : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("indent",false,null);		
	},
	
	// 윗첨자
	SuperScript : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("superscript",false,null);		
	},
	
	// 아랫첨자
	SubScript : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("subscript",false,null);		
	},
	
	// 다시실행
	Redo : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("redo",false,null);		
	},
	
	// 되살리기
	Undo : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("undo",false,null);		
	},
	
	// 왼쪽정렬
	AlignLeft : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("justifyleft",false,null);		
	},
	
	// 가운데정렬
	AlignCenter : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("justifycenter",false,null);		
	},
	
	// 오른쪽정렬
	AlignRight : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("justifyright",false,null);		
	},
	
	// 번호리스트
	ListNumber : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("insertorderedlist",false,null);		
	},
	
	// 점리스트
	ListDot : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("insertunorderedlist",false,null);		
	},
	
	// 수평선
	Line : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("inserthorizontalrule",false,null);		
	},	
	
	// 진하게
	Bold : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("bold",false,null);		
	},
	
	// 기울이기
	Italic : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("italic",false,null);		
	},
	
	// 가운데줄
	Strike : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("strikethrough",false,null);		
	},
	
	// 밑줄
	Under : function() {
		this.ChangeEditorMode();		
		$(this.iframe).contentWindow.focus();		
		document.execCommand("underline",false,null);		
	},
	
	// 폰트
	FontSelect : function(val) {
		$(this.iframe).contentWindow.focus();	
		document.execCommand("fontname",false,val);				
		this.newWindow.close();
	},
	
	FontOpen : function() {
		this.ChangeEditorMode();		
		this.OpenWindow(this.url_editor+"/font.php?EditorName="+this.EditorName,290,270);
	},
	
	FontClose : function() {
		this.newWindow.close();
	},
	
	// 사이즈
	SizeSelect : function(val) {
		$(this.iframe).contentWindow.focus();	
		document.execCommand("fontsize",false,val);				
		this.newWindow.close();
	},
	
	SizeOpen : function() {
		this.ChangeEditorMode();		
		this.OpenWindow(this.url_editor+"/size.php?EditorName="+this.EditorName,290,170);
	},
	
	SizeClose : function() {
		this.newWindow.close();
	},
	
	// 글자,배경색
	ColorSelect : function(val) {
		$(this.iframe).contentWindow.focus();	
		document.execCommand(this.color_type,false,val);
		this.newWindow.close();
	},
	
	ColorOpen : function(type) {
		this.ChangeEditorMode();
		this.color_type = type;
		this.OpenWindow(this.url_editor+"/color.php?EditorName="+this.EditorName,290,260);
	},
	
	ColorClose : function() {
		this.newWindow.close();
	}, 
	
	// 링크
	LinkSelect : function() {
		val = this.newWindow.document.getElementById("type").value+this.newWindow.document.getElementById("url").value;
		$(this.iframe).contentWindow.document.execCommand("CreateLink",false,val);
		this.newWindow.close();
	},
	
	LinkOpen : function(type) {
		this.ChangeEditorMode();		
		this.OpenWindow(this.url_editor+"/link.php?EditorName="+this.EditorName,290,60);
	},
	
	LinkClose : function() {
		this.newWindow.close();
	},
	
	// 문자표
	SpecialSelect : function(val) {
		this.HTMLPaste(val);
		this.newWindow.close();
	},
	
	SpecialOpen : function(type) {
		this.ChangeEditorMode();		
		this.OpenWindow(this.url_editor+"/special.php?EditorName="+this.EditorName,290,260);
	},
	
	SpecialClose : function() {
		this.newWindow.close();
	},

	// 이모티콘
	EmoticonSelect : function(val) {
		this.HTMLPaste("<img src=\""+this.url_editor+"/images/emoticon/"+val+"\">");
		this.newWindow.close();
	},
	
	EmoticonOpen : function(type) {
		this.ChangeEditorMode();		
		this.OpenWindow(this.url_editor+"/emoticon.php?EditorName="+this.EditorName,290,170);
	},
	
	EmoticonClose : function() {
		this.newWindow.close();
	},
	
	// 테이블삽입	
	TableSelect : function() {
		// 변수 저장
		border = this.newWindow.document.getElementById("border").value;
		cellspacing = this.newWindow.document.getElementById("cellspacing").value;	
		cellpadding = this.newWindow.document.getElementById("cellpadding").value;	
		widthSize = this.newWindow.document.getElementById("width").value;
		widthExt = this.newWindow.document.getElementById("widthExt").value;
		alignment = this.newWindow.document.getElementById("alignment").value;
		rows = this.newWindow.document.getElementById("rows").value;
		cols = this.newWindow.document.getElementById("cols").value;
		
		// 태그 생성
		val = "<table border=\""+border+"\" cellspacing=\""+cellspacing+"\" cellpadding=\""+cellpadding+"\" width=\""+widthSize+widthExt+"\" align=\""+alignment+"\">";
		for(i=0;i<eval(rows);i++) {
			val += "<tr>";
			for(j=0;j<eval(cols);j++) {
				val += "<td>";
				val += "&nbsp;";
				val += "</td>";
			}
			val += "</tr>";
		}
		val += "</table>";
		
		this.HTMLPaste(val);
		this.newWindow.close();
	},
	
	TableOpen : function(type) {
		this.ChangeEditorMode();
		this.OpenWindow(this.url_editor+"/table.php?EditorName="+this.EditorName,290,150);
	},
	
	TableClose : function() {
		this.newWindow.close();
	},
	
	// HTML 수정
	EditHtml : function() {
		if(this.mode == "html") {
			this.mode = "text";
			$(this.iframe).style.display = "none";
			$("textareaEditor"+this.EditorName).style.display = "";
			$("textareaEditor"+this.EditorName).value = this.content = $(this.iframe).contentWindow.document.body.innerHTML;			
		} else {
			this.mode = "html";	
			$(this.iframe).style.display = "";
			$("textareaEditor"+this.EditorName).style.display = "none";
			$(this.iframe).contentWindow.document.body.innerHTML = $("textareaEditor"+this.EditorName).value;			
		}
	},
	
	// 미리보기
	PreviewOpen : function(type) {
		this.HTMLSave();
		this.newWindow = window.open(this.url_editor+"/preview.php?EditorName="+this.EditorName,"PopupEditor","width=800,height=600,scrollbars=yes");
	},
	
	PreviewClose : function() {
		this.newWindow.close();
	},
	
	// 이미지업로드
	UploadSelect : function() {
		var opt = "";		
		if(this.upload_type == "image") {
			if(this.width.length > 0) {
				opt += " width=\""+this.width+"\"";
			}
			if(this.align.length > 0) {
				opt += " align=\""+this.align+"\"";
			}
			this.HTMLPaste("<img src=\""+this.url_upload+"/"+this.filename+"\" "+opt+">");
		} else {
			if(this.width.length > 0) {
				opt += " width=\""+this.width+"\"";
			}			
			this.HTMLPaste("<embed src=\""+this.url_upload+"/"+this.filename+"\" autostart=\"true\" loop=\"true\""+opt+"></embed>");
		}
		this.newWindow.close();
	},
	
	UploadOpen : function(type) {
		this.ChangeEditorMode();		
		this.upload_type = type;
		this.OpenWindow(this.url_editor+"/upload.php?EditorName="+this.EditorName+"&type="+type,290,260);
	},
	
	UploadClose : function() {
		this.newWindow.close();
	}
}
﻿ClassEvent = function() {
	var obj;
	var maxLen;
	var nextObj;
	var bNumberCheck;
	var bDelete;
}

ClassEvent.prototype = {
	Create : function() {
		if(this.bDelete) {
			this.obj.onclick = function() {
				this.value = "";
			}
		}
		
		if(this.bNumberCheck) {
			this.obj.onkeydown = function() {
				cBaseCheckEvent = new ClassBaseCheck;
				if(!cBaseCheckEvent.OnlyNumber(this)) {
					return false;
				}
			}			
		}

		if(this.maxLen > 0 && typeof(this.nextObj) == "object") {
			this.obj.onkeydown = function() {
				cBaseCheckEvent = new ClassBaseCheck;
				if(!cBaseCheckEvent.OnlyNumber(this)) return false;
			}
		}

		this.obj.maxLen = this.maxLen;
		this.obj.nextObj = this.nextObj;
		this.obj.onkeyup = function() {
			if(this.value.length >= this.maxLen) {
				this.nextObj.focus();
			}
		}
	},
	
	DenyMouseRightButton : function() {
		document.onmousedown = function() {
			if(event.button == 2) {
				alert("오른쪽 마우스 버튼은 사용할 수 없습니다.");
			}
		}
	}
}

cEvent = new ClassEvent;
﻿ClassFlash = function() {
	this.filename = "";
	this.width = "";
	this.height = "";
	this.id = "";
	this.display = "";

}

ClassFlash.prototype = {
	Create : function() {
		if(this.id.length == 0) {
			var PropertyId = "";
		} else {
			var PropertyId = " id=\""+this.id+"\"";
		}
		var PropertyDisplay = "style=\"display:"+this.display+"\"";
		document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\""+this.width+"\" height=\""+this.height+"\""+PropertyId+PropertyDisplay+">");
		document.write("<param name=\"movie\" value=\""+this.filename+"\">");
		document.write("<param name=\"quality\" value=\"high\">");
		document.write("<embed src=\""+this.filename+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+this.width+"\" height=\""+this.height+"\" wmode=\"transparent\"></embed>");
		document.write("<param name=\"wmode\" value=\"transparent\">");
		document.write("</object>");

		this.filename = "";
		this.width = "";
		this.height = "";
		this.id = "";
	}
}

cFlash = new ClassFlash;
﻿ClassLocation = function() {
	this.url = "";
	this.arrQuerystring = new Array();
	this.arrParse = new Array();
	this.target_iframe = null;
	this.target_frame = null;
}

ClassLocation.prototype = {
	// URL 이동하기
	Go : function() {
		for(i=0,str="";i<this.arrQuerystring.length;i++) {
			if(i == 0) {
				comma = "?";
			} else {
				comma = "&";
			}
			str += comma+this.arrQuerystring[i]
		}
		
		if(this.target_iframe !== null) {
			this.target_iframe.contentWindow.location.href = this.url+str;			
		} else if(this.target_frame !== null) {			
			this.target_frame.src = this.url+str;					
		} else {
			location.href = this.url+str;			
		}
		
		this.Reset();
	},
	
	// POST 처리
	Post : function(target) {
		var form = document.createElement("form");		
		for(i=0;i<this.arrParse.length;i++) {
			var Row = this.arrParse[i].split("=");
			var input = document.createElement("<input name='"+Row[0]+"'>");
			input.type = "hidden";
			input.value = Row[1];
			
			form.appendChild(input);
		}
		
		// 객체 추가 후 전송
		document.body.appendChild(form);
		form.method = "POST";
		form.action = this.url;
		form.target = target;
		form.submit();
		
		// 객체 제거
		document.body.removeChild(form);
		
		// 객체 리셋
		this.Reset();
	},	
	
	// 멤버변수 리셋
	Reset : function() {
		this.url = "";
		this.arrQuerystring = new Array();
		this.arrParse = new Array();
		this.target_iframe = null;
	},
	
	// 쿼리 추가
	AddQuerystring : function(str) {
		this.arrQuerystring[this.arrQuerystring.length] = str;
	},
	
	// 파라메터 추가
	AddParse : function(str) {
		this.arrParse[this.arrParse.length] = str;
	},
	
	// 파라메터 생성
	MakeParse : function() {
		for(i=0,str="";i<this.arrParse.length;i++) {
			if(i == 0) {
				comma = "";
			} else {
				comma = "&";
			}
			str += comma+this.arrParse[i]
		}
		this.Reset();
		return str;
	},
	
	// 경로 생성
	MakePath : function() {
		str = this.MakeParse();	
		result = this.url+"?"+str;
		this.Reset();
		return result;
	}
}

cLocation = new ClassLocation;
﻿ClassLog = function() {
	this.url = cCommon.action+"?e=utility_log";
}

ClassLog.prototype = {
	// 로그 이미지 삽입
	CreateImage : function() {
		// 이미지 객체 생성
		var img = document.createElement("img");

		// 이미지 객체 설정
		var url = this.url;
		url += "&url="+encodeURIComponent(location.href);
		url += "&referer="+encodeURIComponent(document.referrer);
		img.src = url;
		img.style.display = "none";
	},

	// 생성자
	ClassLog : function() {
		setTimeout("cLog.CreateImage();",1000);
	}
}
﻿ClassObject = function() {
}

ClassObject.prototype = {
	// 폼내의 모든 객체명 쿼리 형식으로 변경
	FormToStr : function(form) {
		var pars;
		for(i=0,pars="";i<$(form).length;i++) {
			pars += "&"+form[i].name+"="+form[i].value;
		}
		return pars;
	},
	
	// 라디오버튼 값 구하기
	GetValueRadio : function(objname) {
		var obj = document.getElementsByName(objname);
		val = "";
		if(obj.length == 0) {
			if(obj.checked) {
				val = obj.value;
			}
		} else {
			for(i=0;i<obj.length;i++) {
				if(obj[i].checked) {
					val = obj[i].value;
				}
			}
		}
		return val;
	},
	
	// 체크박스 값 구하기
	GetValueCheckbox : function(objname) {
		var obj = document.getElementsByName(objname);

		val = "";
		if(obj.length == 0) {
			if(obj.checked) {
				val = obj.value;
			}
		} else {
			for(i=0;i<obj.length;i++) {
				if(obj[i].checked) {
					if(val.length == 0) {
						comma = "";
					} else {
						comma = ",";
					}
					val += comma+obj[i].value;
				}
			}
		}
		return val;
	},
	
	// 값 비교해서 체크박스  체크하기
	PutValueCheckbox : function(objName,val) {
		arrObj = document.getElementsByName(objName);
		arrVal = val.split(",");
		if(arrObj.length == 0) {
			for(j=0;j<arrVal.length;j++) {
				if(arrVal[j] == arrObj.value) {
					arrObj.checked = true;
				}
			}
		} else {
			for(i=0;i<arrObj.length;i++) {
				for(j=0;j<arrVal.length;j++) {
					if(arrVal[j] == arrObj[i].value) {
						arrObj[i].checked = true;
					}
				}			
			}
		}
	},
	
	// 셀렉트박스 값 리셋
	SelectReset : function(obj) {
		obj.options.length=0;
	},
	
	// 셀렉트박스에 옵션값 추가
	SelectAdd : function(obj,val,text) {
		var Option = document.createElement("OPTION");
		Option.innerHTML = text;
		Option.value = val;
		obj.appendChild(Option);							
	},

	// 셀렉트박스 값 선택
	SelectSelect : function(obj,val) {
		var arr = obj.getElementsByTagName("option");
		for(var i=0;i<arr.length;i++) {
			var Row = arr[i];

			if(Row.value == val) {
				arr[i].selected = true;
			}
		}
	},

	// 아이프레임 내용 사이즈로 변경
	ResizeIframe : function(obj){
		var innerBody = obj.contentWindow.document.body;
		var innerHeight = innerBody.scrollHeight + (innerBody.offsetHeight - innerBody.clientHeight);
		obj.style.height = innerHeight+100;
	}
}

cObject = new ClassObject;
﻿ClassProgress = function() {
	this.flag = true;
}

ClassProgress.prototype = {
	Show : function() {
		document.body.appendChild(this.div);
		var obj = document.getElementById("DivProgress");
		obj.style.top = (document.body.clientHeight/2)+document.body.scrollTop-234;
		obj.style.left = (document.body.clientWidth/2)+document.body.scrollLeft-232;		
		obj.style.display = "";
	},

	Hide : function() {
		// 감추기
		var obj = $("DivProgress");
		obj.style.display = "none";		
		document.body.removeChild(this.div);

		// 플래그 리셋
		this.flag = true;
	},

	// 한번 실행
	Once : function() {
		if(this.flag) {
			this.flag = false;
			return true;
		}
		return false;
	},
	
	CreateObject : function() {
		// 이미지 설정
		var img = document.createElement("img");
		img.src = cCommon.base_url+"/external/JKC_Library_1.0/images/ani_progress.gif";

		// 플래시 설정
		var cProgressFlash = new ClassFlash();
		cProgressFlash.width = "234";
		cProgressFlash.height = "232";
		cProgressFlash.filename = cCommon.base_url+"/external/JKC_Library_1.0/images/ani_progress.swf";
		cProgressFlash.id = "ObjectProgress";
		cProgressFlash.display = "none";
		cProgressFlash.Create();

		var flash= $("ObjectProgress").cloneNode(true);
		flash.style.display = "";

		// 레이어 설정
		var div = document.createElement("div");
		div.id = "DivProgress";
		div.style.position = "absolute";
		div.style.display = "none";
		//div.appendChild(img);
		div.appendChild(flash);
		this.div = div;
	},

	ClassProgress : function() {
		cProgress.CreateObject();
	}
}

cProgress = new ClassProgress;
﻿ClassQuickbar = function() {
	this.div = null;
	this.align = "left";
	this.width = 600;
	this.top = 50;
}

ClassQuickbar.prototype = {
	Position : function() {
		// 정렬별 x 좌표
		switch(this.align) {
			case "left":
				var x = this.width;
				break;
			case "center":
				var x = this.width+(document.body.clientWidth-this.width)/2;
				break;
		}

		// 위치 지정
		this.div.style.position = "absolute";
		this.div.style.display = "";
		this.div.style.left = x;
		this.div.style.top = this.top;
	},
	
	Scroll : function() {
		this.Position();
		this.Move();
	},
	
	Move : function() {
		this.div.style.top = (document.body.scrollTop+this.top)+"px";
		setTimeout("cQuickbar.Move();",100);
	}
}

cQuickbar = new ClassQuickbar;
﻿ClassRolling = function() {
}

ClassRolling.prototype = {
	// 롤링 시작
	Start : function() {
		// 브레이크 포인트
		if(this.breakevent) {
			return;
		}

		// 변수 정의
		var direction = this.direction;
		var bDelay = false;
		var px_move = this.px_move;
		var obj = this.obj;
		var width = this.width;
		var height = this.height;
		var bStop = this.bStop;
		
		// 롤링 방향별 처리
		switch(direction) {
			case "down":
				// 마지막 스크롤일 경우
				if(obj.scrollTop  >= obj.scrollHeight-obj.clientHeight) {
					this.bStop = true;
					bDelay = true;
					obj.scrollTop = 0;
				} else if(obj.scrollTop%height == 0&& !bStop) { // 멈추는 부분
					this.bStop = true;
					bDelay = true;
				} else { // 움직이는 부분
					this.bStop = false;
					bDelay = false;
				}
				break;
			case "up":
				// 처음 스크롤일 경우
				if(obj.scrollTop  == 0) {
					this.bStop = true;
					bDelay = true;
					obj.scrollTop = obj.scrollHeight-obj.clientHeight;
				} else if(obj.scrollTop%height == 0&& !bStop) { // 멈추는 부분
					this.bStop = true;
					bDelay = true;
				} else { // 움직이는 부분
					this.bStop = false;
					bDelay = false;
				}
			case "right":
				// 마지막 스크롤일 경우
				if(obj.scrollLeft >= obj.scrollWidth-obj.clientWidth) {
					this.bStop = true;
					bDelay = true;
					obj.scrollLeft = 0;
				} else if(obj.scrollLeft%width == 0&& !bStop) { // 멈추는 부분
					this.bStop = true;
					bDelay = true;
				} else { // 움직이는 부분
					this.bStop = false;
					bDelay = false;
				}
				break;
			case "left":
				// 처음 스크롤일 경우
				if(obj.scrollLeft  == 0) {
					this.bStop = true;
					bDelay = true;
					obj.scrollLeft = obj.scrollWidth-obj.clientWidth;
				} else if(obj.scrollLeft%width == 0&& !bStop) { // 멈추는 부분
					this.bStop = true;
					bDelay = true;
				} else { // 움직이는 부분
					this.bStop = false;
					bDelay = false;
				}
				break;

		}

		// 멈추기 or 움직이기
		if(bDelay) {
			setTimeout(this.id+".Start();",this.delay);
		} else {
			this.Move(direction,px_move);
			setTimeout(this.id+".Start();",this.delay_short);
		}
	},

	// 이동
	Move : function(direct,px) {
		// 변수정의
		var obj = this.obj;
		var pos = "";
		switch(direct) {
			case "up":
				pos = obj.scrollTop-px;
				break;
			case "down":
				pos = obj.scrollTop+px;
				break;
			case "left":
				pos = obj.scrollLeft-px;
				break;
			case "right":
				pos = obj.scrollLeft+px;
				break;			
		}

		// 스크롤 위치 변경
		if(direct == "up" || direct == "down") {
			obj.scrollTop = pos;
		} else {
			obj.scrollLeft = pos;
		}
	},

	// 디버그
	Debug : function(name,val) {
		document.getElementById("DivDebug").innerHTML += "<br>"+name+" : "+val;
	},

	// 생성자
	ClassRolling: function(obj) {
		// 멤버변수 설정
		this.obj = document.getElementById(obj);
		this.width = 800;
		this.height = 200;
		this.direction = "down";
		this.top = 0;
		this.delay = 3000;
		this.delay_short = 100;
		this.px_move = 100;
		this.breakevent = false;
		this.bStop = false;

		// 롤링 시작
		this.Start();
	}
}
﻿ClassString = function() {
}

ClassString.prototype = {
	// 콤마찍기 함수
	AddComma : function(number) {
		number = ""+number+"";
		var CommaNumber = "";
		for(i=0;i<number.length; i++) {
			if(i > 0 && (i%3)==0) {
				CommaNumber = number.charAt(number.length - i -1) + "," + CommaNumber;
			} else {
				CommaNumber = number.charAt(number.length - i -1) + CommaNumber;
			}
		}
		return CommaNumber;
	} 
}

cString = new ClassString;
﻿ClassXml = function() {
}

ClassXml.prototype = {
	// 노드값 구하기
	GetValue : function(obj,name) {
		if(obj.getElementsByTagName(name)[0].hasChildNodes()) {
			if(obj.getElementsByTagName(name)[0].childNodes[0].nodeValue.length > 0) {
				return obj.getElementsByTagName(name)[0].childNodes[0].nodeValue;
			}
		}
		return "";
	},
	
	// 자식노드 구하기
	GetChildNodes : function(todo) {
		if(todo.hasChildNodes()) {
			var result = new Array();
			var myRe = /^[\s](1,)$/gi;
			for(var i=0;i<todo.childNodes.length;i++) {
				if(todo.childNodes[i].nodeType == 3) {
					if(todo.childNodes[i].nodeValue.replace(/\s/gi,"") != "") {
						result.push(todo.childNodes[i]);
					}
				} else {
					result.push(todo.childNodes[i]);
				}
			}
			return result;
		} else {
			return null;
		}		
	},
	
	// XML을 XSL로 처리
	XSLTransform : function(xmlNode,xslDoc) {
		if(xslDoc == null) {
			var xslUrl = getXslUrl(xmlNode);
			if(xslUrl === null) return null;
			var xslDoc = createXmlDocumentFromURL(xslUrl);
			if(xslDoc == null) return null;
		}
		if(typeof(xmlNode.transformNodeToObject) != "undefined") {
			var result = new ActiveXObject("Msxml2.DOMDocument.3.0");
			xmlNode.transformNodeToObject(xslDoc,result);
			if(result.parseError != 0) return null;
			else return result;
		} else {
			var processor = new XSLTProcessor();
			processor.importStylesheet(xslDoc);
			var result = processor.transformToDocument(xmlNode);
			if(result.documentElement.nodeName == "parseerror") return null;
			else return result;
		}
	},

	// URL로 부터 XML 문서 생성
	createXmlDocumentFromURL : function(toGet) {
		if(typeof(ActiveXObject) == "function") {
			var result = new ActiveXObject("Msxml2.DOMDocument.3.0");
			result.validateOnParse = false;
			result.async = false;
			result.load(toGet);
			if(result.parseError.errorCode == 0) {
				return result;
			} else {
				var message = "에러가 발생했습니다. (";
				message += "errorCode : "+result.parseError.errorCode+", ";
				message += "reason : "+result.parseError.reason+").";
				alert(message);
				return null;
			}
		} else {
			var result = self.document.implementation.createDocument("","",null);
			result.async = false;
			result.load(toGet);
			if(result.documentElement.nodeName == "parseerror") {
				var message = "에러가 발생했습니다 (";
				message += result.documentElement.childNodes[0].nodeValue+".";
				alert(message);
				return null;
			} else {
				return result;
			}
		}
	},

	// XML 객체를 문자열로 변경
	toString : function(xmlObject) {
		if(typeof(xmlObject.xml) != "undefined") {
			return xmlObject.xml;
		} else {
			serializer = new XMLSerializer();
			return serializer.serializeToString(xmlObject);
		}
	},

	// XSL 경로 파싱
	getXslUrl : function(xmlDocument) {
		if(xmlDocument.nodeType != 9) return null;
		for(var i=0;i<xmlDocument.childNodes.length;i++) {
			if(xmlDocumnet.childNodes[i].nodeName == "xml-stylesheet") {
				var myRe = /href\s*\=\s*[\"\'](^\"\']+)[\"\']/;
				var result = myRe.exec(xmlDocument.childNodes[i].nodeValue);
				if(result != null) return result[1];
				else return null;
			}
		}
	},
	
	// 문자열로 XML 개체 생성
	createXmlDocumentFromString : function(str) {
		if(typeof(ActiveXObject) == "function") {
			var result = new ActiveXObject("Msxml2.DOMDocument.3.0");
			result.validateOnParse = false;
			result.loadXML(str);
			return result;
		} else {
			var parser = new DOMParser();
			return parser.parseFromString(str,"text/xml");
		}
	}
}

cXml = new ClassXml;