// ブラウザ判定
var isWin9X = (navigator.appVersion.toLowerCase().indexOf('windows 98')+1);
var isIE = (navigator.appName.toLowerCase().indexOf('internet explorer')+1?1:0);
var isOpera = (navigator.userAgent.toLowerCase().indexOf('opera')+1?1:0);
if (isOpera) isIE = false;
var isSafari = (navigator.appVersion.toLowerCase().indexOf('safari')+1?1:0);

function outputSwf(fname,fvars,wd,hi,bgcolor) {
    var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
    + 'width="'+ wd +'" height="'+ hi +'"'
    + 'codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
    + '<param name="movie" value="'+ fname +'" /><param name="quality" value="high" /><param name="bgcolor" value="'+bgcolor+'" />'
    + '<param name="flashvars" value="'+ fvars +'" />'
    + '<embed src="' + fname + '" quality="high" bgcolor="'+bgcolor+'" '
    + 'width="'+ wd +'" height="'+ hi +'" name="movie" align="middle"'
    + 'play="true"'
    + 'loop="false"'
    + 'quality="high"'
    + 'allowScriptAccess="sameDomain"'
    + 'type="application/x-shockwave-flash"'
    + 'flashvars="'+ fvars +'"'
    + 'pluginspage="https://www.macromedia.com/go/getflashplayer">'
    + '<\/embed>'
    + '<\/object>';
    document.write(oeTags);   // Flash ムービーの埋め込み
}

function clickhandler(event) {
        if (!event) { event = window.event; }
        var hx, hy;
        if (document.all) { // for IE
                hx = event.offsetX;
                hy = event.offsetY;
        } else {
                hx = event.layerX;
                hy = event.layerY;
        }
        //alert("x:"+hx+",y:"+hy);
        //return [hx,hy];
        window.parent.putMap(hx,hy);
}

function toolMap(flg) {
    if (flg) {
        if (isIE) {
          var obj = getScreenSize();
          document.getElementById("baseContainer2Div").style.width = obj.x + "px";
          document.getElementById("baseContainer2Div").style.height = obj.y + "px";
        } else {
          document.getElementById("baseContainer2Div").style.width = "100%";
          document.getElementById("baseContainer2Div").style.height = "100%";
        }
        document.getElementById("baseContainer2Div").style.display = "block";
        document.getElementById("baseContainer2Div").onclick=function(theEvent){ clickhandler(theEvent);};
    } else {
        document.getElementById("baseContainer2Div").style.width = "0px";
        document.getElementById("baseContainer2Div").style.height = "0px";
        document.getElementById("baseContainer2Div").style.display = "none";
        //document.getElementById("baseContainer2Div").onclick=function(theEvent){ clickhandler(theEvent);};
    }
}

function getScreenSize() {
  var obj = new Object();
  if (!isSafari && !isOpera) {
    obj.x = document.documentElement.clientWidth || document.body.clientWidth || document.body.scrollWidth;
    obj.y = document.documentElement.clientHeight || document.body.clientHeight || document.body.scrollHeight;
  } else {
    obj.x = window.innerWidth;
    obj.y = window.innerHeight;
  }
  return obj;
}

function submitForm(param) {
  var form_nm = param;
  frm = document.forms[form_nm];
  submitForm = disableButton;
  frm.submit();
  return false;
}

function disableButton() {
  return false;
}
