// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

function limitText(limitField, limitCount, limitNum) {
	if (document.getElementById(limitField).value.length > limitNum) {
		alert("This is what you would have _said_, not the book you would have written.\n\nKeep it under 5000 characters, Tolstoy.")
		document.getElementById(limitField).value = document.getElementById(limitField).value.substring(0,limitNum);
	}
}

function Switch(element) {
	if(document.getElementById(element).style.display=="none") {
		document.getElementById(element + "_title").className="nav_open";
		return new Effect.SlideDown(element, {duration: 0.35});
	} else {
		document.getElementById(element + "_title").className="nav";		
		return new Effect.SlideUp(element, {duration: 0.35});
	}
}
