Hello

I have a situation, where I added some links in the database with their IMPORTANCE from 1 to 10. (where 10 is HIGHEST).

Now, i have an Ad Rotator that picks the link randomly and present that.
BUT what I want is that if a link is given the HIGHER importance that should be presented more than once (on page loads). So For example :

Suppose there are 5 AD Links are stored. Ad no. 2 is given a higher importance.

User A visits PAGE and the PAGE shows AD No. 1
User B visits PAGE and the PAGE shows AD No. 2
User C visits PAGE and the PAGE shows AD No. 3
User D visits PAGE and the PAGE shows AD No. 4
User E visits PAGE and the PAGE shows AD No. 2
User F visits PAGE and the PAGE shows AD No. 5
User G visits PAGE and the PAGE shows AD No. 2
------------ a cycle of random links complete --- now it will start again
User H visits PAGE and the PAGE shows AD No. 2
User I visits PAGE and the PAGE shows AD No. 5
User J visits PAGE and the PAGE shows AD No. 1
User K visits PAGE and the PAGE shows AD No. 2
User L visits PAGE and the PAGE shows AD No. 3
User M visits PAGE and the PAGE shows AD No. 2

you can see that in picking the RANDOM links, AD No. 2 was shown multiple times.

Please help me how this can be achieved.

Thanks
Zeeshan Hashmi