
function tabs(){
	var lists = jQuery("#portfolioNav li");
	var theTabs = lists.children("a");
	var shows = jQuery(".portfolioPost");
	var linkNum = theTabs.length;
	var currentSection = jQuery("#current");
	var currentLink = jQuery("#portfolioNav li a.current");
	var currentImage = 0;
	
	for (i=0; i<linkNum; i=i+1){
		addClick(i);
	};
	
	shows.css("display", "none");
	shows.css("visibility", "visible");
	currentSection.css("display", "block");
	
	
	function addClick(a){
		jQuery(theTabs[a]).click(
			function(){
				if(jQuery(this).attr("class") != "current"){
					currentSection.css("display", "none");
					jQuery(shows[a]).css("display", "block");
					currentSection = jQuery(shows[a]);
					currentSection.attr("id", "current");
					currentLink.removeClass("current");
					jQuery(this).addClass("current");
					currentLink = jQuery(this);
					fixheight();									
				
				};
				
				return false;
				
			}
		
		);
	};
	
	function fixheight(){
		var currentImages = currentSection.children(".entry-content").children(".slideshow").children(".next").children("img");
		for(i=0;i<currentImages.length;i++){
			var currentParent = jQuery(currentImages[i-1]).parent();
			
			if(currentParent.css("opacity")== "1"){
				jQuery(currentImages[i]).addClass("currentImage");
			}else{
				jQuery(currentImages[i]).removeClass("currentImage");				
			};
				
		}
			
		
	};
	
	jQuery(".arrow").click(
			function(){
				fixheight();
		}
		);
	
	
	
	
}



