function swapHero(a) {
	document.getElementById("heroImg").src = "images/portfolio/" + portfolio[a] + ".jpg";
	//writeIndex(a);
	updateThumbClasses(a);
	var pos = 120-(a*40);
	document.getElementById("portfoliothumbs").style.top=pos + "px";
}
/*function writeIndex(a) {
	var realIndex = a + 1;
	document.getElementById("portfolioindex").innerHTML = realIndex + " of " + portfolio.length;
}*/
function updateThumbClasses(a) {
	var thumbID;
	for (var i=0; i<portfolio.length; i++) {
		thumbID = "thumb" + i;
		if (i == a) {
			eval("document.getElementById(thumbID).className =\"thumb_on\";");
		} else {
			eval("document.getElementById(thumbID).className =\"\";");			
		}
	}
}
function writePortfolio() {
	for (var i=0; i<portfolio.length; i++) {
		document.write('<a href="#" onclick="swapHero(' + i + ');"><img src="images/portfolio/' + portfolio[i] + '_thumb.jpg" width="58" height="33" alt="" id="thumb' + i + '"></a>');
	}
}

/******************************************
* Scrollable content script II- © Dynamic Drive (www.dynamicdrive.com)
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/
iens6=document.all||document.getElementById;
ns4=document.layers;
var speed=3; //specify speed of scroll (greater=faster)

document.write('<a href="#" onMouseover="moveup()" onMouseout="clearTimeout(moveupvar)"><img src="images/up.gif" class="navarrow"></a>');

if (iens6){
document.write('<div id="portfoliocontainer"">') //border:1px solid black;
document.write('<div id="portfoliothumbs">') //style="position:absolute;width:100px;left:0;top:160;"
}

document.write('<ilayer name="nsportfoliocontainer" width=90 height=320 clip="0,0,90,320">');
document.write('<layer name="nsportfoliothumbs" width=90 height=320 visibility=hidden>');
document.write('<center>');

writePortfolio();

document.write('</center>');
document.write('</layer>');
document.write('</ilayer>');

if (iens6)
document.write('</div></div>')

document.write('<a href="#" onMouseover="movedown()" onMouseout="clearTimeout(movedownvar)"><img src="images/down.gif" class="navarrow"></a>');

if (iens6){
var crossobj=document.getElementById? document.getElementById("portfoliothumbs") : document.all.portfoliothumbs
var contentheight=crossobj.offsetHeight
}
else if (ns4){
var crossobj=document.nsportfoliocontainer.document.portfoliothumbs
var contentheight=crossobj.clip.height
}

function movedown(){
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+166))
crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
else if (ns4&&crossobj.top>=(contentheight*(-1)+166))
crossobj.top-=speed
movedownvar=setTimeout("movedown()",20)
}

function moveup(){
if (iens6&&parseInt(crossobj.style.top)<=119) //0?
crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
else if (ns4&&crossobj.top<=119) //0?
crossobj.top+=speed
moveupvar=setTimeout("moveup()",20)
}

function getcontent_height(){
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nsportfoliocontainer.document.portfoliothumbs.visibility="show"
}
window.onload=getcontent_height;