    function toggle_div(div_id, show_text, hide_text) {
        jq_div_id       = '#' + div_id;
        jq_show_hide_id = jq_div_id + '_' + 'show_hide';
        $(jq_div_id).slideToggle('slow', function () {
            if ($(jq_div_id).css('display') == 'none') {
                $(jq_show_hide_id).text(show_text);
            }
            else {
                $(jq_show_hide_id).text(hide_text);
            }
        });
        return false;
    }
    function show_dialog(title, val, val_is_url) {
    var $dialog = $('<div></div>')
                      .dialog({
                          autoOpen : false,
                          title    : title,
                          modal    : false,
                          height   : 300,
                          width    : 400,
                          buttons  : {
                              Close: function() {
                                  $( this ).dialog( "close" );
                              }
                          }
                      });
    if (val_is_url == true) {
        $.get(val,
              {},
              function(data) {
                  $dialog.html(data).dialog('open');
              });
    }
    else {
        $dialog.html(val).dialog('open');
    }
    return false;
}
function override_onclick(id, confirm_msg, on_click) {
    $('#' + id).click(function() {
        confirmed = true;
        if (confirm_msg.length > 0) {
            confirmed = confirm(confirm_msg);
        }
        if (confirmed) {
            if (on_click.length > 0) {
                eval(on_click);
                return false;
            }
        }
        return confirmed;
    });
}



