// for the instances where we need prototype as well, we let prototype have it's $
try{ $j = jQuery.noConflict(); }catch(e){};

/*
 *  toggle_all function
 * ---------------------------
 * provides a simple way of toggling html elements
 *
 * USAGE: call this method on a jquery object and each element will be toggled
 * EXAMPLE: jQuery('#tabs .tab_page').toggle_all();
 */ 

(function($) { 
	$.fn.toggle_all = function(){
		this.each(function(){
			$(this).toggle();
		});
	};
})(jQuery);


// run the default popup setup
$j(document).ready(function(){
	$j("a.popup").popup_links();
});

function listSelectedTags(object_name){
	$('selected_tags').innerHTML = $A($(object_name+'_tags').options).select(function(option, index){ 
																					return option.selected 
																		}).map(function(option, index){ 
																					return option.value
																		}).join(', ');
}
$j(document).ready(function(){
	$j("a.image_popup").popup_links({offset_y:14, link_selector:'a.image_popup'});
});