var query_confirm_request_accept_now   = 'Požadavek číslo %id% bude Vámi přijmut s aktuálním datumem a časem.';

/**
 * Displays an confirmation box before the action.
 * This function is called while clicking links
 *
 * @param   object   the link
 * @param   object   the query to submit
 * @param   object   the id to be inserted in the query (%id%)
 *
 * @return  boolean  whether to run the action or not
 */
function confirm_link( theLink, theQuery, theId )
{
    // browser is Opera (crappy js implementation)
    if (typeof(window.opera) != 'undefined')
    {
        return true;
    }

    // The replace function (js1.2) isn't supported
    if (typeof(theQuery.replace) == 'undefined')
    {
        return true;
    }

    theQuery = theQuery.replace( '%id%', theId );
    var is_confirmed = confirm( theQuery );
    if (is_confirmed)
    {
        theLink.href += '&is_js_confirmed=1';
    }

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

/**
 * Switch object visibility
 *
 * @param   string   id of the object to be shown
 * @param   string   id of the object to be hidden
 *
 * @return  boolean  whether to run the action or not
 */
function change_visibility( showId, hiddId )
{
  document.getElementById(showId).className = document.getElementById(hiddId).className.replace(' hidden', '');
  document.getElementById(hiddId).className += ' hidden';
  return false;
} // end of the 'change_visibility()' function

