var ajax_request_type = "POST";
var EstSNH = "";
var uri = "";
function x_update_info() {
	ajax_do_call("",x_update_info.arguments);
	
}

function ajax_do_call(func_name, args) {
	var i, x, n;
	var post_data;
	var estimateS_H;
	estimateS_H = EstSNH;
	if (ajax_request_type == "") 
		ajax_request_type = "GET";

	if (ajax_request_type == "GET") {

		if (uri.indexOf("?") == -1) 
			uri += "?rs=" + escape(func_name);
		else
			uri += "&rs=" + escape(func_name);
		uri += "&rst=" + escape(EstSNH);
		uri += "&rsrnd=" + new Date().getTime();

		for (i = 0; i < args.length-1; i++) 
			uri += "&rsargs[]=" + escape(args[i]);

		post_data = null;
	} 
	else if (ajax_request_type == "POST") {
		post_data = "rs=" + escape(func_name);
		post_data += "&rst=" + escape(EstSNH);
		post_data += "&rsrnd=" + new Date().getTime();

		for (i = 0; i < args.length-1; i++) 
			post_data = post_data + "&rsargs[]=" + escape(args[i]);
	}
	else {
		alert("Illegal request type: " + ajax_request_type);
	}

	x = ajax_init_object();
	x.open(ajax_request_type, uri, true);

	if (ajax_request_type == "POST") {
		x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
		x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	}

	x.onreadystatechange = function() {
		if (x.readyState != 4) 
			return;

		var status;
		var data;
		var txt = "";
		var txt = x.responseText.replace(/^\s*|\s*$/g,"");
		
		document.getElementById("estHS1").style.display= "none";
		document.getElementById(estimateS_H).innerHTML = txt;
		
	}
	x.send(post_data);
	delete x;
	
	return true;
}
function ajax_init_object() {
	var A;
	try {
		A=new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		try {
			A=new ActiveXObject("Microsoft.XMLHTTP");
		} catch (oc) {
			A=null;
		}
	}
	if(!A && typeof XMLHttpRequest != "undefined")
		A = new XMLHttpRequest();
	if (!A)
	{}
	return A;
}
