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

// Put in modal_dialog.js?
function openModalDialog(){
	window.scrollTo(0,0);
	document.getElementById("graybox").style.visibility = "visible";
	document.getElementById("modalDialog").style.visibility = "visible";
}

function cancelModalDialog() {
	document.getElementById("graybox").style.visibility = "hidden";
	document.getElementById("modalDialog").style.visibility = "hidden";
	showLoader("modalDialog");
}

function showLoader(id) {
	document.getElementById(id).innerHTML = "<center><img src='/images/misc/loading.gif'></center>";
}

// These are used for card scorlling ==> Put in card_scroller.js?
function prev_cards() {
	document.form_card_index.index_field.value = parseInt(document.form_card_index.index_field.value) - 5
}

function next_cards() {
	document.form_card_index.index_field.value = parseInt(document.form_card_index.index_field.value) + 5
}

// Used in profile ==> Put in profiler.js?
function clear_box(id) {
	document.getElementById(id).value = '';
}

function check_input_elt(id) {
	document.getElementById(id).checked = true;
}

