
$(document).ready(function() {
	$('.form-field').focusin(function() {
		$(this).addClass('form-field-active');
	}).focusout(function() {
		$(this).removeClass('form-field-active');
	});

	$('.cancel-button').click(function() {
		$rel = $(this).attr("rel");
		document.location = $rel;
	});


	$('.delete-button').click(function() {
		if (confirm('Are you sure?')) {
			return true;
		} else {
			return false;
		}
	});








});





///Original from: http://renownedmedia.com/codevault/Clean_URL_Generator
function url_friendly(text) {
	var url = text
		.toLowerCase()
		.replace(/^\s+|\s+$/g, "")
		.replace(/[_|\s]+/g, "_")
		.replace(/[^a-z0-9_]+/g, "")
		.replace(/^_+|_+$/g, "")
		; 
	return url;
			//.replace(/[_]+/g, "-")

}