$(document).ready(function(){
	
	//alternate background colors on list items 
	
	$('#message-threads tr:odd').css('background-color','#fefbf2')
	$("#groups-list li:even").css('background-color','#fefbf2');
	$('#item-body #activity-stream li:even').css('background-color','#fefbf2');
	$("#members-list li:even").css('background-color','#fefbf2');
	$("#member-list li:even").css('background-color','#fefbf2');
	$('.single-group #activity-stream li:even').css('background-color','#fefbf2');
	$('#topic-post-list li:even').css('background-color','#fefbf2');
	
	//keep the zebra striping when the select form is used
	
	$("#groups-all").bind('submit',function(){
		
		 $("#groups-list li:even").css('background-color','#fefbf2'); 
	
	});
	
	
	//add active class to groups sub-nav (the three tabs at the top of each group page)
	//get the title of the current page
	var the_title = $("#item-header #item-header-content h1").text(); 
	//cycle through all the list items, and add the current_item class if the li class equals the page title. Clumsy, I know. 
	$('#group_select #custom_groups_list li').each(function(i){
		if ($(this).hasClass(the_title)){
			$(this).addClass('current_item');
		}
	});
	
	// auto-populate hidden "nickname" field in buddypress registration. Done to avoid having multiple (confusing) names for members. 
	
		$('#field_1').val('&nbsp;');
		
			
		$('#signup_form').submit(function(){
			var bp_name = $('#signup_username').val(); //get the original username
			$('#field_1').val($('#signup_username').val()); //assign it to the hidden realname field on submit
		})

	//REMOVE THE EDIT PROFILE TABS
	
	$('.custom_list #public-personal-li, .custom_list #edit-personal-li').remove();
	
	//REMOVE THE 'AGE' LABEL ON PROFILE PAGE 
	

	
});


