var ns = navigator.appName == "Netscape";
var ns4 = (ns && parseInt(navigator.appVersion) == 4);
var ns5 = (ns && parseInt(navigator.appVersion) > 4);


function okraBrowserType()
{
  if (ns)
  {
    if (ns4)
    {
      return "N4";
    }
    else if (ns5)
    {
      return "N5";
    }
  }
  else
  {
    return "IE";
  }
}

/*
esta retorna um objeto do documento. Criada para facilitar as coisas já que os comandos para obter
objetos do documento diferem por browser
*/
function okraDocumentObject(sId)
{
  if (ns4)
    return (document[sId]);
  else
    if (ns5)
      return (documentById(sId));
//    else
//      return (document.all[sId]);

}


// este aqui provou ser mais eficaz
function MM_findObj(n, d)
{  if (!d)
    d=document;

  return d.getElementById(n);

}


function okraGetClientWidth()
{
  if (ns)
    return (window.innerWidth-20 /*o Netscape desconsidera a scrollbar*/);
  else
    return (document.body.clientWidth);
}

function okraGetClientHeight()
{
  if (ns)
    return (window.innerHeight-20 /*o Netscape desconsidera a scrollbar*/);
  else
    return (document.body.clientHeight);
}


function okraSetPos(sObj, nLeft, nTop)
{
  var obj = MM_findObj(sObj); //okraDocumentObject(sObj);


  if (ns4)
  {
    obj["left"] = nLeft;
    obj["top"] = nTop;
  }
  else
  {
    if (ns5)
    {
      obj["style"]["left"] = nLeft+"px";
      obj["style"]["top"] = nTop+"px";
    }
    else
    {
      obj["style"]["left"] = nLeft;
      obj["style"]["top"] = nTop;
    }
  }
}
