// JavaScript Document for Total Fabrication Toolbox

var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	
	closeWin();
	
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}

	if (type == "standard"){
		var strLeft = screen.availWidth - strWidth;
		var strTop = screen.availHeight - strHeight;
	}

	var tools="";
	if (type == "standard") tools = "resizable=yes,toolbar=yes,location=no,scrollbars=yes,menubar=no,width="+strWidth+",height="+strHeight+",top=100,left=100";
	if (type == "standard2") tools = "resizable=yes,toolbar=yes,location=no,scrollbars=yes,menubar=no,width="+strWidth+",height="+strHeight+",top=300,left=300";
	if (type == "fullScreen") tools = "resizable=yes,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top="+strLeft+",left="+strTop+"";
	if (type == "console") tools = "resizable=no,toolbar=no,location=no,scrollbars=no,width="+strWidth+",height="+strHeight+",left=600,top=300";
	if (type == "console2") tools = "resizable=yes,toolbar=no,location=no,scrollbars=yes,width="+strWidth+",height="+strHeight+",left=200,top=200";
	newWindow = window.open(url, type, tools);
	newWindow.focus();
}


