// Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
// Permission granted to Dynamic Drive to feature script in archive
// For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings =
	'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(mypage,myname,settings)
}


// Popup events mini-window for EasyPHPCalendar. Embedded here because it
// sometimes failes to load on-the-fly on the homepage

function popupEvent(ev, w, h) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	win = window.open("/_calendar/functions/popup.php?ev=" + ev + "&readFile=0&readSQL=1&showCat=&oc=1","Calendar","scrollbars=yes,status=no,location=no,toolbar=no,menubar=no,directories=no,resizable=yes,width=" + w + ",height=" + h + ",top=" + wint + ",left=" + winl + "");
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

