function setClass(theRow, theRowNum, theAction, theDefaultClass, thePointerClass, theMarkClass)
/* Appended from "setPointer" in file "libraries/functions.js" within phpMyAdmin */
/* $Id: functions.js,v 1.26 2002/10/25 14:11:06 loic1 Exp $ */

//--- Achtung: diese Function läuft (noch) nicht unter NS 7 - muss noch umgestellt werden! ---
//--- Bis dahin untenstehende Function setPointer verwenden ---
{
    var theCells = null;
    // 1. Pointer and mark feature are disabled or the browser can't get the row -> exits
    if ((thePointerClass == '' && theMarkClass == '') || typeof(theRow.style) == 'undefined') {
        return false;
    }
    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }
    // 3. Gets the current class...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentClass = null;
    var newClass     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentClass = theCells[0].getAttribute('className');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentClass = theCells[0].className;
        domDetect    = false;
    } // end 3

    // 4. Defines the new class
    // 4.1 Current class is the default one
    if (currentClass == ''
        || currentClass.toLowerCase() == theDefaultClass.toLowerCase()) {
        if (theAction == 'over' && thePointerClass != '') {
            newClass              = thePointerClass;
        }
        else if (theAction == 'click' && theMarkClass != '') {
            newClass              = theMarkClass;
        }
    }
    // 4.1.2 Current class is the pointer one
    else if (currentClass.toLowerCase() == thePointerClass.toLowerCase()) {
        if (theAction == 'out') {
            newClass              = theDefaultClass;
        }
        else if (theAction == 'click' && theMarkClass != '') {
            newClass              = theMarkClass;
        }
    }
    // 4.1.3 Current class is the marker one
    else if (currentClass.toLowerCase() == theMarkClass.toLowerCase()) {
        if (theAction == 'click') {
            newClass              = (thePointerClass != '')
                                  ? thePointerClass
                                  : theDefaultClass;
        }
    } // end 4

    // 5. Sets the new class...
    if (newClass) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('className', newClass, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].className = newClass;
            }
        }
    } // end 5

    return true;
} // end of the 'setClass()' function

function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
/* Appended from "setPointer" in file "libraries/functions.js" within phpMyAdmin */
/* $Id: functions.js,v 1.26 2002/10/25 14:11:06 loic1 Exp $ */
{
	var theCells = null;
	// 1. Pointer and mark feature are disabled or the browser can't get the row -> exits
//    if ((thePointerColor == '' && theMarkColor == '') || typeof(theRow.style) == 'undefined') return false;
    if ((theMarkColor == '') || typeof(theRow.style) == 'undefined') return false;
    if (theDefaultColor == '#') theDefaultColor = 'transparent';

	// 2. Gets the current row and exits if the browser can't get it
	if (typeof(document.getElementsByTagName) != 'undefined') {
		theCells = theRow.getElementsByTagName('td');
	} else if (typeof(theRow.cells) != 'undefined') {
		theCells = theRow.cells;
	} else {
		return false;
	}

	// 3. Gets the current color...
	var rowCellsCnt  = theCells.length;
	var domDetect    = null;
	var currentColor = null;
	var newColor     = null;
	if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
		// 3.1 ... with DOM compatible browsers except Opera that does not return valid values with "getAttribute"
		currentColor = theCells[0].getAttribute('bgcolor');
		domDetect    = true;
	} else {
		// 3.2 ... with other browsers
		currentColor = theCells[0].style.backgroundColor;
		domDetect    = false;
    } // end 3

	// 4. Defines the new color
    if (!currentColor || currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
		// 4.1 Current color is the default one
		if 		(theAction == 'over' && thePointerColor != '')	newColor = thePointerColor;
		else if	(theAction == 'click' && theMarkColor != '')	newColor = theMarkColor;
		msg = "Set";
	} else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) {
		// 4.1.2 Current color is the pointer one
		if 		(theAction == 'out')							newColor = theDefaultColor;
		else if (theAction == 'click' && theMarkColor != '')	newColor = theMarkColor;
		msg = "Unset";
	} else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
		// 4.1.3 Current color is the marker one
		if (theAction == 'click') 								newColor = (thePointerColor != '')? thePointerColor:theDefaultColor;
	} else if (theAction == 'out')								newColor = theDefaultColor;
	// end 4

	// 5. Sets the new color...
	if (newColor) {
		var c = null;
		if (domDetect) {
			// 5.1 ... with DOM compatible browsers except Opera
			for (c = 0; c < rowCellsCnt; c++) {
				if (theAction == 'out' && theDefaultColor == 'transparent') theCells[c].style.removeAttribute('bgcolor','false');
				else theCells[c].setAttribute('bgcolor', newColor, 0);
			} // end for
		} else {
			// 5.2 ... with other browsers
			for (c = 0; c < rowCellsCnt; c++) {
				if (theAction == 'out' && theDefaultColor == 'transparent') theCells[c].style.backgroundColor = '';
				else theCells[c].style.backgroundColor = newColor;
			}
		}
	} // end 5
	return true;
} // end of the 'setPointer()' function

function setClass(theRow, theRowNum, theAction, theDefaultClass, thePointerClass, theMarkClass)
/* Appended from "setPointer" in file "libraries/functions.js" within phpMyAdmin */
/* $Id: functions.js,v 1.26 2002/10/25 14:11:06 loic1 Exp $ */
{
    var theCells = null;
    // 1. Pointer and mark feature are disabled or the browser can't get the row -> exits
    if ((thePointerClass == '' && theMarkClass == '') || typeof(theRow.style) == 'undefined') {
        return false;
    }
    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }
    // 3. Gets the current class...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentClass = null;
    var newClass     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        currentClass = theCells[0].getAttribute('className');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentClass = theCells[0].className;
        domDetect    = false;
    } // end 3

    // 4. Defines the new class
    // 4.1 Current class is the default one
    if (currentClass == ''
        || currentClass.toLowerCase() == theDefaultClass.toLowerCase()) {
        if (theAction == 'over' && thePointerClass != '') {
            newClass              = thePointerClass;
        }
        else if (theAction == 'click' && theMarkClass != '') {
            newClass              = theMarkClass;
        }
    }
    // 4.1.2 Current class is the pointer one
    else if (currentClass.toLowerCase() == thePointerClass.toLowerCase()) {
        if (theAction == 'out') {
            newClass              = theDefaultClass;
        }
        else if (theAction == 'click' && theMarkClass != '') {
            newClass              = theMarkClass;
        }
    }
    // 4.1.3 Current class is the marker one
    else if (currentClass.toLowerCase() == theMarkClass.toLowerCase()) {
        if (theAction == 'click') {
            newClass              = (thePointerClass != '')
                                  ? thePointerClass
                                  : theDefaultClass;
        }
    } // end 4

    // 5. Sets the new class...
    if (newClass) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('className', newClass, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].className = newClass;
            }
        }
    } // end 5

    return true;
} // end of the 'setClass()' function
