


var interval = 10.0; // delay between rotating images (in seconds)
var random_display = 1; // 0 = no, 1 = yes
interval *= 1000;

var image_index = 0;
image_list = new Array();
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture040.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture005.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/jag-06-2001-Small.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture004.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture065.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/bean-tunnel.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture019.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture007.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture052.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/C1AG9701.JPG';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture018.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/corrie+chipper.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Roxie.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/air-cattledog.png';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/KV0H9554.JPG';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/sasha.png';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture006.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture023.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/DSCN2718.JPG';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/mvc-361f.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture016.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/C1AG9693.JPG';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture035.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture142.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/small-bean-jumping.JPG';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Patch3.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/ad_103104f_112.JPG';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Maggie.png';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/D2H_06805.JPG';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/patch1.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/JAG=easter.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/P7220143.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture003.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/princeton-bean.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/moose_woof.png';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Maggie1.png';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture002.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/snowflake.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture042.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/P7220152.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/C1AG7476.JPG';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/P7220154.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/flying-beardie.jpg';
image_list[image_index++]='http://www.bayshoredogclub.org/pix/gallery/Picture027.jpg';

// image_list[image_index++] = new imageItem("http://javascript.internet.com/img/image-cycler/01.jpg");


var number_of_image = image_list.length;

function imageItem(image_location) {
	this.image_item = new Image();
	this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
	return(imageObj.image_item.src);
}
function generate(x, y) {
	var range = y - x + 1;
	return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
	if (random_display) {
		image_index = generate(0, number_of_image-1);
	} else {
		image_index = (image_index+1) % number_of_image;
	}
//	var new_image = get_ImageItemLocation(image_list[image_index]);
	var new_image = new imageItem(image_list[image_index]);
	return(new_image);
}


function addImageItemURL(url){
     image_item[image_index] = new imageItem(url);
     image_index = image_index + 1;
     
}


function rotateImage(place) {
	var new_image = getNextImage();
image_index = generate(0, number_of_image-1);
	
//	document[place].src = new_image;
	document[place].src = image_list[image_index];
	var recur_call = "rotateImage('"+place+"')";
	setTimeout(recur_call, interval);
}

    

