function clearFocus(theText) {
	if (theText.value == theText.defaultValue) {
		theText.value = "";
		theText.style.color = "#3d3d3d";
	}
}

function resetBlur(theText) {
	if (theText.value == "") {
		theText.value = theText.defaultValue;
		theText.style.color = "#3d3d3d";
	}
}

function validateWP(elem) {
	var emailFilter=/^.+@.+\..{2,3}$/;
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
	
	if (elem.email.value=='' || elem.email.value==elem.email.defaultValue) {
		document.getElementById('error').style.visibility = 'visible';
		return false;
	}
	else if (!emailFilter.test(elem.email.value) || elem.email.value.match(illegalChars)) { 
		document.getElementById('error').style.visibility = 'visible';
		return false;
	}
	
	document.getElementById('error').style.visibility = 'hidden';
	return true;
}
		
function validateForm(felem) {
	var why = "";
	var elem;
	var emailFilter=/^.+@.+\..{2,3}$/;
	var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/
	
	elem = felem.name;
	if (elem) {
		if (elem.value=='' || elem.value==elem.defaultValue) {
			why += "Please enter your name.\n";
		}
	}
	
	elem = felem.email;
	if (elem) {
		if (elem.value=='' || elem.value==elem.defaultValue) {
			why += "Please enter your e-mail address.\n";
		}
		else if (!emailFilter.test(elem.value) || elem.value.match(illegalChars)) { 
			why += "Please enter a valid e-mail address.\n";
		}
	}
		
	elem = felem.phone;
	if (elem) {
		if (elem.value=='' || elem.value==elem.defaultValue) {
			why += "Please enter your phone number.\n";
		}
	}
		
	elem = felem.type_of_assets;
	if (elem) {
		if (elem.value=='' || elem.value==elem.defaultValue) {
			why += "Please enter the type of asset.\n";
		}
	}
		
	elem = felem.asset_worth;
	if (elem) {
		if (elem.value=='' || elem.value==elem.defaultValue) {
			why += "Please enter the approximate worth of assets.\n";
		}
	}
/* 
	elem = felem.list_upload;
	if (elem) {
		if (elem.value=='' || elem.value==elem.defaultValue) {
			why += "Please upload a list of assets.\n";
		}
	}
*/
	elem = felem.security_code;
	if (elem) {
		if (elem.value.length != 5) {
			why += "Please enter the security code exactly how it appears.\n";
		}
	}

	if (why != "") {
		alert('There are problems with your request:\n\n'+why);
		return false;
	}
	else {
		return true;
	}	
}