// open specified source in window of specified name, width, and height
function openWindow (myName, mySource, myWidth, myHeight) {
	windowName = myName;
	myWin = window.open(mySource,windowName,'left=0,top=0,width=' + myWidth + ',height=' + myHeight + ',toolbar=0,location=0,directories=0,menubar=0,scrollbars=0,resizable=0');
	myWin.focus();
}

// open gallery window with specified gallery and image index
function openGallery (myGallery, myIndex) {
	mySource = "http://www.gregames.net/scripts/gallery.php?gallery=" + myGallery + "&index=" + myIndex;
	openWindow('gallery', mySource, 674, 543);
}

// adapted from http://www.quirksmode.org/js/mailcheck.html
function checkMail(email)
{
	var filter  = /^([a-zA-Z]+)([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(email)) return true;
	return false;
}