function gallerylaunch(gallerypath, imagecount) {
	var win = null;
	var w = 450;
	var h = 430;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	var pathvar = '/gallery_new.php?gallery=' + gallerypath + '&photo=1&max=' + imagecount;
	var options = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',directories=0,resizable=1,status=0,titlebar=0,titlebar=0,toolbar=0';
	
	myWindow = window.open(pathvar, "gallerywindow", options)	
}
function gallerylaunch2(gallerypath, imagecount) {
	var win = null;
	var w = 650;
	var h = 660;
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	var pathvar = '/gallery_new2.php?gallery=' + gallerypath + '&photo=1&max=' + imagecount;
	var options = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',directories=0,resizable=1,status=0,titlebar=0,titlebar=0,toolbar=0';
	
	myWindow = window.open(pathvar, "gallerywindow", options)	
}

function NewWindow(mypage,myname,w,h,scroll,resizable){ //Autocenters popup window added March 29, 2004 Patrick Smith
	var win = null;
	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='+resizable+''
	win = window.open(mypage,myname,settings)
}