$(".clickme").click(function() {
$(this).parent("div.main").toggle();
});
Что касается вашей второй проблемы, вам нужно добавить:
$(this).unbind('click');
В конце любой из ваших функций переключения, и она будет работать так, как вы намерены. Удачи.
РЕДАКТИРОВАТЬ: в ответ на вашу последнюю проблему, это должно сделать это:
$(".abrefecha").click( function() {
var that = this; // save this in that :)
jQuery(this).parent().toggle(
function () {
var itemId = jQuery(this).attr("id");
var itemIndex = $(".showhide").index(this);
var currentItemHeight = b[itemIndex] + 30 + 'px'
jQuery(this).css("overflow","auto");
jQuery(this).animate( { height: currentItemHeight } , 500 );
$(that).html('close'); // change html inside pink to 'close'
$(this).unbind('click');
},
function () {
jQuery(this).css("overflow","hidden")
jQuery(this).animate( { height:"60px" } , 500 );
$(that).html('abrefecha'); // change html back to 'abrefecha'
$(this).unbind('click');
}
);
});