function browseImage(whichway) {
	if ((whichway == "prev") && (current == 0)) {
		return;
	}	
	if ((whichway == "next") && (current == imgArray.length - 1)) {
		return;
	}
	if (whichway == "prev") {
		current--;
	} else {
		current++;
	}
	var imgid = "l" + current;	
	changeImage(imgArray[current], imgid, imgArray.length, current);
}

function changeImage (imagename, imgid, imgcount, index) {
	current = index;
	var largeImg = document.getElementById("large_img");
	largeImg.src = "images/large/" + imagename;
	//var smallImg = document.getElementById("small_img");
    //smallImg.src = "images/small/" + imagename;
	for (i = 0; i < imgcount; i++) {
		var tmpid = "l" + i;
		var tmp = document.getElementById(tmpid);
		tmp.className = "";
	}
	var dot = document.getElementById(imgid);
	dot.className = "active";
}

function initPage()
{
	var navRoot = document.getElementById("portfolio");
	if (navRoot) {
		var lis = navRoot.getElementsByTagName("li");
		for (var i=0; i<lis.length; i++)
		{
			lis[i].onmouseover = function()
			{
				this.className += " hover";
	                }
			lis[i].onmouseout = function()
			{
				this.className = this.className.replace(new RegExp(" hover"),"");
			}
		}
	}
}

if (window.attachEvent && !window.opera)
	attachEvent("onload", initPage);
