(function(c){c.Zebra_Accordion=function(s,t){var u={animate_opacity:!0,collapsible:!1,expanded_class:"Zebra_Accordion_Expanded",hide_speed:400,scroll_speed:600,show_speed:400,show:0,toggle_on_mouseover:!1,onBeforeClose:null,onBeforeOpen:null,onClose:null,onOpen:null},a=this,h=null,k=null,p=[],g=[];a.settings={};a.show=function(b,d,n){if(null!==(new String(b)).match(/^[0-9]+$/)&&0<=b&&b<=g.length-1){var f=c(h[b]),l=c(k[b]),e=g[b];if(a.settings.onBeforeOpen&&"function"==typeof a.settings.onBeforeOpen)a.settings.onBeforeOpen(b, f,l);if(a.settings.collapsible&&0<l.height())return a.hide(b,d);a.settings.collapsible||k.each(function(c){c!=b&&a.hide(c,d)});f.addClass(a.settings.expanded_class);l.css("display","block");l.stop();l.animate({height:e.height,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,marginTop:e.marginTop,marginBottom:e.marginBottom,opacity:1},d?0:a.settings.show_speed,function(){if(a.settings.onOpen&&"function"==typeof a.settings.onOpen)a.settings.onOpen(b,f,l);if(!n){var d=Math.round(f.offset().top), g=d+p[b].height+e.outerHeight,h=c(window).height(),k=c(window).scrollTop(),m=null;g>h+k&&(m=g-h,m>d&&(m=d));d<k&&(m=d);m&&c("html, body").animate({scrollTop:m},a.settings.scroll_speed)}})}};a.hide=function(b,d){if(null!==(new String(b)).match(/^[0-9]+$/)&&0<=b&&b<=g.length-1){var n=c(h[b]),f=c(k[b]),e=g[b];if(a.settings.onBeforeClose&&"function"==typeof a.settings.onBeforeClose)a.settings.onBeforeClose(b,n,f);n.removeClass(a.settings.expanded_class);f.stop();f.css({borderTopWidth:0,borderBottomWidth:0}); f.animate({height:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0,opacity:a.settings.animate_opacity?0:1},d?0:a.settings.hide_speed,function(){if(a.settings.onClose&&"function"==typeof a.settings.onClose)a.settings.onClose(b,n,f);c(this).css({display:"none",visibility:"visible",borderTopWidth:e.borderTopWidth,borderBottomWidth:e.borderBottomWidth})})}};var q=function(){g=[];k.each(function(b){var d=c(this);d.css({visibility:"hidden",display:"block"});g.push({height:d.height(),outerHeight:d.outerHeight(), paddingTop:e(d.css("paddingTop")),paddingBottom:e(d.css("paddingBottom")),marginTop:e(d.css("marginTop")),marginBottom:e(d.css("marginBottom")),borderTopWidth:e(d.css("borderTopWidth")),borderBottomWidth:e(d.css("borderBottomWidth")),style:d.attr("style")});a.hide(b,!0)})},r=function(b){p=[];h.each(function(d){var e=c(this),f=!a.settings.collapsible&&a.settings.toggle_on_mouseover?"mouseover":"click";p.push({height:e.outerHeight(),style:e.attr("style")});void 0===b&&e.bind(f,function(){a.show(d)})})}, e=function(a){a=parseInt(a,10);return isNaN(a)?0:a};(function(){a.settings=c.extend({},u,t);var b=c(s);h=c("dt",b);k=c("dd",b);r();q();if(!1!==a.settings.show)if(a.settings.collapsible&&(c.isArray(a.settings.show)||!0===a.settings.show))if(!0===a.settings.show)for(b=0;b<h.length;b++)a.show(b,!0,!0);else c.each(a.settings.show,function(b){a.show(a.settings.show[b],!0,!0)});else a.show(a.settings.show,!0,!0);c(window).bind("resize",function(){var b=[];h.each(function(e){var f=c(this);f.hasClass(a.settings.expanded_class)&& b.push(e);f.attr("style",p[e].style)});r(!1);k.each(function(a){c(this).attr("style",g[a].style)});q();0<b.length&&c.each(b,function(c){a.show(b[c],!0,!0)})})})()}})(jQuery);