/**
 * Sets/unsets the pointer in browse mode
 *
 * @param   object   the table row
 * @param   object   the color to use for this row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointerRow(theRow, thePointerColor)
{
    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;
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined' && typeof(theCells[0].getAttribute) != 'undefined') {
        
		for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].setAttribute('bgcolor', thePointerColor, 0);
        } // end for
    }
    else {        
        for (var c = 0; c < rowCellsCnt; c++) {
            theCells[c].style.backgroundColor = thePointerColor;
        }
    }

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

function setPointerCol(theCol, thePointerColor)
{
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined' && typeof(theCol.getAttribute) != 'undefined' && typeof(theCol.getAttribute) != 'undefined')
	{
            theCol.setAttribute('bgcolor', thePointerColor, 0);
    }
    else
	{        
            theCol.style.backgroundColor = thePointerColor;
    }

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

function removePointerCol(theCol)
{
    // Opera does not return valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined' && typeof(theCol.getAttribute) != 'undefined' && typeof(theCol.getAttribute) != 'undefined')
	{
            theCol.setAttribute('bgcolor', '', 0);
    }
    else
	{        
            theCol.style.backgroundColor = '';
    }

    return true;
}

function winOpen(width, height, url, name)
{
	newWin = window.open(url, name, "locationbar=yes, menubar=no, height="+height+", width="+width+"");
	newWin.focus();
}

function winOpenWithout(witdh, height, url, name)
{
	newWin = window.open(url, name, "locationbar=no, menubar=no, height="+height+", width="+width+", fullscreen=yes");
	newWin.resizeTo(width, height);
	newWin.moveTo(screen.height/2-height/2, screen.width/2 - width/2);
	newWin.focus();
}

