function writeEmail(emAddress, emLabel) {
	emDomain="ribbitflightschool.com";                                                          
	document.write("<a href=mailto:" + emAddress + "@" + emDomain + ">" + emLabel + "</a>");
}

function validateEmail(theemail) {
	if (theemail.length == 0) { 
		return false;
	} else if (theemail.length < 5) { 
		alert("Oops, check your email address again.");
		return false;
	} else if (theemail.length > 64) {
		alert("Email address must be 64 characters or less.");
		return false;
	} else if (theemail.search('@') == -1) {
		alert("Oops, check your email address again.");
		return false;
	} else if (theemail.search('.') == -1) {
		alert("Oops, check your email address again.");
		return false;
	} else { 
		return true;
	}
}
function validatePhone(thephone) {
	if (thephone.length == 0) { 
		return false;
	} else {
		return true;
	}
}

function validateMessage(theemail, thephone) {
	em = validateEmail(theemail);
	ph = validatePhone(thephone);
	if ((em==false) && (ph==false)) {
		return false;
	} else {
		return true;
	}
}

function openPopup(url, lwidth, lheight) {
	var lscreenX = ( screen.width - lwidth ) / 2;
	var lscreenY = ( screen.height - lheight ) / 2;
	if(( lscreenX % 1 ) > 0 ) lscreenX = lscreenX + .5;
	if(( lscreenY % 1 ) > 0 ) lscreenY = lscreenY + .5;
	var strOptions = "width=" + lwidth + ",height=" + lheight + ",toolbar=no,top=" + lscreenY + ",left=" + lscreenX;
	newWin = window.open(url, "openWin", strOptions);
	if (!newWin.closed) newWin.focus();
}