<!--
function stopError() {return true;}

window.onerror=stopError;
	
var formCookieId = 'form_save-1';
	
function dbstream(a1) {
	var db = '';
	for (var k in a1) if (a1[k] || a1[k] == '') db += '&' + escape(k) + '=' + escape(a1[k]);
	return db.substring(1);
}

function dbparse(a1) {
	var db = {};
	if (!a1) return db;
		a1 = a1.split('&');
		for (var k in a1) {
		k = a1[k].split('=');
		db[unescape(k[0])] = unescape(k[1]);
	}
	return db;
}

function setcookie(a1,a2,a3) {
	if (!a1) return;
		function daystring(A1) {
		var time = new Date();
		time.setTime(time.getTime() + (86400000 * A1))
		return time.toGMTString();
	}
	document.cookie = escape(a1) + '=' + escape(a2) + (a3 &&
	( isNaN(a3.expires) ? '' : '; expires=' + daystring(a3.expires) ) +
	( a3.path ? '; path=' + a3.path : '' ) +
	( a3.domain ? '; domain=' + a3.domain : '' ) +
	( a3.secure ? '; secure' : '' ) || '');
}

function getcookie(a1){
	a1 = escape(a1);
	var tie = ' ' + document.cookie;
	var sta = tie.indexOf(' ' + a1 + '=');
	if (sta == -1) return null;
		var end = tie.indexOf(';',sta);
		return (end != -1) ? unescape(tie.substring(sta + 2 + a1.length,end)) : unescape(tie.substring(sta + 2 + a1.length));
}

function killcookie(a1) { setcookie(a1,'',{ expires:0 }); }

function tiecookie(a1,a2,a3) {
if (!a1 || !a2) return;
	setcookie(a1,dbstream(a2),a3);
}

function untiecookie(a1) {
	var ties = getcookie(a1);
	if (!ties && ties != '') return null;
		return dbparse(ties);
}

function saveForm(Form, skipTo, stopAt) {

var allLength =  Form.length;
var dataStore = new Object();

dataStore.textFields = new Object();
dataStore.popuplists = new Object();

for (var i=skipTo||0; i<(stopAt||allLength); i++) {

var thisField = Form.elements[i];
var fieldType = thisField.type;
var fieldName = thisField.name;

 if (!fieldName)        continue;

 if (fieldType == 'text') {
  dataStore.textFields[fieldName] = thisField.value;

  continue; }
 
 if (fieldType == 'select-one') {
  dataStore.popuplists[fieldName] = thisField.selectedIndex; } 
}

dataStore.textFields = dbstream(dataStore.textFields);
dataStore.popuplists = dbstream(dataStore.popuplists);

tiecookie(formCookieId, dataStore, { expires:60 });

}


function autoFill(Form) {
	var allLength = Form.length;
	var dataFound = untiecookie(formCookieId);

	if (dataFound && 
    	confirm('This form has been filled in previously.\nWould you like to reenter it automatically?')
   	) {
		dataFound.textFields = dbparse(dataFound.textFields);
		dataFound.popuplists = dbparse(dataFound.popuplists);

		for (var i=0; i<allLength; i++) {

		var thisField = Form.elements[i];
		var fieldType = thisField.type;
		var fieldName = thisField.name;

	 	if (!fieldName)        continue;

 			if (fieldType == 'text' && dataFound.textFields[fieldName]) {
  				thisField.value = dataFound.textFields[fieldName];
  				continue;}
 
		 	if (fieldType == 'select-one' && dataFound.popuplists[fieldName]) {
 				thisField.selectedIndex = dataFound.popuplists[fieldName];} 
   	 	}
	}
}

function info(arg) {
	if (arg) {
	window.status = arg;
	window.defaultStatus = arg;
	return true;
	} return false;
}

//-->