codice:
<%
dim FotoImmob(20)
jj=0
' EFFETTUA QUERY DI RICERCA SUL DB IN BASE AI PARAMETRI PASSATI'
query = "SELECT * FROM foto WHERE immobile=" & session("IdImmobile") & " ORDER BY numero"
set rs=server.createobject("ADODB.Recordset")
rs.open query, connex
do while not rs.eof
jj=jj+1
if jj<=21 then FotoImmob(jj) = "foto/" & rs("foto")
rs.movenext
loop
rs.close
set rs=nothing
connex.close
set connex=nothing
%>
<script type="text/javascript">
var dynimages=new Array()
dynimages[0]=['<%=FotoImmob(1)%>', ""]
dynimages[1]=['<%=FotoImmob(2)%>', ""]
dynimages[2]=['<%=FotoImmob(3)%>', ""]
dynimages[3]=['<%=FotoImmob(4)%>', ""]
dynimages[4]=['<%=FotoImmob(5)%>', ""]
dynimages[5]=['<%=FotoImmob(6)%>', ""]
dynimages[6]=['<%=FotoImmob(7)%>', ""]
dynimages[7]=['<%=FotoImmob(8)%>', ""]
dynimages[8]=['<%=FotoImmob(9)%>', ""]
dynimages[9]=['<%=FotoImmob(10)%>', ""]
dynimages[10]=['<%=FotoImmob(11)%>', ""]
dynimages[11]=['<%=FotoImmob(12)%>', ""]
dynimages[12]=['<%=FotoImmob(13)%>', ""]
dynimages[13]=['<%=FotoImmob(14)%>', ""]
dynimages[14]=['<%=FotoImmob(15)%>', ""]
dynimages[15]=['<%=FotoImmob(16)%>', ""]
dynimages[16]=['<%=FotoImmob(17)%>', ""]
dynimages[17]=['<%=FotoImmob(18)%>', ""]
dynimages[18]=['<%=FotoImmob(19)%>', ""]
dynimages[19]=['<%=FotoImmob(20)%>', ""]
var preloadimg="no"
var optlinktarget=""
var imgborderwidth=0
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"
if (preloadimg=="yes"){
for (x=0; x<dynimages.length; x++){
var myimage=new Image()
myimage.src=dynimages[x][0]
}
}
function returnimgcode(theimg){
var imghtml=""
if (theimg[1]!="")
imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'
imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'">'
if (theimg[1]!="")
imghtml+='</a>'
return imghtml
}
function modifyimage(loadarea, imgindex){
if (document.getElementById){
var imgobj=document.getElementById(loadarea)
if (imgobj.filters && window.createPopup){
imgobj.style.filter=filterstring
imgobj.filters[0].Apply()
}
imgobj.innerHTML=returnimgcode(dynimages[imgindex])
if (imgobj.filters && window.createPopup)
imgobj.filters[0].Play()
return false
}
}
</script>
</head>
<body>
<table align="center" width="650px" height="450px" cellpadding="0" cellspacing="0" border="1" style="border:1px solid #CCCCCC">
<tr>
<td align="center" height="450px" width="650px" class="nobord">
<div id="dynloadarea""><img src=<%=FotoImmob(1)%> height="400" width="600" border="0"/></div>
</td>
</tr>
</table>
<br>
<table align="center" cellpadding="5" cellspacing="0" style="border:1px solid #CCCCCC">
<tr>
<% if FotoImmob(1)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 0)"><img src=<%=FotoImmob(1)%> height="100" width="100" border="0"/></a>
<br>
</td>
<% end if %>
<% if FotoImmob(2)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 1)"><img src=<%=FotoImmob(2)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(3)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 2)"><img src=<%=FotoImmob(3)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(4)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 3)"><img src=<%=FotoImmob(4)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(5)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 4)"><img src=<%=FotoImmob(5)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(6)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 5)"><img src=<%=FotoImmob(6)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(7)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 6)"><img src=<%=FotoImmob(7)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(8)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 7)"><img src=<%=FotoImmob(8)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(9)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 8)"><img src=<%=FotoImmob(9)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(10)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 9)"><img src=<%=FotoImmob(10)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(11)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 10)"><img src=<%=FotoImmob(11)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(12)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 11)"><img src=<%=FotoImmob(12)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(13)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 12)"><img src=<%=FotoImmob(13)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(14)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 13)"><img src=<%=FotoImmob(14)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(15)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 14)"><img src=<%=FotoImmob(15)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(16)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 15)"><img src=<%=FotoImmob(16)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(17)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 16)"><img src=<%=FotoImmob(17)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(18)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 17)"><img src=<%=FotoImmob(18)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(19)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 18)"><img src=<%=FotoImmob(19)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
<% if FotoImmob(20)<>"" then %>
<td>
<a href="#" onClick="modifyimage('dynloadarea', 19)"><img src=<%=FotoImmob(20)%> height="100" width="100" border="0"/></a><br>
</td>
<% end if %>
</tr>
</table>
</body>