var bActive = 0;
var iDelay=2000;

function timedout(sID)
{
	if (bActive==0)
	{
		hide(sID);
	}
}


function Is()
{   // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase()

    // --- BROWSER VERSION ---
    this.major = parseInt(navigator.appVersion);//stringToNumber(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion)

    this.nav  = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1)))
    this.nav2 = (this.nav && (this.major == 2))
    this.nav3 = (this.nav && (this.major == 3))
    this.nav4 = (this.nav && (this.major == 4))
	
	//Netscape 6
	this.nav5 =	(this.nav && (this.major == 5))
	this.nav6 = (this.nav && (this.major == 5))
	this.gecko = (this.nav && (this.major >= 5))

    this.ie   = (agt.indexOf("msie") != -1)
    this.ie3  = (this.ie && (this.major == 2))
    this.ie4  = (this.ie && (this.major == 3))
    this.ie5  = (this.ie && (this.major == 4))

    this.opera = (agt.indexOf("opera") != -1)
     
    this.nav4up = this.nav && (this.major >= 4)
    this.ie4up  = this.ie  && (this.major >= 4)
}


var is = new Is();


function getElt() 
{ if (is.nav4)
  {
    var currentLayer = document.layers[getElt.arguments[0]];
    for (var i=1; i<getElt.arguments.length && currentLayer; i++)
    {   currentLayer = currentLayer.document.layers[getElt.arguments[i]];
    }
    return currentLayer;
  } 
  else if(document.getElementById && document.getElementsByName)
  { 
    var name = getElt.arguments[getElt.arguments.length-1];
    if(document.getElementById(name))                      //First try to find by id
       return document.getElementById(name);
    else if (document.getElementsByName(name))             //Then if that fails by name
	   return document.getElementsByName(name)[0];
  }
  else if (is.ie4up) {
    var elt = eval('document.all.' + getElt.arguments[getElt.arguments.length-1]);
    return(elt);
  }

}

function showElt(elt)
{
	setEltVisibility(elt,'visible');
}

function hideElt(elt)
{
	setEltVisibility(elt, 'hidden');
}
/* value must be "visible", "hidden", or "inherit".
   These values work on Nav4, Gecko and IE for setting visibility.
*/

function setEltVisibility (elt, value)
{  if (is.nav4) elt.visibility = value;
   else if (elt.style) elt.style.visibility = value;
}


function show( sDiv )
{
	objElement = getElt(sDiv);
	showElt(objElement);
}

function hide( sDiv )
{
	objElement = getElt(sDiv);
	hideElt(objElement);
}

//isNN = (document.layers) ? 1 : 0;
//isIE = (document.all) ? 1 : 0;
//
//function show( sDiv )
//{
//    objElement = (isNN) ? eval("document." + sDiv) : eval(sDiv);
//    if ( isNN ) { objElement.visibility="show"; }
//    if ( isIE ) { objElement.style.visibility="visible"; }
//}
//
//function hide( sDiv )
//{
//    objElement = (isNN) ? eval("document." + sDiv) : eval(sDiv);
//    if ( isNN ) { objElement.visibility="hide"; }
//    if ( isIE ) { objElement.style.visibility="hidden"; }
//}
