function createRequestObject(){
  var req;
  try
  {
    // Firefox, Opera, Safari
    req = new XMLHttpRequest();
  }
  catch (e)
  {
    // Internet Explorer
    try
    {
      //For IE 6
      req = new ActiveXObject("Msxml2.XMLHTTP");
    }

    catch (e)
    {
      try
      {
        //For IE 5
        req = new ActiveXObject("Microsoft.XMLHTTP");
      }

      catch (e)
      {
        alert('Your browser is not IE 5 or higher, or Firefox or Safari or Opera');
      }
    }
  }

  return req;
}

//Make the XMLHttpRequest Object
var http = createRequestObject();

function sendRequest(method, url){
  if(method == 'get' || method == 'GET'){

        var s = document.form1.parent_nontechnical_id;
        var selected_parent_nontechnical_id = s.options[s.selectedIndex].value;

        var queryString = "?selected_parent_nontechnical_id=" + encodeURIComponent(selected_parent_nontechnical_id);
        url = url + queryString;

    http.open(method,url,true);
    http.onreadystatechange = handleResponse;
    http.send(null);
  }
}

function handleResponse(){
  if(http.readyState == 4 && http.status == 200){
    var response = http.responseText;
    if(response){
      document.getElementById('professional_layer').innerHTML = response;
    }
  }
}



function sendRequest2(method, url){
  if(method == 'get' || method == 'GET'){

        var s = document.form1.nontechnical_id;
        var nontechnical_id = s.options[s.selectedIndex].value;

        var queryString = "?nontechnical_id=" + encodeURIComponent(nontechnical_id);
        url = url + queryString;

    http.open(method,url,true);
    http.onreadystatechange = handleResponse2;
    http.send(null);
  }
}

function handleResponse2(){
  if(http.readyState == 4 && http.status == 200){
    var response = http.responseText;
    if(response){
      document.getElementById('text_box_layer').innerHTML = response;
    }
  }
}

