function clearDefault(ID){

	if (document.getElementById(ID)){
		if (document.getElementById(ID).value == 'enter an email address') document.getElementById(ID).value = '';
	}

}

function findFiend(ID){

	if (document.getElementById(ID)){

		var email = document.getElementById(ID).value;

		if (email == ''){
				alert('Please enter the email address of your friend to find their submission');
		} else if (email == 'enter an email address'){
				alert('Please enter the email address of your friend to find their submission');
		} else if ( email.match(/.+?@.+?\..+?/) ){

			window.open('findafriend.php?email=' + email);

		} else {
				alert('Please enter a valid email address');
		}
	}

}


function newWindow(legend, size) {

	switch (size) {
		case 'legal' :
			w=640;
			h=450;
		break;
	}

	var feature = 'scrollbars=yes,width='+w+',height='+h+',resizable=yes,screenY=0,screenX=0,left=50,top=50';
	var windowName = "seatWin"+size;
	var seatWindow = window.open(legend, windowName, feature);
	seatWindow.focus()

}
