
    ///////////////////////////////////////////////////////////////////////////////////////////////////////
	// doAjaxFill
	// Calls a template (URL) and deposits the resulting data in a specified div (fieldToFill).
	// Use <!--BEGINTAG--> and <!--ENDTAG--> to mark off desired content in template.
	///////////////////////////////////////////////////////////////////////////////////////////////////////
    function doAjaxFill(URL, fieldToFill) {
      	http.open("GET", URL, false);  // third argument controls whether call is synchronous (false) or asynchronous (true), needs to be false for this application so that the collected data goes into the proper fields
	http.onreadystatechange = function (){ fillField(http, fieldToFill)};
     	http.send(null);
    }
	

    ///////////////////////////////////////////////////////////////////////////////////////////////////////	
	// Private Functions
	///////////////////////////////////////////////////////////////////////////////////////////////////////
	
	function getHTTPObject() { 
      var xmlhttp;
      if (!xmlhttp && typeof XMLHttpRequest != 'undefined') { 
        try { 
          xmlhttp = new XMLHttpRequest(); 
        } catch (e) { 
          xmlhttp = false; 
        } 
      } 
      return xmlhttp; 
    } 

    var http = getHTTPObject();

    function fillField(http, fieldToFill) {
      if (http.readyState == 4) { 
        results = http.responseText;
		if (results.indexOf("<!--BEGINTAG-->") > -1) {  // Check for presence of BEGINTAG and ENDTAG delimiters.
		  begin   = results.indexOf("<!--BEGINTAG-->");
		  end     = results.indexOf("<!--ENDTAG-->");
		  results = results.slice(begin, end);
		}
		document.getElementById(fieldToFill).innerHTML = results;
      } 
    }
	
