';
$content .= $asm->openListItem( wp_list_categories( 'echo=0&orderby='.$asm->order_by.'&taxonomy='.$asm->taxonomy.'&title_li=&hide_empty=0&include=' . trim($asm->top_id)) );
}
//If there are children to display
if( !empty($all_categories) ){
$content .= '
';
#-- If they want all the child categories displayed always
if( $asm->display_all() ){
$content .= wp_list_categories('echo=0&orderby='.$asm->order_by.'&taxonomy='.$asm->taxonomy.'&title_li=&child_of=' . $asm->top_id .'&depth=' .$instance['levels'] );
} else {
#-- to Display the categories based a parent child relationship
foreach( $all_categories as $child_cat ){
//IF this is a child category of the top one
if( $asm->first_level_category( $child_cat ) ){
//List the child category and the children if it is the current one
$content .= $asm->openListItem(wp_list_categories('echo=0&orderby='.$asm->order_by.'&taxonomy='.$asm->taxonomy.'&title_li=&include=' . $child_cat->term_id . '&depth=1' ) );
//If there are children of this cat and it is a parent or child or the current cat
if( $asm->second_level_cat( $child_cat ) ){
#-- Create a new menu with all the children under it
$content .= '