var sWidth = (screen.width) ? screen.width : 0;
var sHeight = (screen.height) ? screen.height : 0;
var screenX;
var screenY;
//**********************//
function setWindowSize() {
	if (! top.navFrame || ! top.navFrame.fullScreen) {
		//resizeWindow(window, 800, 600);
		window.resizeTo(800, 600);
	}

	if ((! top.navFrame  && (sWidth <= 800 || sHeight <= 600)) || ((sWidth <= 800 || sHeight <= 600) && (top.navFrame && ! top.navFrame.fullScreen))) {
		window.moveTo(0, 0);
	}
}
//**********************//
function centerWindow(myWin) {
	myDoc = myWin.document.body;
	if (sWidth > 800 || sHeight > 600) {
		screenX = (screen.availWidth / 2) - ((myDoc != null && myDoc.clientWidth > 0) ? (myDoc.clientWidth / 2) : 400);
		screenY = (screen.availHeight / 2) - ((myDoc != null && myDoc.clientHeight > 0) ? (myDoc.clientHeight / 2) : 300);
		myWin.window.moveTo(screenX, screenY);
	}
	else {
		screenX = 0;
		screenY = 0;
		myWin.window.moveTo(screenX, screenY);	
	}
}
//**********************//
function openWin(thefolder) {
	if (sWidth > 800) {  // if the screen res is higher than 800x600 then open the large auditorium
		var aWindow=window.open(thefolder + "/auditorium/index_large.htm","thewindow","width=1020,height=714,toolbar=no,menubar=no,status=no,scrollbars=no,resize=no,top=0,left=0");
		//centerWindow(aWindow)
		aWindow.focus();
	}
	else {
		var aWindow=window.open(thefolder + "/auditorium/index.htm","thewindow","width=790,height=568,toolbar=no,menubar=no,status=no,scrollbars=no,resize=no");
		centerWindow(aWindow)
		aWindow.focus();
	}
}

