/**
 * BoxAccordion - Verwendet das Plugin boxslider, es wird lediglich geprüft welches der Elemente geöffnet wird und schließt alle anderen Elemente die noch offen sind
 * @author Christian
 * @version 0.1
 * @since 24.07.2009 
 * 
 * @param string content Inhalt der geöffnet wird und geschlossen durch die Pfeile 
 * @param string container Container der die in content enthaltene Elemente umfasst (Oberstes Element in dem die geöffneten Elemente enthalten sind)
 * 
 * @example 
 * 				$('#startseite_boxen .inbox_arrow').boxAccordion({content: '.innerbox'});
 * @return jQuery Object
 */

(function($) {
	
jQuery.fn.boxAccordion = function(options) {
 var defaults = {
	 content: '.innerbox',
	 container: '#startseite_boxen'
 };
 var options = $.extend(defaults, options);

  return this.each(function(){
    $(this).click(function(event) {
		event.preventDefault();
		var box = $(this).parent().next(options.content); //Ab Pfeil eins nach oben und einen weiter ist die innerbox normalerweise
		box = box[0];
		$(options.container).find(options.content).each(function(el) {
			if ($(this).is(':visible') && this != box) {
				$(this).slideUp("slow");
			}
		});
	});

  });
};

})(jQuery);