// JavaScript Document

function PageLoad() {
	FocusOnFirstFormField();
	return true;
}

function FocusOnFirstFormField() {
	if(document.forms.length > 0) {
		
		//Loop through all forms in the document
		for(i = 0; i < document.forms.length; i++) {
			
			var frm = document.forms[i];			
			var elmts = frm.elements;	
			
			if(elmts.length > 0) {
				
				//Loop through all of the elements in the current form.
				for(j = 0; j < elmts.length; j++) {
					
					var e = elmts[j];
					
					//Check to see if the element is a textarea or text element.
					//Note: We might want to change the if statement below to check for 
					//text and textarea types like this: (e.type == "textarea") || (e.type == "text")
					if(e.type != "hidden") {
						e.focus();
						return true;
					}
					else
						continue;
				}
			}
			else
				continue;
		}
	}
	else {
		return true;	
	}	
}