/*
* collapsor (1.0) // 2008.04.05 // <http://plugins.jquery.com/project/collapsor>
* 
* REQUIRES jQuery 1.2.3+ <http://jquery.com/>
* 
* Copyright (c) 2008 TrafficBroker <http://www.trafficbroker.co.uk>
* Licensed under GPL and MIT licenses
* 
* @author    Jesus Carrera <jesus.carrera@trafficbroker.co.uk>
*
* 2008-12-24 - Changed to work with new layout. changed from trigger's next sibling to parent's next sibling.
* 
*/
(function(A) { A.fn.collapsor = function(C) { C = A.extend({}, A.fn.collapsor.defaults, C); var B = this; return this.each(function() { A(this).find("+ " + C.sublevelElement).hide(); if (A(this).hasClass(C.openClass)) { A(this).find("+ " + C.sublevelElement).show() } A(this).click(function() { A(B).not(A(this)).parent().removeClass(C.openClass); if (A(this).parent().next().is(C.sublevelElement)) { A(this).parent().blur().toggleClass(C.openClass); A(this).parent().next().animate({ height: "toggle", opacity: "toggle" }, C.speed, C.easing); A(this).parent().parent().parent().find(C.sublevelElement).not(A(this).parent().next()).animate({ height: "hide", opacity: "hide" }, C.speed, C.easing); return false } }) }) }; A.fn.collapsor.defaults = { activeClass: "active", openClass: "open", sublevelElement: "ul", speed: 300, easing: "swing"} })(jQuery);