var width;
var count;
var topValue = 0;
var liwidth = 132;
var licount = 5;
var profile_info;

$(document).ready(function(){
   	count = $("ul.members_frame li").size();
   	width = count * liwidth;
   	negwidth = (-width) + (licount * liwidth);
   	
   	for (var j=0; j<count; j++){
   		left = (j) * 132;
   		$('ul.members_frame li').eq(j).css("left", left);
   	}
   	
   	
   	$('ul.members_frame').css("width", width);
    $('.prev').click(function() {
		if(topValue>negwidth){
 			$("ul.members_frame").animate({  
 				left : topValue - liwidth + "px"      
 			}, 400 );
 			topValue = topValue - liwidth;
 		}
    	return false;
    });
    
    $('.next').click(function() {
    	
    	if(topValue<0){
 			$("ul.members_frame").animate({ 
 				left : topValue + liwidth + "px"      
 			}, 400 );
 			topValue = topValue + liwidth;
 		}
    	return false;
    });
    
    
    /*hovers*/
    $('.next').animate({opacity: 0.4});
    $('.prev').animate({opacity: 0.4});
    
    $('.next').hover(function(){
        $(this).animate({opacity: 1}, 300);   
    }, 
    function(){
    	$(this).animate({opacity: 0.4}, 300);
    });
    
    $('.prev').hover(function(){
        $(this).animate({opacity: 1}, 300);   
    }, 
    function(){
    	$(this).animate({opacity: 0.4}, 300);
    });
    
    
    /*hover images for information*/
    $('ul.members_frame li p').hide();
    
    $('ul.members_frame li').hover(function(){
	   members_p = $(this).find('p');
	   $(members_p).slideDown(400);
	          

    }, 
    function(){

    	$(this).find('p').slideUp(400);
   		    	
    });
});

