   
  $(document).ready(function() {

    $('.showmore').each(hideMore);  

  });



function hideMore(aObj){
  
  if (aObj==0){
     aObj=$(this);

  //if ($(this).siblings('.showmore_text').length <= 0){
      var spanopen = ""; 
      var textnodes = $(this).parent().contents()
          .filter(function() {
                return this.nodeType == 3;
              })
          .last()
          .wrap('<span class="showmore_text"></span>');

      $(this).parent().next('p').addClass('showmore_text');  
  };
  
    aObj.nextAll().slideUp('fast');
    aObj.parent().next('.showmore_text').slideUp('fast');
  
    aObj.text('more ...');
    aObj.unbind();
    aObj.click(function(event) {
      event.preventDefault();
      showMore($(this));
    });
}
function showMore(aObj){
  aObj.text('hide ...');
  
  
  aObj.nextAll().css('display','inline');
  aObj.parent().next('.showmore_text').slideDown('fast');
  aObj.unbind();
  aObj.click(function(event) {
      event.preventDefault();
      hideMore(aObj);
    });
    
}

