$(function( )
{
  $('#panel3').bind(
    'initpanel',
    function(e)
    {
      $('#gaindiskspace').selectmenu({
          maxHeight : 260,
          icons : [
          { find: '.listitem-drive' }
          ],
          bgImage : function( )
          {
            return 'url(' + $(this).attr('icon') + ')';
          },
          format : function(text, opt)
          {
            var newHTML;

          newHTML =
          '<table><tr>' +
          '<td class="name">' + text + '</td>' +
          '<td class="usage">' +
          '<span class="meter"><span style="width: ' + opt.attr('percentused') + '%"></span></span>' +
          '<span class="freespace">' + opt.attr('title') + '</span>' +
          '</td>' +
          '</tr></table>';

            return newHTML;
          },
          select : function(event, options)
          {
          if (options && options.option)
          {
              tuDispatcher.trigger("gdsDriveSelected", $(options.option));
            }
          }
        });
    });
});
