// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function smiley(code, target_id) {
		$(target_id).value += (code + " ");
		$(target_id).focus();
}

function toggleCheck(aform, master_checkbox) {
	for(i = 0; i < aform.elements.length; i++) {
		if (aform.elements[i].type == 'checkbox')
			if (master_checkbox.checked)
				aform.elements[i].checked = true;
			else
				aform.elements[i].checked = false;
	}
}

function submitFormByAction(form_id, action, confirm_msg) {
	if (confirm_msg != null) {
		if (confirm(confirm_msg)) {
			$(form_id).action = action;
			$(form_id).submit();
		}
	}
	else {
		$(form_id).action = action;
		$(form_id).submit();
	}
}
