Echoing Javascript Link not working

Hey, I have this javascript link that when clicked puts a picture into TinyMCE editor. This works just plain on HTML, but when I try to echo it in PHP it doesn’t work. I have tried alot of different things, so now I am asking you to help me get this to echo this out properly.

Here is the HTML:

<a href="javascript: blogit('<center><a href=\'/user/WizardsWithWands/pictures/view/74009\'><img src=\'/media/09062007/u48i9x1189078620_n.jpg\'></a><br />photo from <a href=\'/user/WizardsWithWands>WizardsWithWands</a></center><br /><br />')" class='thumbnail'><img src='/images/thumbnail.php?f=/media/09062007/u48i9x1189078620_n.jpg&size=50' style='width:50px; height: 50px;' ></a>