// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function validate_evaluation_form(form) {
	returnValue = true;
	returnValue = validate_field('evaluation_form_name') & returnValue
	returnValue = validate_field('evaluation_form_email') & returnValue
	returnValue = validate_field('evaluation_form_website', 'http://') & returnValue
	returnValue = validate_field('evaluation_form_phone') & returnValue
	$('evaluation_form_alert').innerHTML = "<b>Please fill in all the fields. Thank you.</b>";
	$('evaluation_form_alert').show();
	return returnValue;
}

function validate_contact_form(form) {
	returnValue = true;
	returnValue = validate_field('contact_form_name') & returnValue
	returnValue = validate_field('contact_form_company') & returnValue
	returnValue = validate_field('contact_form_email') & returnValue
	returnValue = validate_field('contact_form_phone') & returnValue
	returnValue = validate_field('contact_form_message') & returnValue
	$('contact_form_alert').innerHTML = "<b>Please fill in all the fields. Thank you.</b>";
	$('contact_form_alert').show();
	return returnValue;
}

function validate_field(field_id, bad_value) {
	if ($(field_id).value == '' || $(field_id).value == bad_value) {
		$(field_id).style.background = "#fcd3d3";
		return false;
	} else {
		$(field_id).style.background = "#ffffff";
		return true;
	}
}