Graham
This will also do it
Use filecount in a xtscript variable and divide it by the number per page and round it up to give you the total pages
then use that in the random function as a xtscript $$ get variable
ps your original post had no space after your site url so everything else was being included in the url messing up the layout