var aNavVisible = new Array();
var aNavJustClosed = false;
var clientOpera = navigator.userAgent.indexOf("Opera") > -1;
var clientIE = navigator.userAgent.indexOf("MSIE") > 1 && !clientOpera;
var clientMozilla = navigator.userAgent.indexOf("Mozilla/5.") == 0 && !clientOpera;

function ShowNav(iId){
	if(!aNavJustClosed){
	NavInp = document.getElementById('navNfof_'+iId); 
	NavhighlightText(NavInp,0,1);
	document.getElementById('divNav_'+iId).style.display=''; 
	aNavVisible[iId] = false;
	document.getElementById('navNfof_'+iId).focus(); 	
	}
}

function nav_mouseover(iId,act){
	aNavVisible[iId] = act;
	//if (!act){
	NavInp = document.getElementById('navNfof_'+iId); 
	NavhighlightText(NavInp,0,1);
	//}
}

function navfoc(iId){
document.getElementById('navNfof_'+iId).focus(); 	
}

function HideNav(iId) { 
	if (!aNavVisible[iId]){
		
		document.getElementById('divNav_'+iId).style.display='none'; 
		aNavJustClosed = true;
		setTimeout('aNavJustClosed = false',100);
		//aNavVisible[iId] = false;
		//window.setTimeout('_HideNav(' + iId + ');', 200);
	}
}

function _HideNav(iId){ 
	if ( !aNavVisible[iId] ) 
		document.getElementById('divNav_'+iId).style.display='none'; 
}



function NavhighlightText(textboxObjBnw, iStart, iEnd) {
  switch(arguments.length) {
    case 1:      textboxObjBnw.select();
    break;
    case 2:      iEnd = textboxObjBnw.value.length;
    case 3:      if (clientIE) {
      var oRange = textboxObjBnw.createTextRange();
      oRange.moveStart("character", iStart);
      oRange.moveEnd("character", -textboxObjBnw.value.length + iEnd);
      oRange.select();
    }
    else if (clientMozilla || clientOpera){
      textboxObjBnw.setSelectionRange(iStart, iEnd);
    }
  }
  textboxObjBnw.focus();
}