// JavaScript Document

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("main_nav");
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI") {
node.onmouseover=function() {
this.className+=" over";
  }
  node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
   }
  }
 }
}
window.onload=startList;

function writePicNav() {
	if  (document.body.className!='web') {
		document.write('<img id="portfolio_img" src="' + picNav[0] + '" height="380" width="380" /><ul id="picnav">');
	
		for (i=0;i<picNav.length;i++)
			{
			if (i==0) {
				document.write('<li><a class="selected" id="pic' + i + '" href="#" onclick="replaceImg(\'' + picNav[i] + '\', this, ' + i + ')">' + (parseFloat(i)+1) + '</a></li>');
			}
			else {
			document.write('<li><a id="pic' + i + '" href="#" onclick="replaceImg(\'' + picNav[i] + '\', this, ' + i + ')">' + (parseFloat(i)+1) + '</a></li>');}
			}		
	}
	else {
		document.write('<a href="' + picNav[0,1] + '" target="_new"><img id="portfolio_img" border="0" src="' + picNav[0,0] + '" height="380" width="380" /></a><ul id="picnav">');
		document.write('<p class="instructions" style="padding-bottom:0;margin-bottom:0;padding-left:0;margin-left:0">Click image to view site</p>');	
	}
	document.write('</ul>');
	
}




function replaceImg(imgPath, obj, objNumber) {
	document.getElementById("portfolio_img").src=imgPath;
	for (i=0;i<picNav.length;i++)
		{
			document.getElementById('pic' + i).className=''; 	
		}
	obj.className = 'selected';
	if (document.body.className=='currentprojects') {
		for (i=0;i<picNav.length;i++) {
			document.getElementById("desc" + i).className = "silent";
		}
		document.getElementById("desc"+objNumber).className = "";
	}
	
}

