jquery function replaces all iframes with the same thing
<p>I have multiple iframes on my page and this jQuery replaces them all with the same thing an <strong>example here</strong> <a href="http://jsfiddle.net/yusaf/g6Mdq/4/" rel="nofollow">http://jsfiddle.net/yusaf/g6Mdq/4/</a> as you will see the iframe src for both are different
I have tried to implement <code>.each</code> but I have not been successfull :/</p>

<pre><code>&lt;script&gt;
$(function (){
    if($(".vid-wrap iframe").length){
        var youtubeid = $(".vid-wrap iframe").attr("src").match(/[\w\-]{11,}/)[0];

        $(".vid-wrap iframe").replaceWith('&lt;a onclick="window.open(&amp;#39;http://www.youtube.com/watch_popup?v=' + youtubeid +'&amp;vq=medium&amp;#39;,&amp;#39;Video&amp;#39;,&amp;#39;width=560, height=315&amp;#39;); return false;"&gt;&lt;img style="width:480px;height:360px;background-image:url(http://i1.ytimg.com/vi/' + youtubeid +'/hqdefault.jpg);" class="someClass" src="http://3.bp.blogspot.com/--0FurTdrYzg/Tsj3RPXGz4I/AAAAAAAAAGI/mm_4UvmoD-A/s1600/standard.png"/&gt;&lt;/a&gt;');
    }
});
&lt;/script&gt;
</code></pre>
