/*
# ====================================================================
#
# Copyright (c) 2006 @ANT_COMPANY_NAME@. All rights reserved.
#
# This software is the confidential and proprietary information of @ANT_COMPANY_NAME@.
# You shall not disclose such Confidential Information and shall use it only in accordance
# with the terms of the license agreement you entered into with @ANT_COMPANY_NAME@.
#
# ====================================================================
#
# For more information, please see <@ANT_DOMAIN_NAME@>
#
*/

/**
 * Method to provide functionality similar to java assert.
 */
function assert(condition, errMsg) {
    if (condition == false) {
        msg = errMsg ? errMsg : "Assert condition failed";

        alert(msg);

        throw msg;
    }
}

/**
 * Sets the display style of a given element to either "none" or "block",
 * hiding or displaying the element on the page.
 */
function toggleDisplay(id) {
    var e = document.getElementById(id);

    assert(e != null, "Element with given id is not in DOM [id=" + id + ']');

    if (e.style.display == 'none') {
        e.style.display = 'block';
        e.style.visibility = 'visible';
    }
    else {
        e.style.display = 'none';
        e.style.visibility = 'hidden';
    }
}

