Nested Popups Chained

Nested Popups Chained

Hi

I have 2 nested popups chained and using the workaround to get chained popups working with a timeout
Both popups consists of an unordered list. And the problem I'm encountering is the  2nd popup shows the first choice  #popup2_1  only no matter which one of the others I select. Any help on this one  please.
<script> $(document).on("pagecreate", function () { $("#popup1").on("popupafterclose", function () { setTimeout(function () { $("#popup2_1").eq(0).popup("open") }, 100), setTimeout(function () { $("#popup2_2").eq(0).popup("open") }, 100),
setTimeout(function () { $("#popup2_3").eq(0).popup("open") }, 100),
setTimeout(function () { $("#popup2_4").eq(0).popup("open") }, 100),
}); });  
</ script >