
function ajaxOutput(span,result) {
	document.getElementById(span).innerHTML = result;
}

function ajaxLoad(url, span) {
	var http_request = false;
	var callback_function = "ajaxOutput";
	var return_xml = false;

	if(window.XMLHttpRequest) { // Mozilla
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {
			http_request.overrideMimeType('text/xml');
		}
	} else if (window.ActiveXObject) { // IE
		try {
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {}
		}
	}

	if(!http_request) {
//		alert('Unfortunatelly you browser doesn\'t support this feature.');
		return false;
	}

	http_request.onreadystatechange = function() {
			if (http_request.readyState == 4) {
				if (http_request.status == 200) {
					if(return_xml)
						eval(callback_function+'(span,http_request.responseXML)');
					else
						eval(callback_function+'(span,http_request.responseText)');
				} else {
//					alert('There was a problem with the request.(Code: ' + http_request.status + ')');
				}
			}
	}

	http_request.open('GET', url, true);
	http_request.send(null);
}


/*
function get(obj,span) {
	var getstr = "";

	for (i=0; i<obj.childNodes.length; i++) {
		if (obj.childNodes[i].tagName == "INPUT") {
			if (obj.childNodes[i].type == "text") {
				getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
			}
			if (obj.childNodes[i].type == "checkbox") {
				if (obj.childNodes[i].checked) {
					getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
				} else {
					getstr += obj.childNodes[i].name + "=&";
				}
			}
			if (obj.childNodes[i].type == "radio") {
				if (obj.childNodes[i].checked) {
					getstr += obj.childNodes[i].name + "=" + obj.childNodes[i].value + "&";
				}
			}
		}   
		if (obj.childNodes[i].tagName == "SELECT") {
			var sel = obj.childNodes[i];
			getstr += sel.name + "=" + sel.options[sel.selectedIndex].value + "&";
		}
	}
	ajaxLoad('content_weblinks.php?form=1&'+getstr,span);
}
*/
