Código:
  
Como veis la pagina abre una carpeta, mete los archivos en un array y luego deberia mediante JS meterlos en otro array para ir mostrando las fotos aleatoriamente, mi fallo esta en la manera de cargar el array en JS, no?? como deberia hacerlo? y si me aconsejais sobre la estructura del codigo pues todo oidos, gracias y salu2!! Código:
<?
$f=0;
$di="venta/$ru/";
if (is_dir($di))
{
  $d = opendir($di);
  while (false !== ($n_arch = readdir($d))){
   if (is_file($di.$n_arch))
    {
    $f++;
    $archivos[]=$n_arch;
    }
   }
      }
else
{
   ?><img src="SIN.jpg"><?
} 
$e=0;?>  
<script language="javascript"> 
//Aquí cambia los nombres de las imágenes por las tuyas. 
var imagenes=new Array() 
x =<?=$f;?>; 
for (i=0;i<=x;i++) { 
<? $e++; ?>
imagenes[i]=new Image (100,100); 
imagenes[i].src="<?=$di.$archivos[$e];?>" 
}
cont=0 
function presImagen() 
{ 
if (document.all){ 
document.getElementById('foto').filters.blendTrans  .apply() 
document.getElementById('foto').src=imagenes[cont].src 
document.getElementById('foto').filters.blendTrans  .play() 
} 
else 
    { 
    document.images.foto.src = imagenes[cont].src 
    } 
if (cont < imagenes.length-1) 
{cont ++} 
else 
{cont=0} 
tiempo=window.setTimeout('presImagen()',5000) 
//cada 5000 milisegundos (5 seg.) cambia la imagen. 
//cambia la cantidad por el tiempo que quieras que transcurra entre imagen e imagen 
} 
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" onLoad="presImagen()">
<table width="87%" height="70" border="0">
  <tr>
       <td align="center"> <img src="tibidabo.jpg" width="100" height="84" id="foto" style="filter:blendTrans(duration=3)"> 
     </td>
    </tr>
  </table>
</body>
</html>
 
 


