/**** SHOW / HIDE DIVS ******/
//Create an array 
var allPageTags = new Array(); 
var currentItem = 1;

function hideThisClass(theClass) {
//Populate the array with all the page tags
	var allPageTags=document.getElementsByTagName("*");
      //Cycle through the tags using a for loop
	for (i=0; i<allPageTags.length; i++) {
	     //Pick out the tags with our class name
		if (allPageTags[i].className==theClass) {
			//Manipulate this in whatever way you want
			allPageTags[i].style.display='none';
		}  
	} 
		
} 

function hideAllThenShowOne(itemName) {
	hideThisClass("portfolioItem");
	currentItem = itemName;
	document.getElementById("image"+itemName).style.display='inline';
	document.getElementById("desc"+itemName).style.display='block';
}


function showhide(itemName) {
	hideAllThenShowOne(itemName);
}

function showNext(totalItems) {
	//alert(totalItems+"/"+currentItem);
	if (currentItem == totalItems) {
		currentItem = totalItems;
	} else {
		currentItem = currentItem + 1;
	}
	hideAllThenShowOne(currentItem);
}

function showPrevious(totalItems) {
	//alert(totalItems+"/"+currentItem);
	if (currentItem == 1) {
		currentItem = currentItem;
	} else {
		currentItem = currentItem - 1;
	}
	hideAllThenShowOne(currentItem);
}

