function openCruise(fecha,cruiseID) { location.href = crucerosformpage + "?FechaSalida=" + fecha + "&cruiseID=" + cruiseID + crucerosformpage_params; } //Sort Ascending by name attribute function ordenaCruceros(){ $("#listadocruceros>div").tsort({attr:'data-sort'}); } function refreshSlider(cid){ max = 0; min = 999999; $( "div[id^='CRU_']" ).each( function( index ) { if ( $(this).attr( 'data-cid') == cid || cid == '' || cid == null ) { valor = parseInt( $(this).attr( 'data-sort') ); if ( valor < parseInt( min ) ) { min = valor; } if ( valor > parseInt( max ) ) { max = valor; } }; }); $("#slider-range").slider('option',{min: min, max: max}); $("#slider-range").slider('values',0,min); $("#slider-range").slider('values',1,max); $("#slider-range").trigger('change'); $( "#amountmin" ).html( min + "€" ); $( "#amountmax" ).html( max + "€" ); } function refreshCIAS(){ $( ".cruiselinelogo" ).each(function( index ) { var min = $("#slider-range").slider("values")[0]; var max = $("#slider-range").slider("values")[1]; cruiseline = $(this).attr('data-id'); nocruiseline = $(".totalcontainer[data-cid='" + cruiseline + "']").filter(function() { return $(this).attr("data-sort") >= min && $(this).attr("data-sort") <= max; }).length; if (nocruiseline>0) { $(this).html( nocruiseline ); $(this).show(300); }else{ $(this).hide(300); } }); } function filtrapornaviera(obj){ cruiselineid = $(obj).find('.cruiselinelogo').attr('data-id'); last_cid = $( "#listadonavieras" ).attr("data-id"); if (cruiselineid == last_cid ) { cruiselineid=''; } $( "#listadonavieras" ).attr("data-id",cruiselineid); var min = $("#slider-range").slider("values")[0]; var max = $("#slider-range").slider("values")[1]; var n=0; $( ".filternaviera" ).each( function( index ) { img = $(this).find('.img_nav'); cir = $(this).find('.numberCircle'); if ( cruiselineid != $(img).attr('data-id') && cruiselineid != '') { $(img).addClass( "grayscale" ); $(cir).addClass( "numberCircleGray" ); } else { $(img).removeClass( "grayscale" ); $(cir).removeClass( "numberCircleGray" ); } }); $( "div[id^='CRU_']" ).each( function( index ) { oculta=false; cid = $(this).attr( 'data-cid'); if ( cid != cruiselineid && cruiselineid !='' ) { oculta=true; } if ( parseInt( $(this).attr( 'data-sort') ) < parseInt( min ) ) { oculta=true; } if ( parseInt( $(this).attr( 'data-sort') ) > parseInt( max ) ) { oculta=true; } if ( oculta == true ) {$(this).hide(); } else { $(this).show(); n++; } }); $('#crucerosEncontrados').html(n); } $(function() { ordenaCruceros(); $('#resumenlistado').disableSelection(); $('#listadonavieras').disableSelection(); $('.fotoBordes').error(function() { $(this).attr("src", "/integra/images/sinimagen.png") }); $( ".boton_masinfo" ).click( function() { openmasinfo(this); }); $( ".headtitulo" ).click( function() { openmasinfo(this); }); $( ".destino" ).click( function() { openmasinfo(this,'iti'); }); $( ".logoIntegracion" ).click( function() { openmasinfo(this,'des'); }); $(".filternaviera").click( function() { filtrapornaviera(this); }); $( "#slider-range" ).slider({ range: true, change: function( event, ui ) { var filtronaviera = $( "#listadonavieras" ).attr("data-id"); var n=0; $( "div[id^='CRU_']" ).each( function( index ) { oculta=false; if ( $(this).attr( 'data-cid') != filtronaviera && filtronaviera !='') { oculta=true; } if ( parseInt( $(this).attr( 'data-sort') ) < parseInt( ui.values[ 0 ]) ) { oculta=true; } if ( parseInt( $(this).attr( 'data-sort') ) > parseInt( ui.values[ 1 ]) ) { oculta=true; } if ( oculta == true ) {$(this).hide(); } else { $(this).show(); n++; } }); $('#crucerosEncontrados').html(n); refreshCIAS(); }, slide: function( event, ui ) { $( "#amountmin" ).html( ui.values[ 0 ] + "€" ); $( "#amountmax" ).html( ui.values[ 1 ] + "€" ); } }); refreshSlider(); }); function openmasinfo(obj,tab){ subdominioid = $(obj).closest('.body').data("subid"); container = $(obj).closest('.totalcontainer'); cruceroid = $(container).attr('data-id'); containermasinfo = $(container).find('.masinfo'); containerprices = $(container).find('.bloqueMesesyprecios'); $(container).find('.boton_masinfo').hide('slow'); if ( $(containermasinfo).html()!='') { ctab (tab,cruceroid); return true; } $.ajax({ type: "POST", url: "/integra/crucero_mas_info.asp", data: { cruceroid: cruceroid, fechasalida: fechasalida, subid: subdominioid }, success: function(data) { $( containermasinfo ).empty().append( data ).show('slow'); $( containerprices ).appendTo('#PVPin_' + cruceroid ); ctab (tab,cruceroid); // $( "#MI_"+ cruceroid ).empty().append( data ).show('slow'); // $( "#MI_"+ cruceroid ).show('slow'); }, error: function (xhr, ajaxOptions, thrownError) { alert('Ha ocurrido un error,\nVuelva a intentarlo de nuevo'); } }); } function ctab (tab,cruceroid) { if (tab == 'des') { masinfotabs( $('#tabA'+cruceroid), tab, cruceroid); } if (tab == 'iti') { masinfotabs( $('#tabB'+cruceroid), tab, cruceroid); } } function masinfotabs(liobj,obj,cruceroid) { $("ul.tabrow[id='tab" + cruceroid + "'] li").removeClass("selected"); $(liobj).addClass("selected"); var o_actual = 'mi_' + obj + '_' + cruceroid ; var o_old = 'mi_' + $("#mi_o_" + cruceroid ).val() + '_' + cruceroid ; $("#" + o_old).hide(); $("#" + o_actual).show(); $("#mi_o_" + cruceroid ).val(obj); } function swapfotocrucero(obj,cruceroid) { $imgTITLE = $(obj).attr('title'); $imgURL = $(obj).attr('src'); $('#img'+cruceroid) .fadeOut(200, function() { $('#img'+cruceroid).attr('src',$imgURL); }) .fadeIn(200); $('#imglab'+cruceroid).html('Situacion: '+$imgTITLE ); } function set_botones_tarifas(cruiseID) { $(".boton_fecha_anterior").attr("onClick","cruise_tarifa_fecha_anterior(this)"); $(".boton_fecha_siguiente").attr("onClick","cruise_tarifa_fecha_siguiente(this)"); } function cruise_tarifa_fecha_anterior(obj) { table = $(obj).closest('table'); id = $(table).attr('data-id'); pos = $(table).attr('data-pos'); var first = parseInt ( pos.split(",")[0] ); var last = parseInt ( pos.split(",")[1] ); var cols = parseInt ( $(table).attr('data-cols') ) ; if (last-1 >= 1) { first--; $(table).find('td.col'+first).show(100); $(table).find('td.col'+last).hide(100); last--; $(table).attr('data-pos', first + ',' + last); boton_sig = $(table).find('.boton_fecha_siguiente'); boton_ant= $(table).find('.boton_fecha_anterior'); if ( last >= cols ) { $(boton_sig).hide(); } else { $(boton_sig).show(); } if ( first <= 1 ) { $(boton_ant).hide(); } else { $(boton_ant).show(); } } } function cruise_tarifa_fecha_siguiente(obj) { table = $(obj).closest('table'); id = $(table).attr('data-id'); pos = $(table).attr('data-pos'); var first = parseInt ( pos.split(",")[0] ); var last = parseInt ( pos.split(",")[1] ); var cols = parseInt ( $(table).attr('data-cols') ) ; if (last+1 <= cols) { last++; $(table).find('td.col'+first).hide(100); $(table).find('td.col'+last).show(100); first++; $(table).attr('data-pos', first + ',' + last); boton_sig = $(table).find('.boton_fecha_siguiente'); boton_ant= $(table).find('.boton_fecha_anterior'); if ( last >= cols ) { $(boton_sig).hide(); } else { $(boton_sig).show(); } if ( first <= 1 ) { $(boton_ant).hide(); } else { $(boton_ant).show(); } } } // ELabels3.js // // 2010-06-10 Port to GoogleMaps V3 API by Pat Horton // // This Javascript was originally provided by Mike Williams // Blackpool Community Church Javascript Team // http://www.commchurch.freeserve.co.uk/ // http://econym.googlepages.com/index.htm // // This work is licenced under a Creative Commons Licence // http://creativecommons.org/licenses/by/2.0/uk/ function ELabel(map, point, html, classname, pixelOffset, percentOpacity, overlap) { this.div_ = null; this.map_ = map; this.point = point; this.html = html; this.classname = classname || ""; this.pixelOffset = pixelOffset || new google.maps.Size(0,0); if (percentOpacity) { if (percentOpacity<0) percentOpacity=0; if (percentOpacity>100) percentOpacity=100; } this.percentOpacity = percentOpacity; this.overlap=overlap || false; this.hidden = false; } ELabel.prototype = new google.maps.OverlayView(); ELabel.prototype.onAdd = function() { var div = document.createElement("div"); div.style.position = "absolute"; div.innerHTML = '
' + this.html + '
' ; this.div_ = div; if (this.percentOpacity) { if(typeof(div.style.filter)=='string') {div.style.filter='alpha(opacity:'+this.percentOpacity+')';} if(typeof(div.style.KHTMLOpacity)=='string') {div.style.KHTMLOpacity=this.percentOpacity/100;} if(typeof(div.style.MozOpacity)=='string') {div.style.MozOpacity=this.percentOpacity/100;} if(typeof(div.style.opacity)=='string') {div.style.opacity=this.percentOpacity/100;} } if (this.overlap) { // you may need to work on this "hack" to replace V2 getZindex // GOverlay.getZIndex(this.point.lat()); var z = 1000*(90-this.point.lat()); this.div_.style.zIndex = parseInt(z); } if (this.hidden) { this.hide(); } // add ourselves to the shadow overlay layer var panes = this.getPanes(); panes.floatShadow.appendChild(div); } ELabel.prototype.onRemove = function() { this.div_.parentNode.removeChild(this.div_); } ELabel.prototype.draw = function(force) { var proj = this.getProjection(); var p = proj.fromLatLngToDivPixel(this.point); var h = parseInt(this.div_.clientHeight); this.div_.style.left = (p.x + this.pixelOffset.width) + "px"; this.div_.style.top = (p.y +this.pixelOffset.height - h) + "px"; } ELabel.prototype.show = function() { if (this.div_) { this.div_.style.display=""; this.redraw(); } this.hidden = false; } ELabel.prototype.hide = function() { if (this.div_) { this.div_.style.display="none"; } this.hidden = true; } ELabel.prototype.copy = function() { return new ELabel(this.point, this.html, this.classname, this.pixelOffset, this.percentOpacity, this.overlap); } ELabel.prototype.isHidden = function() { return this.hidden; } ELabel.prototype.supportsHide = function() { return true; } ELabel.prototype.setContents = function(html) { this.html = html; this.div_.innerHTML = '
' + this.html + '
' ; this.redraw(true); } ELabel.prototype.setPoint = function(point) { this.point = point; if (this.overlap) { var z = GOverlay.getZIndex(this.point.lat()); this.div_.style.zIndex = z; } this.redraw(true); } ELabel.prototype.setOpacity = function(percentOpacity) { if (percentOpacity) { if(percentOpacity<0){percentOpacity=0;} if(percentOpacity>100){percentOpacity=100;} } this.percentOpacity = percentOpacity; if (this.percentOpacity) { if(typeof(this.div_.style.filter)=='string') {this.div_.style.filter='alpha(opacity:'+this.percentOpacity+')';} if(typeof(this.div_.style.KHTMLOpacity)=='string') {this.div_.style.KHTMLOpacity=this.percentOpacity/100;} if(typeof(this.div_.style.MozOpacity)=='string') {this.div_.style.MozOpacity=this.percentOpacity/100;} if(typeof(this.div_.style.opacity)=='string') {this.div_.style.opacity=this.percentOpacity/100;} } } ELabel.prototype.getPoint = function() { return this.point; } // ELabels3.js //