// Javascript PopUp Window Routines
// -----------------------------------------------------------------------------------------------------------------------
// Form main edit routines
// BEGIN
var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, xtype, strWidth, strHeight){

	closeWin();

	var tools="";
	var vleft=0;
	var vtop=0;

	if (xtype == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 10;
	}

	if (xtype == "console"){
		vleft = (screen.availWidth - strWidth) / 2;
		vtop = (screen.availHeight - strHeight) / 3;
	}

	if (xtype == "standard") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top="+vtop+",left="+vleft;
	if (xtype == "fullScreen") tools = "resizable,toolbar=no,location=no,scrollbars=yes,menubar=no,width="+strWidth+",height="+strHeight+",top="+vtop+",left="+vleft;;
	if (xtype == "console") tools = "resizable=no,toolbar=no,location=no,scrollbars=no,menubar=no,width="+strWidth+",height="+strHeight+",top="+vtop+",left="+vleft;
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}
// END
// -----------------------------------------------------------------------------------------------------------------------
