 //########################################################################### 
 //## this is a "loader" for the xmlhttp Component for IE6 and older         # 
  
 /*@cc_on @if (@_win32 && @_jscript_version >= 5) if (!window.XMLHttpRequest) 
 function XMLHttpRequest() { return new ActiveXObject('Microsoft.XMLHTTP') } 
 @end @*/ 
 //########################################################################### 
  
  
function getData(the_url, the_div, hide_load_text) { 
	div_obj = document.getElementById(the_div);
 	if (!hide_load_text) div_obj.innerHTML = '<b>es wird geladen...</b>';
 
    var xmlHttp = new XMLHttpRequest(); 
    xmlHttp.open('GET', the_url, true); 
    xmlHttp.onreadystatechange = function () { 
      if (xmlHttp.readyState==4) {
	  	rt = xmlHttp.responseText
		the_script = rt.substring((rt.indexOf("<script>")+8), rt.indexOf("</script>"));
		
	  	div_obj.innerHTML = rt; 
		
		try {
			eval(the_script);
		} catch(e) {}
	  }
    }; 
	
    xmlHttp.send(null); 
}  
 
function runData(the_url) { 
    var xmlHttp = new XMLHttpRequest(); 
    xmlHttp.open('GET', the_url, true); 
    xmlHttp.onreadystatechange = function () { 
         if (xmlHttp.readyState==4) eval(xmlHttp.responseText);
    }; 
	
    xmlHttp.send(null); 
}
 

function postData(the_url, the_div, values) {
 	 div_obj = document.getElementById(the_div);
	 div_obj.innerHTML = '<b>es wird geladen...</b>';
	 
 	 var xmlHttp = new XMLHttpRequest(); 
     xmlHttp.open('POST', the_url, true); 
     xmlHttp.onreadystatechange = function () { 
          if (xmlHttp.readyState==4) {
		  	rt = xmlHttp.responseText
			the_script = rt.substring((rt.indexOf("<script>")+8), rt.indexOf("</script>"));
			
		  	div_obj.innerHTML = rt; 
			
			try {
				eval(the_script);
			} catch(e) {}
		  }
     }; 
	 
	 xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
     xmlHttp.send(values); 
}
 

function submForm(url) {
	values = "";
	
	sels = document.getElementsByTagName("select");
	for (i=0; i<sels.length; i++) {
		values += sels[i].name + "=" + sels[i].options[sels[i].selectedIndex].value + "&";
	}
	
	
	obs = document.getElementsByTagName("input");
	for (i=0; i<obs.length; i++) {
		if ((obs[i].type=='radio' || obs[i].type=='checkbox') && !obs[i].checked) continue;
		
		values += obs[i].name + "=" + obs[i].value + "&";
	}
	
	tas = document.getElementsByTagName("textarea");
	for (i=0; i<tas.length; i++) {
		values += tas[i].name + "=" + tas[i].value + "&";
	}
	
	values = encodeURI(values);
	postData(url, 'anzeige', values);
}
