﻿function removeMapListeners() { if (infoWindowOpenHandle) { GEvent.removeListener(infoWindowOpenHandle) } GEvent.clearListeners(map, "zoomend") } function addMapListeners() { zoomEndHandle = GEvent.addListener(map, "zoomend", function() { gaEventTrack("5") }); infoWindowOpenHandle = GEvent.addListener(map, "infowindowopen", function() { gaEventTrack("6") }); GEvent.addListener(map, "tilesloaded", function() { mapIsReady = true }) } function gaEventTrack(a, b) { _gat._getTrackerByName("myTracker"); switch (a) { case "2": break; case "3": _gaq.push(["myTracker._trackPageview", "/consumer/product/movies/theater/find-a-cinema/search-results.ajax"]); break; case "5": _gaq.push(["myTracker._trackEvent", "Cons - Find a Cinema", "Transition", "Map View - Zoom Locale"]); break; case "6": _gaq.push(["myTracker._trackEvent", "Cons - Find a Cinema", "View", "Map View - Cinema Detail"]); break; case "7": var c = new RegExp("http(s)?://"); var d = b.replace(c, ""); _gaq.push(["myTracker._trackPageview", "/consumer/product/movies/theater/find-a-cinema/outbound/" + d]); break; case "8": _gaq.push(["myTracker._trackEvent", "Cons - Find a Cinema", "View", "Dolby Digital Cinema"]); break; case "9": _gaq.push(["myTracker._trackEvent", "Cons - Find a Cinema", "View", "Dolby 3D"]); break; case "10": _gaq.push(["myTracker._trackEvent", "Cons - Find a Cinema", "View", "Dolby Surround 7.1"]); break; case "11": _gaq.push(["myTracker._trackEvent", "Cons - Find a Cinema", "Error", "No Results"]); break; default: break } } function plotInput() { address = document.getElementById("gmapsearch").value; var a = new GClientGeocoder; a.getLatLng(address, function(a) { if (!a) { alert(LOCALIZEDTEXT["LocationNotFoundError"]); gaEventTrack("11") } else { gaEventTrack("3"); newSearchOrigin = true; map.closeInfoWindow(); updateNearest(a) } }) } function loadMap(a, b, c) { gotData() } function displayCinema(a, b) { removeMapListeners(); autoShowCinemaInfo = true; showmarkerEvent = a; map.closeInfoWindow(); map.setCenter(new GLatLng(a.latitude, a.longitude), CLUSTER_MAXZOOMLEVEL); addMapListeners() } function comparMarkerData(a, b) { return a.theaterName == b.theaterName && a.longitude == b.longitude && a.latitude == b.latitude } function checkEnter(a) { var b; if (a && a.which) { a = a; b = a.which } else { a = a || window.event; b = a.keyCode } if (b == 13) { plotInput(document.getElementById("gmapsearch").value, 1); return false } } function getSearchResults(a, b) { var c = 10; var d = c; var e = 1; var f = []; f.push("<table>"); f.push("<tr><th>" + LOCALIZEDTEXT["CinemaInformation"] + "</th><th>" + LOCALIZEDTEXT["Technology"] + "</th><th>" + LOCALIZEDTEXT["Distance"] + "</th></tr>"); SEARCHRESULT = new Array; for (i = 0; i < c; i++) { SEARCHRESULT.push(b[i]); if (b[i].latitude !== 0 && b[i].longitude !== 0) { if (e % 2 === 0) { f.push("<tr>") } else { f.push('<tr class="altRow">') } f.push('<td valign="top" class="first">'); f.push('<strong><a href="#mapView" onclick="javascript:displayCinema(SEARCHRESULT[' + i + ']);">'); f.push(b[i].theaterName + "</a></strong><br/>"); for (j = 0; j < b[i].address.length; j++) { if (b[i].address[j].length > 0) { f.push(b[i].address[j] + "<br/>") } } if (b[i].url !== "") { var g = b[i].url.substring(0, 25); var h = b[i].url; var k = new RegExp("^http://"); if (k.test(h) == false) { h = "http://" + h } if (b[i].url.length > 25) { f.push('<a target="_blank" href="' + h + "\" onmousedown=\"gaEventTrack('7','" + h + "');\">" + g + "...</a><br/>") } else { f.push('<a target="_blank" href="' + h + "\" onmousedown=\"gaEventTrack('7','" + h + "');\">" + h + "</a><br/>") } } f.push('<br/></td><td valign="top" align="center">'); if (b[i]["dolbyDigital"] > 0) { f.push('<img title="Dolby Digital Cinema" alt="Dolby Digital Cinema" src="/images/icons/dolby.png" align="baseline" border="0" />') } if (b[i]["dolby3D"] > 0) { f.push('<img title="Dolby 3D" alt="Dolby 3D" src="/images/icons/dolby_3D.png" align="baseline" border="0" />') } if (b[i]["dolby7.1"] > 0) { f.push('<img title="Dolby Surround 7.1" alt="Dolby Surround 7.1" src="/images/icons/dolby_7-1.png" align="baseline" border="0" />') } f.push("</td>"); var l = b[i].distance; var m = b[i].distance / 1.609344; f.push('<td valign="top" class="last">' + m.toFixed(1) + " mi<br/>" + l.toFixed(1) + " km </td></tr>"); e = e + 1 } else { c = c + 1 } } f.push("</table>"); jQuery("#mapSearchResults").html("<h3>" + LOCALIZEDTEXT["TopResults"] + "</h3>" + f.join("")); try { var n = $(".leftmenu").height(); var o = $("#contentContainer").height(); var p = $("#mapSearchResults").height(); if (n > o - CONTENTOFFSET) { var q = o + p - CONTENTOFFSET; $("#contentContainer").height(q) } } catch (r) { } } function gotData() { addMapListeners() } var map = null; var mgr = null; var showmarkerEvent = null; var defaultOrigin = null; var defaultZoom = 2; var searchOrigin = null; var CINEMADATA = []; var CINEMADATA_ALL = []; var CINEMADATA_3D = []; var CINEMADATA_71 = []; var MARKERDATA = []; var SEARCHRESULT = []; var mapIsReady = false; var newSearchOrigin = false; var clusterer = null; var infoWindowOpenHandle = null; var zoomEndHandle = null; var displayInfoWindowHandle = null; var autoShowCinemaInfo = false; var firstRun = true; var filterType = "all"; var marker_icon = marker_icon = new GIcon; marker_icon.image = "/images/icons/marker_location.png"; marker_icon.transparent = null; marker_icon.shadow = null; marker_icon.iconSize = new GSize(27, 33); marker_icon.shadowSize = null; marker_icon.iconAnchor = new GPoint(19, 38); marker_icon.infoWindowAnchor = new GPoint(19, 22); marker_icon.infoShadowAnchor = null
