
/* Merged Plone Javascript file
 * This file is dynamically assembled from separate parts.
 * Some of these parts have 3rd party licenses or copyright information attached
 * Such information is valid for that section,
 * not for the entire composite file
 * originating files are separated by ----- filename.js -----
 */

/* ----- formsubmithelpers.js ----- */
function inputSubmitOnClick(event) {
    if (!event) var event = window.event; // IE compatibility

    if (hasClassName(this, 'submitting')) {
        return confirm(window.form_resubmit_message);
    } else {
        addClassName(this, 'submitting');
    }
    return true;
}

function registerSubmitHandler() {
    var nodes = cssQuery('input[type=submit]');
    for (var i=0; i<nodes.length; i++) {
        var node = nodes[i];
        if (!node.onclick) {
            node.onclick = inputSubmitOnClick;
        }
    }
}
registerPloneFunction(registerSubmitHandler);


/* ----- cleanupDocumentFirstHeading.js ----- */
function cleanupPageTitle () {

  doc_body = document.getElementById('portal-columns');
  titles = cssQuery("h1", doc_body);
  addClassName(titles[0], 'documentFirstHeading');


  for (i=1; i < titles.length; i++) {
    var node = nodes[i];
    removeClassName(node, "documentFirstHeading");
  }
}

registerPloneFunction(cleanupPageTitle);

