jQuery(function($){
  var h = $('#selection-block').find('.content').height();
  var collapse = function(e){
    var _this = $(this);
    _this.find('.content').stop().animate({
      height: 0
    },200
    ,function(){
      $(this).css({display: 'none'});
      _this.find('.bg').find('span').css({left: 0+"px"});
      _this.unbind('mouseleave', collapse);
      _this.unbind('click').bind('click', expand);
    });
  }
  var expand = function(e){
    $(this).find('.bg span').css({left: -210+"px"});
    $(this).unbind('click', expand).bind('mouseleave', collapse);
    $(this).find('.content').css({zIndex:10, height: 0+"px", left:0, display: "block"}).stop().animate({
      height: h
    },200);
    e.preventDefault();
  }
  
  $('#selection-block').bind('click', expand);
});//(jQuery);
