$(function(){
    $('a[href^=http://www.youtube.com/watch]').each(
        function() {
            h = $(this).get()[0].href;
            var re = /[\?|\&]v=(\w*)/i
            l = re.exec(h);
            if (l[1].length) {
                $(this).before('<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/'+l[1]+'"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'+l[1]+'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>').remove();
            }
        }
    )
})
