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

function ajax_load(type,url,id)
{
	
 if (xmlHttp) {
	
     xmlHttp.open(type, url, true);
     xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=iso-8859-1');
     

     xmlHttp.send(null);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             parent.document.getElementById(id).innerHTML = xmlHttp.responseText;
         	 if(parent.myLightWindow) parent.myLightWindow.deactivate();
         }
     };
     
 }
 

}


function ajax_post(url,vars,id)
{
	
 if (xmlHttp) {
	
     xmlHttp.open('POST', url, true);
     xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=iso-8859-1');
     xmlHttp.send(vars);
     xmlHttp.onreadystatechange = function () {
         if (xmlHttp.readyState == 4) {
             parent.document.getElementById(id).innerHTML = xmlHttp.responseText;
         	 if(parent.myLightWindow) parent.myLightWindow.deactivate();
         }
     };
     
 }
 

}

function JSON() {
      var formValues = '{';
      for (var i=0; i<document.getElementsByTagName('input').length; i++) with (document.getElementsByTagName('input')[i])
      {
        formValues = formValues + '\"' + name + '\":\"' + value + '\",';
      }
      return formValues = formValues.substr(0,formValues.length-1) + '}';
    }
