// ------------- PLAZA SCRIPT FILE -------------------- // This is the JavaScript prelude for all Pl@za services. // plaza $Id: script.js,v 1.10 2005/03/18 15:37:06 daves Exp $ // ------------- Page initialisation statements ------- var onLoad = ""; var onUnload = ""; // ------------- Set the input focus ------------------ onLoad += "placeFocus();"; function placeFocus() { var firstvis; for (var j = document.forms.length-1; j >= 0; j -= 1) { // each form var firstform; for (var k=document.forms[j].elements.length-1; k >= 0; k -= 1) { // each elt var elt = document.forms[j].elements[k]; if (elt != null && elt.type != null) { var type = elt.type.toLowerCase(); if ("text" == type || "textarea" == type || "password" == type) { if (!elt.disabled && !elt.readOnly) { firstform = elt; } } var name = elt.name; if ("setfocus" == name) { var focus = elt.value; if ("" != focus) { // set focus elt = document.forms[j].elements[focus]; elt.focus(); } return; } if ("dontfocus" == name) { firstform = null; break; } } } if (firstform != null) { firstvis = firstform; } } if (firstvis != null) { firstvis.focus(); } } // ----------------------------------------------------