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

function correctAllValidateBars(form) {
	var elements = document.getElementsByClassName('mandatory', form);

	for (var i = 0; i < elements.length; i++) {
		elements[i].removeClassName('mandatory');
	}
}

function jumpToNext(element,content){
	if (content.length == element.maxLength){
		next = element.next().focus()
	}
}

function insertArticleContent(article_content) {
	tinyMCE.execCommand("mceSetContent", false, article_content);
}

function addContestQuestion(form_authenticity_token) {
	new Ajax.Request('/betty/objects/add_contest_question', {asynchronous:true, evalScripts:true, parameters:'authenticity_token=' + encodeURIComponent(form_authenticity_token)})
}

function correctRemindersList(postfix) {
	var reminder = $('reminder_' + postfix);
	Element.remove(reminder);
}

function correctNotificationList(postfix) {
	var notification = $('notification_' + postfix);
	Element.remove(notification);
}