
function ReportInfo() {

	this.title      = "";
	this.reportName = "";
	this.width      = 1024;
	this.height     = 768;
	this.zoomRatio  = 100;

	this.hideStatusBar = false;
	this.hideToolBar = false;
	this.hideStatusDlg = false;

	/**
	 *
	 */
	this.reportOption = "/rf";

	this.params = new ValueObject();
	this.getParams = function() { return this.params; }
	this.setParams = function(p_vo) { this.params = p_params; }

	this.set = function(p_value) {
		if( this.params != null )
			this.params.set("P_" + this.params.getSize(), p_value);
	}


	this.showPopup = function() {
	    var inWidth  = this.width; 	
		var inHeight = this.height;

		var x = screen.availWidth;	
		var y = screen.availHeight;

		var xtop = Number((y - inHeight)/2);	
		var xleft = Number((x - inWidth)/2);

		var url = "/dialog/dlgReport.screen?" + this.getParameter();

	    window.open(url, '_blank', "top="+xtop+",left="+xleft+",width="+inWidth+",height="+inHeight+",SCROLLBARS=NO");
	}
	
	this.showPopupDebug = function() {
	    var inWidth  = this.width; 	
		var inHeight = this.height;

		var x = screen.availWidth;	
		var y = screen.availHeight;

		var xtop = Number((y - inHeight)/2);	
		var xleft = Number((x - inWidth)/2);

		var url = "/dialog/dlgReportDebug.screen?" + this.getParameter();

	    window.open(url, '_blank', "top="+xtop+",left="+xleft+",width="+inWidth+",height="+inHeight+",SCROLLBARS=NO");
	}

	this.showFrame = function(frameObject) {
		if( frameObject == null )
			alert("FrameObject is null.");

		if( frameObject.src == null )
			alert("FrameObject.src is null.");

		frameObject.src = "/dialog/dlgReport.screen?" + this.getParameter();
	}

	this.getParameter = function() {
		var params_str = "&WINDOW_TITLE="    + encodeURIComponent(this.title)
	    	           + "&REPORT_NAME="     + encodeURIComponent(this.reportName)
		               + "&REPORT_OPTION="   + encodeURIComponent(this.reportOption)
		               + "&HIDE_STATUS_BAR=" + this.hideStatusBar
		               + "&HIDE_TOOL_BAR="   + this.hideToolBar
		               + "&ZOOM_RATIO="      + this.zoomRatio
		               + "&HIDE_STATUS_DLG=" + this.hideStatusDlg;

		for( var i = 0 ; i < this.params.getSize() ; i++ ) {
			params_str += "&P_" + i + "=" + encodeURIComponent(this.params.getValue(i));
		}

		params_str += "&P_SIZE=" + this.params.getSize();
		
		return params_str;
	}
}