Function parameter list too long | Minimizing
<p>As this animation grows more complex, I keep adding in parameters, so that they are available on each call back.  6 total currently.</p>

<p>For example now I want to disable the input box while the message is being displayed so I have to add in yet another element - <code>in_element;</code></p>

<p><strong>The Call:</strong></p>

<pre><code>    Mo.C.movePane( cover_element, pane_element, 0, 0, 0, 'begin' );
</code></pre>

<p><strong>The Function:</strong></p>

<pre><code>    movePane: function( cover_element, pane_element, start, end, index, state ) {
        if( ( state === 'begin' ) ) {
            start = parseInt( window.getComputedStyle( pane_element, null ).getPropertyValue("top"), 10 );
            end = start + 40;
            index = start;
            state = 'down';
            cover_element.style.display = 'inline';
            Mo.C.movePane(cover_element, pane_element, start, end, index, 'down' );
        }
        if( ( state === 'down' ) &amp;&amp; ( index &lt; end ) ) {
            index += 1;
            pane_element.style.top = ( index ) + 'px';
            setTimeout( function( ){ Mo.C.movePane(cover_element, pane_element, start, end, index, state ); }, 1 );
        }
        else if( ( state === 'down' ) &amp;&amp; index === end ) { 
            state = 'up';
            setTimeout( function( ){ Mo.C.movePane(cover_element, pane_element, start, end, index, state ); }, 2000 );
        }
        else if( ( state === 'up' ) &amp;&amp; ( index &gt; start ) ) {
            index -= 1;
            pane_element.style.top = ( index ) + 'px';
            setTimeout( function( ){ Mo.C.movePane(cover_element, pane_element, start, end, index, state ); }, 1 );
        }
        else if( ( state === 'up' ) &amp;&amp; ( index === start ) ) {
            cover_element.style.display = 'none';
            // signup_pass_input.addEventListener( "keypress", Mo.UserNew.enter, false );
        }
    }
};
</code></pre>

<p><strong>Possible Solutions</strong></p>

<ul>
<li>Wrap all in a single object called <code>object_all = {}</code>, and pass just this one variable.</li>
<li>Break up the functionality in some way - likely pull out the start and end conditions to separate functions</li>
<li>Move from function parameters to object properties ( statics ) to keep needed variables persistent</li>
<li>?</li>
</ul>
