/*
filename: mywin.js		Written: 9-Feb-09		by: Rick Johnson

call skeleton: <a href="javascript:void(myWin('',''));"></a>
where:
arg 1 = url.
arg 2 = Text to use if prompt feature is employed.

This code spawns and writes to a pop window.
The spawned window is closed when calling code is closed.
*/

nw = false;

function myWin(url,anchor){		//call: <a href="javascript:void(myWin('',''));"></a>
	//if(nw) {nw.close();wsw=0}	// close the old "new window"
	if(anchor !='') { yn = confirm("click OK to continue to \n\n"+anchor); if(!yn) return; }
	// limited control attributes
	//ribs= "width=800,height=600,resizable=1,scrollbars=1"
	// full control attributes
	ribs = "width=1200,height=800,"
	ribs +="resizable=yes,scrollbars=yes,location=yes,status=yes,toolbar=yes"
	if(!nw) { // first time create window
		nw = window.open(url, "newWin",ribs);
		nw.status="This spawned window ... will be closed by calling code"
		return; }
	if (nw) { // second time and later just change content pause before status window write.
		nw.location = url
		setTimeout("nw.status='This window ... will be closed by calling code';",900)
		}
}
// end of script