$('document').ready(function() {
    $('.wc_form .form-item label').hover(
        function(event) {
           $(this).parent().find('div.description').show();
        },
        function(event) {
           $(this).parent().find('div.description').hide();
        } );

    /* wrap a div around the submit buttons */
//cjpo    $('.wc_form .form-submit:first').before('<div class="submit_clearer">');

    /* tweak the label of checkboxes and radio buttons */
    $('.wc_form label+.form-radios,.wc_form label+.form-checkboxes').parent().find('label:first').addClass('form-collections-label');
    /* accountadmin account edit has a list of IP's that has this format */
    $('.wc_form label .form-checkbox').parent('label').addClass('form-collections-label');


    /* hide the required "*" and instead append it to the description */
    $('.wc_form span.form-required').each(function() {
        $(this).hide()
        .parent('label').addClass('form-required');
        $(this).parents('div.form-item').find('div.description').append('<br /><span class="form-required">'+$(this).attr('title')+'</span>');
    });

    /* replace cancel links with buttons */
    $('a:contains(cancel), a:contains(Cancel)').after('<input type="button" value="Cancel" onclick="history.back();" />').remove();

    $('table.accounts-table tr').hover(function() { $(this).addClass('accounts-table-hover'); }, function() { $(this).removeClass('accounts-table-hover'); });

  /* highlight the top level menu if a submenu is active */
  $('#navlinks a.active').parents('li').children('a').addClass('active');

});


