	
	fade_in_speed_latest_act = 300;
	
	$(document).ready(function(){
				
		// References

		var content_links 		= $("#latest_activities_bar a");
		var latest_box			= $("#switch_pet_photos, #switch_pet_videos, #switch_yellow_pages, #switch_comunity");
		var text_link			= $("#visit_link");
		var link_href			= $("#link_href");

		// clicks in titlebar
		content_links.click(function(){
			
			// remove "active" css class
			content_links.removeClass("active");
			
			// hide all divs
			latest_box.css({display:"none"});
			
			// load selected section
			switch(this.id){

				case "lab_pet_photos":
					$("#lab_pet_photos").addClass('active');
					$("#switch_pet_photos").css({display:"block"});
					$("#switch_pet_photos").css({opacity:"0"});
					$("#switch_pet_photos").fadeTo(fade_in_speed_latest_act, 1);
					text_link.html('Visit Pet Photo section to explore other photos!');
					link_href.attr("href", "/pet-photos/");
					return false;
					break;
					
				case "lab_pet_videos":
					$("#lab_pet_videos").addClass('active');
					$("#switch_pet_videos").css({display:"block"});
					$("#switch_pet_videos").css({opacity:"0"});
					$("#switch_pet_videos").fadeTo(fade_in_speed_latest_act, 1);
					text_link.html('Visit Pet Videos section to explore other videos!');
					link_href.attr("href", "/pet-videos/");
					return false;
					break;
					
				case "lab_pet_yp":
					$("#lab_pet_yp").addClass('active');
					$("#switch_yellow_pages").css({display:"block"});
					$("#switch_yellow_pages").css({opacity:"0"});
					$("#switch_yellow_pages").fadeTo(fade_in_speed_latest_act, 1);
					text_link.html('Visit Yellow Pages to explore other ads!');
					link_href.attr("href", "/yellow-pages/");
					return false;
					break;
					
				case "lab_pet_comm":
					$("#lab_pet_comm").addClass('active');
					$("#switch_comunity").css({display:"block"});
					$("#switch_comunity").css({opacity:"0"});
					$("#switch_comunity").fadeTo(fade_in_speed_latest_act, 1);
					text_link.html('Visit community to explore threads and posts!');
					link_href.attr("href", "/forum/");
					return false;
					break;
										
				default:
					break;
			}
		});

	});