$(document).ready(function() {
  if(window.rcmail){
    rcmail.addEventListener('init', function(evt) {
      compose_in_taskbar_move_icon();
      window.setTimeout("rcmail.enable_command('compose', true);",2000);
      if(rcmail.env.action == 'compose'){
        if(rcmail.env.skin == 'larry')
          $('#compose_button').children().css('color','#3cf');
      }
    });
  }
});

function compose_in_taskbar_move_icon(){
  try{
    // move button to right place on toolbar and show
    $('#' + rcmail.buttons['tcompose'][0].id).insertAfter('#' + rcmail.buttons['mail'][0].id);
    $('#' + rcmail.buttons['tcompose'][0].id).show();
  }
  catch(e){}
}