//
// CorePHP5 javascript lib
//

function hideElementDisplay(id) {
  document.getElementById(id).style.display = 'none';
}

function showElementDisplay(id) {
  document.getElementById(id).style.display = 'block';
}

function switchDIV(id) {
  if(document.getElementById(id).style.display != 'none') {
    hideElementDisplay(id);
  } else {
    showElementDisplay(id);
  }
}

function setFocus(id) {
  document.getElementById(id).focus();
}

function setValue(id, value) {
  document.getElementById(id).value = value;
}

function getValue(id) {
  return document.getElementById(id).value;
}

function createEmail(emailaddr) {
	var repemailaddr = emailaddr.replace(/\(at\)/, '@');
	window.open('mailto:' + repemailaddr, '_self');
}