// JavaScript Document

function swapImages(i,h) {
	var lines = document.getElementById('projectMapLines');
	var projectCodes = new Array("Atlas","Cathedral","Bellevue","ExILVA","Sime","Hope","Courtland","MOHAI","Vasco","Everything","WaterPlant","Snoqualmie");
	
	// Change connect-the-dot lines
	lines.className = "projectMapLines-"+i;
	
	// Set all project names to gray
	var a=0;
	while (a<projectCodes.length) {
		var b = document.getElementById("projectMapName-"+projectCodes[a]);
		var over = b.className.indexOf('over');
		if (over >= 0) {
			b.className = b.className.substring(0,over);
		}
		a++;
	}
	
	if (h==1) {
		var n=0;
		while (n<projectCodes.length) {
			var t = document.getElementById("imageGrid-"+projectCodes[n]);
			if (projectCodes[n] != i) {
				t.style.opacity = "0.3";
				t.style.filter  = "alpha(opacity=30)"; // MSIE
			}
			else { // shouldn't be necessary, but just in case
				t.style.opacity = "1";
				t.style.filter  = "alpha(opacity=100)"; // MSIE
			}
			n++;
		}
	}
}

function resetImages(d,h) {
	var lines = document.getElementById('projectMapLines');
	var projectCodes = new Array("Atlas","Cathedral","Bellevue","ExILVA","Sime","Hope","Courtland","MOHAI","Vasco","Everything","WaterPlant","Snoqualmie");
	
	// Reset connect-the-dot lines
	lines.className = "projectMapLines-"+d;
	
	if (h==1) {
		// on home page, so reset all images to 100% opacity
		var n=0;
		while (n<projectCodes.length) {
			var t = document.getElementById("imageGrid-"+projectCodes[n]);
			t.style.opacity = "1";
			t.style.filter  = "alpha(opacity=100)"; // MSIE
			n++;
		}
	}
	else {
		// on project page so reset active project title to orange
		document.getElementById('projectMapName-'+d).className += " over";
	}
}
