formField = function(block, objid, formid, default_text) {

	this.obj = document.getElementById(objid);
	this.form = (formid != null) ? document.getElementById(formid) : null;
	this.default_text = default_text;
	this.fsubmit = document.getElementById(block+"-submit");

	this.state = { value: false };

	this.obj.value = this.default_text;
	this.obj.onfocus = function(state, obj) { return function() { if (!state.value) {obj.value = ''; $(obj).addClass('focus'); } } } (this.state, this.obj);
	this.obj.onblur  = function(state, obj, default_text) { return function() { if (!state.value) {obj.value = default_text; $(obj).removeClass('focus'); }} } (this.state, this.obj, this.default_text);
	this.obj.onkeyup = function(state, obj) { return function() { state.value = obj.value; } } (this.state, this.obj);
	if (this.form != null) this.form.onsubmit = function(state) { return function() { if (!state.value) return false; } } (this.state);
}