function submitToNewWindow(frm)
{
	// open a blank window
	// 10/23/2002 - used to be width 200 and height 270, and scrollbars false
	windowOpen("", "submitNewWindow", 250, 400, true, true);
	
	// set the target to the blank window
	frm.target = "submitNewWindow";
	
	// submit
	frm.submit();
}

// testing
//function submitToNewWindow2(frm)
//{
//	
//	alert(frm.top.window.location);
//  alert(frm.name);
//}

function windowOpen(fileName, name, width, height)
{
	windowOpen(fileName, name, width, height, false);
}

function windowOpen(fileName, name, width, height, scrollbars)
{
	var scrolltext = (scrollbars) ? 'scrollbars=yes' : 'scrollbars=no';
	
	aWindow = window.open(fileName, name, scrolltext + ',menubar=no,resizable=yes,toolbar=no,width=' + width + ',height=' + height);

	// IE has a js error if focus() is called without a delay
	// when the open window is being opened again from a window other than the originator.
	setTimeout('aWindow.focus();',200);
}

function codeExampleOpener(strTitle, strResults)
{
	msgWindow=window.open("","codeExampleWindow","scrollbars=yes,menubar=yes,resizable=yes,width=500,height=400");
  msgWindow.document.open();
	msgWindow.document.writeln("<HTML><HEAD><TITLE>" + strTitle + "</TITLE></HEAD>");
	msgWindow.document.writeln("<BODY onLoad='self.focus()'><PRE>");
  msgWindow.document.writeln(parseHTML(strResults));
	msgWindow.document.writeln("</PRE></BODY></HTML>");
	msgWindow.document.close();
}

function parseHTML(str)
{
	var newStr = '';
	var i;
	for (i=0; i<str.length; i++)
	{
		if (str.charAt(i)=='<')
		{
			newStr += '&lt;';
		}
		else if (str.charAt(i)=='>')
		{
			newStr += '&gt;';
		}
		else
		{
			newStr += str.charAt(i);
		}
	}
	
	return newStr;
}
