var XMLHttpReq;
var arrayValues = null;


function XMLHttpPost(strMethod,strUrl,targetElement,arrayValues) {

	XMLHttpReq = false;
	if(window.XMLHttpRequest) {

		// Mozilla/Safari
		try {
			XMLHttpReq = new XMLHttpRequest();
		} catch(e) {
			XMLHttpReq = false;
		}

	} else if(window.ActiveXObject) {

		// IE
		try {
			XMLHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try {
				XMLHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
			} catch(e) {
				XMLHttpReq = false;
			}
		}

	} // end if

	if(XMLHttpReq) {

		XMLHttpReq.onreadystatechange = function() {

			if (XMLHttpReq.readyState == 4) {

				// only if "OK"
				if (XMLHttpReq.status == 200) {
					document.getElementById(targetElement).innerHTML = XMLHttpReq.responseText;
				} else {
					alert("There was a problem retrieving the XML data:\n" +XMLHttpReq.statusText);
				}
			}

		}

		XMLHttpReq.open(strMethod,strUrl,true);
		XMLHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
				
		XMLHttpReq.send('arrayValues='+arrayValues);

	} // end if

} // end function