//Screenplay Custom Functions

/*//no right-click
function noRightClick(evnt) {
errMsg="The right-click function has been disabled."
//if (navigator.appName.toUpperCase().match(/NETSCAPE/) != null) {
//if (evnt.which == 3){alert(errMsg);return false;}}else
if (event.button==2)alert(errMsg);}
document.onmousedown=noRightClick;
*/
//Check passed value to see if it's a number
function isNumber(floatValue) {
  return (isNaN(floatValue)) ? true : false;
}

//Confirm action for deletes on TEXT ONLY -- onClick='return confirmIt()'
function confirmIt() {
	if (confirm('Are you sure you wish to delete this item?')) { return true } else {return false }
}

//validate email address
function validEmail(email) {
	invalidChars = " /:,;"
	if (email == "") {
		return false
	}
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i)
		if (email.indexOf(badChar,0) != -1) {
			return false
		}
	}
	atPos = email.indexOf("@",1)
	if (atPos == -1) {
		return false
	}
	if (email.indexOf("@",atPos+1) != -1) {
		return false
	}
	periodPos = email.indexOf(".",atPos)
	if (periodPos == -1) {
		return false
	}
	if (periodPos+3 > email.length)	{
		return false
	}
	return true
}

//OPEN HELP POPUP
function openHelp(type) {
	var page;
	if (type=='interface') { page="help_interface.php" }
	if (type=='main') { page="help_main.php" }
	window.open(page,'help','resizable=yes,scrollbars=yes,width=500,height=400');
}

//OPEN UPDATES POPUP
function openUpdates() {
	window.open('/screenplaze/members/updates.htm','updates','resizable=yes,scrollbars=yes,width=500,height=400');
}



