//  blindmicemedia.com Portfolio Page behaviors
//  February 2008
//  
//  Makes use of Prototype 1.6.0 (http://prototypejs.org)
//  and Scriptaculous 1.8.1 (http://script.aculo.us).
//

var pageLinks, pageDivs, currentPage;

function blindmicemediaPortfolioPageInit(){	
	pageLinks = $('project_thumbs').childElements();
	pageDivs = $('project_content').childElements();

	for (var i = 1; i < pageDivs.length; i++){
		pageDivs[i].toggle();
	}
	currentPage = 1;
}

function showPage(pageNum){	
	if (pageNum != currentPage){
		Effect.Fade(pageDivs[Number(currentPage-1)], {duration:0.3});
	//	window.status = "pageNum is currently " + pageNum + " and we're trying to hide " + currentPage-1 + "";
		window.setTimeout(function(){Effect.Appear(pageDivs[pageNum-1], {duration:0.3});}, 0.3*1000);

		pageLinks[currentPage-1].removeClassName('active');
		pageLinks[pageNum-1].addClassName('active');
	
		currentPage = pageNum;
	}
}