function swapdiv( joblyr, listlyr ) {
	var f = document.getElementById(joblyr);	
	f.style.display = (f.style.display == "block") ? "none" : "block";
	
	var a = document.getElementById(listlyr);
	a.style.backgroundImage = (f.style.display == "block") ? "url('images/arrow_down.gif')" : "url('images/arrow_right.gif')";
}

function showThumbs( lyr ) {
	//Loop through all the current thumb panel DIVs, and hide them all before displaying the selected one.
	for(i = 1; i <= total_records; i++) {
		document.getElementById("thumb_panel_" + i).style.display = "none";
	}
	document.getElementById("thumb_panel_" + lyr).style.display = "inline";
	//Loop through all the current school hyperlinks, and remove the bg color to them all before displaying the selected one.
	for(i = 1; i <= total_records; i++) {
		document.getElementById("link_" + i).style.backgroundColor = "#252525";
	}
	document.getElementById("link_" + lyr).style.backgroundColor = "#5C5C5C";
}

function swapBigImage( imgName, thumb, di ) {
	var f = document.getElementById('bigpic');
	f.src = imgName.href;

	var t = document.getElementById("rollthumb" + thumb);
	//t.style.MozOpacity = 1.0;
	//t.style.opacity = 100/100
	//t.style.filter = "alpha(opacity:100)";
	
	
	generateDetailLayer(di);
}

function generateDetailLayer( di ) {
	//Populate the datasheet DIV with the selected object's contents
	var d = document.getElementById('datasheet');
	html = "";
	html += "<table cellpadding=\"2\" cellspacing=\"3\" class=\"datatable\" width=\"99%\">\n";
	html += "<tr valign=\"top\">\n\t<td width=\"200\" rowspan=\"2\"><span class=\"gray\">Cost</span><br />" + di.cost + "\n";
	html += "<p><span class=\"gray\">Architect / Engineer</span><br />" + di.architect + "</p>\n";
	html += "<p><span class=\"gray\">Contract Type</span><br />" + di.contract + "</p>\n";
	html += "<p><span class=\"gray\">Square Footage</span><br />" + di.sf + "</p></td>\n";
	html += "<td height=\"30\"><p><strong style='font-size:12pt;'>" + di.client  + "</strong><br />";
	html += di.location + "</p></td></tr>\n";
	html += "<tr valign=\"top\"><td>" + di.blurb + "\n";
	html += "</td></tr>\n";
	html += "</table>";
	d.innerHTML = html;
	d.style.display = "inline";	
}

function dimThumb( thumb ) {
	//document.getElementById("rollthumb" + thumb).style.MozOpacity = 0.4;
	//document.getElementById("rollthumb" + thumb).style.opacity = 40/100
	//document.getElementById("rollthumb" + thumb).style.filter = "alpha(opacity:40)";
}