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 calcularPrecio(){
	var p1, p2, p3, contenedor;
	contenedor = document.getElementById('price');
	p1 = document.getElementById('destino').value;
	p2 = document.getElementById('num_pasajeros').value;
	if(document.getElementById('radio1').checked) p3 = document.getElementById('radio1').value;
	else p3 = document.getElementById('radio2').value;
	
	ajax=nuevoAjax();
	ajax.open("GET", "includes/mostrarPrecio.php?p1="+p1+"&p2="+p2+"&p3="+p3,true);
	ajax.onreadystatechange=function() {
		if (ajax.readyState==4) {
		contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.send(null)
}

