// *** General application functions
// *** v01 181104 swg Add textarea limiter
// *** v00 210504 swg Creation

var origclass=""
var origcolour=""

function set_class(obj,newclass) {
	origclass = obj.getAttribute("className")
	obj.className=newclass
}

function restore_class(obj) {
	obj.className=origclass
}

function set_bgcol(obj,newcolour) {
	origcolour = obj.style.backgroundColor
	obj.style.backgroundColor=newcolour
}

function restore_bgcol(obj) {
	obj.style.backgroundColor=origcolour
}

function hideit(elementID) {
	document.getElementById(elementID).style.display="none"
}

function showit(elementID) {
	document.getElementById(elementID).style.display=""
}

function textlimit(field,limit) {
	if (field.value.length > limit) {
	  field.value=field.value.substring(0,limit)
	}
}

