function nuevoAjax(){

var xmlhttp=false;

 try {

  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

 } catch (e) {

  try {

   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");

  } catch (E) {

   xmlhttp = false;

  }

 }



if (!xmlhttp && typeof XMLHttpRequest!='undefined') {

  xmlhttp = new XMLHttpRequest();

}

return xmlhttp;

}



function confpago(){

	c = document.getElementById('resultado_pago');

	

	//variable=documenet.nombre_del_form.nombre_del_control.value



	nom=document.factura.nombre.value;
	rut=document.factura.rut.value;
	rsoc=document.factura.razonsocial.value;
	dir=document.factura.direccion.value;
	com=document.factura.comuna.value;
	ema=document.factura.email.value;
	
	ser=document.factura.servicio.value;
	dom=document.factura.dominio.value;
	come=document.factura.comentarios.value;



	
	

	ajax=nuevoAjax();
c.innerHTML = '<p style="text-align:center;"><img src="esperando.gif"/></p>'; 
	ajax.open("POST", "envia_pagosfac.php",true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
			c.innerHTML = ajax.responseText
		}
		borrarCampos()
	}
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	ajax.send("nombre="+nom+"&rut="+rut+"&razonsocial="+rsoc+"&direccion="+dir+"&comuna="+com+"&email="+ema+"&servicio="+ser+"&dominio="+dom+"&comentarios="+come)
}

