function profile() {
	var rank_li_a = $$('ul#view_rank_friends li');
	Element.addClassName(rank_li_a.first(),"first_child");
	
	var add_me_menu_a = $$('ul#add_me_menu li');
	Element.addClassName(add_me_menu_a.first(),"first_child");
}
function camp_profile() {
	var recent_friends = $$('ul#recent_friends li');
	Element.addClassName(recent_friends.first(),"first_child");
	
   var other_friends = $$('ul#other_friends li');
	Element.addClassName(other_friends.first(),"first_child");
	
   var map_directions = $$('ul#map_directions li');
	Element.addClassName(map_directions.first(),"first_child");
	      
  var add_me_menu = $$('ul#add_me_menu li');
	Element.addClassName(add_me_menu.first(),"first_child");
	
	var view_rank_friends = $$('ul#view_rank_friends li');
	Element.addClassName(view_rank_friends.first(),"first_child"); 
	// alert(add_me_menu.first());
	
	//var add_me_menu_a = $$('ul#add_me_menu li');
	//Element.addClassName(add_me_menu_a.first(),"first_child");
}
function every_four() {
	var top_friends = $$('ul#top_friends li');
	var top_friends_hash = $H(top_friends);
	var keyz = (top_friends_hash.keys());
	keyz.each(function(x) {
  		if (x.divisibleNoRemainder(4)) Element.addClassName(top_friends[x],"fourth");
  		
	});
	top_friends.each(function(x) {
  		Element.setStyle(x,{display:'block'});
  		
	});
}
function every_ten() {
	var top_friends = $$('ul#top_friends li');
	var top_friends_hash = $H(top_friends);
	var keyz = (top_friends_hash.keys());
	keyz.each(function(x) {
  		if (x.divisibleNoRemainder(10)) Element.addClassName(top_friends[x],"tenth");
  		
	});
	top_friends.each(function(x) {
  		Element.setStyle(x,{display:'block'});
  		
	});
}
function every_four_camp() {
	var top_friends = $$('ul#recent_friends li');
	var top_friends_hash = $H(top_friends);
	var keyz = (top_friends_hash.keys());
	keyz.each(function(x) {
  		if (x.divisibleNoRemainder(4)) Element.addClassName(top_friends[x],"fourth");
	});
	top_friends.each(function(x) {
  		Element.setStyle(x,{display:'block'});
  		
	});
	var top_friends = $$('ul#other_friends li');
	var top_friends_hash = $H(top_friends);
	var keyz = (top_friends_hash.keys());
	keyz.each(function(x) {
  		if (x.divisibleNoRemainder(4)) Element.addClassName(top_friends[x],"fourth");
	});
	top_friends.each(function(x) {
  		Element.setStyle(x,{display:'block'});
  		
	});
}  
function display_camp_player(id) {
	var so = new SWFObject("/filebin/flash/mp3player.swf", "flash_camp_song", "445", "50", "8", "#FFFFFF");  
	so.addVariable("camp_id", id);
	so.addParam("wmode","transparent");
	so.write("flash_camp_song");
}
function display_camper_memorybook(id) {
	var so = new SWFObject("/filebin/flash/mem_book.swf", "membook", "277", "177", "7", "#FFFFFF");  
	so.addVariable("camper_id", id);
	so.addParam("wmode","transparent");  
	so.write("membook");
}
function top_forms() {
	Event.observe('find_camp_camp', 'focus',function(event) {
		var el = this; 
	    if (event.srcElement) var el = event.srcElement;
		if (el.value=="find your camp") el.value=""; 
		Event.observe('find_camp_camp', 'blur',function(event) {  
			var el = this; 
			if (event.srcElement) var el = event.srcElement;  
			if (el.value=="") el.value="find your camp";
		});
	});
   	Event.observe('find_friends_friend', 'focus',function(event) { 
		var el = this; 
		if (event.srcElement) var el = event.srcElement; 
		if (el.value=="find your friends") el.value=""; 
		Event.observe('find_friends_friend', 'blur',function(event) {  
		   	var el = this; 
			if (event.srcElement) var el = event.srcElement; 
			if (el.value=="") el.value="find your friends";
		});
	});
}
String.prototype.divisibleNoRemainder = function(divider){
	var num = ((parseInt(this)+1)/divider).toString();
	if (num.indexOf('.')==-1) {
		return true;
	}
};
