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 'propertyN' where N is an integer.
	//alert("running setVisible");
	var object = document.getElementById('project' + index);
	for (var j = 1; j < 7; 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);
	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");
		preloadFlag = true;
		
		var interval = 2000;
		var t = new Array(30);
		//sets up 6x30=180 timeouts
		for (var j = 0; j < 30; j+=1) {
			for (var i = 1; i < 7 ; i+=1){
				t[i+j] = setTimeout("setVisibleAnimate('" + i + "')",interval*(i + 1)+j*interval*6);
			}
		}

	}
}
