I have the following code:

HTML Code:
<script type='text/javascript'>
function enlarge(table, master_id) {
window.open("../admin/include/getImage.php?table="+table+"&master_id="+master_id+"&type=larger_image", "mywindow", "status=0, toolbar=0, scrollbars=1, menubar=0, width=400, height=400");


<h1> my site </h1>
PHP Code:
echo "<a style='border: 0px;' href='#' onClick='enlarge('images', $main_product_id);><img style='border: 0px;' src='images/button-magnify-yel.gif'>";
HTML Code:
OK, the function works fine, however, I'm trying to call it using from within a link which is being echoed by PHP. However, I can't figure out how to call it, as there are too many ' and ".

I am closing it like so:

echo "<a href='#' onClick='enlarge(' .......

So how do I organise it, to call it, whilst passing the values successfully?