var currIMG
arImages = new Array();
arCount = 0;

function imageData(image) {
arImages[arCount] = new Array(image);
arCount ++;
}

function buildViewer(imgNo){

//Adjust imgNo down by one, as array starts at 0;
imgNo--;

//document.write("<textarea>");

document.write("<div id='projectViewer'>");

/*navigation*/
document.write("<img src='../../Images/Gallery/arrowPrev.gif' alt='' border='0' onmouseover='mOverGif(this)' onmouseout='mOverGif()' onClick='moveBack()' id='backArrowSimple' class='FloatLeft'>");

/*main image*/
document.write("<div style='margin-bottom:10px; float:left; width:678px; height:500px; text-align:center;'><div><img src='" + arImages[imgNo][0] +  "' alt='' border='0' id='mainIMG' style='padding:4px; background-color:#FFFFFF;margin-right:auto; margin-left:auto;'></div></div>");

document.write("<img src='../../Images/Gallery/arrowNext.gif' alt='' border='0' onmouseover='mOverGif(this)' onmouseout='mOverGif()' onClick='moveForward()' id='forwardArrowSimple' class='FloatLeft'>");

document.write("</div><div class='ClearDiv'></div>  ");
currIMG = imgNo;
	



}

function jumpTo(imgNo) {
document.getElementById("mainIMG").src = arImages[imgNo][0];
currIMG = imgNo;
}

function moveForward() {
if (currIMG == (arImages.length -1)) {
jumpTo(0);
} else {
jumpTo(currIMG + 1)
}

}

function moveBack() {
if (currIMG == 0) {
jumpTo(arImages.length - 1);
} else {
jumpTo(currIMG - 1)
}
}


