window.onerror=null;
var win = null;
var win1 = null;

function closePopWin() {
	if(win != null) { 
		if(!win.closed) { 
			win.close();
			win = null;
		} else {
			win = null;
		}
	}
}

function popUpPop(mypage, myname, w, h, scroll) {
	var win2 = (screen.width - w) / 2;
	var win3 = (screen.height - h) / 2;
	winprops1 = 'height='+h+',width='+w+',top='+win3+',left='+win2+',scrollbars='+scroll+',noresize'
	win1 = window.open(mypage, myname, winprops1)
	if (parseInt(navigator.appVersion) >= 4) { win1.window.focus(); }
}

function NewWindow(mypage, myname, w, h, scroll) {
	closePopWin();
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',noresize'
	myname = 'win';
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function NewWindowResize(mypage, myname, w, h, scroll) {
	closePopWin();
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=yes,resizable=yes'
	myname = 'win';
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function NewDFCWindow(mypage, myname, w, h, scroll,resize) {
	closePopWin();
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable='+resize;
	myname = 'win';
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

// opens new window
function new_window(url) {
	win = window.open(url,'newwindow','width=420,height=540,scrollbars=yes');
	if (win.opener == null) win.opener = window;
	win.opener.name = "opener";
}

function new_windowSL(url) {
	win = window.open(url,'newwindow');
	if (win.opener == null) win.opener = window;
	win.opener.name = "opener";
}

  

	
	
