I have a random banner ad function, shown below, using a pretty standard
way of picking a random array index value. I am wondering if anyone has
a good way to pick a random number but also "weight" it to one end of
the array or the other. In other words, the function shows a fairly
predictable favoritism toward, say, array elements 0-5 in a 10 element
array. That way element 0 in the array would have a higher percentage of
use then element 9. I also want to do this entirely on the client side,
using only javaScript, and preferably without a cookie.
Thanks for any ideas.
Bob.
// Functions
function pickad_banner()
{
var s ;
var n ;
n=Math.round( Math.random() * (ad_ban_array.length-1) ) ;
s=ad_ban_array[n] ;
return s ;
}