// JavaScript Document

function alterImage() {
	var rand = getRandomInt(0, images.length-1);
	var img_src = images[rand];
	var img_width = widths[rand];
	var img_height = heights[rand];
					
	if (document.getElementById('change')) {
		var rot = document.getElementById('change');
		rot.src = img_src;
		rot.style.width = img_width + 'px';
		rot.style.height = img_height + 'px';
	}
}
	
/* from the mozilla javascript reference at http://developer.mozilla.org */
function getRandomInt(min, max) {
	return Math.floor(Math.random() * (max - min + 1)) + min;
}

function displayImage(img) {
	listProperties(document.getElementById('change'), 0);
}

var timeId = window.setInterval(alterImage, 5000);

function doTimer() {
	var button = document.getElementById('stopFlash');
	//alert('button=' + button.src);
	if (button.src == 'http://coralbeachrealtyusvi.com/images/stop.jpg') {
		clearInterval(timeId);
		button.src = 'http://coralbeachrealtyusvi.com/images/start.jpg';
	} else {
		timeId = window.setInterval(alterImage, 5000);
		button.src = 'http://coralbeachrealtyusvi.com/images/stop.jpg';
	}
}
	