/* Global Vars */
var activeGroup = 0;
var activeImage = 0;
var totalImages = arr_workImages0.length;

/* Our Work Functions */
function showContent(whichView) {
	activeGroup = whichView;
	activeImage = 0;
	totalImages = eval('arr_workImages' + activeGroup + '.length');
	for( var i = 0; ; i++ ) {
		 if(document.getElementById('ourWork-imgs' + i) == undefined) { 
		 	break;
		} else {
			document.getElementById('ourWork-imgs' + i).style.display = "none";
			document.getElementById('ourWork-copy' + i).style.display = "none";
		}
	}
	document.getElementById('ourWork-imgs' + whichView).style.display = "block";
	document.getElementById('ourWork-copy' + whichView).style.display = "block";
}


function swapWorkImage(whichGroup,whichImage) {
	activeGroup = whichGroup;
	activeImage = whichImage;
	document.getElementById('ourWork-image' + whichGroup).src = eval('arr_workImages' + whichGroup + '[' + whichImage + ']');
	for(var j=0; j<totalImages; j++) {
		document.getElementById('img-button' + whichGroup + '-' + j).src = '../common/images/btn-img' + j + '.gif'
	}
	document.getElementById('img-button' + whichGroup + '-' + whichImage).src = '../common/images/btn-img' + whichImage + '-on.gif'
	if (activeImage == 0) {
		document.getElementById('img-previous' + whichGroup).style.visibility = "hidden";
	} else {
		document.getElementById('img-previous' + whichGroup).style.visibility = "visible";
	}
	if(activeImage == totalImages - 1) {
		document.getElementById('img-next' + activeGroup).style.visibility = "hidden";
	} else {
		document.getElementById('img-next' + activeGroup).style.visibility = "visible";
	}
}

function nextImage() {
	activeImage = activeImage + 1;
	for(var j=0; j<totalImages; j++) {
		document.getElementById('img-button' + activeGroup + '-' + j).src = '../common/images/btn-img' + j + '.gif'
	}
	document.getElementById('img-button' + activeGroup + '-' + activeImage).src = '../common/images/btn-img' + activeImage + '-on.gif'
	if(document.getElementById('img-previous' + activeGroup).style.visibility == "hidden") {
		document.getElementById('img-previous' + activeGroup).style.visibility = "visible";
	}
	if(activeImage == totalImages - 1) {
		document.getElementById('img-next' + activeGroup).style.visibility = "hidden";
	}
	document.getElementById('ourWork-image' + activeGroup).src = eval('arr_workImages' + activeGroup + '[' + activeImage + ']');	
}

function previousImage() {
	activeImage = activeImage - 1;
	for(var j=0; j<totalImages; j++) {
		document.getElementById('img-button' + activeGroup + '-' + j).src = '../common/images/btn-img' + j + '.gif'
	}
	document.getElementById('img-button' + activeGroup + '-' + activeImage).src = '../common/images/btn-img' + activeImage + '-on.gif'
	if(activeImage == 0) {
		document.getElementById('img-previous' + activeGroup).style.visibility = "hidden";
	}
	document.getElementById('img-next' + activeGroup).style.visibility = "visible";
	document.getElementById('ourWork-image' + activeGroup).src = eval('arr_workImages' + activeGroup + '[' + activeImage + ']');
}

