// JavaScript Document
var newWindow = null;

function closeWin(){
	if (newWindow != null){
		if(!newWindow.closed)
			newWindow.close();
	}
}

function popUpWin(url, type, strWidth, strHeight){
	window.name = "main";
	closeWin();
	
	if (type == "fullScreen"){
		strWidth = screen.availWidth - 10;
		strHeight = screen.availHeight - 160;
	}
	
	var tools="";
	if (type == "standard" || type == "fullScreen") tools = "resizable,toolbar=yes,location=yes,scrollbars=yes,menubar=yes,width="+strWidth+",height="+strHeight+",top=0,left=0";
	if (type == "console") tools = "resizable,toolbar=no,location=no,scrollbars=yes,width="+strWidth+",height="+strHeight+",left = 529,top = 369";
	if (type == "center"){
		var strLeft = ((screen.availWidth - strWidth) / 2);
		var strTop = ((screen.availHeight - strHeight) / 2);
		tools = "resizable,toolbar=no,location=no,scrollbars=yes,width="+strWidth+",height="+strHeight+",left =" + strLeft  + ",top = " + strTop;
	}
	newWindow = window.open(url, 'newWin', tools);
	newWindow.focus();
}

function openTarget (form, features, windowName){
	if (!windowName)
		windowName = 'formTarget' + (new Date().getTime());
		form.target = windowName;
		open ('', windowName, features + ",left=529,top=369");
}