function ab(){var u = document.location;var t = document.title;try{window.external.AddFavorite(u,t);}catch(e){if(window.sidebar){alert("To bookmark this page, close this pop-up and then press Ctrl+D.");}else{alert("Your browser does not support this function. Please use the browser controls to set this page as a favorite/bookmark.");}}}function td(c,t){tc = $(c);if(tc){var tcd = $(document.createElement('div'));tcd.insert(t[Math.floor(Math.random()*t.length)]);tc.update(tcd);tcd.setStyle({'marginTop':Math.floor((tc.getHeight()-tcd.getHeight()) / 2) + 'px'});}}

function contactSubmit_click ( f ) {
	// Run through the form and make sure we have valid elements.

	var elms = $H($(f).serialize( true ));
	var errs = [];

	if(elms.get('contactName') == '') {
		errs.push("You must include a name.");
	}

	if(elms.get('contactEmail') == '') {
		errs.push("You must include an email address.");
	} else if (! elms.get('contactEmail').match(/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9-])+(\.[a-zA-Z0-9_-]+)+$/)) {
		errs.push("You must include a valid email address. (ex. you@domain.com)");
	}

	if(elms.get('contactPhone') == '') {
		errs.push("You must include a phone number.");
	}

	if(errs.length > 0) {
		alert("The following errors have occurred while attempting to submit the contact form:\r\n\n - " + errs.join("\n - "));
		return;
	} else {
		var u = 'http://www.centerforchildandfamilytherapy.com/contact.php';

		new Ajax.Request(u, {
			method: 'post',
			parameters: elms,
			onSuccess: function( ) {
				alert("Thank you for contacting the Center for Child and Family Therapy. We will contact you shortly.");
				f.reset( );
			}
		});
	}
}