JQuery hide/show gone wrong
<p>Here is a simplified example of what i'm working with, working around preexisting code:</p>

<p>Basically I have 2 divs I want to hide/show in multiple places(stage 1, stage 2, stage 3,etc), as so: </p>

<pre><code>var blue_div = "#Blue";
var red_div = "#Red";
var blue_stage = "#Blue" + count;
var red_stage = "#Red" + count;
</code></pre>

<p><i>Adding insult to injury</i> the div's exist elsewhere on page and are hidden. Need to pull the content into another div for each stage. So i'm using .prepend() to grab the content, as so:</p>

<pre><code>var blue_html = $(blue_div).html();
var new_div = "#new_div";

$(new_div).prepend(blue_html);
$(new_div).attr('id', blue_stage); //Changing the id based on the stage
</code></pre>

<p><b>That last part is really whats throwing me</b>...As now I'm trying to use the new_div without first ending the script so it's not yet in the DOM...</p>

<pre><code>if ($(blue_stage).is(':hidden')) {
    $(blue_stage).show()
    $("#cancel").bind("click",function(){
        $(blue_stage).hide()
    }
}
</code></pre>

<p>I've seen a lot done with <i>Window setTimeout()</i> as well as <i>setinterval</i> and <i>.queue()</i>. But my attempts have all failed. Hopefully my example wasn't confusing, any help at all is appreciated!</p>
