/* $Id: functions.js,v 1.11 2002/01/03 12:09:30 loic1 Exp $ */

/**
 * Displays an confirmation box beforme to submit a "DROP" query.
 * This function is called while clicking links
 *
 * @param   object   the link
 * @param   object
 *
 * @return  boolean  whether to run the query or not
 */
function confirmLink(theLink, theSqlQuery)
{
    // Confirmation is not required in the configuration file
    if (confirmMsg == '') {
        return true;
    }

    var is_confirmed = confirm(confirmMsg + ' :\n' + theSqlQuery);
    if (is_confirmed) {
        theLink.href += '&is_js_confirmed=1';
    }

    return is_confirmed;
} // end of the 'confirmLink()' function


/**
 * Visualizza una finestra esterna.
 * Funzione richiamata alla pressione del link
 */
function RicExt(url)
{
	popup = window.open(url,"popDialog","Height=416,Width=700,resizable=yes,status=yes,scrollbars=yes")
	popup.document.close()
}
// end of the 'RicExt()' function


/**
 * 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 setPointer(theRow, thePointerColor)
{
    if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        var theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        var theCells = theRow.cells;
    }
    else {
        return false;
    }

    var rowCellsCnt  = theCells.length;
    for (var c = 0; c < rowCellsCnt; c++) {
			theCells[c].style.backgroundColor = thePointerColor;
    }

    return true;
}
// end of the 'setPointer()' function
function addperm(url)
{
	popup = window.open(url,"popDialog","Height=50,Width=600,status=no,scrollbars=yes")
	popup.document.close()
}
// end of the 'addperm()' function

function bannulla(url)
{
	window.location=url;
}


