$(document).ready(function() {	

	//popup for great team page
	
	$('.popup').click(function() {
 		var memberID = $(this).attr('memberID');
 		$('#'+memberID).css("display", "block"); 
 		$(this).children('img').addClass('orange');
 		$.scrollTo( 50, 2500);
 		return false;
 	}); 

	$('.popup-close').click(function() {
 		var memberID = $(this).attr('memberID');
 		$('#'+memberID).css("display", "none"); 
 		$('.orange').removeClass('orange');
 		return false;
 	}); 
 	
 	$('.btn_forward').click(function() {
 		//find current id and hide
 	 	var memberID = $(this).attr('memberID'); 
 		$('#'+memberID).css("display", "none"); 
 		
 		//find next id and show
 		var nextID = parseFloat(memberID.substr(6));
 		nextID = nextID + 1;
 		$('#member'+nextID).css("display", "block"); 
 		$.scrollTo( 50, 2500);
 		return false;
 	}); 

 	$('.btn_back').click(function() {
 		//find current id and hide
 	 	var memberID = $(this).attr('memberID'); 
 		$('#'+memberID).css("display", "none"); 
 		
 		//find next id and show
 		var nextID = parseFloat(memberID.substr(6));
 		nextID = nextID - 1;
 		$('#member'+nextID).css("display", "block"); 
 		$.scrollTo( 50, 2500);
 		return false;
 	}); 
 	
 	//select sidebar children
 	$('ul#sidelist li:first-child').addClass( 'first' );
 	
 	//side hover
 	$('#sidebar li a').hover(function(){
 		$(this).addClass('sidehover');
 	}, function(){
 		$(this).removeClass('sidehover');
 	});
 	
 	$('#sidebar li a img.activepage').parent('a').addClass('activepage');
 

});

