

function loadRight(content) 
{

	//set up the right frame
	var rightContent = $("#right");
	rightContent.empty();
	var newHTML = "<iframe allowtransparency name='rightFrame' id='rightFrame' src='about.aspx' scrolling='auto' width='100%' height='100%' frameborder='0' style='border: none;' />";
	rightContent.html(newHTML);

	 switch (content)
	 {
		case "about":
			document.getElementById("aboutlink").style.color='#858585';
			document.getElementById("bloglink").style.color='#000000';
			document.getElementById("resumelink").style.color='#000000';
			document.getElementById("linkedinlink").style.color='#000000';
			theUrl = "about.aspx";
			break;
		case "blog":
			document.getElementById("aboutlink").style.color='#000000';
			document.getElementById("bloglink").style.color='#858585';
			document.getElementById("resumelink").style.color='#000000';
			document.getElementById("linkedinlink").style.color='#000000';
			theUrl = "http://jensmcnaughton.typepad.com/";
			break;
		case "resume":
			document.getElementById("aboutlink").style.color='#000000';
			document.getElementById("bloglink").style.color='#000000';
			document.getElementById("resumelink").style.color='#858585';
			document.getElementById("linkedinlink").style.color='#000000';
			theUrl = "resume.aspx";
			break;
		case "linkedin":
			document.getElementById("aboutlink").style.color='#000000';
			document.getElementById("bloglink").style.color='#000000';
			document.getElementById("resumelink").style.color='#000000';
			document.getElementById("linkedinlink").style.color='#858585';
			theUrl = "http://www.linkedin.com/in/jensmcnaughton";
			break;
		default:
			document.getElementById("aboutlink").style.color='#000000';
			document.getElementById("bloglink").style.color='#000000';
			document.getElementById("resumelink").style.color='#000000';
			document.getElementById("linkedinlink").style.color='#000000';
			theUrl = "";
			break;
		
	 }

	if (theUrl != "") {
		document.getElementById("rightFrame").src = theUrl;
		/*
		if (content == "blog"){
			$.frameReady(function(){
				var navbar = $("#navbar");
				alert(navbar.html());
				navbar.remove();
			}, 
			"top.rightFrame",
			{remote: true});
		}
		*/
	}
}

function loadPortfolio(dirName){
	//change the main nav color
	loadRight();
	//get the portfolio content
	dirName = escape(dirName);
	var rightContent = $("#right");
	var theUrl = "assets/"+dirName+"/index.html";
	rightContent.load(theUrl,function(){
		var tmpHTML = rightContent.html();
		tmpHTML = tmpHTML.toLowerCase();
		var search1 = '<PARAM NAME="Movie" VALUE="';
		var replace1 = '<PARAM NAME="Movie" VALUE="assets/'+dirName+'/';
		var search2 = '<PARAM NAME="Src" VALUE="';
		var replace2 = '<PARAM NAME="Src" VALUE="assets/'+dirName+'/';
		var search3 = '<EMBED src="';
		var replace3 = '<EMBED src="assets/'+dirName+'/';
		var search4 = '<img src="';
		var replace4 = '<img src="assets/'+dirName+'/';
		tmpHTML = tmpHTML.replace(search1.toLowerCase(),replace1.toLowerCase());
		tmpHTML = tmpHTML.replace(search2.toLowerCase(),replace2.toLowerCase());
		tmpHTML = tmpHTML.replace(search3.toLowerCase(),replace3.toLowerCase());
		tmpHTML = tmpHTML.replace(search4.toLowerCase(),replace4.toLowerCase());
		
		//alert(tmpHTML);
		rightContent.html(tmpHTML);
		
		//get the header and body content
		rightContent.prepend("<div id='portfolio_item_header' class='main_text_subheader_gray'></div><div id='portfolio_item_body' class='main_text_body'></div>");
		
		var header = $('#portfolio_item_header');
		var headerURL = "assets/"+dirName+"/header.html";
		header.load(headerURL);
		var header = $('#portfolio_item_body');
		var headerURL = "assets/"+dirName+"/body.html";
		header.load(headerURL);
		
	});
}

function init(){
	loadRight("blog");
	/*
	$.ajax({
		type: "GET",
		url: "http://twitter.com/javascripts/blogger.js",
		dataType: "script"
	});
	$.ajax({
		type: "GET",
		url: "http://twitter.com/statuses/user_timeline/jensmcnaughton.json?callback=twitterCallback2&count=1",
		dataType: "script"
	});
	*/
}
