/*
 *
 * REUSABLE FUNCTIONS
 *
 */
// Delete Prompt
function confirmDelete() {
    return confirm('Do you want to remove this?');
} // function

/**
 * This will ask the user a question.  You may pass a parameter message to
 * be the display value of the question.
 * @since 2006.03.30
 */
function ask(message) {

    if (message == "") {
        message = 'Are you sure?';
    } // if

    return confirm(message);

} // function


// Show/Hide Span!
function swap_content_image(url_to_images, content_id) {

    displayType=(document.getElementById(content_id).style.display=='none') ? 'block' : 'none';
    document.getElementById(content_id).style.display=displayType;

    document.getElementById(content_id + '_arrowimage').src=(document.getElementById(content_id).style.display=='none')
        ? url_to_images + 'arrow_up.gif'
        : url_to_images + 'arrow_down.gif';

}


// Clear an input box
function clearBox(obj, defaultValue) {
    if (obj.value == defaultValue) {
        obj.value = '';
    } // if
} // function


/**
 * Show/Hide Span!
 */
function swap_content(content_id) {
    displayType=(document.getElementById(content_id).style.display=='none') ? 'block':'none';
    document.getElementById(content_id).style.display=displayType;
}


/**
 * Hide Span!
 */
function hide(content_id) {
    document.getElementById(content_id).style.display='none';
} // function


/**
 * Show Span!
 */
function show(content_id) {
    document.getElementById(content_id).style.display='block';
} // function


/**
 * changeClass
 *
 * Change the class of an HTML object.
 *
 * @param string id 		Element Id
 * @param string newClass 	New Class Name
 * @return true
 * @since 2006.01.11
 */
function changeClass(id, newClass) {

    identity=document.getElementById(id);
    identity.className=newClass;

    return true;

} // function


/**
 * This function will display some help text via alert to the user
 * on how to use the date input field.
 */
function strtotimeHelp() {
    alert(
    "You may use the following formats for Date fields:\n"+
    "1972-09-24\n"+
    "72-9-24\n"+
    "72-09-24\n"+
    "9/24/72\n"+
    "24 September 1972\n"+
    "24 Sept 72\n"+
    "24 Sep 72\n"+
    "Sep 24, 1972\n"+
    "24-sep-72\n"+
    "24sep72\n"
    );
} // function