you can do
switchelements(elements);
function switchelements(e){
e.eq(0).delay(1000).fadeIn(1000,function(){
if($(this).children(".section").length>0){
var inner=$(this).children(".section");
switchelements(inner);
}
else{
$(this).delay(1000).fadeOut(1000,function(){
if(e.length>=2){
e.splice(0,1);
switchelements(e);
}else{
if($(this).parent(".switch").next("switch")){
$(this).parent(".switch").delay(1000).fadeOut(1000,function(){
switchelements($(this).nextAll(".switch"));
});
}
}
});
}
});
}