function OpenReport(strRptName, objParams, blnDebugMode, blnAllInputsFromDocument)
{
	var newWindow = {};
	var oNewDoc = {};

	var m = strRptName.match(/(.*)[\/\\]([^\/\\]+\.\w+)$/);
	var strWinName = m[2].replace(/./g, '_');
		
	var strHtmlWaitMsg = '<div align="center"><table><tr><td align="center"><h2>Apertura del report in corso...<br>Attendere, prego...</h2></td></tr><tr><td align="center"><img src="../images/pleaseWaitRound.gif"></td></tr></table></div>'
	var strWParams = 'channelmode=0,directories=0,fullscreen=0,height=600,left=100,location=0,menubar=0,resizable=1,scollbars=1,status=1,titlebar=0,toolbar=0,top=100,width=800';
		
	if (newWindow[strWinName] && !newWindow[strWinName].closed) {
		newWindow[strWinName] = window.open('',strWinName,'');
		newWindow[strWinName].close();
		newWindow[strWinName] = null;
	} 
	newWindow[strWinName] = window.open('about:blank', strWinName, strWParams);
	try 
	{
		oNewDoc[strWinName] = newWindow[strWinName].document.open();
	}
	catch (err)
	{
		newWindow[strWinName] = window.open('',strWinName,'');
		oNewDoc[strWinName] = newWindow[strWinName].document.open();
	}
		
	newWindow[strWinName].focus();
		
	oNewDoc[strWinName].write(strHtmlWaitMsg);
		
	if (blnDebugMode == true) {
			var strHtml = '<form id="reportGateway" name="reportGateway" method="post" action="/dwwe/tests/seeGetAndPost.php?rptFNameOutOfPostForDebugOnly='+strRptName+'">';
	} else {
			var strHtml = '<form id="reportGateway" name="reportGateway" method="POST" action="' + strRptName + '">';
	}
	for(var objParam in objParams){
		var pName = objParam;
		var pValue = objParams[objParam];
		strHtml += '<input id="' + pName + '" name="' + pName + '" type="hidden" value="' + pValue + '">';
	};
	if(blnAllInputsFromDocument == true){
		var objInput = document.getElementsByTagName("input");
		for(var i = 0; i < objInput.length; i++){
			strHtml += '<input id="' + objInput[i].id + '" name="' + objInput[i].name + '" type="hidden" value="' + objInput[i].value + '">';
	}
		objInput = document.getElementsByTagName("select");
		for(var i = 0; i < objInput.length; i++){
			strHtml += '<input id="' + objInput[i].id + '" name="' + objInput[i].name + '" type="hidden" value="' + objInput[i].options[objInput[i].selectedIndex].value + '">';			}
		}
		strHtml += '</form>';
		oNewDoc[strWinName].write(strHtml);

		oNewDoc[strWinName].close();
		newWindow[strWinName].document.reportGateway.submit();
}
