function getBrowserWidth ( ) {  
    if ( window.innerWidth ) { return window.innerWidth; }
    else if ( document.documentElement && document.documentElement.clientWidth != 0 ) { return document.documentElement.clientWidth; }  
    else if ( document.body ) { return document.body.clientWidth; }  
    return 0;
}

function getBrowserHeight ( ) {  
    if ( window.innerHeight ) { return window.innerHeight; }
    else if ( document.documentElement && document.documentElement.clientHeight != 0 ) { return document.documentElement.clientHeight; }  
    else if ( document.body ) { return document.body.clientHeight; }  
    return 0;
}

//*************************************************
//**                  画像の拡大                 **
//*************************************************
function winPopup(e, elm_nm, img_nm, pref_nm, shop_nm, message) {
  var elImg = document.getElementById(elm_nm);

  if ( document.body.scrollTop == 0){ addY=document.documentElement.scrollTop; }
  else{ addY=document.body.scrollTop; }

  posX = e.clientX - 400;
  if ( posX < 0 ) posX = e.clientX + 10;
  posY = e.clientY + addY - 100;
  if ( e.clientY + 200 > getBrowserHeight() ) posY = posY - 200;

  var_html  = "<div style=\"top:" + posY + "px; left:" + posX + "px; position:absolute; background-color:#FFF; border:1px solid #000; padding:10px;\">\r\n";
  var_html += "  <img src=\"" + img_nm + "\" class=\"popup_img\">\r\n";
  var_html += "  <table class=\"popup_tbl\">\r\n";
  var_html += "    <tr><td width=\"60\">都道府県</td><td>" + pref_nm + "</td><td width=\"60\">店名</td><td>" + shop_nm + "</td></tr>\r\n";
  var_html += "    <tr><td colspan=\"4\">メッセージ</td></tr>\r\n";
  var_html += "    <tr><td colspan=\"4\">" + message + "</td></tr>\r\n";
  var_html += "  </table>\r\n";
  var_html += "</div>\r\n";
  elImg.innerHTML = var_html;
}

//*************************************************
//**             ポップアップを閉じる            **
//*************************************************
function winClose(elm_nm) {
  var elImg = document.getElementById(elm_nm);

  elImg.innerHTML = "";
}