function ajax(dest,docEl) { 
	try {
		xmlhttp = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("MSXML2.XMLHTTP");
	} 
	catch (e) {}
	targetElement = document.getElementById(docEl);
	xmlhttp.onreadystatechange = function () {
		if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) {
			targetElement.innerHTML = xmlhttp.responseText;
			var scripts = targetElement.getElementsByTagName('script');
			for (var i=0; i < scripts.length; i++) {
				script = scripts[i].innerHTML;
				if (window.ActiveXObject) {
					//window.execScript(script); //IE
					(window.eval || eval)(script, null);
				} else {
					eval(script); //real browsers
				}
			}
		}
	}
	xmlhttp.open("GET", dest);
	xmlhttp.send(null);
	iefooterfix();
}

function ajax1(dest,docEl) { 
	try {
		xmlhttp1 = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("MSXML2.XMLHTTP.2.0");
	} 
	catch (e) {}
	targetElement = document.getElementById(docEl);
	xmlhttp1.onreadystatechange = function () {
		if ((xmlhttp1.readyState == 4) && (xmlhttp1.status == 200)) {
			targetElement.innerHTML = xmlhttp1.responseText;
			var scripts = targetElement.getElementsByTagName('script');
			for (var i=0; i < scripts.length; i++) {
				script = scripts[i].innerHTML;
				if (window.ActiveXObject) {
					window.execScript(script); //IE
				} else {
					eval(script); //real browsers
				}
			}
		}
	}
	xmlhttp1.open("GET", dest);
	xmlhttp1.send(null);
	iefooterfix();
}
 
	
function ajaxPost(dest,form,url0,docEl0) { //form can be passed an element id or an element
	if (!url0 || !url0 == null) url0 = '';
	if (!docEl0 || !docEl0 == null) docEl0 = '';
	if (typeof(form) == "string") {
		form = document.getElementById(form);	
	}
	inputs = form.getElementsByTagName('input');
	var params = "";
	for ( var i = 0; i < inputs.length; i++ ) {
		if ( i != 0 ) {
			params += '&';
		}
		if (inputs[i].type == 'checkbox') {
			if (inputs[i].checked) {
				params +=inputs[i].name + '=on';
			}
		} else if (inputs[i].type == 'radio') {
			if (inputs[i].checked) {
				params +=inputs[i].name + '=' + inputs[i].value;
			}
		} else {
			params += inputs[i].name + '=' + encodeURIComponent(inputs[i].value);
		}
	}
	inputs = form.getElementsByTagName('textarea');
	for ( var i = 0; i < inputs.length; i++ ) {
		params += '&' + inputs[i].name + '=' + encodeURIComponent(inputs[i].value);
	}
	inputs = form.getElementsByTagName('select');
	for ( var i = 0; i < inputs.length; i++ ) {
		params += '&' + inputs[i].name + '=' + encodeURIComponent(inputs[i].options[inputs[i].selectedIndex].value);
	}
	try {
		xmlhttp2 = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
	} 
	catch (e) {}
	xmlhttp2.open("POST", dest, true);
	xmlhttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlhttp2.setRequestHeader("Content-length", params.length);
	xmlhttp2.setRequestHeader("Connection", "close");
	xmlhttp2.send(params);
	xmlhttp2.onreadystatechange = function() {
		if(xmlhttp2.readyState == 4 && xmlhttp2.status == 200) {
			if ((url0 != "") && (docEl0 != "")) {
				ajax(url0,docEl0);
			}
		}
	}
}

function ajaxDirectPost(dest,params,url0,docEl0) { 
	try {
		xmlhttp2 = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
	} 
	catch (e) {}
	xmlhttp2.open("POST", dest, true);
	xmlhttp2.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlhttp2.setRequestHeader("Content-length", params.length);
	xmlhttp2.setRequestHeader("Connection", "close");
	xmlhttp2.send(params);
	xmlhttp2.onreadystatechange = function() {
		if(xmlhttp2.readyState == 4 && xmlhttp2.status == 200) {
			if ( (url0 != "") && (docEl0 != "") ) {
				ajax(url0,docEl0);
			}
		}
	}
}