// JavaScript Document function sfFocus() { inputs = new Array('INPUT', 'SELECT', 'TEXTAREA'); types = new Array(); types['INPUT'] = new Array('text', 'password', 'submit'); for (j=0; j < inputs.length; j++) { var sfEls = document.getElementsByTagName(inputs[j]); for (i=0; i < sfEls.length; i++) { var p = false; if (inputs[j].length > 0) { for (k=0; k < inputs[j].length; k++) { if (types[ inputs[j] ] && sfEls[i].type == types[ inputs[j] ][k] && sfEls[i].name != 'url') { p = true; break; } } } if (p == true) { sfEls[i].onfocus=function() { this.className += ' focus'; }; sfEls[i].onblur=function() { this.className = this.className.replace(new RegExp('focus'), ''); }; if (sfEls[i].type == 'submit' || sfEls[i].type == 'button'){ sfEls[i].onmouseover=function() { this.className += ' hover'; }; sfEls[i].onmouseout=function() { this.className = this.className.replace(new RegExp('hover'), ''); }; } } } } }