Creating Multiple Functions
<p>I am going to try to make this question as clear as I can.</p>

<p>Here's what I'm trying to do:</p>

<p>ELEMENTS:
- button
- modal box
- functions</p>

<p>Application Requirements:</p>

<ol>
<li>I need to have a button on a page, when clicked it calls a function
called <code>newcontent</code>.  That function will need to have it's own
unique ID because I have a specific pageID show up in a modal box</li>
<li>In the modal box function, I call a specific page with a specific
ID, but I also use an .each function to grab the specific DIV ID
from which the button was pushed.</li>
</ol>

<p>Here is the current modal box code:</p>

<pre><code>function newcontent() {    
    $('div.heriyah').each(function() {        
        $.fallr('show', {
            content     :  '&lt;iframe width=620" height="600" src="&lt;? echo $URL ?&gt;/manage_content.php?id=&lt;? echo $pageID; ?&gt;&amp;div='+ this.id +'"&gt;&lt;/iframe&gt;',
            width       : 620 + 5, // 100 = for width padding
            height         : 600,
            closeKey        : true,
            closeOverlay    : true,
            buttons     : {}
        }); 
    });
}
</code></pre>

<p>I will get an error like this:</p>

<pre><code>uncaught  exception: Can't create new message with content: "&lt;iframe 
width=620" height="600" 
src="http://www.brandonrray.com/Heriyah/admin/manage_content.php?id=1&amp;div=sermons_home"&gt;&lt;/iframe&gt;",
past message with content "&lt;iframe width=620" height="600" 
src="http://www.brandonrray.com/Heriyah/admin/manage_content.php?id=1&amp;div=up_events_home"&gt;&lt;/iframe&gt;"
is still active
</code></pre>

<p>But I know that is because I am trying to call the same function like 10 times depending on how many divs are on the page.</p>

<p>Button Jquery Wiring:</p>

<pre><code>$('div.heriyah').each(function() { 
$('div.heriyah').append('&lt;div id="add_button_container"&gt;&lt;a onClick=newcontent_'+ this.id +'();return false&gt;&lt;div id="add_button" class="edit_links"&gt;+ ADD NEW CONTENT&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="clear"&gt;&lt;/div&gt;&lt;div class="placeable"&gt;&lt;/div&gt;');
}); 
</code></pre>

<p>Can anyone push me in the right direction for this app, and if you need me to be more clear, please let me know. I do not want to get kicked off these forums again!</p>
