
//++
// cross browser get object by id or name.  if the name is
// not a string, it is passed by unchanged since it can't be an id.
// if it is a string, it tries DOM first, then IE 4/5 then Netscape 4
// if forceIEBehavior is true and the getElementById
// fails, routine will try to find a name instead of IE
//--
function getObj( name, forceIEBehavior )
{
    var newObj;
    if ( typeof name == "string" ) {
        if (document.getElementById) {
            newObj = document.getElementById(name);
            if ( newObj == null && forceIEBehavior != null & forceIEBehavior ) {
                var newObjArray = document.getElementsByName( name );
                if ( newObjArray != null && newObjArray.length > 0 ) 
                    newObj = newObjArray[ 0 ];
            }else{
                var newObjArray = document.getElementsByName( name );
                if ( newObjArray != null && newObjArray.length > 0 ) 
                    newObj = newObjArray[ 0 ];
            }
        }
        else if (document.all) {
            newObj = document.all[name];
        }
        else if (document.layers) {
            newObj = document.layers[name];
        }
    }
    else
        newObj = name;
    return newObj;
}


function statusNavClick(id, numTabs) {
	var elStatusNavPrefix = "statusNav";
	var elStatusBodyPrefix = "statusBody";
	
	
	var sNavElement = getObj("statusNav" + id);
	if (sNavElement.className != elStatusNavPrefix + "On") {
		for (var i=0; i<numTabs; i++) {
			getObj("statusNav" + i).className = elStatusNavPrefix + "Off";
			getObj("statusBody" + i).style.display = "none";  // hide body under inactive tabs
		}
		if (id < numTabs-1) {
			sNavElement.className = elStatusNavPrefix + "On";  // active tab
			getObj("statusNav" + (id+1)).className = elStatusNavPrefix + "OffAfterOn";  // set tab left of active to special style
		} else {
			// last element
			sNavElement.className = elStatusNavPrefix + "OnLast";
		}
		getObj(elStatusBodyPrefix + id).style.display = "block";  // show body under active tab
	}
}
