Hey,

I found this really simple javascript to show a random image everytime the page loads but i was wondering if anybody knows how to modify it and set an percentage ammount to display each link/image,i saw a php code that uses random images/link and has like 10% for the first image and so on,also i was wondering if you can set sessions or cookies with javascript so it does not slow down the users so much. Heres the code:

<script language="JavaScript"><!--

//Javascript Created by Computerhope http://www.computerhope.com

//store the quotations in arrays

images = new Array(4);

images[0] = "<a href = 'http://www.computerhope.com/index.htm'><img src='http://www.computerhope.com/banners/banner.gif' alt='Visit Computer Hope'></a>";

images[1] = "<a href = 'http://www.computerhope.com/history/index.htm'><img src='http://www.computerhope.com/banners/banner2.gif' alt='Computer History'></a>";

images[2] = "<a href = 'http://www.computerhope.com/index.htm'><img src='http://www.computerhope.com/banners/banner3.gif' alt='Visit Computer Hope'></a>";

images[3] = "<a href = 'http://www.computerhope.com/newslet.htm'><img src='http://www.computerhope.com/banners/banner4.gif' alt='Computer Hope Newsletter'></a>";

index = Math.floor(Math.random() * images.length);

document.write(images[index]);

//done

// --></script>

Thanks for the help

Regards

Mick