var linksNumber=14; /* This is the number of links to be shown and matches the HTML */

var myimages=[ 
'images/randomlinks/coalcreek.jpg','images/randomlinks/woolmuseum.jpg', 
'images/randomlinks/forddiscovery.jpg','images/randomlinks/werribeepark.jpg', 
'images/randomlinks/hangingrock.jpg','images/randomlinks/portarthur.jpg', 
'images/randomlinks/discoverycentre.jpg','images/randomlinks/centraldeborah.jpg', 
'images/randomlinks/talkingtram.jpg','images/randomlinks/josshouse.jpg',
'images/randomlinks/swanhill.jpg','images/randomlinks/sovhill.jpg',
'images/randomlinks/portechuca.jpg','images/randomlinks/kyneton.jpg',
'images/randomlinks/flagstaff.jpg'
];

var imagelinks=[ 
'destination_coalcreek.php','destination_woolmuseum.php', 
'destination_forddiscovery.php','destination_werribeepark.php', 
'destination_hangingrock.php','destination_portarthur.php', 
'destination_discoverycentre.php','destination_centraldeborah.php', 
'destination_talkingtrams.php','destination_josshouse.php',
'destination_swanhill.php','destination_sovhill.php',
'destination_portechuca.php','destination_kyneton.php',
'destination_flagstaff.php'
]

var ary0=[]; 
var ary1=[]; 
var k=0 
var c,n;

function randomImgDisplay() {

for(c=0;c<myimages.length;c++) { 
ary0[c]=c;
} 

while(ary0.length>0) {

n=Math.floor(Math.random()*ary0.length);
ary1[k]=ary0[n];
k++; 
ary0.splice(n,1);

}

for(c=0;c<linksNumber;c++){ 
document.getElementById('pic'+c).src=myimages[ary1[c]];
document.getElementById('lnk'+c).href=imagelinks[ary1[c]];

}

}

if(window.addEventListener){ 
window.addEventListener('load',randomImgDisplay,false); 
} 
else { 
if(window.attachEvent){ 
window.attachEvent('onload',randomImgDisplay); 
} 
}

