function erzeugeNeuesXMLHttpRequestObjekt() {
   // 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();
   }
   return xmlHttp;
}

//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) {
	var url = 'mailerstatus.php?lid=' + lid;
	var data = erzeugeNeuesXMLHttpRequestObjekt();
 if (data) {
     data.open('GET', url, true);
     data.onreadystatechange = function () {
         if (this.readyState == 4) {
             document.getElementById("progress_content").innerHTML = this.responseText;
         }
     }
     data.send(null);
 }
}

function uaData(workbase,page) {
	var url = 'workbase.php?workbase=' + workbase + '&page1=' + page;
	var data = erzeugeNeuesXMLHttpRequestObjekt();
 if (data) {
     data.open('GET', url, true);
     data.onreadystatechange = function () {
         if (this.readyState == 4) {
             document.getElementById("progress_content").innerHTML = this.responseText;
         }
     }
     data.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() {
	var data = erzeugeNeuesXMLHttpRequestObjekt();
if (data) {
    data.open('POST', 'setdata.php');
    data.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    data.send('name='+document.frmshoutbox.txtname.value+'&message='+document.frmshoutbox.txtmessage.value);
}
}

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

function loadVideo(vid) {
   var url = 'videoplayer.php?file_id=' + vid;
   var video = erzeugeNeuesXMLHttpRequestObjekt();
   if (video) {
      video.open('GET', url, true);
      video.onreadystatechange = function () {
         if (this.readyState == 4) {
            document.getElementById("video_content_"  + vid).innerHTML = this.responseText;
         }
      }
      video.send(null);
   }
}

//function loadVideo(vid)
//{
//url = 'videoplayer.php?file_id=' + vid;
// if (xmlHttp) {
//     xmlHttp.open('GET', url, true);
//     xmlHttp.onreadystatechange = function () {
//         if (xmlHttp.readyState == 4) {
//             document.getElementById("video_content_"  + vid).innerHTML = xmlHttp.responseText;
//         }
//     };
//     xmlHttp.send(null);
 //}
//}

function convertVideo(vid) {
	var url = 'videokonverter.php?file_id=' + vid;
	var convert = erzeugeNeuesXMLHttpRequestObjekt();
 if (convert) {
     convert.open('GET', url, true);
     convert.onreadystatechange = function () {
         if (this.readyState == 4) {
             document.getElementById("videokonverter").innerHTML = this.responseText;
         }
     }
     convert.send(null);
 }
}
