﻿//accordion loader        

//plus & minus included in master or page itself as resolveClientUrl won't get hit if it stays here.
//images for accordion expand/contract
//plus = '<img src="<%= ResolveClientUrl("images/accordion/plus.gif") %>" class="statusicon" />';
//minus = '<img src="<%= ResolveClientUrl("images/accordion/minus.gif") %>" class="statusicon" />';

ddaccordion.init(
{
    defaultexpanded: [], //Use this to indication which "subheadermenu" is open. []=none, [0]=the first one, [1]=2nd, etc... 
    headerclass: "submenuheader", //Shared CSS class name of headers group
    contentclass: "submenu", //Shared CSS class name of contents group
    //clickgo does not work unless the href != # IE will throw a major fit, additionally, we have to set persiststate to true, otherwise
    //the submenu will snapshot on the page load. This has proven to be an issue, especially w/other scripts running in tandem - such as the
    //scroller. Typically you can't get the error thrown unless you 'backspace' or reload the page. My advice, find a way not to use clickgo.
    //keep in mind, you have to override every page in the section to avoid this - see programs as an example - I managed to use 'click' w/o
    //persist state which is most excellent.
    revealtype: "clickgo", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
    mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
    collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
    onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
    animatedefault: false, //Should contents open by default be animated into view?
    persiststate: false, //persist state of opened contents within browser session?
    //2 CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    toggleclass: ["blah", "active"],
    //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    togglehtml: ["suffix", plus, minus],
    animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
    oninit: function(headers, expandedindices)
    {   //custom code to run when headers have initalized
        ; //do nothing
    },
    onopenclose: function(header, index, state, isuseractivated)
    {   //custom code to run whenever a header is opened or closed
        ; //do nothing
    }
})