function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function setVisibleAnimate(index){
	//assumes the visible class is 'propertyVisible' and the invisible class is 'propertyInvisible'
	//assumes the divs to turn on and off are called 'projectN' where N is an integer.
	//alert("running setVisible");
	var object = document.getElementById('project' + index);
	for (var j = 1; j < 14; j+=1) {
		if (j != index) {
			object = document.getElementById('project' + j);
			object.className = 'propertyInvisible';
			//alert("doing " + j + " for index of " + index);
		}
	}
	object = document.getElementById('project' + index);
	//alert("setting visible project" + index );
	object.className = 'propertyVisible';
	
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
	
		lightweight = newImage("assets/home_01.jpg");
		cabinet = newImage("assets/home_02.jpg");
		concrete = newImage("assets/home_03.jpg");
		panelized = newImage("assets/home_04.jpg");
		modifiediso = newImage("assets/home_05.jpg");
		noncombustible = newImage("assets/home_06.jpg");
		img07 = newImage("assets/home_07.jpg");
		img08 = newImage("assets/home_08.jpg");
		img09 = newImage("assets/home_09.jpg");
		img10 = newImage("assets/home_10.jpg");
		img11 = newImage("assets/home_11.jpg");
		img12 = newImage("assets/home_12.jpg");
		img13 = newImage("assets/home_13.jpg");
		img14 = newImage("assets/home_14.jpg");
		preloadFlag = true;
		
		var interval = 2000;
		var t = new Array(30);
		//sets up 13x30 timeouts
		for (var j = 0; j < 30; j+=1) {
			for (var i = 1; i < 14 ; i+=1){
				//alert('setting visible ' + i);
				t[i+j] = setTimeout("setVisibleAnimate('" + i + "')",interval*(i + 1)+j*interval*13);
			}
		}

	}
}
