
// ---------------------- Browser detection ----------------------------
function ns4browser()
{ // returns true if Netscape and version < 6
   var agt = navigator.userAgent.toLowerCase();
   if((agt.indexOf('mozilla') != -1) && (agt.indexOf('gecko') == -1)
        && (agt.indexOf('compatible') == -1) && (agt.indexOf('spoofer') == -1)
        && (parseInt(navigator.appVersion) < 5))
     return true;
   else return false;
}
function ie5browser()
{ // returns true if MSIE and version < 6
   var agt = navigator.userAgent.toLowerCase();
   if(agt.indexOf('msie') == -1) return false;
   var idx = agt.indexOf('msie') + 5;
   var vstr = agt.substring(idx, idx+10);
   if(parseInt(vstr) < 6) return true;
   else return false;
}

function getelbyid(id)
{
  if(ns4browser())	return document.ids[id];
  else if(ie5browser())	return document.all[id];
  else			return document.getElementById(id);
}
function getstylebyid(id)
{
  if(ns4browser())	return document.ids[id];
  else if(ie5browser())	return document.all[id].style;
  else			return document.getElementById(id).style;
}

