var xmlhttp;
var reaction;
function createAJAX() {
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (err) {
				xmlhttp = null;
			}
		}
		if(!xmlhttp && typeof XMLHttpRequest != "undefined")
			xmlhttp = new XMLHttpRequest();
}



function runAjax(urlstring,method,urldate,returnaction){
	
	createAJAX();
	
	reaction=returnaction;
			if (xmlhttp) {
				
				xmlhttp.onreadystatechange =runChange;
				method=method.toLowerCase();
				if (method == "GET" || method=="get") {
					xmlhttp.open("GET", urlstring, true);
				} else {
					xmlhttp.open("POST", urlstring, true);
				}
				if (method == "POST" || method=="post"){
  					try {
						xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded')  
					} catch (e) {}
				}

				xmlhttp.send(urldate);
				//alert('in ajax.js');
				
		
	}
}

function runChange(str){
	//alert('=in runchange===');
	if(xmlhttp.readyState==4)eval(reaction);
}
function $(oid){
	return document.getElementById(oid);
}
function v(oid){
	return document.getElementById(oid).value;
}