Create Featured Content Slider - HELP NEEDED!

Create Featured Content Slider - HELP NEEDED!

Hi
I am using the following code to create a banner area like the one at the following link. I have 6 banners
 
 
What I am trying to do is from a content management system let users select what order they want the banners to appear.
 
Here is what I have done, I basically split up the sections, I have a yes/no drop down so that you can choose if you want a banner to display or not and also a drop down numbered 1,2,3 etc so that you can specify an order.  It works fine when the order is 123 but when I chnage the order to say 312 the banner breaks and does not display.  any ideas how I can get this working?
 
[CODE]
<%
String sCount="";
String stitle = "";
String iPanels = "";
String sShowPanels = "";
String sContent="";
%>

<ul class="ui-tabs-nav">

<%
for(int i=1;i<7;i++){

sCount="" + i;
stitle = "stitle";
stitle= stitle + i;
iPanels = "iPanels";
        iPanels  = iPanels + i;
sShowPanels = "sShowPanels";
sShowPanels = sShowPanels + i;

//out.print(requestItem.getFieldValue(iPanels) + "=" + sCount);



if(requestItem.getFieldValue(iPanels).equals(sCount)){


if(requestItem.getFieldValue(sShowPanels)!=null && requestItem.getFieldValue(sShowPanels).equals("Yes")){

if(requestItem.getFieldValue(stitle)!=null && requestItem.getFieldValue(stitle).length() >2){

%>

<li class="ui-tabs-nav-item" id="nav-fragment-<%=i%>"><a href="#fragment-<%=i%>">
<%=requestItem.getFieldValue(stitle)%>
</a></li>
<%
}
}
}
}

%>
</ul>


<%


  for(int i=1;i<7;i++){


sCount="" + i;
stitle = "stitle";
stitle= stitle + i;
iPanels = "iPanels";
        iPanels  = iPanels + i;
sShowPanels = "sShowPanels";
sShowPanels = sShowPanels + i;
sContent = "sContent";
sContent= sContent + i;



if(requestItem.getFieldValue(iPanels).equals(sCount))
{
if(requestItem.getFieldValue(sShowPanels)!=null && requestItem.getFieldValue(sShowPanels).equals("Yes"))
{
if(requestItem.getFieldValue(sContent)!=null && requestItem.getFieldValue(sContent).length() >2)
{
%>
<div id="fragment-<%=i%>" class="ui-tabs-panel ui-tabs-hide" style="">
<%=requestItem.getFieldValue(sContent)%>
</div>
<%
}
}
}
}
%>

              </div>
                              

</div>                           <!--content-->




















































































[/CODE]