var tags = document.getElementsByTagName('script');
var product_id = tags[tags.length-1].src.match(/.*\?(\d+)/)[1];
var html = [
  '<div style="margin: 0; border: 0; padding: 0;    margin: 0; font-size: 100%; line-height: 1; text-decoration: none; width: 162px; height: 237px;">',
    '<a href="http://teeparty.jp/products/detail.php?product_id='+product_id+'" target="_blank">',
      '<img src="http://teeparty.jp/bp_image.php?id='+product_id+'" alt="teeparty blogparts" style="border: none;" width="162" height="237" />',
    '</a>',
  '</div>'
].join("");
document.write(html);