/* GENERIC */

function highlightField(theid,theact) {
if (theact == 1) {
theid.className = theid.className + " " + theid.className + "-focusfix";
} else {
var temp = theid.className;
var temp2 = temp.split(" ");
theid.className = temp2[0];
}
}

function confirmFunc(thequestion,theanswer) {
if (confirm(thequestion)) {
alert(theanswer);
}
}

function setFocus(theid) {
document.getElementById(theid).focus();
}

function unCheckMe(theitem) {
theitem.checked = false;
}
function reCheckMe(theitem) {
theitem.checked = true;
}

function displayItem(theitem) {
var theid = document.getElementById(theitem);
theid.style.display = "";
}
function hideItem(theitem) {
var theid = document.getElementById(theitem);
theid.style.display = "none";
}
function changeClassName(theitem,theclass) {
var theid = document.getElementById(theitem);
theid.className = theclass;
}

function updateFieldText(theitem,thetext) {
var theid = document.getElementById(theitem);
theid.innerHTML = thetext;
}
function updateInputText(theitem,thetext) {
var theid = document.getElementById(theitem);
theid.value = thetext;
}


function getObj() {
	var thingy = arguments[0];
	if ( typeof thingy == 'object' ) {
		return thingy;
	} else if ( typeof thingy == 'string' ) {
		return document.getElementById(thingy);
	}
}

function toggleDisplay() {
	var toggleDiv = getObj(arguments[0]);
	with (toggleDiv.style) { display = (display=='none'||display==''?'block':'none'); }
}
function showDisplay() {
	var showDiv = getObj(arguments[0]);
	with (showDiv.style) { display = 'block'; }
}
function hideDisplay() {
	var hideDiv = getObj(arguments[0]);
	with (hideDiv.style) { display = 'none'; }
}

function toggleVisibility() {
	var toggleDiv = getObj(arguments[0]);
	with (toggleDiv.style) { visibility = (visibility=='hidden'?'visible':'hidden'); }
}
function showVisibility() {
	var showDiv = getObj(arguments[0]);
	with (showDiv.style) { visibility = 'visible'; }
}
function hideVisibility() {
	var hideDiv = getObj(arguments[0]);
	with (hideDiv.style) { visibility = 'hidden'; }
}
