var ddaccordion={ajaxloadingmsg:'<img src="loading2.gif" /><br />Loading Content...',headergroup:{},contentgroup:{},preloadimages:function(a){a.each(function(){(new Image).src=this.src})},expandone:function(a,b){this.toggleone(a,b,"expand")},collapseone:function(a,b){this.toggleone(a,b,"collapse")},expandall:function(a){var b=this.headergroup[a];this.contentgroup[a].filter(":hidden").each(function(){b.eq(parseInt($(this).attr("contentindex"))).trigger("evt_accordion")})},collapseall:function(a){var b=
this.headergroup[a];this.contentgroup[a].filter(":visible").each(function(){b.eq(parseInt($(this).attr("contentindex"))).trigger("evt_accordion")})},toggleone:function(a,b,c){var d=this.headergroup[a].eq(b),a=this.contentgroup[a].eq(b);(typeof c=="undefined"||c=="expand"&&a.is(":hidden")||c=="collapse"&&a.is(":visible"))&&d.trigger("evt_accordion")},ajaxloadcontent:function(a,b,c,d){function g(a){if(a&&(e.cacheddata=a,e.status="cached",b.queue("fx").length==0))b.hide().html(a),e.status="complete",
d();e.status!="complete"&&setTimeout(function(){g(e.cacheddata)},100)}var e=a.data("ajaxinfo");e.status=="none"?(b.html(this.ajaxloadingmsg),b.slideDown(c.animatespeed),e.status="loading",$.ajax({url:e.url,error:function(a){g("Error fetching content. Server Response: "+a.responseText)},success:function(a){g(a==""?" ":a)}})):e.status=="loading"&&g(e.cacheddata)},expandit:function(a,b,c,d,g,e){var h=a.data("ajaxinfo");if(h)if(h.status=="none"||h.status=="loading")this.ajaxloadcontent(a,b,c,function(){ddaccordion.expandit(a,
b,c,d,g)});else if(h.status=="cached")b.html(h.cacheddata),h.cacheddata=null,h.status="complete";this.transformHeader(a,c,"expand");b.slideDown(e?0:c.animatespeed,function(){c.onopenclose(a.get(0),parseInt(a.attr("headerindex")),b.css("display"),d);if(c.postreveal=="gotourl"&&g){var e=a.is("a")?a.get(0):a.find("a:eq(0)").get(0);e&&setTimeout(function(){location=e.href},200)}})},collapseit:function(a,b,c,d){this.transformHeader(a,c,"collapse");b.slideUp(c.animatespeed,function(){c.onopenclose(a.get(0),
parseInt(a.attr("headerindex")),b.css("display"),d)})},transformHeader:function(a,b,c){a.addClass(c=="expand"?b.cssclass.expand:b.cssclass.collapse).removeClass(c=="expand"?b.cssclass.collapse:b.cssclass.expand);b.htmlsetting.location=="src"?(a=a.is("img")?a:a.find("img").eq(0),a.attr("src",c=="expand"?b.htmlsetting.expand:b.htmlsetting.collapse)):b.htmlsetting.location=="prefix"?a.find(".accordprefix").html(c=="expand"?b.htmlsetting.expand:b.htmlsetting.collapse):b.htmlsetting.location=="suffix"&&
a.find(".accordsuffix").html(c=="expand"?b.htmlsetting.expand:b.htmlsetting.collapse)},urlparamselect:function(a){a=window.location.search.match(RegExp(a+"=((\\d+)(,(\\d+))*)","i"));a!=null&&(a=RegExp.$1.split(","));return a},getCookie:function(a){a=RegExp(a+"=[^;]+","i");return document.cookie.match(a)?document.cookie.match(a)[0].split("=")[1]:null},setCookie:function(a,b){document.cookie=a+"="+b+"; path=/"},init:function(a){document.write('<style type="text/css">\n');document.write("."+a.contentclass+
"{display: none}\n");document.write("a.hiddenajaxlink{display: none}\n");document.write("</style>");jQuery(document).ready(function(b){ddaccordion.urlparamselect(a.headerclass);var c=ddaccordion.getCookie(a.headerclass);ddaccordion.headergroup[a.headerclass]=b("."+a.headerclass);ddaccordion.contentgroup[a.headerclass]=b("."+a.contentclass);var d=ddaccordion.headergroup[a.headerclass],g=ddaccordion.contentgroup[a.headerclass];a.cssclass={collapse:a.toggleclass[0],expand:a.toggleclass[1]};a.revealtype=
a.revealtype||"click";a.revealtype=a.revealtype.replace(/mouseover/i,"mouseenter");if(a.revealtype=="clickgo")a.postreveal="gotourl",a.revealtype="click";a.htmlsetting=typeof a.togglehtml=="undefined"?{location:"none"}:{location:a.togglehtml[0],collapse:a.togglehtml[1],expand:a.togglehtml[2]};a.oninit=typeof a.oninit=="undefined"?function(){}:a.oninit;a.onopenclose=typeof a.onopenclose=="undefined"?function(){}:a.onopenclose;var e,h,f=ddaccordion.urlparamselect(a.headerclass)||(a.persiststate&&c!=
null?c:a.defaultexpanded);typeof f=="string"&&(f=f.replace(/c/ig,"").split(","));f.length==1&&f[0]=="-1"&&(f=[]);a.collapseprev&&f.length>1&&(f=[f.pop()]);a.onemustopen&&f.length==0&&(f=[0]);d.each(function(c){var d=b(this);/(prefix)|(suffix)/i.test(a.htmlsetting.location)&&d.html()!=""&&(b('<span class="accordprefix"></span>').prependTo(this),b('<span class="accordsuffix"></span>').appendTo(this));d.attr("headerindex",c+"h");g.eq(c).attr("contentindex",c+"c");var i=g.eq(c),j=i.find("a.hiddenajaxlink:eq(0)");
j.length==1&&d.data("ajaxinfo",{url:j.attr("href"),cacheddata:null,status:"none"});jQuery.inArray(typeof f[0]=="number"?c:c+"",f)!=-1?(ddaccordion.expandit(d,i,a,!1,!1,!a.animatedefault),e=d,h=i):(i.hide(),a.onopenclose(d.get(0),parseInt(d.attr("headerindex")),i.css("display"),!1),ddaccordion.transformHeader(d,a,"collapse"))});d.bind("evt_accordion",function(c,d){var f=g.eq(parseInt(b(this).attr("headerindex")));f.css("display")=="none"?(ddaccordion.expandit(b(this),f,a,!0,d),a.collapseprev&&e&&b(this).get(0)!=
e.get(0)&&ddaccordion.collapseit(e,h,a,!0),e=b(this),h=f):(!a.onemustopen||a.onemustopen&&e&&b(this).get(0)!=e.get(0))&&ddaccordion.collapseit(b(this),f,a,!0)});d.bind(a.revealtype,function(){if(a.revealtype=="mouseenter"){clearTimeout(a.revealdelay);var c=parseInt(b(this).attr("headerindex"));a.revealdelay=setTimeout(function(){ddaccordion.expandone(a.headerclass,c)},a.mouseoverdelay||0)}else return b(this).trigger("evt_accordion",[!0]),!1});d.bind("mouseleave",function(){clearTimeout(a.revealdelay)});
a.oninit(d.get(),f);b(window).bind("unload",function(){d.unbind();var c=[];g.filter(":visible").each(function(){c.push(b(this).attr("contentindex"))});a.persiststate==!0&&d.length>0&&(c=c.length==0?"-1c":c,ddaccordion.setCookie(a.headerclass,c))})})}};ddaccordion.preloadimages(jQuery(ddaccordion.ajaxloadingmsg).filter("img"));

