function swapRIAS(num) {
	if(document.getElementById) {
		//document.getElementById("rias").src= "assets/images/rias"+num+".gif";
	}
}
var subnavview=0;

function showSubNav() {
	if(document.getElementById) {
		if(subnavview==0) { document.getElementById("subnav").style.display = "block"; subnavview=1; }
	}
}
function hideSubNav() {
	if(document.getElementById) {
		if(subnavview==1) { document.getElementById('subnav').style.display = 'none'; subnavview=0; }
	}
}
function checkEnd(id) {
	/* show Endorsement if variable exists */
	var url = ""+window.location;
	if(url.indexOf("end=1")!=-1) { showEnd(id); }
}
function chgImg(id,margin,top) {
	// check for compatible js
	if(document.getElementById) {
		// turn off borders on all other thumbs
		for(i=1;i<=tTotal;i++) {
			var a = "t"+i;
			document.getElementById(a).style.borderColor = "#191919";
		}
		// turn on border on clicked thumb
		var b = "t"+id;
		document.getElementById(b).style.borderColor = "#ffffff";
		// turn off info and endorsement
		document.getElementById("info").style.display = "none";
		visInfo = 0;
		if(document.getElementById("end")) { document.getElementById("end").style.display = "none"; visEnd = 0; }
		// change stage image
		if(top) { var marginTop = "margin-top:"+top+"px;"; }
		document.getElementById("stage").innerHTML = "<img src=\"assets/images/"+basehref+id+".jpg\" alt=\"Photo of property\" style=\"margin-left:"+margin+"px;"+marginTop+"\" />";
	} else { 
		alert ("Sorry, you must have a javascript-capable browser to view this site properly.")
	}
}
function makeInfo(h2,p) {
	this.h2 = h2;
	this.p = p;
}
var visInfo = 0;
function showInfo(id) {
	var b = "t"+id;
	// check for compatible js
	if(document.getElementById) {
		if (visInfo == 0) {
			// turn on border on clicked thumb
			document.getElementById(b).style.borderColor = "#ffffff";
			// turn off border on end (assuming the info button is the one before the endorsment one)
			var c = "t"+(id+1);
			if(document.getElementById(c)) { document.getElementById(c).style.borderColor = "#191919"; }
			// hide endorsement
			if(document.getElementById("end")) { document.getElementById("end").style.display = "none"; visEnd = 0; }
			// show info on stage
			var display=info;
			document.getElementById("info").innerHTML = "<h2>"+display.h2+"</h2><p>"+display.p+"</p><p style=\"text-align:center;margin-bottom:3px;\"><img src=\"assets/images/close.gif\" alt=\"Close\" /></p>";
			document.getElementById("info").style.display = "block";
			visInfo = 1;
		} else { 
			// turn off border on clicked thumb
			document.getElementById(b).style.borderColor = "#191919";
			document.getElementById("info").style.display = "none";
			visInfo = 0;
		}
	} else { 
		alert ("Sorry, you must have a javascript-capable browser to view this site properly.")
	}
}
var visEnd = 0;
function showEnd(id) {
	var b = "t"+id;
	// check for compatible js
	if(document.getElementById) {
		if (visEnd == 0) {
			// turn on border on clicked thumb
			document.getElementById(b).style.borderColor = "#ffffff";
			// turn off border on info (assuming the info button is the one before the endorsment one)
			var c = "t"+(id-1);
			document.getElementById(c).style.borderColor = "#191919";
			// hide info
			if(document.getElementById("info")) { document.getElementById("info").style.display = "none"; visInfo = 0; }
			// show info on stage
			var display=end;
			document.getElementById("end").innerHTML = "<h2>"+display.h2+"</h2><p>"+display.p+"</p><p style=\"text-align:center;margin-bottom:3px;\"><img src=\"assets/images/close.gif\" alt=\"Close\" /></p>";
			document.getElementById("end").style.display = "block";
			visEnd = 1;
		} else { 
			// turn off border on clicked thumb
			document.getElementById(b).style.borderColor = "#191919";
			document.getElementById("end").style.display = "none";
			visEnd = 0;
		}
	} else { 
		alert ("Sorry, you must have a javascript-capable browser to view this site properly.")
	}
}
function setupInfo() {
	if(window.innerWidth) { var x = window.innerWidth/2 - 255; } else { var x = document.body.scrollWidth/2 - 255; }
	document.getElementById("info").style.left = x+"px";
	if(document.getElementById("end")) { document.getElementById("end").style.left = x+"px"; }
}
function showSummary(id) {
	// check for compatible js
	if(document.getElementById) {
		// change summary text
		var display=p[id];
		document.getElementById("summary").innerHTML = "<h2>"+display.h2+"</h2><p>"+display.p+"</p>";
	} else { 
		alert ("Sorry, you must have a javascript-capable browser to view this site properly.")
	}
}
function hideSummary() {
	// check for compatible js
	if(document.getElementById) {
		// change summary text
		document.getElementById("summary").innerHTML = '<h2 style="font-weight:normal;">&lt; Choose a project</h2>';
	} else { 
		alert ("Sorry, you must have a javascript-capable browser to view this site properly.")
	}
}