// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

Ajax.Responders.register({
  onCreate: function() {
    if(Ajax.activeRequestCount > 0)
      Element.show('busy');
  },
  onComplete: function() {
    if(Ajax.activeRequestCount == 0)
      Element.hide('busy');
  }
});

Flash={
    show:function(){
        $('flashMessage').visualEffect('appear');
        this.timer=setTimeout('Flash.hide()',5000);
    },
    hide:function(){
        $('flashMessage').visualEffect('fade');
        clearTimeout(this.timer);
        return false;
    }
};

function fixBoxHeight() {
  // match the left menu and content heights
  var m_height = $('menuBox').getHeight();
  var b_height = $('bodyBox').getHeight();
  if (m_height > b_height) {
    $('bodyBox').setStyle({height: (m_height-65)+'px'} );    
  } else {
    $('menuBox').setStyle({height: (b_height-35)+'px'} );    
  }
}