// ==============================================
// Copyright 2007 www.chadsonline.co.uk Author: David Chadwick
// Modified to allow links and alt tags for images based on:
// Source: jsCode.com Author: etLux
// Copyright 2003 by jsCode.com
// Copyright statement must stay intact
// ==============================================

// Set up the image files to be used.
var theImages = new Array();
var theLinks = new Array();
var theTags = new Array();
// do not change this
// To add more image files, continue with the
// pattern below, adding to the array. Rememeber
// to increment the theImages[x] index!

theImages[0] = 'images/100.jpg';
theImages[1] = 'images/200.gif';
theImages[2] = 'images/300.jpg';
theImages[3] = 'images/400.jpg';
theImages[4] = 'images/500.gif';


// To add links for each image
theLinks[0] = 'appointments.htm';
theLinks[1] = 'testimonials.htm';
theLinks[2] = 'what_is.htm';
theLinks[3] = 'treated.htm';
theLinks[4] = 'testimonials.htm';



// To add alt tags for each image
theTags[0] = 'Go to Appointments';
theTags[1] = 'Go to Testimonials';
theTags[2] = 'Go to About Orthotics';
theTags[3] = 'Go to Treated Conditions';
theTags[1] = 'See more Testimonials';



// ======================================
// do not change anything below this line
// ======================================

var j = 0
var p = theImages.length;


var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = theImages[i]
}

var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
//document.write('<img src="'+theImages[whichImage]+'">');



document.write('<a href="' + theLinks[whichImage]+'"><img src="'+theImages[whichImage]+' " alt="' + theTags[whichImage] +' " title="' + theTags[whichImage] + '"  style="border:none" /></a>');

}

