function create_xmlHttp() {
	/* Create a new XMLHttpRequest object to talk to the Web server */

	var xmlHttp = false;

	/*@cc_on @*/
	/*@if (@_jscript_version >= 5)

	try {
	  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	  try {
		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (e2) {
		xmlHttp = false;
	  }
	}
	@end @*/

	if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
	  xmlHttp = new XMLHttpRequest();
	}

	return xmlHttp;
}

function callServerGet(url, parameter, user_func, loader_func) {
	// Create a new XMLHttpRequest object to talk to the Web server
	xmlHttp = create_xmlHttp();

  // Build the URL to connect to  == "field=" + encodeURIComponent(dong_value)

  var url = url + "?" + parameter;

  // Open a connection to the server
  xmlHttp.open("GET", url, true);

  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4) {
			if (xmlHttp.status == 200) {
				var response = xmlHttp.responseText;
				var displayState = "none";
				eval(loader_func+'(displayState);');
				eval(user_func + '(response);');
			} else if (xmlHttp.status == 404) {
				alert ("Requested URL is not found.");
			} else if (xmlHttp.status == 403) {
				alert("Access denied.");
			} else {
				alert("status is " + xmlHttp.status);
			}
		} else if(xmlHttp.readyState == 1 || xmlHttp.readyState == 2 || xmlHttp.readyState == 3) {
			var displayState = "block";
			eval(loader_func+'(displayState);');
		}
  }

  // Send the request
  xmlHttp.send(null);
}

function callServerPost(url, parameter, user_func, loader_func) {
	// Create a new XMLHttpRequest object to talk to the Web server
	xmlHttp = create_xmlHttp();

  // Build the URL to connect to  == "field=" + encodeURIComponent(dong_value)
  var url = url;

  // Open a connection to the server
  xmlHttp.open("POST", url, true);

  // Header
  xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

  // Setup a function for the server to run when it's done
  xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4) {
			if (xmlHttp.status == 200) {
				var response = xmlHttp.responseText;
				var displayState = "none";
				eval(loader_func+'(displayState);');
				eval(user_func + '(response);');
			} else if (xmlHttp.status == 404) {
				alert ("Requested URL is not found.");
			} else if (xmlHttp.status == 403) {
				alert("Access denied.");
			} else {
				alert("status is " + xmlHttp.status);
			}
		} else if(xmlHttp.readyState == 1 || xmlHttp.readyState == 2 || xmlHttp.readyState == 3) {
			var displayState = "block";
			eval(loader_func+'(displayState);');
		}
  }

  // Send the request
  xmlHttp.send(parameter);
}