/*
'*********************************************************************
'VERSION DETAILS	
'RELEASE NAME   :	iService 2.6.1
'DATE			:	07-01-2003
'AUTHOR			:	Sridhar Vishnubhotla
'*********************************************************************
*/
// set focus on first text input of first form on page, or first button, if there are no
// text inputs.
function focusFirstTextInputOnPage() {
    var foundButton = false;
    for (var i = 0; i < document.forms.length; i++) {
        var form = document.forms[i];
        for (var j = 0; j < form.elements.length; j++) {
            var element = form.elements[j];
            if (element.type == "text" || element.type == "textarea" || element.type == "password") {
                element.focus();
                // alert("focusing " + element.name);
                return; }
            else if (!foundButton &&
                     (element.type == "submit" || element.type == "button")) {
                element.focus();
                // alert("focusing " + element.name);
                foundButton = true; }
        }
    }
}
