// done

function create_ajax(){
	var ajax_obj=false;

	if (window.XMLHttpRequest) {
		try {
			ajax_obj=new XMLHttpRequest();
		} catch(e) {
			ajax_obj=false;
		}
	} else if (window.ActiveXObject) {
		try {
			ajax_obj=new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				ajax_obj=new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				ajax_obj=false;
			}
		}
	}

	return ajax_obj;
}

function send_ajax(url, div_id) {	
	var xml_http_obj=create_ajax(); 
		
	xml_http_obj.open("GET", url, true);
	xml_http_obj.onreadystatechange=function() {
		if (xml_http_obj.readyState==4) {
			if (xml_http_obj.status==200) {
				document.getElementById(div_id).innerHTML=xml_http_obj.responseText;
			} else {
				document.getElementById(div_id).innerHTML=xml_http_obj.statusText;
			}
		}
	}
	xml_http_obj.send("");
}

function send_ajax_message(url, div_id, override) {	
	var xml_http_obj=create_ajax(); 
	
	if (override!="") {
		document.getElementById(div_id).innerHTML=override;
	}
	
	if (div_id=="chopper_low") {
		toggle('chopper_medium');
		toggle('chopper_high');
	}

	if (div_id=="chopper_medium") {
		toggle('chopper_low');
		toggle('chopper_high');
	}

	if (div_id=="chopper_high") {
		toggle('chopper_low');
		toggle('chopper_medium');
	}
	
	xml_http_obj.open("GET", url, true);
	xml_http_obj.onreadystatechange=function() {
		if (xml_http_obj.readyState==4) {
			if (xml_http_obj.status==200) {
				document.getElementById(div_id).innerHTML=xml_http_obj.responseText;
			} else {
				document.getElementById(div_id).innerHTML=xml_http_obj.statusText;
			}
		}
	}
	xml_http_obj.send("");
}

function toggle(div_id) {
	if (document.getElementById) {       
		if (document.getElementById(div_id).style.display=="none") {
			document.getElementById(div_id).style.display="";
		} else {
			document.getElementById(div_id).style.display="none";
		}
	}
} 