Prado.Focus = Class.create(); Prado.Focus.setFocus = function(id) { var target = document.getElementById ? document.getElementById(id) : document.all[id]; if(target && !Prado.Focus.canFocusOn(target)) { target = Prado.Focus.findTarget(target); } if(target) { try { target.focus(); target.scrollIntoView(false); if (window.__smartNav) { window.__smartNav.ae = target.id; } } catch (e) { } } } Prado.Focus.canFocusOn = function(element) { if(!element || !(element.tagName)) return false; var tagName = element.tagName.toLowerCase(); return !element.disabled && (!element.type || element.type.toLowerCase() != "hidden") && Prado.Focus.isFocusableTag(tagName) && Prado.Focus.isVisible(element); } Prado.Focus.isFocusableTag = function(tagName) { return (tagName == "input" || tagName == "textarea" || tagName == "select" || tagName == "button" || tagName == "a"); } Prado.Focus.findTarget = function(element) { if(!element || !(element.tagName)) { return null; } var tagName = element.tagName.toLowerCase(); if (tagName == "undefined") { return null; } var children = element.childNodes; if (children) { for(var i=0;i