function updateContent(strJSON) {
	var obj = new siteJSON(strJSON);
	writeHTML(obj);
}

function writeHTML(obj) {
//	var obj = new siteObj(strJSON);
	var html = "";
	if (obj.title) html += "<h1>"+ unescape(obj.title) +"</h1>\n";
	if (obj.client) html += "<h2>"+ unescape(obj.client) +"</h2>\n";
	if (obj.partner) html += "<h3>// partner: <span class=\"partnerName\">"+ unescape(obj.partner) +"</span></h3>\n";
	if (obj.description) html += "<p>"+ unescape(obj.description) +"</p>\n";
	if (obj.accolades[0]) {
		var i = 0;
		html += "<ul>\n";
		while (obj.accolades[i]) {
			html += "\t<li>"+ unescape(obj.accolades[i]) +"</li>\n";
			i++;
		}
		html += "</ul>\n";
	}
	if (obj.linkURL) html += "<a href=\""+ obj.linkURL +"\" target=\"_blank\" class=\"viewProject\">View Project</a>\n";
	if (obj.images) {
		var j = 0;
		while (obj.images[j]) {
			html += "<img src=\""+ obj.images[j] +"\" />\n";
			j++;
		}
	}
	html += "<br /><br />";
	document.getElementById("content").scrollTop = 0;
	document.getElementById("content").scrollLeft = 0;
	document.getElementById("content").innerHTML = html;
}

function siteJSON(str) {
	var o = eval('('+str+')');
	this.title = o.title;
	this.client = o.client;
	this.partner = o.partner;
	this.description = o.description;
	this.linkURL = o.linkURL;
	this.images = o.images;
	this.accolades = o.accolades;
}

var myWidth = 0, myHeight = 0;

function handleResize() {
	
	if ( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if ( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	var contentHeight = myHeight - document.getElementById("content").offsetTop;
	if (document.getElementById("leftNav")) document.getElementById("leftNav").style.height = myHeight + "px";	
	document.getElementById("content").style.height = contentHeight - 12 + "px";
	document.getElementById("content").style.width = myWidth - document.getElementById("content").offsetLeft + "px";
}



if (window.attachEvent)
{
	window.attachEvent("onresize", handleResize);
	window.attachEvent("onload", handleResize);
} else {
	window.addEventListener('resize', handleResize, false);
	window.addEventListener('load', handleResize, false);
}
