var xmlHttp;

function suche(suchbegriff) {
xmlHttp=httpXMLobjects();
if (xmlHttp==null) {
  alert ("Browser does not support AJAX");
  return;
}
if (suchbegriff.length==0) { 
  document.getElementById("ausgabe").innerHTML="";
  return;
}
else {
	//URL vorbereiten, Zufallszahl umgeht den Browsercache  
	var aufruf="suchausgabe.php"+"?q="+suchbegriff+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",aufruf,true);
	xmlHttp.send(null);
	}
} 
function stateChanged() { 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
 document.getElementById("ausgabe").innerHTML=xmlHttp.responseText;
 } 
}
//AJAX-Standards 
//Weniger interessant

function httpXMLobjects() {
var xmlHttp=null;
try {
 // Fuer Firefox, Opera und Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e) {
 // Der Internet Explorer wills wieder anders
 try {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e) {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }
return xmlHttp;
}

// Alt

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 und Safari
if (!xmlHttp  && typeof XMLHttpRequest != 'undefined') {
    xmlHttp = new XMLHttpRequest();
}


function loadData(lid)
{
url = 'mailerstatus.php?lid=' + lid;
 if (xmlHttp) {
     xmlHttp.open('GET', url, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("progress_content").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

function uaData(workbase,page)
{
url = 'workbase.php?workbase=' + workbase + '&page1=' + page;
 if (xmlHttp) {
     xmlHttp.open('GET', url, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("progress_content").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}

function startMail()
{
 if (xmlHttp) {
     xmlHttp.open('GET', 'iframe_mailer.php');
    // xmlHttp.onreadystatechange = function () {
       //  if (xmlHttp.readyState == 4) {
		 
		// 	if (xmlHttp.responseText == "weiter") {
		//	startMail();
             //document.getElementById("progress_content").innerHTML = xmlHttp.responseText;
		//	 }
       //  }
     //};
     //xmlHttp.send(null);
 }
}

function saveData()
{
if (xmlHttp) {
    xmlHttp.open('POST', 'setdata.php');
    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    xmlHttp.send('name='+document.frmshoutbox.txtname.value+'&message='+document.frmshoutbox.txtmessage.value);
}
}

function UploadStatus(id)
{
url = 'uploadstatus.php?status=true&id=' + id;
 if (xmlHttp) {
     xmlHttp.open('GET', url, true);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             document.getElementById("progress_content").innerHTML = xmlHttp.responseText;
         }
     };
     xmlHttp.send(null);
 }
}