var sWidth = (screen.width) ? screen.width : 0;
var sHeight = (screen.height) ? screen.height : 0;
var screenX;
var screenY;
//**********************//
function resizeWindow(win, width, height) {
	win = eval(win);

	if (navigator.appName == "Netscape") {
		win.outerWidth = width;
		win.outerHeight = height;
	} else {
		win.resizeTo(width, height);
	}
}
//**********************//
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 centerStopWindow(myWin) {
	myDoc = myWin.document.body;
	if (sWidth > 800 || sHeight > 600) {
		screenX = (screen.availWidth / 2) - ((myDoc != null && myDoc.clientWidth > 0) ? (myDoc.clientWidth / 2) : 250);
		screenY = (screen.availHeight / 2) - ((myDoc != null && myDoc.clientHeight > 0) ? (myDoc.clientHeight / 2) : 120);
		myWin.window.moveTo(screenX, screenY);
	}
}
//***************************//
function openWin(folder) {
	var aWindow=window.open("webcasts/" + folder + "/index.php","thewindow","width=684,height=568,toolbar=no,menubar=no,status=no,scrollbars=no,resize=no");
	centerWindow(aWindow);
	aWindow.focus();
}
//**********************//
//***************************//
function openWinNew(folder, cpid) {
	var aWindow=window.open("to_resource.aspx?resId=" + folder + "&CPID=" + cpid,"thewindow","width=684,height=568,toolbar=no,menubar=no,status=no,scrollbars=no,resize=no");
	centerWindow(aWindow);
	aWindow.focus();
}
//**********************//

//**********************//
function openWinNew34(folder, cpid) 
{
	if (sWidth > 800) 
	{  // if the screen res is higher than 800x600 then open the large auditorium
		aWidth = 1014;
		aHeight = 678;
		screensize="large";
	}
	else
	{
		aWidth = 790;
		aHeight = 510;
		screensize="small";
	}

	pLeft = (sWidth - aWidth) / 2;
	pTop = ((sHeight - aHeight) / 2 ) - 40;
	if (pTop < 0)
	{
		pTop = 0;
	}
	if (pLeft < 0)
	{
		pLeft = 0;
	}

	var aWindow=window.open("to_resource.aspx?resId=" + folder + "&CPID=" + cpid,"thewindow","width="+aWidth+",height="+aHeight+",top="+pTop+",left="+pLeft+",toolbar=0,location=0,statusbar=0,menubar=0,resizable=0");
	if (aWindow)
	{
		aWindow.focus();
	}
}
//**********************//



//**********************//
function openCop(){
aWindow=window.open("include/copyright.htm","copwindow","width=300,height=450,toolbar=no,menubar=no,status=no,scrollbars=yes,resize=no");
  if (aWindow.opener == null) aWindow.opener = window;
}
