Changing background sync'd with jQueryUI Tabs

I love to use jQuery UI plugins. The one I use constantly is Tabs and this time I needed to sync the auto-changing of tab with the background. For this I used an event called tabsshow to trigger my function + the code I wrote yesterday for full-page background with CSS: /@author Jose Luis Rivas joseluis@eserre.com * * @desc swaping full-background pages with jQuery UI's Tabs plugin events./

$(document).ready(function() {

$( "#slides" ).bind( "tabsshow", function(event, ui) {
    var tabattr = $('.ui-state-active').find('a').attr('href');

    switch(tabattr) {
        case '#tab1':
            $('img#bg').attr('src', '/img/tab1.jpg');
            break;

        case '#tab2':
            $('img#bg').attr('src', '/img/tab2.jpg');
            break;

        default:
            $('img#bg').attr('src', '/img/tab1.jpg');
                            break;
    }

});

});

What it does the script?

Finds the active-tab identified with the .ui-state-active class and then changes the img tab src attribute according to the href attribute of the active-tab.

Any comment goes best to my twitter here.