// EmptyInputCheck - check if input is empty
function EmptyInputCheck(id) {
 var o = document.getElementById(id);
 if (o) {
  if (o.value == "") {
   o.value = "";
   o.focus();
   o.select();
   return false;
  }
 }
 return true;
}

// IgnoreEnter - ENTERを無視
function IgnoreEnter(e) {
 var keycode;

 if (window.event) {
  keycode = window.event.keyCode;
 } else if (e) {
  keycode = e.which;
 } else {
  return true;
 }

 if (keycode == 13) {
  return false;
 }
 return true;
}


// SubmitOnEnter - submit a form if o.value is not empty
function SubmitOnEnter(o,button,e) {
 var keycode;

 if (window.event) {
  keycode = window.event.keyCode;
 } else if (e) {
  keycode = e.which;
 } else {
  return true;
 }

 if (keycode == 13) {
  if (o.value != "") {
   button.click();
  }
  return false;
 }
 return true;
}


/* FlipDisplay - flip display*/
function FlipDisplay(id) {
 var o = document.getElementById(id);
 if (o) {
  if (o.style.visibility == 'hidden' || o.style.visibility == "") {
   o.style.display = 'block';
   o.style.visibility = 'visible';
  } else {
   o.style.display = 'none';
   o.style.visibility = 'hidden';
  }
 }
 return false;
}


