function TLabel(){}TLabel.prototype.initialize=function(B){this.parentMap=B;var A=document.createElement("span");A.setAttribute("id",this.id);A.appendChild(this.content);document.body.appendChild(A);A.style.position="absolute";A.style.block;this.w=this.content.childNodes[0].offsetWidth;this.h=this.content.childNodes[0].offsetHeight;this.mapTray=B.getPane(G_MAP_MAP_PANE);this.mapTray.appendChild(A);A.parentNode.style.zIndex=1000;if(!this.markerOffset){this.markerOffset=new GSize(0,0)}this.setPosition();GEvent.bind(B,"zoomend",this,function(){this.setPosition()})};TLabel.prototype.setPosition=function(C){var D=document.getElementById(this.id);if(D!==null){if(C){this.anchorLatLng=C}var B=this.parentMap.fromLatLngToDivPixel(this.anchorLatLng);var A=parseInt(B.x);var E=parseInt(B.y);switch(this.anchorPoint){case"topLeft":break;case"topRight":A-=this.w;break;case"bottomRight":A-=this.w;E-=this.h;break;case"bottomLeft":E-=this.h;break;default:break}D.style.left=A-this.markerOffset.width+"px";D.style.top=E-this.markerOffset.height+"px";D.style.zIndex=100}};GMap2.prototype.addTLabel=function(A){A.initialize(this)};GMap2.prototype.removeTLabel=function(B){var A=document.getElementById(B.id);fn_borrar_contenido(A);this.getPane(G_MAP_MAP_PANE).removeChild(A);delete (A)};function Tooltip(A,C,B){this.marker_=A;this.text_=C;this.padding_=B}Tooltip.prototype=new GOverlay();Tooltip.prototype.initialize=function(A){var B=document.createElement("div");B.appendChild(document.createTextNode(this.text_));B.className="tooltip";B.style.position="absolute";B.style.visibility="hidden";A.getPane(G_MAP_FLOAT_PANE).appendChild(B);this.map_=A;this.div_=B};Tooltip.prototype.remove=function(){fn_borrar_contenido(this.div_);this.div_.parentNode.removeChild(this.div_)};Tooltip.prototype.copy=function(){return new Tooltip(this.marker_,this.text_,this.padding_)};Tooltip.prototype.redraw=function(D){if(!D){return }var B=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());var A=this.marker_.getIcon().iconAnchor;var E=Math.round(B.x-this.div_.clientWidth/2);var C=B.y-A.y-this.div_.clientHeight-this.padding_;this.div_.style.top=C+"px";this.div_.style.left=E+"px"};Tooltip.prototype.show=function(){this.div_.style.visibility="visible"};Tooltip.prototype.hide=function(){this.div_.style.visibility="hidden"};function fn_standardize(A){for(var B=0;B<gl_standards.length;B++){if(A==gl_standards[B][0]){A=gl_standards[B][1]}}return A}function fn_different(B,A){B=B.trim();A=A.trim();B=B.removeAccents();A=A.removeAccents();A=A.replace(/Spain/g,"España");B=B.toLowerCase();A=A.toLowerCase();B=B.replace(/'/g,"");A=A.replace(/'/g,"");B=B.replace(/\s+/g," ");A=A.replace(/\s+/g," ");B=B.replace(/\W/g," ");A=A.replace(/\W/g," ");B=B.fn_remplazar();A=A.fn_remplazar();var C=true;B=B.trim();A=A.trim();if(B.dentro(A)||A.dentro(B)){C=false}return(C)}function fn_place(E,F,B,A){gl_tipo_vista="buscar";var D=new GLatLng(E-0.000005,F);gl_map.setCenter(D,A);var G="./img/bola_donde.png";var C=fn_createMarker(D,gl_icono_lugar,G);var I=new Tooltip(C,B,4);C.tooltip=I;fn_cambiar_punto_busqueda(C,I);gl_punto_busqueda=C;gl_overlay_busqueda=I;var H=document.getElementById("search");document.getElementById("sinopsis1").innerHTML="";if(gl_cine!==undefined||gl_pelicula!==undefined){fn_escribir_sinopsis()}B=B.replace(/Spain/g,"España");H.value=B;fn_fin_evento("buscar")}function fn_cambiar_punto_busqueda(B,A){if(gl_punto_busqueda!==undefined){gl_map.removeOverlay(gl_punto_busqueda);GEvent.clearInstanceListeners(gl_punto_busqueda);GEvent.clearNode(gl_punto_busqueda);if(gl_overlay_busqueda!==undefined){gl_map.removeOverlay(gl_overlay_busqueda)}delete gl_punto_busqueda}gl_map.addOverlay(B);gl_map.addOverlay(A)}function fn_showAddress(){var C;var A="es";gl_tipo_vista="buscar";gl_geocoder.setBaseCountryCode("es");gl_tipo_vista="buscar";var B=document.getElementById("search").value;gl_geocoder.getLocations(B,function(E){fn_borrar_eventos_overlays();if(E.Status.code==G_GEO_SUCCESS){var D="";if(E.Placemark.length>1){if(E.Placemark.length>3){E.Placemark.length=3}D="<span style = 'line-height: 20px;'>Quizás quisiste decir:";var F="";for(var G=0;G<E.Placemark.length;G++){F=E.Placemark[G].address.replace(/, Spain/g," ");var J=E.Placemark[G].Point.coordinates;D+="<br>"+(G+1)+":<b> <a href='javascript:fn_place("+J[1]+","+J[0]+',"'+F+"\", 13);'>"+F+"</a></b>"}D+="</span>";fn_escribir_error_busqueda(D)}else{if(fn_different(B,E.Placemark[0].address)){J=E.Placemark[0].Point.coordinates;if(E.Placemark[0].address!="España"){F=E.Placemark[0].address.replace(/, Spain/g," ");D="Quizás quisiste decir: <b><a href='javascript:fn_place("+J[1]+","+J[0]+',"'+F+"\", 13);'>"+F+"</a></b>";fn_escribir_error_busqueda(D)}else{J=E.Placemark[0].Point.coordinates;F=E.Placemark[0].address.replace(/, Spain/g," ");fn_place(J[1],J[0],F,9)}}else{J=E.Placemark[0].Point.coordinates;F=E.Placemark[0].address.replace(/, Spain/g," ");fn_place(J[1],J[0],F,13)}}}else{var I="Code "+E.Status.code;if(gl_reasons[E.Status.code]){I=gl_reasons[E.Status.code]}D="No se en entrado este lugar.";var H=B;D=D+"<b>"+H+"</b>";fn_escribir_error_busqueda(D)}},{locale:"es"});gl_tipo_vista="buscar"}function fn_escribir_error_busqueda(B){fn_debuguear("dentro del fn_escribir_error_busqueda(texto, sugerencia)");var A=document.getElementById("sinopsis1");fn_borrar_contenido(A);A.innerHTML=B;A.style.visibility="visible";gl_error_busqueda=false;fn_fin_evento("buscar")};