var cgiUrl  = "http://shop.enegai.jp/modxshop/getzaiko.html?productid=";
imageTag1 = '<script language="javascript" type="text/javascript" src ="' ;
imageTag3 = '"> </script>';
var tmp = location.href;
var pos1 = tmp.lastIndexOf("/");
if (pos1){
  var pos2 = tmp.lastIndexOf(".html");
  if (pos2){
    var productid = tmp.substring(pos1 + 1 ,pos2  );
    imageTag = imageTag1 +  cgiUrl  + productid + imageTag3;
    /*document.open();*/
    document.write(imageTag);
   /*document.close();*/
  }
}
