/* Confirm function for category/account deletion	*/
/* Function taken from phpMyAdmin 				*/

/**
 * Displays an confirmation box before to submit a "DROP DATABASE" query.
 * This function is called while clicking links
 *
 * @param   object   the link
 * @param   object   the sql query to submit
 *
 * @return  boolean  whether to run the query or not
 */
function confirmLinkDropDB(theLink, theSqlQuery) {
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

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

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

function confirmLinkDropACC(theLink, theSqlQuery) {
    // Confirmation is not required in the configuration file
    // or browser is Opera (crappy js implementation)
    if (confirmMsg == '' || typeof(window.opera) != 'undefined') {
        return true;
    }

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

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

// js form validation stuff
var errorMsg0   = '';
var errorMsg1   = '';
var noDropDbMsg = '';
var confirmMsg  = 'Are you sure you want to';
var confirmMsgDropDB  = 'Warning! This operation will delete all accounts in the current category!';
