	function tabs() {
		$("ul.tabs").each(function() {
			$(this).find("li").each(function(i) {
				$(this).click(function(){
					$(this).addClass("current").siblings().removeClass("current")
					.parents("div.section").find("div.box").hide().end().find("div.box:eq("+i+")").fadeIn(150);
				});
			});
		});
		return false;
	};
	
	var slideWeight = 526;
	var nextPage = 1;
	function scrollContent() {
		//alert("!");		
		$(".wrapperScroll").animate({ left: (-1)*nextPage*slideWeight }, 1000);
		if (nextPage==(pages-1)) nextPage=0;
		else nextPage = nextPage+1;
		//alert("!");
		return false;
	};
	
	var thumbWeight = 96;
	var nextThumb = 1;
	maxThumb = 15;
	function scrollThumb() {
		//alert((nextThumb+1)*thumbWeight);		
		$("#portfolio_table").animate({ top: (-1)*nextThumb*thumbWeight }, 1000);
		if (nextThumb >= (maxThumb-8)) nextThumb = 0;
		else nextThumb = nextThumb+1;
		//alert("!");
		return false;
	};

	function getCurThumb(){
		//if	(!curThumb) { curThumb=1; return false;}
		curThumb = maxThumb - curThumb + 1;
		if	(curThumb < 5) return false;
		else if (curThumb > (maxThumb-7)) 
			$("#portfolio_table").animate({ top: (-1)*(maxThumb-8)*thumbWeight }, 1000);
		else {
			$("#portfolio_table").animate({ top: (-1)*(curThumb-3)*thumbWeight }, 1000);
		}
		return false; 
	};
	
	
	function view_screenshots() {
		var vmax=$("div#main").find('.project_nav li').size(); 
		//alert(vmax);
		var z = 1;
		$('.screenshots').click(function(){
			//var zt=parseInt($(this).attr('name'));
			//alert(zt);
			//if (zt!="Nan") z=zt;
			if ( z >= vmax ) z = 0;
			$("#main ul.tabs").find("li").each(function() {
				$(this).siblings().removeClass("current").parents("div.section").find("div.box").hide().end().find("div.box:eq("+z+")").fadeIn(150);
			});
			$("#main ul.tabs").find("li:eq("+z+")").addClass("current");
			z = z + 1;
			return false;
		}); 
	};
