Hello !
I'm using your wonderful code Pman and Falah. I have Image+Quotation+Link and it works great. But once and a while (let's say, every 5 times you refresh your page, but it's really random), i get an "undefined" error where Image+Quotation usually appear. Link still works well.
I did not have this error with Falah's first code, but i want the Quotation with the appropriate image too... It seems that this part causes the problem:
Code:
<script language="JavaScript" type="text/JavaScript">
var Q = Quotation.length;
var whichQuotation=Math.round(Math.random()*(Q-1));
function showQuotation(){document.write(Quotation[whichQuotation]);}
showQuotation();
</script>
... but i really am a beginner in all that, and i can't find anything to make this work 
Here is my code:
Code:
<table>
<tr>
<td width="140" valign="middle">
<script language="JavaScript">
var imagenumber = 5 ;
var randomnumber = Math.random() ;
var rand1 = Math.round( (imagenumber-1) * randomnumber) + 1 ;
images = new Array
images[1] = "./imagesrandom/1.jpg";
images[2] = "./imagesrandom/2.jpg";
images[3] = "./imagesrandom/3.jpg";
images[4] = "./imagesrandom/4.jpg";
images[5] = "./imagesrandom/5.jpg";
var image = images[rand1] ;
links = new Array
links[1] = "./galerie/1.html";
links[2] = "./galerie/2.html";
links[3] = "./galerie/3.html";
links[4] = "./galerie/4.html";
links[5] = "./galerie/5.html";
var link = links[rand1] ;
var Quotation = new Array() ;
Quotation[1] = "Applique multicolore L 65 cm <br><br> <font color=#666666>Prix TTC: 345 Euros</font>";
Quotation[2] = "Luminaire Orange H 65 cm <br><br> <font color=#666666>Prix TTC: 575 Euros</font>";
Quotation[3] = "Totem H 165 cm <br><br> <font color=#666666>Prix TTC: 1575 Euros</font>";
Quotation[4] = "Panneau sail H 70 cm <br><br> <font color=#666666>Prix TTC: 1200 Euros</font>";
Quotation[5] = "Lampe de table Fohen H 65 cm <br><br> <font color=#666666>Prix TTC: 575 Euros</font>";
</script></td></tr>
<tr>
<td valign="bottom" width="140"><font face="Arial, Helvetica, sans-serif" size="2" align="justify" color="#CC6600">
<script language="JavaScript">var Q = Quotation.length;
var whichQuotation=Math.round(Math.random()*(Q-1));
function showQuotation()
{
document.write("<IMG SRC='" + images[whichQuotation] + "' width='100' border='0'><br>") ;
document.write(Quotation[whichQuotation]);
}
showQuotation();</script></font>
</td></tr>
<tr>
<td width="140"><script language="JavaScript">document.write('<A HREF="' + link + '"><IMG SRC="images/details.gif" align="center" border="0"></a>')</script></td></tr>
</table>
Have you got an idea ?
Thank you very much for your help and sorry for my english
Bookmarks