// -------------------------------------------------------------------------------
// JavaScript Functions
// Copyright Property Designers Inc.
// -------------------------------------------------------------------------------

// -------------------------------------------------------------------------
// 入力データのチェック
// -------------------------------------------------------------------------
function isRegNum(obj,comment){
  var str=obj.value; /* 入力値 */
  if (str.match(/[^0-9]/g)){
    var chara = str.match(/[^0-9]/g);
    if(chara==" "||chara==""){
      chara="(空白文字)";
    }
    alert (comment+"に数値以外の文字「"+chara+"」が含まれています");
    return false;
  } else {
    return true;
  }
}


// -------------------------------------------------------------------------
// 拡大画像を表示
// -------------------------------------------------------------------------
function WidePhoto(code,id){
  var ImageURL = "/photo/" + code + "_" + id + "L.jpg" ;

  NewWin = window.open("","PHOTO","width=700,height=500,resizable=yes,scrollbars=yes,status=no") ;
  NewWin.document.open() ;
  NewWin.document.write("<html><head><title>" + code + "</title></head>") ;
  NewWin.document.write("<body bgColor=#ffffff leftMargin=0 topMargin=0 rightMargin=0 marginwidth=0 marginheight=0><center>") ;
  NewWin.document.write("<form><BR><img src='" + ImageURL + "'><br><br>") ;
  NewWin.document.write("<input type='button' value='閉じる' onClick='window.close()'></form>") ;
  NewWin.document.write("</center></body></html>") ;
  NewWin.document.close() ;
}

function comma(num) {
  return num.toString().replace( /([0-9]+?)(?=(?:[0-9]{3})+$)/g , '$1,' );
}

function ViewArea(obj,Area){
  if(obj.checked){
    document.getElementById(Area).style.display = 'block';
  } else {
    document.getElementById(Area).style.display = 'none';
  }
}


function imageSwap (path,name,ext){
  document.images[name].src = path + "/" + name + ext ;
}


function imageSwapID (path,name,ext,id){
  document.images[id].src = path + "/" + name + ext ;
}


function popup(file,name,width,height){
  var control = 'width=' + width + ',height=' + height + ',scrollbars=yes,resizable=yes,toolbar=yes' ;
  sub = window.open(file,name,control) ;
  sub.focus();

}


function popup_nobar(file,name,width,height){
  var control = 'width=' + width + ',height=' + height + ',scrollbars=no,resizable=no,toolbar=no' ;
  sub = window.open(file,name,control) ;
  sub.focus();

}


function SubClose(){
  window.top.close();
}

// ------------------------------------------------------------ End Script File --

