// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults
function swap_img(id, name) {
    var e = document.getElementById(id);
    e.src = 'images/layout/' + name;
}

function swap_img_on(id) {
    swap_img(id, id + "_on.png");
}

function swap_img_off(id) {
    swap_img(id, id + "_off.png");
}

function onlyNumbers(evt) {
	var e = event || evt; // for trans-browser compatibility
	var charCode = e.which || e.keyCode;
	if (charCode > 31 && (charCode < 48 || charCode > 57)) {
		return false;
    }
	return true;
}

function removeThickBox() {
    this.parent.tb_remove();
}

function replaceHtml(id, content) {
    this.parent.document.getElementById(id).innerHTML = content;
}