// JavaScript Document
var maxPage=58; // количество страниц

var mul=Math.pow(10,maxPage.toString().length );

function chgPg() {
  var cpage;
  var name;
  do
  {
	cpage = Math.round( Math.random() * mul ) + 1
  ;}
  while (cpage > maxPage)
 ; window.location.href = 'stories/story_0' + cpage + '.html'
}
