// funciones para el control AJAX

//funcion para mandar por get				
function mandarget(params, url_get, funcion) {
 //params debe contener la cadena de parametros por ejemplo: "id=1&nombre=xhiena"
 //funcion debe ser el manejador
  http.open("GET", url_get +"?" +params, true);
  http.onreadystatechange = funcion;
  http.send(null);
}
//funcion que hace la cadena de parametros


//funcion para mandar por post
function mandarpost(params, url_post, funcion){
 //params debe contener la cadena de parametros por ejemplo: "id=1&nombre=xhiena"
	http.open("POST", url_post,true);
	http.onreadystatechange=funcion;
	http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	http.send(params);
}

//Funcion que crea un objeto ajax
function getHTTPObject() {
  var xmlhttp;
  /*@cc_on
  @if (@_jscript_version >= 5)
	try {
	  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	  try {
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	  } catch (E) {
		xmlhttp = false;
	  }
	}
  @else
  xmlhttp = false;
  @end @*/
  if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
	try {
	  xmlhttp = new XMLHttpRequest();
	} catch (e) {
	  xmlhttp = false;
	}
  }
  return xmlhttp;
}
var http = getHTTPObject(); //creamos objeto Ajax
