title: Jquery if div hasClass do something with a other div
body: <p>Here is my problem (besides the fact that i'm a beginnen with javascript). I am building a page that wil load ajax content into a HTML page with a tab plugin. We need to build one page only which has to carry loads of content. Everything is working fine but we need to have little enhancement that uses javascript.</p>
  
  <p>The first set are the tabs (ul.tabs) the second set are the content placeholders (div.panel-container) the third set is a layer popup (div#popup)</p>
  
  <pre><code>&lt;div id="ajax-tab-container" class='tab-container'&gt;
  
      &lt;ul class='tabs'&gt;
          &lt;li class='tab'&gt;&lt;a href="file.html #section-one" data-target="#one" class="index"&gt;one&lt;/a&gt;&lt;/li&gt;
          &lt;li class='tab'&gt;&lt;a href="file.html #section-two" data-target="#two" class="blue"&gt;two&lt;/a&gt;&lt;/li&gt;
          &lt;li class='tab'&gt;&lt;a href="file.html #section-three" data-target="#three" class="green"&gt;three&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  
      &lt;div class='panel-container'&gt;
          &lt;div id="one" class="active"&gt;&lt;/div&gt;
          &lt;div id="two"&gt;&lt;/div&gt;
          &lt;div id="three"&gt;&lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div id="#popup"&gt;
          &lt;div class="one-ph"&gt;Content&lt;/div&gt;
          &lt;div class="two-ph"&gt;Content&lt;/div&gt;
          &lt;div class="three-ph"&gt;Content&lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Now based on which tab is active the current scripts set the active status. Now what i need to do is create a script that checks (hasClass) which div within the .panel-container hasClass "active". But then it should addClass to the div within div#popup. But they have to match. </p>
  
  <p>So if div#one hasClass "active" then addClass to div.one-ph, 
  if div#two hasClass "active" then addClass to div.two-ph etc.</p>
  
  <p>Now in this example there are only three but the finished document will have about 20. kan somebody help me create this, i tried almost every example but is does not work. Also this is not a click function but a function that should work probably on document ready.</p>
  
  <p>Please help this desperate guy</p>