function terraFormRefresh() {
	var sourceForm = (event.target) ? event.target.form : event.srcElement.form;
	sourceForm.elements(sourceForm.name).value = 'refresh';
	sourceForm.submit();
}




// Original:  Ronnie T. Moore
// Web Site:  The JavaScript Source
// Dynamic 'fix' by: Nannette Thacker
// Web Site: http://www.shiningstar.net
// This script and many more are available free online at
// The JavaScript Source!! http://javascript.internet.com
function terraform_textarea_counter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) // if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
	// otherwise, update 'characters left' counter
	else 
		countfield.value = maxlimit - field.value.length;
}




// Browser Onload script 
// From http://javascript.about.com/library/scripts/blsafeonload.htm

// Browser Detection
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;

// Body onload utility (supports multiple onload functions)
var gSafeOnload = new Array();
function SafeAddOnload(f)
{
	if (IEmac && IE4)  // IE 4.5 blows out on testing window.onload
	{
		window.onload = SafeOnload;
		gSafeOnload[gSafeOnload.length] = f;
	}
	else if  (window.onload)
	{
		if (window.onload != SafeOnload)
		{
			gSafeOnload[0] = window.onload;
			window.onload = SafeOnload;
		}		
		gSafeOnload[gSafeOnload.length] = f;
	}
	else
		window.onload = f;
}
function SafeOnload()
{
	for (var i=0;i<gSafeOnload.length;i++)
		gSafeOnload[i]();
}

// Call the following with your function as the argument
// SafeAddOnload(yourfunctioname);





/*
Adapted from...
Submit Once form validation- 
� Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

function hidebuttons(theform){
	document.body.style.cursor = "wait";
	//if IE 4+ or NS 6+
	if (document.all||document.getElementById){
	//screen thru every element in the form, and hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++){
			var tempobj=theform.elements[i]
			try {
				if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="button") {
					var found = tempobj.name.match(/_hidden$/);
					if (found)
						tempobj.style.display="inline";
					else
						tempobj.style.display="none";
				}
			}
			catch(errorObject) {}	
		}
	}
}








