For slideToggle()
you can write custom filter that will filter out your element:
var that = this;
$(this).parent().find('.gclass2,.gclass3').filter(function() {
return $(this).prev()[0] === that || $(this).prev().prev()[0] === that
}).slideToggle();
Working example see here: http://jsbin.com/IjaboNE/1/edit