function openWin(popname)
{

//the following tests are to ensure that the popup window is not accidently left minimized
if (typeof popwindow== "undefined") {
	//window has never been opened - OK
}
else {
	if (popwindow.closed) {
		//window has been properly closed - OK
	}
	else {
		//window has been opened and left behind
		popwindow.close();
	}
}

popwindow=window.open(popname,"popup","width=600,height=300,menubar=no,scrollbars=yes,statusbar=no,toolbar=no,resizable")
//fyiwindow.focus();	
}


// this function will replace the page in the opener with the newPage and close the popup
function changePageAndClosePopup(newPage)
{
self.location = newPage;
popupwindow.close();
}

// open a sized window
function openWinSized(htmlname, winWidth, winHeight, noScroll)
{
if (winWidth==null) 
{
	winWidth = 700;	//default width
}

if (winHeight==null) 
{
	winHeight = 350;	//default height
}
if (noScroll==null) 
{
	noScroll = yes;	//default width
}

winStatus = "width="+winWidth+",height="+winHeight+",scrollbars="+ noScroll + ",menubar=no,statusbar=no,toolbar=no,resizable"

if (typeof popwindow== "undefined") {
	//window has never been opened - OK
}
else {
	if (popwindow.closed) {
		//window has been properly closed - OK
	}
	else {
		//window has been opened and left behind
		popwindow.close();
	}
}

popwindow=window.open(htmlname,"popup",winStatus)

popwindow.focus();
}