Have the index have a global variable
When you click on play, have that assign a random value 1-30 to that global varible
if that global varible equals 1 go to layout1
if that global varible equals 2 go to layout2
that would be logically clear, even if it requires 30 conditions...