/*****************************************************
 * startSearch
 * if the string is blank return true 
 *****************************************************/
	function startSearch(field) {
		if (field.value == 'SEARCH') {
			field.value = '';
			field.style.color='#000';
		}
	return true;
	}


/*****************************************************
 * phIsBlank
 * if the string is blank return true 
 *****************************************************/
function phIsBlank(thetext) {
	if (thetext == "") { return true; } else { return false; }
}

/*****************************************************
 * phValidEmail
 * check if text appears to be an email address 
 * return true or false 
 *****************************************************/
function phValidEmail(email) {
	// characters not allowed in an email address
	invalidChars = " /:,;";

	// blank emails are invalid
	if (email == "") { return false }
	
	// emails with illegal characters are invalid
	for (i=0; i<invalidChars.length; i++) {
		badChar = invalidChars.charAt(i);
		if (email.indexOf(badChar,0) > -1) { return false }
	}

	// emails without an @ are invalid
	atPos = email.indexOf("@",1)
	if (atPos == -1) { return false }
	
	// emails with more than one @ are invalid
	if (email.indexOf("@",atPos +1) > -1) { return false }

	// emails without a . are invalid
	periodPos = email.indexOf(".",atPos)
	if (periodPos == -1) { return false }

	// emails with less than three chars after the 
	// first . following the @ are invalid
	if (periodPos + 3 > email.length) { return false }
	
	return true;
}
/*****************************************************
 * setSection
 * uses the Section info to turn on the main nav buttons 
 * note: editing folder names will break this function. If folder names are changed, update header.inc in offline>includes
 * return true or false 
 *****************************************************/
function setSection(sectionId) {
	if (document.getElementById(sectionId)) {
		document.getElementById(sectionId).style.backgroundPosition='0 0';
	}
	return true;
}
