    var renderStartTime = new Date();





    function getStyleObject(objectId) {
      // cross-browser function to get an object's style object given its id
      if(document.getElementById && document.getElementById(objectId)) {
  	  // W3C DOM
	  return document.getElementById(objectId).style;
      } else if (document.all && document.all(objectId)) {
 	  // MSIE 4 DOM
 	  return document.all(objectId).style;
      } else if (document.layers && document.layers[objectId]) {
	  // NN 4 DOM.. note: this won't find nested layers
	  return document.layers[objectId];
      } else {
	  return false;
      }
    } 

    function getObject(objectId) {
      // cross-browser function to get an object given its id
      // If you need to change the style of an object or its display/visibility
      // use one of the other methods in this template
      // This function won't work for NN 4 DOM ==> Only use internally
      if(document.getElementById && document.getElementById(objectId)) {
  	  // W3C DOM
	  return document.getElementById(objectId);
      } else if (document.all && document.all(objectId)) {
 	  // MSIE 4 DOM
 	  return document.all(objectId);
      } else {
	  return false;
      }
    }

    function changeObjectVisibility(objectId, newVisibility) {
      // get a reference to the cross-browser style object and make sure the object exists
      var styleObject = getStyleObject(objectId);
      if(styleObject) {
	  styleObject.visibility = newVisibility;
	  return true;
      } else {
	 // we couldn't find the object, so we can't change its visibility
	 return false;
      }
    } 


    function changeObjectDisplay(objectId, newDisplay) {
      // get a reference to the cross-browser style object and make sure the object exists
      var styleObject = getStyleObject(objectId);
      if(styleObject) {
	  styleObject.display = newDisplay;
	  return true;
      } else {
	  // we couldn't find the object, so we can't change its visibility
	  return false;
      }
    }




    // cross platform equiv. to document.getElementById
    function gGetElementById(s) {
      var o = (document.getElementById ? document.getElementById(s) : document.all[s]);
      return o == null ? false : o;
    }

    // simple hide/display
    function toggleVisibility(id) {
      var o = gGetElementById(id);
      if (o != null) {
        if (o.style.display == 'none')
          o.style.display = 'block';
        else
          o.style.display = 'none';
      }
    }

    function isGoodBrowser() {
     var ua=navigator.userAgent;
     var isGood=0;
       if ((ua.indexOf("MSIE 5")!=-1) 
 	|| (ua.indexOf("MSIE 6")!=-1) 
	|| (ua.indexOf("Mozilla/5")!=-1) )
	{ 
	  if (ua.indexOf("Opera")==-1){
	    var isGood = 1;
	}
      }
      return isGood;
    }
    

    var rowWithMouse = null;


    
    // finds row number
    function getRowFromBox(box) {
      var row = null;
      if (box.parentNode && box.parentNode.parentNode) {
        row = box.parentNode.parentNode;
      } else if (box.parentElement && box.parentElement.parentElement) {
        row = box.parentElement.parentElement;
      }
      if (row != null && row.id.indexOf('tr_') == 0) {
        return row;
      }
      return document.getElementById('tr_' + box.id.substr(4));
    }

   



// rollovers for border and link color
 function over(myId, isInRow) {
      // myId is our own integer id, not the DOM id
      // isInRow is 1 for onmouseover, 0 for onmouseout
      var row = document.getElementById('filename_' + myId);
      var box = document.getElementById('preview_' + myId);
      rowWithMouse = (isInRow) ? row : null;
      rowUpdateBg(row, box);
    }
   

   function rowUpdateBg(row, box) {
      if (box && box.checked) {
        box.style.borderColor = "#cccccc";
        row.style.color = "#0072BB";
       
      } else {
        box.style.borderColor = (row == rowWithMouse) ? '#0072BB' : '#cccccc';
        row.style.color = (row == rowWithMouse) ? '#0072BB' : '';
      }
    }


    function initRolloverTables() {
      for (var i=0; i < document.forms.length; i++) {
        var f = document.forms[i];
        if (f.className == 'rollover' && f.toggleAll) {
          for (var j=0; j < f.elements.length; j++) {
            var box = f.elements[j];
            if (isElemBox(box) && box.checked == true) {
              var row = getRowFromBox(box);
              rowUpdateBg(row, box);
            }
          }
          f.toggleAll.checked = isAllSelected(f);
        }
      }
    }


    
 
 
 // below is for expanding and contacting rows
 
 
 var isNav4, isNav6, isIE4;

/*
 * Browser version snooper; determines your browser
 * (Navigator 4, Navigator 6, or Internet Explorer 4/5)
 */
function setBrowser()
{
    if (navigator.appVersion.charAt(0) == "4")
    {
        if (navigator.appName.indexOf("Explorer") >= 0)
        {
            isIE4 = true;
        }
        else
        {
            isNav4 = true;
        }
    }
    else if (navigator.appVersion.charAt(0) > "4")
    {
        isNav6 = true;
    }
}

/*
 *
 * Given a selector string, return a style object
 * by searching through stylesheets. Return null if
 * none found
 *
 */
function getStyleBySelector( selector )
{
    if (!isNav6)
    {
        return null;
    }
    var sheetList = document.styleSheets;
    var ruleList;
    var i, j;

    /* look through stylesheets in reverse order that
       they appear in the document */
    for (i=sheetList.length-1; i >= 0; i--)
    {
        ruleList = sheetList[i].cssRules;
        for (j=0; j<ruleList.length; j++)
        {
            if (ruleList[j].type == CSSRule.STYLE_RULE &&
                ruleList[j].selectorText == selector)
            {
                return ruleList[j].style;
            }   
        }
    }
    return null;
}

/*
 *
 * Given an id and a property (as strings), return
 * the given property of that id.  Navigator 6 will
 * first look for the property in a tag; if not found,
 * it will look through the stylesheet.
 *
 * Note: do not precede the id with a # -- it will be
 * appended when searching the stylesheets
 *
 */
function getIdProperty( id, property )
{
    if (isNav6)
    {
        var styleObject = document.getElementById( id );
        if (styleObject != null)
        {
            styleObject = styleObject.style;
            if (styleObject[property])
            {
                return styleObject[ property ];
            }
        }
        styleObject = getStyleBySelector( "#" + id );
        return (styleObject != null) ?
            styleObject[property] :
            null;
    }
    else if (isNav4)
    {
        return document[id][property];
    }
    else
    {
        return document.all[id].style[property];
    }
}

/*
 *
 * Given an id and a property (as strings), set
 * the given property of that id to the value provided.
 *
 * The property is set directly on the tag, not in the
 * stylesheet.
 *
 */
function setIdProperty( id, property, value )
{
    if (isNav6)
    {
        var styleObject = document.getElementById( id );
        if (styleObject != null)
        {
            styleObject = styleObject.style;
            styleObject[ property ] = value;
        }
        
    }
    else if (isNav4)
    {
        document[id][property] = value;
    }
    else if (isIE4)
    {
         document.all[id].style[property] = value;
    }
}

/*
 *
 * Move a given id.  If additive is true,
 * then move it by xValue dots horizontally and
 * yValue units vertically.  If additive is
 * false, then move it to (xValue, yValue)
 *
 * Note: do not precede the id with a # -- it will be
 * appended when searching the stylesheets
 *
 * Note also: length units are preserved in Navigator 6
 * and Internet Explorer. That is, if left is 2cm and
 * top is 3cm, and you move to (4, 5), the left will
 * become 4cm and the top 5cm.
 *
 */
function generic_move( id, xValue, yValue, additive )
{
    var left = getIdProperty(id, "left");
    var top = getIdProperty(id, "top");
    var leftMatch, topMatch;

    if (isNav4)
    {
        leftMatch = new Array( 0, left, "");
        topMatch = new Array( 0, top, "");
    }
    else if (isNav6 || isIE4 )
    {
        var splitexp = /([-0-9.]+)(\w+)/;
        leftMatch = splitexp.exec( left );
        topMatch = splitexp.exec( top );
        if (leftMatch == null || topMatch == null)
        {
            leftMatch = new Array(0, 0, "px");
            topMatch = new Array(0, 0, "px");
        }
    }
    left = ((additive) ? parseFloat( leftMatch[1] ) : 0) + xValue;
    top = ((additive) ? parseFloat( topMatch[1] ) : 0) + yValue;
    setIdProperty( id, "left", left + leftMatch[2] );
    setIdProperty( id, "top", top + topMatch[2] );
}

/*
 *
 * Move a given id to position (xValue, yValue)
 *
 */
function moveTo( id, x, y )
{
    generic_move( id, x, y, false );
}

/*
 *
 * Move a given id to (currentX + xValue, currentY + yValue)
 *
 */
function moveBy( id, x, y)
{
    generic_move( id, x, y, true );
}

/*
 *
 * Function used when converting rgb format colors
 * from Navigator 6 to a hex format
 *
 */ 
function hex( n )
{
    var hexdigits = "0123456789abcdef";
    return ( hexdigits.charAt(n >> 4) + hexdigits.charAt(n & 0x0f) );
}

/*
 *
 * Retrieve background color for a given id.
 * The value returned will be in hex format (#rrggbb)
 *
 */ 
function getBackgroundColor( id )
{
    var color;

    if (isNav4)
    {
        color = document[id].bgColor;
    }
    else if (isNav6)
    {
        var parseExp = /rgb.(\d+),(\d+),(\d+)./;
        var rgbvals;
        color = getIdProperty( id, "backgroundColor" );
        if (color)
        {
            rgbvals = parseExp.exec( color );
            if (rgbvals)
            {
                color = "#" + hex( rgbvals[1] ) + hex( rgbvals[2] ) +
                    hex( rgbvals[3] );
            }
        }
        return color;
    }
    else if (isIE4)
    {
        return document.all[id].backgroundColor;
    }
    return "";
}

/*
 *
 * Return a division's document
 * 
 */
function getDocument( divName )
{
    var doc;

    if (isNav4)
    {
        doc = window.document[divName].document;
    }
    else if (isNav6)
    {
        doc = document;
    }
    else if (isIE4)
    {
        doc = document;
    }
    return doc;
}

 
 /**********************************************************
    <span>s or <div>s come in pairs. The
    "contracted" forms have id=c0, c1, c2 (etc.), and
    the "expanded" forms have id=e0, e1, e2 (etc.)

    This function swaps the pair with the given
    divNum, and shows the expanded div if expanding is
    true, or the short one if expanding is false.
**********************************************************/
function swapDiv( divNum, expanding )
{
    if (expanding)
    {
        setIdProperty("c" + divNum, "display", "none");
        setIdProperty("e" + divNum, "display", "inline");
                
        
    }
    else
    {
        setIdProperty("e" + divNum, "display", "none");
        setIdProperty("c" + divNum, "display", "inline");
    }
}



function changeClass(n, h) {
	document.getElementById('category-bar'+n).className = h;
}


function showMenu(divNum) {
    if (getIdProperty("s" + divNum, "display") != "block" ) {
        setIdProperty("s" + divNum, "display", "block");
        changeClass(divNum, 'mheadOpen');   
    } else {
        setIdProperty("s" + divNum, "display", "none");
        changeClass(divNum, 'mhead');
    }
}


function go(url) {
    location.href = url;
}

function writetostatus(input){
    window.status=input;
    return true;
}


function appear( targetId ){
  if (document.getElementById){
        target = document.getElementById( targetId );
           if (target.style.display == "none"){
              target.style.display = "block"; //""
           } else {
              target.style.display = "block";
           }
     }
} 

function disappear( targetId ){
  if (document.getElementById){
        target = document.getElementById( targetId );
           if (target.style.display == "none"){
              target.style.display = "none";
           } else {
              target.style.display = "none";
           }
     }
} 





setBrowser();
