var idata="";
var done=0;
function envio(params, ruta){
	
	var http = new XMLHttpRequest();
	http.open('POST', ruta, true);
	http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	http.onreadystatechange = function() {//Call a function when the state changes.
    if(http.readyState == 4 && http.status == 200) {
       //idata = JSON.parse(http.responseText);
      idata = http.responseText;

      //done = 1;
	}
	}
	http.send(params);
	//return idata;
}