function imagePopup(picfile, photodesc) {
	window.open('/largepic.php?picfile=' + picfile + '&photodesc=' + photodesc,'largepic','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,copyhistory=no,width=200,height=200');
}

function newWindow(url, w, h) {
	window.open(url,"tum"+w,"width="+w+",height="+h+",status=yes");
}

function newWindowScroll(url, w, h) {
	window.open(url,"tum"+w,"width="+w+",height="+h+",status=yes,scrollbars=yes");
}

// Validates required form input fields
function emailvalidate(formname) {
	var emailFilter=/^.+@.+\..{2,3}$/;
	if (formname.email.value == "") {
		alert("You didn't enter a valid Email!\n\nTry again?");
		formname.email.focus();
		return false;
	} else {
		if (!(emailFilter.test(formname.email.value))) { 
			alert("Your email is invalid.\nTry again?");
			formname.email.focus();
			return false;
		}	
	}
}

// This function opens links in an external window in a standards compliant way.
// To use it, code the link like this:
// 		<a href="document.html" rel="external">external link</a>
function externalLinks() {
	if (!document.getElementsByTagName) return;
	var anchors = document.getElementsByTagName("a");
	for (var i=0; i<anchors.length; i++) {
		var anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
	     	anchor.target = "_blank";
		}
 	}
}
window.onload = externalLinks;

// Set a form target to a new target.  Use this to open a form in a new window, like this:
// <form action="whatever.php" method="post" onsubmit="return setFormTarget(this, '_blank');">
function setFormTarget(formname, new_target) {
	formname.target = new_target;
}
