function buscador_zonaSeleccionada(z){
                var parametros = {
                        "z" : z
                };
                $.ajax({
                        data:  parametros,
                        url:   '/proceso/ajax/buscador_zonaSeleccionada.php',
                        type:  'get',
                        beforeSend: function () {
                                
                        },
                        success:  function (response) {
                                eval(response);
                        }
                });
}
function buscador_localidadSeleccionada(l){
                var parametros = {
                        "l" : l
                };
                $.ajax({
                        data:  parametros,
                        url:   '/proceso/ajax/buscador_localidadSeleccionada.php',
                        type:  'get',
                        beforeSend: function () {
                                
                        },
                        success:  function (response) {
                                eval(response);
                        }
                });
}
function eventos_calendario(idioma,fechainicio){
                var parametros = {
                        "idioma" : idioma,
                        "fechainicio" : fechainicio
                };
                $.ajax({
                        data:  parametros,
                        url:   '/proceso/ajax/eventos_calendario.php',
                        type:  'get',
                        beforeSend: function () {
                                
                        },
                        success:  function (response) {
                                $("#eventos_calendario").html(response);
                        }
                });
}
function recurso_calendario(iw4id,idioma,fechainicio,http_host){
                var parametros = {
                        "iw4id" : iw4id,
                        "idioma" : idioma,
                        "fechainicio" : fechainicio
                };
                $.ajax({
                        data:  parametros,
                        url:   http_host+'/proceso/ajax/recurso_calendario.php',
                        type:  'get',
                        beforeSend: function () {
                                
                        },
                        success:  function (response) {
                                $("#calendario").html(response);
                        }
                });
}
function recurso_calendario_bo(iw4id,idioma,fechainicio){
                var parametros = {
                        "bo" : 1,
                        "iw4id" : iw4id,
                        "idioma" : idioma,
                        "fechainicio" : fechainicio
                };
                $.ajax({
                        data:  parametros,
                        url:   '/proceso/ajax/recurso_calendario.php',
                        type:  'get',
                        beforeSend: function () {
                                
                        },
                        success:  function (response) {
                                $("#calendario").html(response);
                        }
                });
}
function calculadora_precio(){
		var serv = "";
	
		$("input[type=checkbox]:checked").each(function() {
			var aux = $(this).attr("name").split("_");
			serv = serv + "|" + aux[1] + "|";
		});

                var parametros = {
                        "iw4id" : $("input[name=iw4id]").val(),
                        "fechaentrada" : $("input[name=fechaentrada]").val(),
                        "fechasalida" : $("input[name=fechasalida]").val(),
                        "thabitacion" : $("select[name=thabitacion]").val(),
                        "nhabitaciones" : $("input[name=nhabitaciones]").val(),
                        "serv" : serv
                };

                $.ajax({
                        data:  parametros,
                        url:   '/proceso/ajax/casas_rurales_calculadora.php',
                        type:  'get',
                        beforeSend: function () {
                                
                        },
                        success:  function (response) {
                                $("input[name=precio]").val(response);
                        }
                });
}
function _ajax_envia_amigo(url,idioma) {
        var parametros = {
                "nombre" : $("input[name=ajax_enviar_amigo_nombre]").val(),
                "email" : $("input[name=ajax_enviar_amigo_email]").val(),
                "url" : url,
		"idioma" : idioma
        };
        $.ajax({
                data:  parametros,
                url:   '/proceso/ajax/envia_amigo.php',
                type:  'post',
                beforeSend: function () {
			$("#_ajax_envia_amigo_resultado").html("");
                },
                success:  function (response) {
			$("input[name=ajax_enviar_amigo_nombre]").val("");
			$("input[name=ajax_enviar_amigo_email]").val("");
			$("#_ajax_envia_amigo_resultado").html("<br/>"+response);
                }
        });	
}


