//<![CDATA[
var oldTarget, oldAction;
function openReportWindow() {
	if (validate_data()) {
		var form = document.forms[0];
		oldTarget = form.target;
		oldAction = form.action;
		form.target = 'windReport';
		open_report('about:blank');
		sessionTimeout();
		window.setTimeout('document.forms[0].target=oldTarget;document.forms[0].action=oldAction;', 200);
		return true;
	}
	return false;
}

function open_report(report, width, height)
{
	var optString = 'toolbar=no,menubar=no,resizable=yes,location=no,scrollbars=yes,status=no';
	
	if (width != undefined) {
		optString += ',width=' + width;
	}
		
	if (height != undefined) {
		optString += ',height=' + height;
	}
	
	try
	{
		var wind = window.open(report, 'windReport', optString, true);
		if (wind == null) {
			throw new Error("Failed to create report window.\n\nThe window may have been\nblocked by a popup blocker.");
		}
		else {
			try{
				wind.focus();
			}
			catch(ex){
				//Do nothing as this is typically a race condition when 
				//going from a pdf report presentation to an html presentation.
				//No harm in ignoring an error on wind.focus().
			}
		}
	}
	catch(er) { alert(er.description); }
}
//]]>
