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
<!--parser:xtscript-->
var $c=<xt:filecount folder="/myfolder" />
var $c=call ceil $num=($c/10)
<!--/parser:xtscript-->
<script>
var pg = "<xt:url/>"
if (pg == "http://eaglenet.xtgem.com/index"){
location.replace('http://eaglenet.xtgem.com/index?__filelist_page=<xt:random from="1" to="{_$$c|}" x="1"/>')};
</script>
Copy code
ps your original post had no space after your site url so everything else was being included in the url messing up the layout