// Script created by Nick Beech
// www.nbbs.co.uk; www.nbWebsiteDesign;
// www.LookAndLearnTraining.com and .co.uk
// This script is copyrighted - Please ask permission to reuse

// This script generates random numbers and assigns them to variables. 
// Image names are substituted with these variables to create 
// different images each time the page is loaded.

// This includes all images for the random photo display on www.humaneeducationsociety.co.uk


// function to generate random number for cats from 1 to 12
function getNumberCats(){
  return Math.ceil(Math.random()*12);
}
// function to generate random number for equines from 1 to 13
function getNumberEquines(){
  return Math.ceil(Math.random()*13);
}
// function to generate random number for other animals from 1 to 13
function getNumberOthers(){
  return Math.ceil(Math.random()*13);
}


// call function and assign to variables
  var catpic = getNumberCats();
  var equinepic = getNumberEquines();
  var otherpic = getNumberOthers();
  
  
// create output for slideshow
var catimage = '<img src="images/cats/' + catpic + '.jpg" alt="Cats at The Animal Sanctuary, Wilmslow" width="180" height="135" border="1" />';
var equineimage = '<img src="images/equines/' + equinepic + '.jpg" alt="Equines at The Animal Sanctuary, Wilmslow" width="180" height="135" border="1" />';
var otherimage = '<img src="images/other-animals/' + otherpic + '.jpg" alt="Various animals at The Animal Sanctuary, Wilmslow" width="180" height="135" border="1" />';
  