<%
Set Rs1 = Server.CreateObject("ADODB.Recordset")
Rs1.Open "SELECT DISTINCT livello1 from livelli_categorie", conn
%>
<style type="text/css">
<!--
body {
font: .9em verdana, helvetica, sans-serif;
}
ul {
list-style: disc url(doc.gif);
margin:0;padding:0 2em;
}
li.menu { list-style: square url(cartellachiusa.gif); }
-->
</style>
<script type="text/javascript">
<!--
function mmenu(mID) {
var menu = document.getElementById(mID);
var display = menu.style.display;
menu.style.display = (display == "block") ? "none" : "block";
menu.parentNode.style.listStyleImage = (display == "block") ? "url(cartellachiusa.gif)" : "url(cartellaaperta.gif)";
}
window.onload = function() {
var uls = document.getElementsByTagName("ul");
for (i=0;i<uls.length;i++) {
if(uls[i].className=="submenu")uls[i].style.display = "none";
}
}
//-->
</script>
</head>
<body>
<ul>
<% i = 1 %>
<% do while not rs1.EOF %>
<%
Set Rs2 = Server.CreateObject("ADODB.Recordset")
str= "SELECT DISTINCT livello2 from livelli_categorie WHERE livello1='" & rs1("livello1") &"'"
Rs2.Open str , conn
%>
<% if Rs2("livello2")<>"" then %>
<li class="menu" >
<% else %>
<li >
<%end if%>
<% response.write rs1("livello1") %>
<ul class="submenu" id="submenu-<% =i %>">
<% j = 1 %>
<% do while not rs2.EOF %>
<%
Set Rs3 = Server.CreateObject("ADODB.Recordset")
str= "SELECT DISTINCT livello3 from livelli_categorie WHERE livello1='" & rs1("livello1") &"' AND livello2='"& rs2("livello2") &"'"
Rs3.Open str , conn
%>
<% if Rs3("livello3")<>"" then %>
<li class="menu" >
<% else %>
<li >
<%end if%>
<% response.write rs2("livello2") %>
<ul class="submenu" id="submenu-<% =i %>-<% =j %>">
<% do while not rs3.EOF %>
<%if rs3("livello3")<>"" then %>
[*]<% response.write rs3("livello3") %>
<% end if%>
<%
rs3.MoveNext
loop
%>
[/list]
<%
j = j + 1
%>
<%
rs2.MoveNext
loop
%>
[/list]
<%
i = i + 1
%>
<%
rs1.MoveNext
loop
%>
[/list]
</body>
</html>