function initformcheck() {
// handles multiple forms on the same page, but that probably confuses punters who change both
	pending = new Array();
	i = 0;
	while (i<arguments.length) {
		pending[arguments[i]] = new formdet(arguments[i],false);
		i++;
	}
	window.onbeforeunload = formCheck;
} 

function formdet(whatform,changed) {
	this.name = whatform;
	this.change = changed;
};


function ch(whatform) {
	pending[whatform].change = true;
}

function formSent() {
	i = 0;
	while (i<arguments.length) {
		pending[arguments[i]].change = false;
		i++;
	}
}
	
function formCheck() {
	is_pending=false;
	msg = '';
	for (var i in pending) {
		if (pending[i].change) {
			if (msg != '') {
				msg += ' and ';
			}
			msg += pending[i].name;
		}
	}

	if (msg != '') {
		return "If you leave this page without clicking the 'Update...' or 'Save...' button at the bottom, your "+msg+" instructions will be lost.";
	}
}
