jQuery(document).ready(function() {
	
	if(jQuery('.top_featured').hasClass('no_img')){
		url = 'url('+jQuery('.hide_img img').attr('src')+')';
		if(jQuery('.hide_img img').length == 1){
			jQuery('.wrap_inner').css('backgroundImage', url);
		}
	}
	else{
		url2 = 'url('+jQuery('.top_featured img').attr('src')+')';
		if(jQuery('.top_featured img').length == 1){
			jQuery('.wrap_inner').css('backgroundImage', url2);
		}
		else{
			url3 = 'url('+jQuery('.top_featured img:first').attr('src')+')';
			jQuery('.wrap_inner').css('backgroundImage', url3);
		}
	}
	
	
	jQuery('.less').click(function(){		
		if(jQuery(this).parent().hasClass('act')){	
			
				jQuery(this).parent().removeClass('act');
				jQuery(this).parent().find('.green').animate({  opacity: 1}, 700);					
			jQuery(this).parent().animate({height:'42px'}, 700);
		}
		else{	
			jQuery('.trainers').find('.row.act').animate({height:'42px'}, 700);
			jQuery('.trainers').find('.row.act .green').animate({  opacity: 1}, 700);			
				jQuery('.trainers').find('.row.act').removeClass('act');			
				jQuery(this).parent().addClass('act');				
				h = jQuery(this).parent().find('.img_wrap').height();
				h2 = jQuery(this).parent().find('.col_r').height();
				if(h > h2){
					h_sum=h;
				}
				else{
					h_sum=h2;
				}				
			jQuery(this).parent().animate({  height: h_sum+"px"}, 700);
			jQuery(this).parent().find('.green').animate({  opacity: 0}, 700);
		}		
	});	
});
