var buscador_reservas = true;
var pulsado = false;
var opciones_menu_medio = 4;
var idioma_site = "1";
function misplanes(url,foto,titulo,tipo){
var total_planes = $.cookie("totalplanesmurcia");
var nombre_cookie = "";
var url_cookie = "";
var existe = 0;
if (!total_planes){
total_planes = 0;
}else{
for (i = 1; i <= total_planes; i++) {
nombre_cookie = "planesurl_"+i;
url_cookie = $.cookie(nombre_cookie);
if (url_cookie == "https://www.turismoregiondemurcia.es"+url){
existe = 1;
}
}
}
if (existe == 0){
total_planes++;
nombre_cookie = "planesurl_"+total_planes;
url_cookie = "https://www.turismoregiondemurcia.es"+url;
$.cookie(nombre_cookie, url_cookie, { expires: 7 });
nombre_cookie = "planesfoto_"+total_planes;
url_cookie = "https://www.turismoregiondemurcia.es"+foto;
$.cookie(nombre_cookie, url_cookie, { expires: 7 });
nombre_cookie = "planestitulo_"+total_planes;
$.cookie(nombre_cookie, titulo, { expires: 7 });
nombre_cookie = "planestipo_"+total_planes;
$.cookie(nombre_cookie, tipo, { expires: 7 });
$.cookie("totalplanesmurcia", total_planes, { expires: 7 });
alert("Añadido a mis planes correctamente");
}else{
alert("Este plan ya había sido añadido a tus planes");
}
/* if (!http_peticion)
$("#"+obj).val(adultos);
$("#act_texto").val();
if (total_planes) {
}else{
total_planes := 0;
alert("No hay planes");
} */
}
function verplanes(){
var total_planes = $.cookie("totalplanesmurcia");
var nombre_cookie = "";
var url = "";
var foto = "";
var titulo = "";
var tipo = "";
var contador = 0;
var planes_totales = 0;
if (!total_planes){
alert("No tienes planes almacenados");
}else{
for (i = 1; i <= total_planes; i++) {
nombre_cookie = "planesurl_"+i;
url = $.cookie(nombre_cookie);
nombre_cookie = "planesfoto_"+i;
foto = $.cookie(nombre_cookie);
nombre_cookie = "planestitulo_"+i;
titulo = $.cookie(nombre_cookie);
nombre_cookie = "planestipo_"+i;
tipo = $.cookie(nombre_cookie);
if (url != ""){
planes_totales++;
if (contador < 2){
document.write('
');
contador++;
}else{
document.write('
');
if (contador == 0){
document.write('
');
}
}
}
if (planes_totales == 1){
document.getElementById("totresplan").innerHTML = "HAY "+planes_totales+" PLAN GUARDADO";
}else{
document.getElementById("totresplan").innerHTML = "HAY "+planes_totales+" PLANES GUARDADOS";
}
}
}
function eliminarplan(codigo){
var nombre_cookie = "";
nombre_cookie = "planesurl_"+codigo;
$.cookie(nombre_cookie,"", { expires: 7 });
nombre_cookie = "planesfoto_"+codigo;
$.cookie(nombre_cookie,"", { expires: 7 });
nombre_cookie = "planestitulo_"+codigo;
$.cookie(nombre_cookie,"", { expires: 7 });
nombre_cookie = "planestipo_"+codigo;
$.cookie(nombre_cookie,"", { expires: 7 });
location.reload();
}
function mail(texto){
var mailres = true;
var cadena = "abcdefghijklmnñopqrstuvwxyzABCDEFGHIJKLMNÑOPQRSTUVWXYZ1234567890@._-";
var arroba = texto.indexOf("@",0);
if ((texto.lastIndexOf("@")) != arroba) arroba = -1;
var punto = texto.lastIndexOf(".");
for (var contador = 0 ; contador < texto.length ; contador++){
if (cadena.indexOf(texto.substr(contador, 1),0) == -1){
mailres = false;
break;
}
}
if ((arroba > 1) && (arroba + 1 < punto) && (punto + 1 < (texto.length)) && (mailres == true) && (texto.indexOf("..",0) == -1))
mailres = true;
else
mailres = false;
return mailres;
}
function ver_calendario(mes,anyo,parametros){
var url = "./mu_calendario_02?mes="+mes+"&anu="+anyo+parametros+"&id_empresa=1";
hazPeticion(url,"calendar"," ");
}
function buscar_movil(){
var texto = document.getElementById("consulta").value;
texto = texto.replace("Buscar en turismoregiondemurcia.es","");
if (texto != ""){
location.href = "/es/buscar?buscador="+texto;
}
}
function speak(textToSpeak) {
var newUtterance = new SpeechSynthesisUtterance();
newUtterance.text = textToSpeak;
newUtterance.lang = 'es-ES';
window.speechSynthesis.speak(newUtterance);
}
function buscar_recursos(){
var url = "?buscar=si";
if (document.getElementById("texto_libre").value != ""){
url = url + "&texto_libre="+document.getElementById("texto_libre").value;
}
if (document.getElementById("localidad").value != ""){
url = url + "&localidad="+document.getElementById("localidad").value;
}
if (document.getElementById("tipo_recurso")){
url = url + document.getElementById("tipo_recurso").value;
}
if (document.getElementById("tipo_agencia")){
url = url + document.getElementById("tipo_agencia").value;
}
if (document.getElementById("camino")){
url = url + "&camino="+document.getElementById("camino").value;
}
if (document.getElementById("marca_blanca")){
url = url + "&marca_blanca="+document.getElementById("marca_blanca").value;
}
if (document.getElementById("tipo_actividad")){
url = url + document.getElementById("tipo_actividad").value;
}
if (document.getElementById("adheridos")){
if (document.getElementById("adheridos").checked){
url = url + "&adheridos=S";
}
}
if (document.getElementById("mar_menor")){
url = url + "&mar_menor="+document.getElementById("mar_menor").value;
}
if (document.getElementById("localidades")){
if (document.getElementById("localidades").value != ""){
url = url + "&localidades="+document.getElementById("localidades").value;
}
}
if (document.getElementById("ag_desde")){ // Solo para la agenda
var ag_desde = document.getElementById("ag_desde").value;
ag_desde = ag_desde.replace("DESDE","");
var ag_hasta = document.getElementById("ag_hasta").value;
ag_hasta = ag_hasta.replace("HASTA","");
url = url + "&fecha_desde="+ag_desde+"&fecha_hasta="+ag_hasta;
if (ag_desde != "" && (ag_hasta == ag_desde || ag_hasta == "")){ url = url + "&busqueda=dia"; }
else if (ag_desde != "" && ag_hasta != "" && ag_desde != ag_hasta){ url = url + "&busqueda=rango"; }
else if (ag_desde == "" && ag_hasta == ""){ url = url + "&busqueda=todo"; }
}
location.href = url;
}
function foto_oferta(foto,ruta,obj){
$('#'+obj).fadeOut('fast',
function() {
$('#'+obj).attr('src', '/fotos_ofertas/2011/'+ruta+'/'+foto).fadeIn('fast')
}
);
}
function foto_oferta_empresas(foto,obj){
$('#'+obj).fadeOut('fast',
function() {
$('#'+obj).attr('src', '/webs/murciaturistica/fotos/1/alojamientos/'+foto).fadeIn('fast')
}
);
}
function reservar_oferta(){
document.getElementById("recaptcha_response_field").value = document.getElementById("g-recaptcha-response").value;
if (document.getElementById("nombre").value == ""){
mensaje("Debe introducir su nombre");
document.getElementById("nombre").focus();
}else if (document.getElementById("apellidos").value == ""){
mensaje("Debe introducir sus apellidos");
document.getElementById("apellidos").focus();
}else if (document.getElementById("personas").value == ""){
mensaje("Debe introducir el número de personas");
document.getElementById("personas").focus();
}else if (document.getElementById("fecha_entrada").value == ""){
mensaje("Debe introducir la fecha de entrada");
document.getElementById("fecha_entrada").focus();
}else if (document.getElementById("fecha_salida").value == ""){
mensaje("Debe introducir la fecha de salida");
document.getElementById("fecha_salida").focus();
}else if (document.getElementById("email").value == ""){
mensaje("Debe introducir su dirección de email");
document.getElementById("email").focus();
}else if (!validarEmail(document.getElementById("email").value)){
mensaje("Debe introducir una dirección de email valida.");
document.getElementById("email").focus();
}else if (document.getElementById("email2").value == ""){
mensaje("Debe confirmar su dirección de email");
document.getElementById("email2").focus();
}else if (document.getElementById("email").value != document.getElementById("email2").value){
mensaje("Las direcciones de email no coinciden");
document.getElementById("email2").value = "";
document.getElementById("email2").focus();
}else if (document.getElementById("direccion").value == ""){
mensaje("Debe introducir su dirección");
document.getElementById("direccion").focus();
}else if (document.getElementById("poblacion").value == ""){
mensaje("Debe introducir su población de residencia");
document.getElementById("poblacion").focus();
}else if (document.getElementById("telefono").value == ""){
mensaje("Debe introducir su número de teléfono");
document.getElementById("telefono").focus();
}else if (!document.getElementById("condiciones").checked){
mensaje("Debe aceptar las condiciones de reserva");
document.getElementById("condiciones").focus();
}else if (document.getElementById("recaptcha_response_field").value == ""){
mensaje("Debe resolver el captcha");
}else{
document.formreservas.submit();
}
}
function cambiar_fechas_orion(producto){
if (document.getElementById("fecha_desde").value != "" && document.getElementById("fecha_hasta").value != ""){
cargando();
window.location = "/es/?ficha="+producto+"&fecha_desde="+document.getElementById("fecha_desde").value+
"&fecha_hasta="+document.getElementById("fecha_hasta").value+"&empresa="+document.getElementById("cod_empresa").value+"&arpa="+document.getElementById("cod_arpa").value; // +"#salto_5"
}else{
mensaje("Debe rellenar los campos de fecha");
}
/*if (document.getElementById("fecha_desde").value != "" && document.getElementById("fecha_hasta").value != ""){
cargando();
window.location = "/es/?ficha="+producto+"&fecha_desde="+document.getElementById("fecha_desde").value+
"&fecha_hasta="+document.getElementById("fecha_hasta").value+"&unidades="+document.getElementById("unidades").value+
"&servicio="+document.getElementById("cod_service").value+"&empresa="+document.getElementById("cod_empresa").value+"&arpa="+document.getElementById("cod_arpa").value; // +"#salto_5"
}else{
mensaje("Debe rellenar los campos de fecha");
}*/
}
function cambiar_fecha_orion(producto){
if (document.getElementById("fecha_desde").value != ""){
window.location = "/es/?ficha="+producto+"&fecha_desde="+document.getElementById("fecha_desde").value+"&fecha_hasta="+document.getElementById("fecha_desde").value+
"&servicio="+document.getElementById("cod_service").value+"&empresa="+document.getElementById("cod_empresa").value+"&arpa="+document.getElementById("cod_arpa").value;
}else{
mensaje("Debe rellenar los campos de fecha");
}
}
function cambio_manual(){
document.getElementById("fecha_hasta").value = addToDate(document.getElementById("fecha_desde").value,document.getElementById("dias_cambio").value);
cambiar_fechas_orion(document.getElementById("cod_ficha").value);
}
function cambiar_fechas_orion_compra(producto){
if (document.getElementById("fecha_desde").value != "" && document.getElementById("fecha_hasta").value != ""){
cargando();
window.location = "/es/?ficha="+producto+"&fecha_desde="+document.getElementById("fecha_desde").value+
"&fecha_hasta="+document.getElementById("fecha_hasta").value+"&empresa="+document.getElementById("cod_empresa").value+"&arpa="+document.getElementById("cod_arpa").value; // +"#salto_5"
}else{
mensaje("Debe rellenar los campos de fecha");
}
}
function genera_precio_compra(){
var atributo;
var unidades = [];
var precios = [];
var fianzas = [];
var tipospago = [];
var contador = 0;
var precio_total = 0;
var importe;
var hayprepago = false;
var importeprepago = 0;
total_personas = 0;
if(esIE > -1){
var c = document.all;
for(i = 0; i < c.length; i++)
{
if (c(i).tagName == "INPUT"){
atributo = c(i).name;
if (atributo.indexOf('fianza') != -1){
fianzas[contador] = String(c(i).value);
}
if (atributo.indexOf('tipopago') != -1){
tipospago[contador] = String(c(i).value);
}
if (atributo.indexOf('precio') != -1){
precios[contador] = String(c(i).value);
contador++;
}
}else if (c(i).tagName == "SELECT"){
atributo = c(i).name;
if (atributo.indexOf('unidades') != -1){
unidades[contador] = String(c(i).value);
total_personas = total_personas + parseInt(c(i).value);
}
}
}
}else{
var c = document.getElementsByTagName("body")[0].getElementsByTagName("*");
for(i = 0; i < c.length; i++)
{
if (c[i].tagName == "INPUT"){
atributo = c[i].name;
if (atributo.indexOf('fianza') != -1){
fianzas[contador] = String(c[i].value);
}
if (atributo.indexOf('tipopago') != -1){
tipospago[contador] = String(c[i].value);
}
if (atributo.indexOf('precio') != -1){
precios[contador] = String(c[i].value);
contador++;
}
}else if (c[i].tagName == "SELECT"){
atributo = c[i].name;
if (atributo.indexOf('unidades') != -1){
unidades[contador] = String(c[i].value);
total_personas = total_personas + parseInt(c[i].value);
}
}
}
}
for(i = 0; i < contador; i++)
{
importe = precios[i];
importe = importe.replace(",",".");
importe = importe * unidades[i];
precio_total = precio_total + parseFloat(importe);
if (tipospago[i] == "prepago"){
hayprepago = true;
importeprepago = importeprepago + ((importe * fianzas[i]) / 100);
}
}
var total = String(precio_total);
total = total.replace(".",",");
document.getElementById("total_precio").innerHTML = "
Total: "+total+"€ ";
if (precio_total > 0){
if (hayprepago){
if (importeprepago > 0){
document.getElementById("textopago").innerHTML = "Para confirmar su reserva, este producto requiere de un pago por adelantado de "+importeprepago+" €, al finalizar el proceso de reserva será redireccionado a nuestra pasarela de pagos seguros.";
}else{
document.getElementById("textopago").innerHTML = "Este producto no requiere de ningún pago por adelantado, el establecimiento cobrará el importe total de la reserva a su llegada, sin embargo el establecimiento necesita los datos de su tarjeta bancaria para confirmar y garantizar su reserva por lo que al finalizar el proceso de reserva será redireccionado a nuestra pasarela de pagos seguros donde se le realizará un cargo simbólico de un céntimo de euro.";
}
}else{
document.getElementById("textopago").innerHTML = "Este producto no requiere de ningún pago por adelantado, el establecimiento cobrará el importe total de la reserva a su llegada.";
}
}else{
document.getElementById("textopago").innerHTML = "Seleccione los servicios que desea reservar para conocer las condiciones de pago de este producto.";
}
}
function reservar_orion_compra(hay_dni)
{
var atributo;
var productos = [];
var servicios = [];
var unidades = [];
var precios = [];
var distribuciones = [];
var codigos = [];
var contador = 0;
var precio_total = 0;
var importe;
var cadena = "";
var unidades_total = 0;
if (hay_dni != 0){
genera_campos_dni();
}
if(esIE > -1){
var c = document.all;
for(i = 0; i < c.length; i++)
{
if (c(i).tagName == "INPUT"){
atributo = c(i).name;
if (atributo.indexOf('producto') != -1){
productos[contador] = String(c(i).value);
}
if (atributo.indexOf('servicio') != -1){
servicios[contador] = String(c(i).value);
}
if (atributo.indexOf('distribucion') != -1){
distribuciones[contador] = String(c(i).value);
}
if (atributo.indexOf('codorion') != -1){
codigos[contador] = String(c(i).value);
}
if (atributo.indexOf('precio') != -1){
precios[contador] = String(c(i).value);
contador++;
}
}else if (c(i).tagName == "SELECT"){
atributo = c(i).name;
if (atributo.indexOf('unidades') != -1){
unidades[contador] = String(c(i).value);
}
}
}
}else{
var c = document.getElementsByTagName("body")[0].getElementsByTagName("*");
for(i = 0; i < c.length; i++)
{
if (c[i].tagName == "INPUT"){
atributo = c[i].name;
if (atributo.indexOf('producto') != -1){
productos[contador] = String(c[i].value);
}
if (atributo.indexOf('servicio') != -1){
servicios[contador] = String(c[i].value);
}
if (atributo.indexOf('distribucion') != -1){
distribuciones[contador] = String(c[i].value);
}
if (atributo.indexOf('codorion') != -1){
codigos[contador] = String(c[i].value);
}
if (atributo.indexOf('precio') != -1){
precios[contador] = String(c[i].value);
contador++;
}
}else if (c[i].tagName == "SELECT"){
atributo = c[i].name;
if (atributo.indexOf('unidades') != -1){
unidades[contador] = String(c[i].value);
}
}
}
}
for(i = 0; i < contador; i++)
{
if (unidades[i] != 0){
unidades_total = unidades_total + parseFloat(unidades[i]);
importe = precios[i];
importe = importe.replace(",",".");
importe = importe * unidades[i];
precio_total = precio_total + parseFloat(importe);
cadena = cadena + "prd:" + productos[i] + "$srv:" + servicios[i] + "$uds:" + unidades[i] + "$dst:" + distribuciones[i] + "$cod:" + codigos[i] + "$pvp:" + precios[i] + "@";
}
}
if (cadena == ""){
mensaje("No ha seleccionado ningun servicio.");
}else{
if (unidades_total < document.getElementById("cantidad_minima").value){
mensaje("La cantidad minima de unidades de este producto que deben reservase son "+document.getElementById("cantidad_minima").value+" Lunidades, usted ha seleccionado un total de "+unidades_total+" Lunidades, por favor corrija su seleccion.");
}else if (unidades_total > document.getElementById("cantidad_maxima").value){
mensaje("La cantidad maxima de unidades de este producto que pueden reservase son "+document.getElementById("cantidad_maxima").value+" unidades, usted ha seleccionado un total de "+unidades_total+" unidades, por favor corrija su seleccion.");
}else{
document.getElementById("selecciones").value = '&v_datos_servicios='+cadena+'&v_precio_total='+precio_total+'&cantidad='+unidades_total;
document.getElementById("cabecera_datos_cliente").style.display = "block";
document.getElementById("salto_8").style.display = "none";
document.getElementById("salto_7").style.display = "none";
document.getElementById("salto_77").style.display = "none";
document.getElementById("salto_6").style.display = "none";
}
}
}
function genera_precio(){
var atributo;
var precio_reserva = 0;
var importe;
if(esIE > -1){
var c = document.all;
for(i = 0; i < c.length; i++)
{
if (c(i).tagName == "INPUT"){
atributo = c(i).name;
if (atributo.indexOf('servicio') != -1){
importe = String(c(i).value);
importe = importe.replace(",",".");
precio_reserva = precio_reserva + parseFloat(importe);
}
}
if (c(i).tagName == "INPUT" && c(i).type == "radio" && c(i).checked){
importe = String(c(i).id);
importe = importe.replace(",",".");
precio_reserva = precio_reserva + parseFloat(importe);
}
}
}else{
var c = document.getElementsByTagName("body")[0].getElementsByTagName("*");
for(i = 0; i < c.length; i++)
{
if (c[i].tagName == "INPUT"){
atributo = c[i].name;
if (atributo.indexOf('servicio') != -1){
importe = String(c[i].value);
importe = importe.replace(",",".");
precio_reserva = precio_reserva + parseFloat(importe);
}
}
if (c[i].tagName == "INPUT" && c[i].type == "radio" && c[i].checked){
importe = String(c[i].id);
importe = importe.replace(",",".");
precio_reserva = precio_reserva + parseFloat(importe);
}
}
}
precio_reserva = precio_reserva * document.getElementById("unidades").value;
var total = String(precio_reserva);
total = total.replace(".",",");
document.getElementById("total_precio").innerHTML = "
Total: "+total+"€ ";
return total;
}
function reservar_orion(){
var datos_servicios = "";
var atributo;
var grupos_marcados = 0;
var grupos_desmarcados = 0;
var aux1 = "";
var aux2 = "";
if(esIE > -1){
var c = document.all;
for(i = 0; i < c.length; i++)
{
if (c(i).tagName == "INPUT" && c(i).type == "radio" && c(i).checked){
datos_servicios = datos_servicios + c(i).name + c(i).value + "@";
atributo = c(i).name;
if (atributo.indexOf('suplemento_') != -1){
if (aux1 != c(i).name){
aux1 = c(i).name;
grupos_marcados = grupos_marcados + 1;
}
}
}else if (c(i).tagName == "INPUT" && c(i).type == "radio" && !c(i).checked){
atributo = c(i).name;
if (atributo.indexOf('suplemento_') != -1){
if (aux2 != c(i).name){
aux2 = c(i).name;
grupos_desmarcados = grupos_desmarcados + 1;
}
}
}
}
}else{
var c = document.getElementsByTagName("body")[0].getElementsByTagName("*");
for(i = 0; i < c.length; i++)
{
if (c[i].tagName == "INPUT" && c[i].type == "radio" && c[i].checked){
datos_servicios = datos_servicios + c[i].name + c[i].value + "@";
atributo = c[i].name;
if (atributo.indexOf('suplemento_') != -1){
if (aux1 != c[i].name){
aux1 = c[i].name;
grupos_marcados = grupos_marcados + 1;
}
}
}else if (c[i].tagName == "INPUT" && c[i].type == "radio" && !c[i].checked){
atributo = c[i].name;
if (atributo.indexOf('suplemento_') != -1){
if (aux2 != c[i].name){
aux2 = c[i].name;
grupos_desmarcados = grupos_desmarcados + 1;
}
}
}
}
}
if (grupos_marcados != grupos_desmarcados){
mensaje("Debe marcar una opción de cada grupo.");
}else{
document.getElementById("selecciones").value = '&v_datos_servicios='+datos_servicios+'&v_precio_total='+genera_precio();
document.getElementById("cabecera_datos_cliente").style.display = "block";
document.getElementById("salto_8").style.display = "none";
document.getElementById("salto_7").style.display = "none";
document.getElementById("salto_6").style.display = "none";
}
}
function volver_seleccion(){
document.getElementById("cabecera_datos_cliente").style.display = "block";
document.getElementById("salto_8").style.display = "block";
document.getElementById("salto_7").style.display = "block";
document.getElementById("salto_77").style.display = "block";
document.getElementById("salto_6").style.display = "block";
document.getElementById("cabecera_datos_cliente").style.display = "none";
}
function filtra_precio_ofertas(desde,hasta,localidad,texto_libre,categoria,localidades,orden){
var precios_recursos = "";
if(esIE > -1){
var c = document.all;
for(i = 0; i < c.length; i++){
if (c(i).type == "checkbox" && String(c(i).id).indexOf("precios_recurso") !== -1){
if (c(i).checked){
precios_recursos = precios_recursos + c(i).value + '@';
}
}
}
}else{
var c = document.getElementsByTagName("body")[0].getElementsByTagName("*");
for(i = 0; i < c.length; i++){
if (c[i].type == "checkbox" && String(c[i].id).indexOf("precios_recurso") !== -1){
if (c[i].checked){
precios_recursos = precios_recursos + c[i].value + '@';
}
}
}
}
var url = document.getElementById("formulariobuscador").action+"?buscar=si&fecha_desde="+desde+"&fecha_hasta="+hasta+"&localidad="+localidad+"&precios="+precios_recursos+
"&texto_libre="+texto_libre+"&categoria="+categoria+"&orden="+orden+"&localidades="+localidades;
location.href = url;
}
function filtra_localidad_ofertas(desde,hasta,localidad,texto_libre,categoria,precios,orden){
var localidades_recursos = "";
if(esIE > -1){
var c = document.all;
for(i = 0; i < c.length; i++){
if (c(i).type == "checkbox" && String(c(i).id).indexOf("localidades_recurso") !== -1){
if (c(i).checked){
localidades_recursos = localidades_recursos + c(i).value + '@';
}
}
}
}else{
var c = document.getElementsByTagName("body")[0].getElementsByTagName("*");
for(i = 0; i < c.length; i++){
if (c[i].type == "checkbox" && String(c[i].id).indexOf("localidades_recurso") !== -1){
if (c[i].checked){
localidades_recursos = localidades_recursos + c[i].value + '@';
}
}
}
}
var url = document.getElementById("formulariobuscador").action+"?buscar=si&fecha_desde="+desde+"&fecha_hasta="+hasta+"&localidad="+localidad+"&precios="+precios+
"&texto_libre="+texto_libre+"&categoria="+categoria+"&orden="+orden+"&localidades="+localidades_recursos;
location.href = url;
}
$("document").ready(function() {
$(function() {
$( "#fecha_desde" ).datepicker({
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
beforeShowDay: enableAll,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
$( "#fecha_hasta" ).datepicker( "option", "minDate", selectedDate );
//document.getElementById("fecha_hasta").value = document.getElementById("fecha_desde").value;
document.getElementById("fecha_hasta").value = addToDate(selectedDate,document.getElementById("dias_cambio").value);
cambiar_fechas_orion(document.getElementById("cod_ficha").value);
}
});
$( "#fecha_hasta" ).datepicker({
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
$( "#fecha_desde" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
});
$(function() {
$( "#fecha_desde_reservas" ).datepicker({
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
$( "#fecha_hasta_reservas" ).datepicker( "option", "minDate", selectedDate );
document.getElementById("fecha_hasta_reservas").value = document.getElementById("fecha_desde_reservas").value;
}
});
$( "#fecha_hasta_reservas" ).datepicker({
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
$( "#fecha_desde_reservas" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
function filtra_localidades(parametros){
var localidades_recursos = "";
if(esIE > -1){
var c = document.all;
for(i = 0; i < c.length; i++){
if (c(i).type == "checkbox" && String(c(i).id).indexOf("localidades_recurso") !== -1){
if (c(i).checked){
localidades_recursos = localidades_recursos + c(i).value + '@';
}
}
}
}else{
var c = document.getElementsByTagName("body")[0].getElementsByTagName("*");
for(i = 0; i < c.length; i++){
if (c[i].type == "checkbox" && String(c[i].id).indexOf("localidades_recurso") !== -1){
if (c[i].checked){
localidades_recursos = localidades_recursos + c[i].value + '@';
}
}
}
}
var url = document.getElementById("formrecursos").action+"?buscar=si"+parametros+"&localidades="+localidades_recursos;
location.href = url;
}
function filtra_tipos_recursos(parametros){
var tipos_recursos = "";
if(esIE > -1){
var c = document.all;
for(i = 0; i < c.length; i++){
if (c(i).type == "checkbox" && String(c(i).id).indexOf("tipos_recurso") !== -1){
if (c(i).checked){
tipos_recursos = tipos_recursos + c(i).value + '@';
}
}
}
}else{
var c = document.getElementsByTagName("body")[0].getElementsByTagName("*");
for(i = 0; i < c.length; i++){
if (c[i].type == "checkbox" && String(c[i].id).indexOf("tipos_recurso") !== -1){
if (c[i].checked){
tipos_recursos = tipos_recursos + c[i].value + '@';
}
}
}
}
var url = document.getElementById("formrecursos").action+"?buscar=si"+parametros+"&tipos="+tipos_recursos;
location.href = url;
}
function filtra_tipos_activo(parametros){
var tipos_activo = "";
if(esIE > -1){
var c = document.all;
for(i = 0; i < c.length; i++){
if (c(i).type == "checkbox" && String(c(i).id).indexOf("tipos_recurso") !== -1){
if (c(i).checked){
tipos_activo = tipos_activo + c(i).value + '@';
}
}
}
}else{
var c = document.getElementsByTagName("body")[0].getElementsByTagName("*");
for(i = 0; i < c.length; i++){
if (c[i].type == "checkbox" && String(c[i].id).indexOf("tipos_recurso") !== -1){
if (c[i].checked){
tipos_activo = tipos_activo + c[i].value + '@';
}
}
}
}
var url = document.getElementById("formrecursos").action+"?buscar=si"+parametros+"&tipos_activo="+tipos_activo;
location.href = url;
}
function filtra_otros(parametros){
var url = document.getElementById("formrecursos").action+"?buscar=si"+parametros;
location.href = url;
}
function autocompletar(texto,prefijo,campo){
if (texto.length > 2){
$('#'+prefijo+'_autocompletar').show("slide", { direction: "up" }, 300);
// document.write("https://www.turismoregiondemurcia.es/es/mu_autocompletar?frase="+texto+"&prefijo="+prefijo+"&campo="+campo);
hazPeticion("https://www.turismoregiondemurcia.es/es/mu_autocompletar?frase="+texto+"&prefijo="+prefijo+"&campo="+campo,prefijo+"_autocompletar","CARGANDO SUGERENCIAS ...");
// hazPeticion("https://www.turismoregiondemurcia.es/es/mu_autocompletar?frase="+texto+"&prefijo="+prefijo+"&campo="+campo,prefijo+"_autocompletar","CARGANDO SUGERENCIAS ...");
}else{
$('#'+prefijo+'_autocompletar').hide("slide", { direction: "up" }, 300);
}
}
function buscarGoogle(){
var texto_libre = document.getElementById("texto_google").value;
texto_libre = texto_libre.replace("TEXTO LIBRE","");
window.open("https://www.google.es/#q=site:turismoregiondemurcia.es+"+texto_libre,"_blank");
}
function comprueba_localidad(valor){
if (valor == "03099" || valor == "orihuela"){
window.open("http://www.orihuelaturistica.es/orihuela/web_php/index.php?contenido=apartadosComerciales&idNivel=3964&id=15&mode=list&order=asc","_blank");
}
}
var tipo_buscador = "alojamientos";
function buscador_alojamientos(){
tipo_buscador = "alojamientos";
document.getElementById("iraloja").className = "";
document.getElementById("iractiv").className = "opaco";
document.getElementById("irpaque").className = "opaco";
document.getElementById("al_texto").style.display = "block";
document.getElementById("ac_texto").style.display = "none";
document.getElementById("al_hasta").style.display = "block";
document.getElementById("ac_tipo").style.display = "none";
document.getElementById("pa_adultos").style.display = "none";
document.getElementById("pa_ninos").style.display = "none";
document.getElementById("pa_bebes").style.display = "none";
document.getElementById("capagratis").style.display = "none";
document.getElementById("titalo").style.display = "block";
document.getElementById("titacti").style.display = "none";
document.getElementById("titpaqu").style.display = "none";
}
function buscador_actividades(){
tipo_buscador = "actividades";
document.getElementById("iraloja").className = "opaco";
document.getElementById("iractiv").className = "";
document.getElementById("irpaque").className = "opaco";
document.getElementById("al_texto").style.display = "none";
document.getElementById("ac_texto").style.display = "block";
document.getElementById("al_hasta").style.display = "none";
document.getElementById("ac_tipo").style.display = "block";
document.getElementById("pa_adultos").style.display = "none";
document.getElementById("pa_ninos").style.display = "none";
document.getElementById("pa_bebes").style.display = "none";
document.getElementById("capagratis").style.display = "block";
document.getElementById("titalo").style.display = "none";
document.getElementById("titacti").style.display = "block";
document.getElementById("titpaqu").style.display = "none";
}
function buscador_paquetes(){
tipo_buscador = "paquetes";
document.getElementById("iraloja").className = "opaco";
document.getElementById("iractiv").className = "opaco";
document.getElementById("irpaque").className = "";
document.getElementById("al_texto").style.display = "none";
document.getElementById("ac_texto").style.display = "block";
document.getElementById("al_hasta").style.display = "block";
document.getElementById("ac_tipo").style.display = "none";
//document.getElementById("pa_adultos").style.display = "block";
//document.getElementById("pa_ninos").style.display = "block";
//document.getElementById("pa_bebes").style.display = "block";
document.getElementById("capagratis").style.display = "none";
document.getElementById("titalo").style.display = "none";
document.getElementById("titacti").style.display = "none";
document.getElementById("titpaqu").style.display = "block";
}
function reservar_alojamientos(){
var oImg = document.createElement("script");
oImg.src = 'https://secure.adnxs.com/px?id=639385&t=1';
document.body.appendChild(oImg);
var pagina = "resultados";
var idpagina = document.getElementById("destino_url").value;
if (tipo_buscador == "alojamientos"){
if (document.getElementById("al_desde").value == "" || document.getElementById("al_desde").value == "LLEGADA"){
mensaje("Debe introducir la fecha de llegada al alojamiento.");
}else if (document.getElementById("al_hasta").value == "" || document.getElementById("al_hasta").value == "SALIDA"){
mensaje("Debe introducir la fecha de salida del alojamiento.");
}else{
var url = "/es/reservas?pagina="+pagina+"&fecha_desde="+document.getElementById("al_desde").value+"&fecha_hasta="+document.getElementById("al_hasta").value;
if (document.getElementById("al_hotel").value != ""){
url = url + "&hotel="+document.getElementById("al_hotel").value;
pagina = "inicio-reserva";
}else{
if (document.getElementById("al_localidades").value != ""){
url = url + "&localidad="+document.getElementById("al_localidades").value;
}
if (document.getElementById("al_localidad").value != "" && document.getElementById("al_localidades").value == ""){
url = url + "&localidad="+document.getElementById("al_localidad").value;
}
if (document.getElementById("al_tipo").value != ""){
url = url + "&tipo_alojamiento="+document.getElementById("al_tipo").value;
}
if (document.getElementById("al_categoria").value != ""){
url = url + "&categoria_alojamiento="+document.getElementById("al_categoria").value;
}
}
cargando();
window.open(url+'&tipo_busqueda=1',idpagina);
}
}else if(tipo_buscador == "actividades"){
if (document.getElementById("al_desde").value == "" || document.getElementById("al_desde").value == "LLEGADA"){
mensaje("Debe introducir la fecha en la que quiere realizar la actividad.");
}else{
var url = "/es/buscar_actividades?buscar=si";
if (document.getElementById("ac_texto").value != "" && document.getElementById("ac_texto").value != "TEXTO LIBRE" && document.getElementById("ac_texto").value != "TEXTO%20LIBRE"){
url = url + "&texto_libre="+document.getElementById("ac_texto").value;
}
if (document.getElementById("al_localidades").value != ""){
url = url + "&localidad="+document.getElementById("al_localidades").value;
}
if (document.getElementById("al_desde").value != "" && document.getElementById("al_desde").value != "LLEGADA"){
url = url + "&fecha_desde="+document.getElementById("al_desde").value + "&fecha_hasta="+document.getElementById("al_desde").value;
}
if (document.getElementById("ac_tipo").value != ""){
url = url + "&categoria="+document.getElementById("ac_tipo").value;
}
if (document.getElementById("ac_gratis").checked){
url = url + "&gratis="+document.getElementById("ac_gratis").value;
}
cargando();
window.open(url,idpagina);
}
}else if(tipo_buscador == "paquetes"){
if (document.getElementById("al_desde").value == "" || document.getElementById("al_desde").value == "LLEGADA"){
mensaje("Debe introducir la fecha de llegada al alojamiento.");
}else if (document.getElementById("al_hasta").value == "" || document.getElementById("al_hasta").value == "SALIDA"){
mensaje("Debe introducir la fecha de salida del alojamiento.");
}else{
var url = "/es/buscar_paquetes?fecha_desde="+document.getElementById("al_desde").value+"&fecha_hasta="+document.getElementById("al_hasta").value;
if (document.getElementById("ac_texto").value != "" && document.getElementById("ac_texto").value != "TEXTO LIBRE" && document.getElementById("ac_texto").value != "TEXTO%20LIBRE"){
url = url + "&texto_libre="+document.getElementById("ac_texto").value;
}
if (document.getElementById("al_localidades").value != ""){
url = url + "&localidad="+document.getElementById("al_localidades").value;
}
url = url + "&distribucion=1-"+document.getElementById("pa_adultos").value+"-"+document.getElementById("pa_ninos").value+"-"+document.getElementById("pa_bebes").value+"@";
cargando();
window.open(url,idpagina);
}
}
}
function reservar_actividades(){
var oImg = document.createElement("script");
oImg.src = 'https://secure.adnxs.com/px?id=639385&t=1';
document.body.appendChild(oImg);
var pagina = "resultados";
var idpagina = document.getElementById("destino_url").value;
if (document.getElementById("ac_desde").value == "" || document.getElementById("ac_desde").value == "LLEGADA"){
mensaje("Debe introducir la fecha en la que quiere realizar la actividad.");
}else{
var url = "/es/buscar_actividades?buscar=si";
if (document.getElementById("ac_texto").value != "" && document.getElementById("ac_texto").value != "TEXTO LIBRE" && document.getElementById("ac_texto").value != "TEXTO%20LIBRE"){
url = url + "&texto_libre="+document.getElementById("ac_texto").value;
}
if (document.getElementById("ac_localidades").value != ""){
url = url + "&localidad="+document.getElementById("ac_localidades").value;
}
if (document.getElementById("ac_desde").value != "" && document.getElementById("ac_desde").value != "LLEGADA"){
url = url + "&fecha_desde="+document.getElementById("ac_desde").value + "&fecha_hasta="+document.getElementById("ac_desde").value;
}
if (document.getElementById("ac_tipo").value != ""){
url = url + "&categoria="+document.getElementById("ac_tipo").value;
}
if (document.getElementById("ac_gratis").checked){
url = url + "&gratis="+document.getElementById("ac_gratis").value;
}
cargando();
window.open(url,idpagina);
}
}
function reservar_paquetes(){
var oImg = document.createElement("script");
oImg.src = 'https://secure.adnxs.com/px?id=639385&t=1';
document.body.appendChild(oImg);
var pagina = "resultados";
var idpagina = document.getElementById("destino_url").value;
if (document.getElementById("pa_desde").value == "" || document.getElementById("pa_desde").value == "LLEGADA"){
mensaje("Debe introducir la fecha de llegada al alojamiento.");
}else if (document.getElementById("pa_hasta").value == "" || document.getElementById("pa_hasta").value == "SALIDA"){
mensaje("Debe introducir la fecha de salida del alojamiento.");
}else{
var url = "/es/buscar_paquetes?fecha_desde="+document.getElementById("pa_desde").value+"&fecha_hasta="+document.getElementById("pa_hasta").value;
if (document.getElementById("pk_texto").value != "" && document.getElementById("pk_texto").value != "TEXTO LIBRE" && document.getElementById("pk_texto").value != "TEXTO%20LIBRE"){
url = url + "&texto_libre="+document.getElementById("pk_texto").value;
}
if (document.getElementById("pk_localidades").value != ""){
url = url + "&localidad="+document.getElementById("pk_localidades").value;
}
url = url + "&distribucion=1-"+document.getElementById("pa_adultos").value+"-"+document.getElementById("pa_ninos").value+"-"+document.getElementById("pa_bebes").value+"@";
cargando();
window.open(url,idpagina);
}
}
function buscar_reservas_movil(){
var pagina ="resultados";
var desde = document.getElementById("desde_movil").value;
var hasta = document.getElementById("hasta_movil").value;
desde = desde.replace("DESDE","");
hasta = hasta.replace("HASTA","");
var error = "";
var diahoy = document.getElementById("movil_dia").value;
var meshoy = document.getElementById("movil_mes").value;
var anohoy = document.getElementById("movil_anu").value;
var diad = 0;
var mesd = 0;
var anod = 0;
var diah = 0;
var mesh = 0;
var anoh = 0;
diad = desde.substring(0,2);
mesd = desde.substring(3,5);
anod = desde.substring(6,10);
diah = hasta.substring(0,2);
mesh = hasta.substring(3,5);
anoh = hasta.substring(6,10);
if ((anod < anohoy) || ((anod == anohoy) && (mesd < meshoy)) || ((anod == anohoy) && (mesd == meshoy) && (diad < diahoy)))
error = "La fecha DESDE no puede ser menor que la fecha actual o ha sido introducida incorrectamente, use el formato 'DD/MM/AAAA'";
if ((anod > anoh) || ((anod == anoh) && (mesd > mesh)) || ((anod == anoh) && (mesd == mesh) && (diad >= diah)))
error = "La fecha HASTA debe ser posterior a la fecha DESDE o ha sido introducida incorrectamente, use el formato 'DD/MM/AAAA'";
if (hasta == "") error = "Debe indicar la fecha HASTA";
if (desde == "") error = "Debe indicar la fecha DESDE";
if (error != "")
mensaje(error);
else{
var url = document.getElementById("formmovilreservas").action+"?pagina="+pagina+"&tipo_busqueda=1&fecha_desde="+desde+"&fecha_hasta="+hasta;
if (document.getElementById("localidad_movil").value != ""){
url = url + "&localidad="+document.getElementById("localidad_movil").value;
}
if (document.getElementById("texto_movil").value != ""){
url = url + "&texto_libre="+document.getElementById("texto_movil").value;
}
cargando();
location.href = url;
}
}
function reservar_entradas(){
if (document.getElementById("en_fecha").value == "" || document.getElementById("en_fecha").value == "FECHA"){
mensaje("Debe introducir la fecha.");
}else if (document.getElementById("en_adultos").value == "" && document.getElementById("en_menores").value == ""){
mensaje("Debe seleccionar el número de adultos o el número de menores.");
}else{
var url = "https://www.turismoregiondemurcia.es/es/turismo.auriga.inicio?tipo_busqueda=entradas"+
"&f_desde="+document.getElementById("en_fecha").value+"&f_hasta="+document.getElementById("en_fecha").value+
"&v_adultos="+document.getElementById("en_adultos").value+"&v_menores="+document.getElementById("en_menores").value+
"&logo=S&id_vendedor=MURCIATURISTICA";
if (document.getElementById("en_destino").value != ""){
url = url + "&v_pais=ES&v_provincia=MU&v_localidad="+document.getElementById("en_destino").value;
}
window.open(url,'_blank');
}
}
function reservar_restaurantes(){
mensaje("En estos momentos no se pueden reservar restaurantes, disculpe las molestias.");
}
function reservar_alojamiento(id){
if (document.getElementById("desde_"+id).value == "" || document.getElementById("desde_"+id).value == "LLEGADA"){
mensaje("Debe introducir la fecha de llegada al alojamiento.");
}else if (document.getElementById("hasta_"+id).value == "" || document.getElementById("hasta_"+id).value == "SALIDA"){
mensaje("Debe introducir la fecha de salida del alojamiento.");
}else{
var url = "/es/reservar?hotel="+id+"&fecha_desde="+document.getElementById("desde_"+id).value+"&fecha_hasta="+document.getElementById("hasta_"+id).value;
window.open(url,'_self');
}
}
$(function() {
$( "#al_desde" ).datepicker({
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
$( "#al_hasta" ).datepicker( "option", "minDate", selectedDate );
document.getElementById("al_hasta").value = addToDate(selectedDate,1);
}
});
$( "#al_hasta" ).datepicker({
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
$( "#al_desde" ).datepicker( "option", "maxDate", selectedDate );
}
});
$( "#ac_desde" ).datepicker({
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
}
});
$( "#pa_desde" ).datepicker({
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
$( "#pa_hasta" ).datepicker( "option", "minDate", selectedDate );
document.getElementById("pa_hasta").value = addToDate(selectedDate,1);
}
});
$( "#pa_hasta" ).datepicker({
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
$( "#pa_desde" ).datepicker( "option", "maxDate", selectedDate );
}
});
$( "#desde_movil" ).datepicker({
showOn: "button",
buttonImage: "/webs/murciaturistica/estatico/img/calendario_reservas.png",
buttonImageOnly: true,
buttonText: "Fecha desde",
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
$( "#hasta_movil" ).datepicker( "option", "minDate", selectedDate );
document.getElementById("hasta_movil").value = addToDate(selectedDate,1);
}
});
$( "#hasta_movil" ).datepicker({
showOn: "button",
buttonImage: "/webs/murciaturistica/estatico/img/calendario_reservas.png",
buttonImageOnly: true,
buttonText: "Fecha hasta",
firstDay: 1,
dateFormat: "dd/mm/yy",
changeMonth: true,
changeYear: true,
minDate: 0,
dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
monthNamesShort: ["Ene","Feb","Mar ","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],
onSelect: function( selectedDate ) {
$( "#desde_movil" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
$("document").ready(function() {
$('.to_top').click(function(){
$("html, body").animate({ scrollTop: 0 }, "slow");
});
$('#to_reservas').click(function(){
$("html, body").animate({ scrollTop: 0 }, "slow");
});
/* $('.carrudest').click(function(){
$('html, body').animate({
scrollTop: $("#carruban").offset().top
}, 1000);
});
$('.carrudest2').click(function(){
$('html, body').animate({
scrollTop: $("#carruban2").offset().top
}, 2000);
});
$('.ttcontainer').click(function(){
$('html, body').animate({scrollTop: $("#topten").offset().top+($("#cab-container").height()/2)}, 1000);
});
$('.perdernavega').click(function(){
$('html, body').animate({scrollTop: $("#topten").offset().top-$("#cab-container").height()}, 1000);
});
$('#carucont .botonCerrar').click(function(){
$('html, body').animate({scrollTop: $("#topten").offset().top-$("#cab-container").height()}, 1000);
});
$('#agenda1x2 .navega').click(function(){
$('html, body').animate({scrollTop: $("#agenda1x2").offset().top-$("#cab-container").height()}, 500);
});
$('#carucont .cerrarDetalle').click(function(){
$('html, body').animate({scrollTop: $("#buscadorofertas").offset().top-$("#cab-container").height()}, 500);
});
$('.carrucontainer').click(function(){
$('html, body').animate({scrollTop: $("#buscadorofertas").offset().top-$("#cab-container").height()}, 500);
}); */
$('#indicadores .desplegable').on('click', function() {
var father = $(this).parent().parent();
var element = $(father).find("ul:first");
var img = $(this).find("img:first");
var imgSrc = $(img).attr("src");
var imgName = imgSrc.substring(0, imgSrc.lastIndexOf('_'));
var imgExt = imgSrc.substring(imgSrc.lastIndexOf('.'), imgSrc.length);
if ((element).is(':visible') && (element).parents(':hidden').length == 0) {
$(img).attr("src", imgName+"_down"+imgExt);
element.hide("blind");
} else {
$(img).attr("src", imgName+"_up"+imgExt);
element.show("blind");
}
});
});