
// whh 2020.01.01     send using contacts

function sendUsingContacts(){

 console.log("Runnning  - sendUsingContacts.js -"); // message for browser console for debugging
  //clear data
  document.getElementById("phoneNumber").innerHTML = "&nbsp;";
  document.getElementById('newWindows').innerHTML = "&nbsp;";
  // document.getElementById("phoneNumberSource").innerHTML = "<br>";

  // set element to display
  document.getElementById("sms").style.display = "block";
  document.getElementById("phone").style.display = "none";
  document.getElementById("numpad").style.display = "none";
  document.getElementById("selectNUM").style.display = "block";
  document.getElementById("newPhoneList").style.display = "none";
  document.getElementById("selectContact").style.display = "block";
  document.getElementById("contactSubmit").style.display = "none";
  document.getElementById("firstName").style.display = "none";
  document.getElementById("lastName").style.display = "none";
  document.getElementById("type").style.display = "block";
  document.getElementById("typeText").style.display = "none";
  document.getElementById("contactDelete").style.display = "none";
  document.getElementById('deleteText').style.display = "none";
  document.getElementById('showMail').style.display = "none";


  // make this input required for this useage
  document.getElementById("message").required  = true;

  document.getElementById("messageText").style.display = "block";

  document.getElementById('phoneNumber').innerHTML = "Contacts";

// direct form to contacts.php from default didww.php
  document.getElementById('ajax-contact').action = "didww.php";
  document.getElementById("firstName").value = "";
  document.getElementById('lastName').value = "";
  document.getElementById("mail").value = "";
  document.getElementById('notes').value = "";


  loadContactId(); // load select list for Contacts

  // back button to numbers under the current source
  // var backNumber = "<div class='row'><div class='col-4 p-2'><input class='btn btn-outline-secondary' style='color:white'' type='button' value='Back' onClick='newMessages()'></input></div>";
  // document.getElementById("newWindows").innerHTML += backNumber;

};
