function elem(name) {
    return document.getElementById(name);
}

function switchVisibility(id) {
	var x = elem(id);
	if (!((x) && (x.style) && (x.style.display))) return false;
	if (x.style.display == "none") {
		x.style.display = "block";
	} else {
		x.style.display = "none";
	}
	return false;
}

function keyup(what) 
{
	var str = new String(what.value);
	var len = str.length;
	if (len > 250) {
		what.value = str.substr(0, 250);
		return false;
	}
	return true;
}

function ask(what) {
	var r = confirm(what);
	if (r == true) {
		return true;
	}
	return false;
}