function cls_ezview() {
	// 변환 체크 시간 3초
	this.refreshTime = 3000;

	// 변환 여부 체크 할지 말지
	this.call = true;

	this.instance = ""; // 인스턴스 이름

	// 파일 다운로드 받을 주소
	this.url;

	// 파일 생성 날짜 (선택사항)
	// yyyyMMddHHmmss 형식
	// 예) 20090203112302
	this.fdate;

	// 진행상태를 물어볼 주소
	this.progress_url;

	// 미리보기 페이지 주소
	this.viewpage_url;

	// 상태값
	this.STATUS_WAIT;
	this.STATUS_PDFCONVERTING;
	this.STATUS_IMAGECONVERTING;
	this.STATUS_COMPLETE;
	this.STATUS_ERROR;

	// 진행상태 UI반전을 위해서
	this.v1 = 0;

	// 결과를 출력할 object;
	this.outObj;

	// 페이지 미리보기
	this.view = function(fdate) {
		if (fdate == null) {
			fdate = "";
		}
		jf_openWindow(this.viewpage_url + "?url="
				+ encodeURIComponent(this.url) + "&fdate=" + fdate,
				'docuemntView', 'yes', 'yes', 1100, 880, 1, 1, 1);
	}

	// 이벤트 처리
	this.viewProc = function(responseXML) {
		// 서버측에서 보낸 응답 처리
		// 전달 받은 데이터를 이용하여 UI 처리
		var xml = responseXML.getElementsByTagName("result");

		// 접속 에러
		if (xml[0] == null) {
			this.error(404);
			return;
		}
		var result = xml[0].childNodes[0].nodeValue;
		var out;
		switch (result) {
		case this.STATUS_WAIT:
			out = "<img src='/app_addition/ezview/ez_download.gif' alt='다운로드'/>";
			break;
		case this.STATUS_PDFCONVERTING:
			out = "<img src='/app_addition/ezview/ez_convert_pdf.gif' alt='PDF변환중'/>";
			break;
		case this.STATUS_IMAGECONVERTING:
			if (this.v1 == 0) {
				this.v1 = 1;
				out = "<img src='/app_addition/ezview/ez_convert_img1.gif' alt='이미지 변환중'/>";
			} else {
				this.v1 = 0;
				out = "<img src='/app_addition/ezview/ez_convert_img2.gif' alt='이미지 변환중'/>";
			}
			break;
		case this.STATUS_COMPLETE:
			out = "<a href=\"#\" onclick=\"";
			if (this.fdate == null) {
				out += this.instance + ".view();";
			} else {
				out += this.instance + ".view('" + this.fdate + "');";
			}
			out += "return false;\" onkeypress='if(event.keyCode==13){this.onclick();}'><img src='/app_addition/ezview/ez_complete.gif' border='0' alt='미리보기'/></a>";

			this.call = false;
			break;
		case this.STATUS_ERROR:
			out = "<img src='/app_addition/ezview/ez_error.gif' alt='변환에러' style='display:none;'/>";
			this.call = false;
			break;
		}
		if (this.outObj != null) {
			this.outObj.innerHTML = out;
		}
	}

	// 서버 접속 에러 처리
	this.error = function(status) {
		this.outObj.innerHTML = "<img src='/app_addition/ezview/ez_error.gif' alt='변환에러' style='display:none;'/><font color='white'>"
				+ status + "</font>";
		this.call = false;
	}

	// 진행사항 체크
	this.refresh = function() {
		if (this.call) {
			var param = "url=" + encodeURIComponent(this.url) + "&fdate="
					+ this.fdate;
			var result = jf_xmlHttpPostUserError(this.progress_url, param,
					this.instance + ".viewProc", this.instance + ".error", true);

			if (result == -1) {
				this.call = false;
			} else {
				setTimeout(this.instance + ".refresh()", this.refreshTime);
			}
		}
	}
}

