/* ******************************************************************
   * Previsão de existência de função : getElementById em versões de
   * browsers mais antigos
   ****************************************************************** */
if (navigator.family == 'ie4' && navigator.version < 5) 
{
    document.getElementById = new Function("id", "return document.all[id];");
}
else if (navigator.family == 'nn4') 
{
    document.getElementById = nav4GetLayerById;
}

function nav4GetLayerById(id) 
{
    return nav4FindLayer(this, id);
}

function nav4FindLayer(doc, id) 
{
    var i;
    var subdoc;
    var obj;
    for (i = 0; i < doc.layers.length; ++i) 
    {
          if (doc.layers[i].id && id == doc.layers[i].id)
          {
              return doc.layers[i];
          }
          subdoc = doc.layers[i].document;
          obj = nav4FindLayer(subdoc, id);
          if (obj != null) 
          {
            return obj;
        }
    }
    return null;
}
