
//globale Instanz von XMLHttpRequest
var xmlHttp = false;
 
//XMLHttpRequest-Instanz erstellen
//... für Internet Explorer
try {
    xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
    try {
        xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
    } catch(e) {
        xmlHttp  = false;
    }
}
//... für Mozilla, Opera, Safari usw.
if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}

function makePostStr(el)
{ 
  var sendstr = "";
  var tform = el.parentNode;
  
  //alert(tform.nodeName);
  
  for(i in tform.childNodes){
    if (tform.childNodes[i].nodeType == 1 && tform.childNodes[i].nodeName == "SELECT"){
	  //alert(el.parentNode.childNodes[i].name);
	  
	  if(tform.childNodes[i].name && tform.childNodes[i].options[tform.childNodes[i].selectedIndex].value){
	    if(sendstr)
	      sendstr += '&';
	  
	    //sendstr += el.parentNode.childNodes[i].name + '=' + el.parentNode.childNodes[i].options[ el.parentNode.childNodes[i].selectedIndex].value;
	    sendstr += tform.childNodes[i].name + '=' + escape(tform.childNodes[i].options[tform.childNodes[i].selectedIndex].value);
	  }
	}
  }
  sendPost(sendstr);
}

function resetselect(){
  sendPost('');
}


function sendPost(postStr){

  if (xmlHttp) {
    xmlHttp.open('POST', 'getdata.php', true);
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttp.send(postStr);
    xmlHttp.onreadystatechange = function () {
      if (xmlHttp.readyState == 4) {
        document.getElementById("outtxt").innerHTML = xmlHttp.responseText;
      }
    };
  }

}



