Open and close panels based on jQuery cookies
<p>I have the following variables which store the value of a set of cookies:</p>

<pre><code>var filterDate = $.cookie('filterDate');
    var filterArea = $.cookie('filterArea');
    var filterCategory = $.cookie('filterCategory');
    var filterType = $.cookie('filterType');
    var filterLevel = $.cookie('filterLevel');
    var filterAge = $.cookie('filterAge');
    var filterAttendance = $.cookie('filterAttendance');
</code></pre>

<p>The name of the cookies and variables are also the ids of some elements that are on the page so for example: <code>&lt;div id="filterDate"&gt;&lt;/div&gt;</code></p>

<p>What I want to do is very minimally (i.e. less code as possible) is check if any have the value of open and if so then run the code inside.</p>

<pre><code>if (filterDate == 'open' || filterArea == 'open' || filterCategory == 'open' || filterType == 'open' || filterLevel == 'open' || filterAge == 'open' || filterAttendance == 'open') {
    $('#' + filter).find('.menuBox.nav ul').show();
    $('#' + filter).find('.menuBox.nav p').hide();
    $('#' + filter.find('h3 span').addClass('active');
}
</code></pre>

<p>How do I get the above to work as <code>filter</code> works for all the cookies without having to duplicate it per cookie and panel?</p>
