var xhr;

function createXHR() {

  var xhr;
  try {
     xhr = new ActiveXObject("Msxml2.XMLHTTP");
  } catch (e) {
    try {
       xhr = new ActiveXObject("Microsoft.XMLHTTP");
    } catch (E) {
      xhr = false;
    }
  }

  if (!xhr && typeof XMLHttpRequest != 'undefined') {
     xhr = new XMLHttpRequest();
  }
  return xhr;
}

function wait(){
   document.getElementById("Container").style.display="none";
   document.getElementById("Wait").style.display="block";
}

function wakeup(){
   
   document.getElementById("Wait").style.display="none";
   document.getElementById("Container").style.display="block";
}
			
function ClearOptions(OptionList) {

// Always clear an option list from the last entry to the first
  for (x = OptionList.length; x >= 0; x--) {
    OptionList[x] = null;
  }
}
            

function AddToOptionList(OptionList, OptionValue, OptionText) {
  // Add option to the bottom of the list
  OptionList[OptionList.length] = new Option(OptionText, OptionValue);
}

			
function putData() {		
  if (xhr.readyState == 4) {
    if (xhr.status == 200) {
       var data = xhr.responseText;
       eval(data);
    } else {
      //document.getElementById("zipError").innerHTML = "Error";
    }
  }
  
}

function getLetterData(id) {
			    
  xhr = createXHR();
  xhr.onreadystatechange=putData;
  xhr.open("GET",
           "getletterdata.php?&type=eval&id="+id);
  xhr.send(null);
}


