function ajaxScript(sender, sendingUrl, fromId, inputId) {
	var xmlHttp;
	var params = "";
	if ((inputId != null) && (inputId != "")) {
		inputId = inputId.replace(/\s/g, "").split(",");
		for (var i=0; i<inputId.length; i++) {
			if ((i > 0) && (params != "") && (inputId[i] != "")) {
				params += "&";
			}
			params += $("#"+inputId[i]).attr("name")+"="+escape($("#"+inputId[i]).attr("value"));
		}
	}

	if (sendingUrl.length == 0) {
		alert("destination url error");
		return false;
  	}

	if (window.XMLHttpRequest) {
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlHttp = new XMLHttpRequest();
	} else {
		// code for IE6, IE5
		xmlHttp = new ActiveXObject("Microsoft.xmlHttp");
	}



	xmlHttp.onreadystatechange = function() {
		if ((xmlHttp.readyState == 4) && (xmlHttp.status == 200)) {
			if (fromId == "head") {
				$("head").append(xmlHttp.responseText);
			} else if ((fromId != null) && (fromId != "")) {
				$("#"+fromId).html(xmlHttp.responseText);
			} else {
				xmlHttp.responseText;
			}
			reloadEventLoad();
			if (!objExists("div", "createOverlay_DIV")) {
				closeOverlayDiv();
			}
		}
	}

	if (sendingUrl.indexOf("?") > -1) {
		sendingUrl += "&fake="+ Math.random();
	} else {
		sendingUrl += "?fake="+ Math.random();
	}

	xmlHttp.open(sender, sendingUrl, true);
	if (sender.toLowerCase() == "post") {
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.setRequestHeader("Content-length", params.length);
		xmlHttp.setRequestHeader("Connection", "close");
	}

	xmlHttp.send(params);
	return false;
}






function ajaxGetValue(v, sendingUrl) {
	var result = null;
	var xmlHttp;
	if (sendingurl == null) {
		sendingUrl = "/ajax.asp?move=" + v
	}
	sendingUrl += "&fake="+Math.random().toString();

	if (window.XMLHttpRequest) {
		// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlHttp = new XMLHttpRequest();
	} else {
		// code for IE6, IE5
		xmlHttp = new ActiveXObject("Microsoft.xmlHttp");
	}

	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4) {
			if (xmlHttp.status == 200) {
				result = xmlHttp.responseText;
			}
		}
	}

	xmlHttp.open("GET", sendingUrl, false);
	xmlHttp.send(null);

	return result;
}
