
var Expandable = Class.create();
Expandable.prototype = {
  
  closed: true,
  
  initialize: function() {
    
    var th = this;
    
    var more_link = $$('.more_home_text').first();
    if( more_link ) {
      more_link.observe('click',th.toggle_text.bindAsEventListener(th));      
    }
    
  },
  
  toggle_text: function(e) {
    
    var th = this;
    
    var text = $('expandable_text');
    
    if( th.closed ) {
      
      text.setStyle({ 'display': 'none' });
      text.removeClassName('hide');
      
      e.target.update('less');
      
      new Effect.BlindDown(text,{ duration: 0.5 });
      
      th.closed = false;
      
    } else {
      
      new Effect.BlindUp(text,{ duration: 0.5 });
      
      th.closed = true;
      e.target.update('more');
      
    }
    
    Event.stop(e);
    
  }
  
};

function initExpandable() { var expandable = new Expandable(); }
document.observe('dom:loaded',initExpandable);