I am unable to figure out why this javascript won't work. I am trying to make it open as a popup for a pinterest sharing button, but it continues to open as a tab, I've tried for over few hours. Any leads would be great as this seems to be a simple fix.
<a href="<?php echo 'http://www.pinterest.com/pin/create/button/?url=' . $url . '&media=images/article_images/original/' . $article_image . '&description=' . $article_quote . ''; ?>"
onClick="return pinterest_click(400, 300)" target="_blank" title="pinterest">0</a>
function pinterest_click(width, height)
{
var leftPosition, topPosition;
leftPosition = (window.screen.width / 2) - ((width / 2) + 10);
topPosition = (window.screen.height / 2) - ((height / 2) + 50);
var windowFeatures = "status=no,height=" + height + ",width=" + width + ",resizable=yes,left=" + leftPosition + ",top=" + topPosition + ",screenX=" + leftPosition + ",screenY=" + topPosition + ",toolbar=no,menubar=no,scrollbars=no,location=no,directories=no";
u=location.href;
media=<?php echo 'images/article_images/original/' .$article_image ?>;
description=<?php echo $article_quote;?>;
window.open('http://pinterest.com/pin/create/button/?url='+encodeURIComponent(u)+'&media='+encodeURIComponent(media)+'&description='+encodeURIComponent(description),'sharer', windowFeatures);
return false;
}