

/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 * @param   object   the background color
 *
 * @return  boolean  whether pointer is set or not
 */

browserName=navigator.appName;
browserVer=parseInt(navigator.appVersion);
if(browserVer >=3)
        version="3";
else
        version="2";

 
function setPointer(theRow, thePointerColor, theNormalBgColor, status)
{

    if (version=="3")
     {
	pfeil=new Image(4,6);
	pfeil.src="pics/menu_arrow.gif";
	nopfeil=new Image(4,6);
	nopfeil.src="pics/menu_no_arrow.gif";
     }


    var theCells = null;
    

    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    var currentColor = null;
    var newColor     = null;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[1].getAttribute) != 'undefined' && typeof(theCells[1].getAttribute) != 'undefined') {
        currentColor = theCells[1].getAttribute('bgcolor');
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 1; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', newColor, 0);
        } // end for

     // Image Code   
        
       if (version=="3")
        {
           if(status == "in")     
                document[theRow.name+"_img"].src=pfeil.src;
           else
                document[theRow.name+"_img"].src=nopfeil.src;
                
        }
        
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        newColor     = (currentColor.toLowerCase() == thePointerColor.toLowerCase())
                     ? theNormalBgColor
                     : thePointerColor;
        for (var c = 1; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = newColor;
        }

     // Image Code   

       if (version=="3")
        {
           if(status == "in")     
                document[theRow.name+"_img"].src=pfeil.src;
           else
                document[theRow.name+"_img"].src=nopfeil.src;
                
        }
    }

    return true;
} // end of the 'setPointer()' function

