jQuery selector by classname minus classname
<p>I have the following jquery line in a click event of a <em>p</em> element:</p>

<pre><code>$(this).nextUntil('.Maintheme not:.Document')
</code></pre>

<p>I would like to get all the next elements with class .Maintheme but not .Document.</p>

<p>To explain myself a little better, this is the html that i have:</p>

<pre><code>&lt;div id="DocumentContents"&gt;

&lt;p class="Maintheme"&gt;ParentTheme1&lt;/p&gt;
&lt;p class="Document"&gt;Document1&lt;/p&gt;
&lt;p class="Maintheme"&gt;ParentTheme2&lt;/p&gt;
&lt;p class="Subtheme"&gt;SubTheme1&lt;/p&gt;
&lt;p class="Document"&gt;Document1&lt;/p&gt;
&lt;p class="Document"&gt;Document2&lt;/p&gt;
&lt;p class="Document"&gt;Document3&lt;/p&gt;
&lt;p class="Subtheme"&gt;SubTheme2&lt;/p&gt;
&lt;p class="Document"&gt;Document1&lt;/p&gt;
&lt;/div&gt; 
</code></pre>

<p>Having this html content i would like that when you click in a p element if there is not subthemes then show documents. Else if there are subthemes with documents below, just show the subthemes, and if you click in a subtheme show the next documents.</p>
