window.addEvent('domready', function() {
		

		
		
		$('gallery').addEvent('click', function(e) { 
		
			e = new Event(e).stop();
					
			var req = new Request.HTML({url:'includes/views/community_preview.php?action=gallery', 
				onSuccess: function(html) {
					//Clear the text currently inside the results div.
					$('community_info').set('text', '');
					//Inject the new DOM elements into the results div.
					$('community_info').adopt(html);
				},
				//Our request will most likely succeed, but just in case, we'll add an
				//onFailure method which will let the user know what happened.
				onFailure: function() {
					$('community_info').set('text', 'The request failed.');
				}
			});
			
			e = req.send();
			});
			
			$('forum').addEvent('click', function(e) { 
		
			e = new Event(e).stop();
					
			var req = new Request.HTML({url:'includes/views/community_preview.php?action=forum', 
				onSuccess: function(html) {
					//Clear the text currently inside the results div.
					$('community_info').set('text', '');
					//Inject the new DOM elements into the results div.
					$('community_info').adopt(html);
				},
				//Our request will most likely succeed, but just in case, we'll add an
				//onFailure method which will let the user know what happened.
				onFailure: function() {
					$('community_info').set('text', 'The request failed.');
				}
			});
			
			e = req.send();
			});

			
});