var Blog = {

  addEntry: function() {
    new Effect.BlindDown('add-entry', {duration:0.4});
  },
  
  cancelAddEntry: function() {
    new Effect.BlindUp('add-entry', {duration:0.4});
  },

  editEntry: function(entry_id) {
    new Effect.BlindDown('edit-entry-' + entry_id, {duration:0.4});
  },
  
  cancelEditEntry: function(entry_id) {
    new Effect.BlindUp('edit-entry-' + entry_id, {duration:0.4});
  },
  
  postComment: function(entry_id) {
    new Effect.BlindDown('post-comment-' + entry_id, {duration:0.4});
  },

  showComments: function(entry_id) {
	Element.hide('show-comments-' + entry_id);
    new Effect.BlindDown('comments-' + entry_id, {duration:0.4});
	new Effect.BlindDown('hide-comments-' + entry_id, {duration:0.4});
    /* Field.focus('comment-body'); */
  },

  hideComments: function(entry_id) {
	Element.hide('hide-comments-' + entry_id);
    new Effect.BlindUp('comments-' + entry_id, {duration:0.4});
	Element.show('show-comments-' + entry_id);
    /* Field.focus('comment-body'); */
  },
  
  cancelPostComment: function(entry_id) {
    new Effect.BlindUp('post-comment-' + entry_id, {duration:0.4});
  },
    
  toggleTextarea: function(bigger) {
    if(bigger) {
      Element.addClassName('entry_body',"more");
      Element.removeClassName('entry_body',"less");
      Element.hide("more-space");
      Element.show("less-space");
    } else {
      Element.addClassName('entry_body',"less");
      Element.removeClassName('entry_body',"more");
      Element.hide("less-space");
      Element.show("more-space");
    }
  },
  
  showTextileHelp: function() {
    if($('textile-help')) {
      if(Element.visible('textile-help')) {
        new Effect.BlindUp('textile-help', {duration:0.4});
      } else {
        new Effect.BlindDown('textile-help', {duration:0.4});
      }
    } else {
      new Ajax.Request("/blog/textile_help");
    }
  },
  
  togglePair: function(element1, element2) {
    Element.toggle(element1);
    Element.toggle(element2);
  }

}