function image(_name, _width, _height, _caption) { 
this.name = _name; 
this.width = _width; 
this.height = _height;
this.caption = _caption; 
} 

// create array of image objects 
che316 = new Array(); 
che316[0] = new image("/images/photos/home/150/random1_kc_legsweep.jpg", 150, 188, 'Kevin’s Low Spin Leg Sweep – DC Jam Circle');
che316[1] = new image("/images/photos/home/150/random2_kcsonoma2002_whip.jpg", 150, 107, 'Counter Balance in Action');
che316[2] = new image("/images/photos/home/150/random3_kcushornet2004_jockey.jpg", 150, 232, 'USS Hornet – Feb 2004');
che316[3] = new image("/images/photos/home/150/random4_kcusopen2001_fig4.jpg", 150, 188, 'US Open 2001 Lindy Hop Champions');
che316[4] = new image("/images/photos/home/150/random5_kcusopen2002_backbendhit.jpg", 150, 215, 'US Open 2002 Lindy Hop Champions');
che316[5] = new image("/images/photos/home/150/random6_kcusopen2002_headshot.jpg", 150, 209, 'Kevin & Carla');
che316[6] = new image("/images/photos/home/150/random7_kcusopen2002_whip.jpg", 150, 129, 'US Open 2002 Lindy Hop Champions');
che316[7] = new image("/images/photos/home/150/random8_kcusopen2004_drag.jpg", 150, 246, 'Kevin & Carla');
che316[8] = new image("/images/photos/home/150/random9_kcusopen2003_kiptoside.jpg", 150, 203, 'US Open 2003 Lindy Hop Champions');
che316[9] = new image("/images/photos/home/150/random10_kcnewyears2001-2_headshot.jpg", 150, 169, 'Kevin & Carla');
che316[10] = new image("/images/photos/home/150/random11_kcusopen2002C_fig4.jpg", 150, 205, 'Kevin & Carla');
che316[11] = new image("/images/photos/home/150/random12_kc_dipkicks.jpg", 150, 150, 'Saucy Kicks - 2001 Baltimore Symphony Orchestra Concert');

// This function returns an image tag that can be written to the html document 
function randomImageTag(imgs, borderSize) { 
// index to the selected image 
var idx = Math.floor(Math.random() * imgs.length);
var tag = '<img src="' + imgs[idx].name + '"'; 
// if image width is defined 
if (imgs[idx].width != 0) 
tag += ' width="' + imgs[idx].width + '"';
// if image height is defined 
if (imgs[idx].height != 0) 
tag += ' height="' + imgs[idx].height + '"';
tag += (borderSize) ? ' border="' + borderSize + '"' : ' border="0"'; 
tag += '>'; 
tag += '<br><span class="caption">';
tag += imgs[idx].caption;
tag += '</span>';

return tag; 
} 