KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.4.62
System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64
User : www ( 80)
PHP Version : 8.3.8
Disable Function : NONE
Directory :  /domains/gwsolutions/disney/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /domains/gwsolutions/disney/coverage_disney.js


    var clickedLat;
    var clickedLon;
    var lastTechSelected = '4G';
    var showAllOperators = false;
    var LAYER_COV = 1;      // this needs to be 0 when we only have 1 layer
    var LAYER_REG = 0;      // this needs to be 0 when we have 2 layers
                            // and set COV to 1
							
	
							
	var pins = [{"Land":"Frontierland","Latitude":28.419198,"Longitude":-81.58391, "Color":"#ffcc00", "BG":"#fdbf3b", "Pin":"flag-Frontierland_45.png"},
				{"Land":"Adventureland","Latitude":28.41793,"Longitude":-81.583833, "Color":"#3366ff", "BG":"#7b9afa", "Pin":"flag-Adventureland_45.png"},
				{"Land":"Main Street","Latitude":28.417429,"Longitude":-81.580874, "Color":"#009933", "BG":"#62b67b", "Pin":"flag-MainStreet_45.png"},
				{"Land":"Tomorrowland","Latitude":28.418844,"Longitude":-81.579868, "Color":"#ff5500", "BG":"#f68a60", "Pin":"flag-Tomorrowland_45.png"},
				{"Land":"Fantasyland","Latitude":28.420459,"Longitude":-81.579721, "Color":"#b219ff", "BG":"#c76ffa", "Pin":"flag-Fantasyland_45.png"},
				{"Land":"Liberty Square","Latitude":28.419838,"Longitude":-81.582976, "Color":"#ff3377", "BG":"#fc7ba1", "Pin":"flag-LibertySquare_45.png"}];

	var tweets = [{"Location":"Adventureland","AT&T":"1","Sprint":"3","T-Mobile":"4","Verizon":"2"},
				  {"Location":"Frontierland","AT&T":"1","Sprint":"2","T-Mobile":"4","Verizon":"3"},
				  {"Location":"Liberty Square","AT&T":"*1","Sprint":"4","T-Mobile":"3","Verizon":"*1"},
				  {"Location":"Main Street","AT&T":"1","Sprint":"2","T-Mobile":"4","Verizon":"3"},
				  {"Location":"Fantasyland","AT&T":"1","Sprint":"4","T-Mobile":"3","Verizon":"2"},
				  {"Location":"Tomorrowland","AT&T":"*1","Sprint":"4","T-Mobile":"3","Verizon":"*1"}];
	
	var selfies = [{"Location":"Adventureland","AT&T":"4","Sprint":"3","T-Mobile":"2","Verizon":"1"},
				  {"Location":"Frontierland","AT&T":"*1","Sprint":"4","T-Mobile":"3","Verizon":"*1"},
				  {"Location":"Liberty Square","AT&T":"*1","Sprint":"4","T-Mobile":"*1","Verizon":"*1"},
				  {"Location":"Main Street","AT&T":"*1","Sprint":"4","T-Mobile":"*1","Verizon":"3"},
				  {"Location":"Fantasyland","AT&T":"*1","Sprint":"4","T-Mobile":"3","Verizon":"*1"},
				  {"Location":"Tomorrowland","AT&T":"*1","Sprint":"4","T-Mobile":"*1","Verizon":"3"}];
	
	var streams = [{"Location":"Adventureland","AT&T":"*1","Sprint":"3","T-Mobile":"4","Verizon":"*1"},
				  {"Location":"Frontierland","AT&T":"3","Sprint":"2","T-Mobile":"4","Verizon":"1"},
				  {"Location":"Liberty Square","AT&T":"2","Sprint":"3","T-Mobile":"4","Verizon":"1"},
				  {"Location":"Main Street","AT&T":"*1","Sprint":"3","T-Mobile":"4","Verizon":"*1"},
				  {"Location":"Fantasyland","AT&T":"2","Sprint":"4","T-Mobile":"3","Verizon":"1"},
				  {"Location":"Tomorrowland","AT&T":"*1","Sprint":"4","T-Mobile":"3","Verizon":"*1"}];
						
	
    var selfies_tsr = [{"Location":"Adventureland","AT&T":1,"Sprint":1,"T-Mobile":1,"Verizon":1,"WiFi":0.857142857},
				{"Location":"Frontierland","AT&T":1,"Sprint":1,"T-Mobile":1,"Verizon":1,"WiFi":0.90625},
				{"Location":"Liberty Square","AT&T":1,"Sprint":1,"T-Mobile":1,"Verizon":1,"WiFi":0.931034483},
				{"Location":"Main Street","AT&T":1,"Sprint":1,"T-Mobile":1,"Verizon":1,"WiFi":0.884615385},
				{"Location":"Fantasyland","AT&T":1,"Sprint":1,"T-Mobile":1,"Verizon":1,"WiFi":0.895238095},
				{"Location":"Tomorrowland","AT&T":1,"Sprint":1,"T-Mobile":1,"Verizon":1,"WiFi":0.849056604}];

    var selfies_time = [{"Location":"Main Street","AT&T":0.4,"Sprint":0.6,"T-Mobile":0.6,"Verizon":0.5,"WiFi":5.1},
				{"Location":"Adventureland","AT&T":0.7,"Sprint":1.7,"T-Mobile":0.9,"Verizon":0.5,"WiFi":8.1},
				{"Location":"Frontierland","AT&T":0.5,"Sprint":1.8,"T-Mobile":3.1,"Verizon":0.4,"WiFi":8.5},
				{"Location":"Fantasyland","AT&T":0.5,"Sprint":3.3,"T-Mobile":1.5,"Verizon":0.4,"WiFi":6.9},
				{"Location":"Tomorrowland","AT&T":0.5,"Sprint":0.9,"T-Mobile":0.6,"Verizon":0.5,"WiFi":4.2},
				{"Location":"Liberty Square","AT&T":0.7,"Sprint":0.8,"T-Mobile":0.8,"Verizon":0.4,"WiFi":16.1}];
    						
    var maptiler = new google.maps.ImageMapType({
        getTileUrl: function (coord, zoom) {
            //return zoom + "/" + coord.x + "/" + (Math.pow(2,zoom)-coord.y-1) + ".png"; 

            // NOTE: WE ARE GOING TO RETRIEVE ALL TILES FROM THE SAME "PRODUCTION" PATH
            // TILE GENERATOR, THAT FORMERLY GENERATED TILES INTO level1, level2, level3 WILL
            // POST ALL FILES TO SINGLE PATH
            /*

                //var tiletype = $(":radio[name=tile]:checked").val();

                /*
                if (zoom <= 11 && zoom >= 9)
                tiletype = 'level3';
                if (zoom <= 8 && zoom >= 7)
                tiletype = 'level2';
                if (zoom <= 6)
                tiletype = 'level1';
            */
            
            //var path = base_path.replace('{0}', tiletype) + zoom + "/" + coord.x + "/" + coord.y + "/";

            //if ($("#layer_sig").is(":checked")) {
             //   tile_folder = 'disney';
            //}
            //else tile_folder = 'disney_thpt';

            var path = base_path.replace('{0}', tile_folder) + zoom + "/" + coord.x + "/" + coord.y + "/";
            //var path = base_path + zoom + "/" + coord.x + "/" + coord.y + "/";

            var measurement = getMeasurement();

            // if we are plotting the "best tech" there is no separation of 2g/3g/4g
            if (measurement == 'tech')
                path += $("#carrier").val() + "_tech_all.png";
            else
                path += $("#carrier").val() + "_" + measurement + "_" + $("#tech").val() + ".png";

            //alert(path);
            return path + "?20151211b";      // append the date to the URL to prevent old version coming up
        },
        tileSize: new google.maps.Size(256, 256),
        isPng: true
    });

    var regionLayer = new google.maps.ImageMapType({
        getTileUrl: function (coord, zoom) {
            //return zoom + "/" + coord.x + "/" + (Math.pow(2,zoom)-coord.y-1) + ".png"; 

            var path = base_path.replace('{0}', 'disney_poly/') + zoom + "/" + coord.x + "/" + coord.y + "/geo.png";
            //alert(path);
            return path;
        },
        tileSize: new google.maps.Size(256, 256),
        isPng: true
    });

    var debugLayer = new google.maps.ImageMapType({
        getTileUrl: function (coord, zoom) {
            //return zoom + "/" + coord.x + "/" + (Math.pow(2,zoom)-coord.y-1) + ".png"; 

            var path = base_path.replace('{0}', 'debug') + zoom + "/" + coord.x + "/" + coord.y + "/debug.png";

            return path;
        },
        tileSize: new google.maps.Size(256, 256),
        isPng: true
    });


    var map;
    var infowindow = "";
    var mapCenter = new google.maps.LatLng(28.419049, -81.581232); 		// madrid
    var initialZoom = 17;
    var mobileZoom = 16;
    var MAX_ZOOM = 19;
    var MIN_ZOOM = 15;
    var oldTimey = [{ "featureType": "administrative", "stylers": [{ "visibility": "off"}] }, { "featureType": "poi", "stylers": [{ "visibility": "off"}] }, { "featureType": "road", "stylers": [{ "visibility": "simplified"}] }, { "featureType": "water", "stylers": [{ "visibility": "simplified"}] }, { "featureType": "transit", "stylers": [{ "visibility": "simplified"}] }, { "featureType": "landscape", "stylers": [{ "visibility": "simplified"}] }, { "featureType": "road.highway", "stylers": [{ "visibility": "off"}] }, { "featureType": "road.local", "stylers": [{ "visibility": "on"}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{ "visibility": "on"}] }, { "featureType": "water", "stylers": [{ "color": "#84afa3" }, { "lightness": 52}] }, { "stylers": [{ "saturation": -77}] }, { "featureType": "road"}];
    var mutedBrown = [{ "elementType": "geometry", "stylers": [{ "hue": "#ff4400" }, { "saturation": -68 }, { "lightness": -4 }, { "gamma": 0.72}] }, { "featureType": "poi", "stylers": [{ "visibility": "off"}] }, { "featureType": "road", "elementType": "labels.icon" }, { "featureType": "landscape.man_made", "elementType": "geometry", "stylers": [{ "hue": "#0077ff" }, { "gamma": 3.1}] }, { "featureType": "water", "stylers": [{ "hue": "#00ccff" }, { "gamma": 0.44 }, { "saturation": -33}] }, { "featureType": "poi.park", "stylers": [{ "hue": "#44ff00" }, { "saturation": -23}] }, { "featureType": "water", "elementType": "labels.text.fill", "stylers": [{ "hue": "#007fff" }, { "gamma": 0.77 }, { "saturation": 65 }, { "lightness": 99}] }, { "featureType": "water", "elementType": "labels.text.stroke", "stylers": [{ "gamma": 0.11 }, { "weight": 5.6 }, { "saturation": 99 }, { "hue": "#0091ff" }, { "lightness": -86}] }, { "featureType": "transit.line", "elementType": "geometry", "stylers": [{ "lightness": -48 }, { "hue": "#ff5e00" }, { "gamma": 1.2 }, { "saturation": -23}] }, { "featureType": "transit", "elementType": "labels.text.stroke", "stylers": [{ "saturation": -64 }, { "hue": "#ff9100" }, { "lightness": 16 }, { "gamma": 0.47 }, { "weight": 2.7}]}];
    var apple = [{ "featureType": "landscape.man_made", "elementType": "geometry", "stylers": [{ "color": "#f7f1df"}] }, { "featureType": "landscape.natural", "elementType": "geometry", "stylers": [{ "color": "#d0e3b4"}] }, { "featureType": "landscape.natural.terrain", "elementType": "geometry", "stylers": [{ "visibility": "off"}] }, { "featureType": "poi", "elementType": "labels", "stylers": [{ "visibility": "off"}] }, { "featureType": "poi.business", "elementType": "all", "stylers": [{ "visibility": "off"}] }, { "featureType": "poi.medical", "elementType": "geometry", "stylers": [{ "color": "#fbd3da"}] }, { "featureType": "poi.park", "elementType": "geometry", "stylers": [{ "color": "#bde6ab"}] }, { "featureType": "road", "elementType": "geometry.stroke", "stylers": [{ "visibility": "off"}] }, { "featureType": "road", "elementType": "labels", "stylers": [{ "visibility": "off"}] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{ "color": "#ffe15f"}] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "color": "#efd151"}] }, { "featureType": "road.arterial", "elementType": "geometry.fill", "stylers": [{ "color": "#ffffff"}] }, { "featureType": "road.local", "elementType": "geometry.fill", "stylers": [{ "color": "black"}] }, { "featureType": "transit.station.airport", "elementType": "geometry.fill", "stylers": [{ "color": "#cfb2db"}] }, { "featureType": "water", "elementType": "geometry", "stylers": [{ "color": "#a2daf2"}]}];
    var paper = [{ "featureType": "administrative", "elementType": "all", "stylers": [{ "visibility": "off"}] }, { "featureType": "landscape", "elementType": "all", "stylers": [{ "visibility": "simplified" }, { "hue": "#0066ff" }, { "saturation": 74 }, { "lightness": 100}] }, { "featureType": "poi", "elementType": "all", "stylers": [{ "visibility": "simplified"}] }, { "featureType": "road", "elementType": "all", "stylers": [{ "visibility": "simplified"}] }, { "featureType": "road.highway", "elementType": "all", "stylers": [{ "visibility": "off" }, { "weight": 0.6 }, { "saturation": -85 }, { "lightness": 61}] }, { "featureType": "road.highway", "elementType": "geometry", "stylers": [{ "visibility": "on"}] }, { "featureType": "road.arterial", "elementType": "all", "stylers": [{ "visibility": "on"}] }, { "featureType": "road.local", "elementType": "all", "stylers": [{ "visibility": "on"}] }, { "featureType": "transit", "elementType": "all", "stylers": [{ "visibility": "simplified"}] }, { "featureType": "water", "elementType": "all", "stylers": [{ "visibility": "simplified" }, { "color": "#5f94ff" }, { "lightness": 26 }, { "gamma": 5.86}]}];
    var mapbox = [{ "featureType": "water", "stylers": [{ "saturation": 43 }, { "lightness": -11 }, { "hue": "#0088ff"}] }, { "featureType": "road", "elementType": "geometry.fill", "stylers": [{ "hue": "#ff0000" }, { "saturation": -100 }, { "lightness": 99}] }, { "featureType": "road", "elementType": "geometry.stroke", "stylers": [{ "color": "#808080" }, { "lightness": 54}] }, { "featureType": "landscape.man_made", "elementType": "geometry.fill", "stylers": [{ "color": "#ece2d9"}] }, { "featureType": "poi.park", "elementType": "geometry.fill", "stylers": [{ "color": "#ccdca1"}] }, { "featureType": "road", "elementType": "labels.text.fill", "stylers": [{ "color": "#767676"}] }, { "featureType": "road", "elementType": "labels.text.stroke", "stylers": [{ "color": "#ffffff"}] }, { "featureType": "poi", "stylers": [{ "visibility": "off"}] }, { "featureType": "landscape.natural", "elementType": "geometry.fill", "stylers": [{ "visibility": "on" }, { "color": "#b8cb93"}] }, { "featureType": "poi.park", "stylers": [{ "visibility": "on"}] }, { "featureType": "poi.sports_complex", "stylers": [{ "visibility": "on"}] }, { "featureType": "poi.medical", "stylers": [{ "visibility": "on"}] }, { "featureType": "poi.business", "stylers": [{ "visibility": "simplified"}]}];
    var ultraLight = [{ "featureType": "water", "elementType": "geometry", "stylers": [{ "color": "#9999ff" }, { "lightness": 17}] },
				  { "featureType": "landscape", "elementType": "geometry", "stylers": [{ "color": "#f5f5f5" }, { "lightness": 20}] },
				  { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [{ "color": "#eeddee" }, { "lightness": 17}] },
				  { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [{ "color": "#eeddee" }, { "lightness": 29}] }, 	//,{"weight":0.2}
				  {"featureType": "road.arterial", "elementType": "geometry", "stylers": [{ "color": "#eeddee" }, { "lightness": 18}] },
				  { "featureType": "road.local", "elementType": "geometry", "stylers": [{ "color": "#eeddee" }, { "lightness": 16}] },
				  { "featureType": "poi", "elementType": "geometry", "stylers": [{ "color": "#f5f5f5" }, { "lightness": 21}] },
				  { "featureType": "poi.park", "elementType": "geometry", "stylers": [{ "color": "#dedede" }, { "lightness": 21}] },
				  { "elementType": "labels.text.stroke", "stylers": [{ "visibility": "on" }, { "color": "#ffffff" }, { "lightness": 16}] },
				  { "elementType": "labels.text.fill", "stylers": [{ "saturation": 36 }, { "color": "#333333" }, { "lightness": 40}] },
				  { "elementType": "labels.icon", "stylers": [{ "visibility": "off"}] }, 			// this was off, turned on
				  {"featureType": "transit", "elementType": "geometry", "stylers": [{ "color": "#f2f2f2" }, { "lightness": 19}] },
				  { "featureType": "administrative", "elementType": "geometry.fill", "stylers": [{ "color": "#fefefe" }, { "lightness": 20}] },
				  { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [{ "color": "#fefefe" }, { "lightness": 17}]}]; 	//,{"weight":1.2}

				  var routexl = [{ "featureType": "administrative",
				      "elementType": "all",
				      "stylers": [{ "visibility": "on" }, { "saturation": -100 }, { "lightness": 20}]
				  },
                    { "featureType": "road", "elementType": "all", "stylers": [{ "visibility": "on" },
                    { "saturation": -100 }, { "lightness": 40}]
                    },
                     { "featureType": "road",
                         "elementType": "labels.text.fill",
                         "stylers": [
                            { "visibility": "on" },
                            { "color": "#5a6969" },
                            { "lightness": -78 }
                            ]
                     },
                    { "featureType": "water", "elementType": "all",
                        "stylers": [{ "visibility": "on" }, { "saturation": -70 }, { "lightness": 255 }, { "color": "#d3d4d4"}]
                    },
                    { "featureType": "landscape.man_made", "elementType": "all",
                        "stylers": [{ "visibility": "simplified" }, { "saturation": -60 }
                    , { "lightness": 10}]
                    }, { "featureType": "landscape.natural", "elementType": "all",
                        "stylers": [{ "visibility": "simplified" }, { "saturation": -60 }, { "lightness": 60}]
                    },
                    { "featureType": "poi", "elementType": "all", "stylers":
                            [{ "visibility": "on" }, { "saturation": -100 }, { "lightness": 60}]
                    },
                    /*{ "featureType": "poi",
                        "elementType": "labels.icon",
                        "stylers": [
                            { "visibility": "off" },
                            
                            ]
                    },*/
                    { "featureType": "poi",
                        "elementType": "labels.text.fill",
                        "stylers": [
                            { "visibility": "on" },
                            { "color": "#5a6969" },
                            { "lightness": -78 }
                            ]
                    },
                    
                    { "featureType": "transit", "elementType": "all",
                        "stylers": [{ "visibility": "off" }, { "saturation": -100 }, { "lightness": 60}]
                    }];

    var lunarlandscape = [{ "stylers": [{ "hue": "#ff1a00" }, { "invert_lightness": true }, { "saturation": -100 }, { "lightness": 33 }, { "gamma": 0.5}] }, { "featureType": "water", "elementType": "geometry", "stylers": [{ "color": "#2D333C"}]}];

    var myOptions = {
        zoom: initialZoom,
        center: mapCenter,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        mapTypeControl: false,
        panControl: false,
        zoomControl: false,
        scaleControl: false,
        streetViewControl: false,
        styles: routexl
    }

    var mobileOptions = {
        zoom: mobileZoom,
        center: mapCenter,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        mapTypeControl: false,
        panControl: false,
        zoomControl: false,
        scaleControl: false,
        streetViewControl: false,
        styles: routexl
    }

    function changeCarrier() {
        if ($("#carrier").val() == 'wifi')
            $("#tech").val('wifi');
        else if ($("#tech").val() == 'wifi')
            $("#tech").prop('selectedIndex', 0);

        
    }


    function changeTech() {
        if ($("#tech").val() == 'wifi')
            $("#carrier").val('wifi');
        else if ($("#carrier").val() == 'wifi')
            $("#carrier").prop('selectedIndex', 0);
    }

    function getMeasurement() {
        var measurement = 'signal';
        
        return measurement;
    }

    function setSize() {
        
    
        var winH = $(window).height();
        // firefox fix, wasn't getting window height
        try {
            if (!(window.mozInnerScreenX == null))
                winH = window.innerHeight;
            }
            catch (ex) {
            }
        var winW = $(window).width();
        //var headH = eval($(".masthead-container").css('height').replace('px', ''));
        var headH = $(".masthead-container").outerHeight();
        var mapH = winH - headH - 10;

        

        //mapH = mapH - 50;

        //alert(winH);
        //alert(headH);
        //alert(mapH);
        //alert(winW);
        $("#map_canvas").height(mapH);
        $("#map_canvas").width(winW);
        //$("#map_canvas").css('height', mapH + 'px !IMPORTANT');

        // in some cases if we're changing the window size and have previously closed the menu via the legend button
        // we could lose the legend entirely, so bring it back...
        if (isMenuVisible() == false && $("#legend").is(":visible") == false) {
            showHideLegend();
        }

        google.maps.event.trigger(map, "resize");
    }

    function isMenuVisible() {
        return ($("#legendbutton").is(":visible"));
    }

    function isMobile() {
        var check = false;
           (function (a) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true })(navigator.userAgent || navigator.vendor || window.opera);
            return check;
    }

    function initialize() {

        var useOption = myOptions;
        if (isMobile()) useOption = mobileOptions;

        map = new google.maps.Map(document.getElementById("map_canvas"), useOption);

        map.overlayMapTypes.insertAt(LAYER_REG, regionLayer);
        map.overlayMapTypes.insertAt(LAYER_COV, maptiler);

        if (getParameterByName("op") != '') {
            $("#carrier").val(getParameterByName("op"));
        }
        if (getParameterByName("lands") == 'off') {
            onOffLands();
        }
        setSize();
        clearAndReload();
        //initializeCarriers();
        
        google.maps.event.addListener(map, 'click', function (e) {
            closePopup();
        });
        /*
        google.maps.event.addListener(map, 'bounds_changed', function () {
            updateCarriers();
        });

       
        */
		
        //if (getParameterByName('show') != '')
		    loadPins();
		

        google.maps.event.addListener(map, 'zoom_changed', function () {
            if (map.getZoom() > MAX_ZOOM)
                map.setZoom(MAX_ZOOM);
            if (map.getZoom() < MIN_ZOOM)
                map.setZoom(MIN_ZOOM);
        });


        $(window).on('resize', function () {
            setSize();

        });
    }

	
	function loadPins()
	{
		for (var i = 0; i < pins.length; i++)
		{
			var obj = pins[i];
            addPin(obj);
		}
	}
    
	
    function addPin(obj)
    {
        var land = obj.Land;
		var myLatLng = {lat: obj.Latitude, lng: obj.Longitude};

        var icon = { url: 'images/' + obj.Pin,
                     size: new google.maps.Size(40,45),
                     origin: new google.maps.Point(0,0),
                     anchor: new google.maps.Point(0,23) };

		var marker = new google.maps.Marker({
				position: myLatLng,
				map: map,
				title: land,
                icon: icon
		});
			
		google.maps.event.addListener(marker,'click',function() {
                
            if (getParameterByName('show') == 'selfie')
			    hookAlt(map,marker,obj);
            else 
                hookIt(map,marker,obj);
            
		});

        return marker;
    }	
		
    function closePopup()
    {
        if (infowindow != "")
			infowindow.close();
    }

    function hookAlt(map,marker,obj) {		
		
		var land = marker.title;
        
		if (infowindow != "")
			infowindow.close();
		var borderColor = obj.BG;
		var captionColor = "#ffffff";
		var titleName = land;
		var photo = '';
		var disableAutoPan = false;

		
        var selfie_time = arrMatching(selfies_time,'Location',land);
        var selfie_tsr = arrMatching(selfies_tsr,'Location',land);
        



		var content = '<table class="pop-table">' +
                        '<tr><td colspan="4" class="pop-title" style="color:{bg}">{land}</td></tr>' +
                        '<tr><td colspan="4" class="pop-subtitle">Posting a Selfie</td></tr>' +
                        '<tr><td></td><td class="pop-head">Time in Seconds</td><td></td><td class="pop-head">Success Rate</td></tr>' +
                        '<tr><td class="pop-carrier">AT&T</td><td class="pop-ranking">{a1}</td><td>&nbsp;&nbsp;</td><td class="pop-ranking">{a2}%</td></tr>' +
                        '<tr><td class="pop-carrier">Sprint</td><td class="pop-ranking">{s1}</td><td></td><td class="pop-ranking">{s2}%</td></tr>' +
                        '<tr><td class="pop-carrier">Verizon</td><td class="pop-ranking">{v1}</td><td></td><td class="pop-ranking">{v2}%</td></tr>' +
                        '<tr><td class="pop-carrier">T-Mobile</td><td class="pop-ranking">{t1}</td><td></td><td class="pop-ranking">{t2}%</td></tr>' +
                        '<tr><td class="pop-carrier">Wi-Fi</td><td class="pop-ranking">{w1}</td><td></td><td class="pop-ranking">{w2}%</td></tr>' +
                        '<tr><td colspan="4" class="pop-pad">&nbsp;</td></tr>' +
                        '</table>';
		
        content = content.replace('{land}',land)
                         .replace('{bg}',obj.BG);

        content = content.replace('{a1}',(selfie_time['AT&T']))
                          .replace('{a2}',pct(selfie_tsr['AT&T']));
                          

        content = content.replace('{s1}',(selfie_time['Sprint']))
                          .replace('{s2}',pct(selfie_tsr['Sprint']));
         
        content = content.replace('{v1}',(selfie_time['Verizon']))
                          .replace('{v2}',pct(selfie_tsr['Verizon']));
                          
        
        content = content.replace('{t1}',(selfie_time['T-Mobile']))
                          .replace('{t2}',pct(selfie_tsr['T-Mobile']));

        content = content.replace('{w1}',(selfie_time['WiFi']))
                          .replace('{w2}',pct(selfie_tsr['WiFi']));
                                           
        	
		infowindow = new InfoBubble({
		    map : map,
		    content : content,
		    shadowStyle : 0,
		    padding : 0,
		    backgroundColor : 'rgb(255,255,255)',
		    borderRadius : 0,
		    arrowSize : 10,
		    borderWidth : 0,
		    borderColor : borderColor,
		    disableAutoPan : disableAutoPan,
		    hideCloseButton : false,
		    arrowPosition : 50,
		    backgroundClassName : 'popbubble',
		    arrowStyle : 0,
				
		});
		//infowindow.setBubbleOffset(0,bubbleOffsetHeight);
		infowindow.open(map, marker);
		currentMarker = marker;
		currentData = jData;
			
		}

	function hookIt(map,marker,obj) {		
		
		var land = marker.title;
        
		if (infowindow != "")
			infowindow.close();
		var borderColor = obj.BG;
		var captionColor = "#ffffff";
		var titleName = land;
		var photo = '';
		var disableAutoPan = false;

		
        var tweet = arrMatching(tweets,'Location',land);
        var selfie = arrMatching(selfies,'Location',land);
        var stream = arrMatching(streams,'Location',land);



		var content = '<table class="pop-table">' +
                        '<tr><td colspan="4" class="pop-title" style="color:{bg}">{land}</td></tr>' +
                        '<tr><td colspan="4" class="pop-subtitle">Social Media Activities<br />Ranked by Speed</td></tr>' +
                        '<tr><td></td><td class="pop-head">Status Update</td><td class="pop-head">Post Selfie</td><td class="pop-head">Stream Video</td></tr>' +
                        '<tr><td class="pop-carrier">AT&T</td><td class="pop-ranking">{a1}</td><td class="pop-ranking">{a2}</td><td class="pop-ranking">{a3}</td></tr>' +
                        '<tr><td class="pop-carrier">Sprint</td><td class="pop-ranking">{s1}</td><td class="pop-ranking">{s2}</td><td class="pop-ranking">{s3}</td></tr>' +
                        '<tr><td class="pop-carrier">Verizon</td><td class="pop-ranking">{v1}</td><td class="pop-ranking">{v2}</td><td class="pop-ranking">{v3}</td></tr>' +
                        '<tr><td class="pop-carrier">T-Mobile</td><td class="pop-ranking">{t1}</td><td class="pop-ranking">{t2}</td><td class="pop-ranking">{t3}</td></tr>' +
                        '<tr><td colspan="4" class="pop-foot">* indicates a tie</td></tr>' +
                        '<tr><td colspan="4" class="pop-pad">&nbsp;</td></tr>' +
                        '</table>';
		
        content = content.replace('{land}',land)
                         .replace('{bg}',obj.BG);

        content = content.replace('{a1}',toOrdinal(tweet['AT&T']))
                          .replace('{a2}',toOrdinal(selfie['AT&T']))
                          .replace('{a3}',toOrdinal(stream['AT&T']));
                          

        content = content.replace('{s1}',toOrdinal(tweet['Sprint']))
                          .replace('{s2}',toOrdinal(selfie['Sprint']))
                          .replace('{s3}',toOrdinal(stream['Sprint']));
         
        content = content.replace('{v1}',toOrdinal(tweet['Verizon']))
                          .replace('{v2}',toOrdinal(selfie['Verizon']))
                          .replace('{v3}',toOrdinal(stream['Verizon']));
                          
        
        content = content.replace('{t1}',toOrdinal(tweet['T-Mobile']))
                          .replace('{t2}',toOrdinal(selfie['T-Mobile']))
                          .replace('{t3}',toOrdinal(stream['T-Mobile']));
                                           
        	
		infowindow = new InfoBubble({
		    map : map,
		    content : content,
		    shadowStyle : 0,
		    padding : 0,
		    backgroundColor : 'rgb(255,255,255)',
		    borderRadius : 0,
		    arrowSize : 10,
		    borderWidth : 0,
		    borderColor : borderColor,
		    disableAutoPan : disableAutoPan,
		    hideCloseButton : false,
		    arrowPosition : 50,
		    backgroundClassName : 'popbubble',
		    arrowStyle : 0,
				
		});
		//infowindow.setBubbleOffset(0,bubbleOffsetHeight);
		infowindow.open(map, marker);
		currentMarker = marker;
		currentData = jData;
			
		}
	
    function showHideLegend() {
		if ($("#legend").is(":visible")) {
		    $("#legend").hide();
		    $("#legendbutton").css('background-image', 'url(images/legend-btn.png)');
		}
		else {
		    var height = (showingLands ? legend_landon : legend_landoff) + legend_pad;
		    $("#legend").css('height', height + 'px');
		    $("#legend").show();
		    $("#legendbutton").css('background-image', 'url(images/legend-close-btn.png)');
		}
    }

	var legend_landoff = 270;
	var legend_landon = 410;
	var legend_pad = 38;

	var showingLands = true;
	
    
    function onOffLands() {
	    if (showingLands) {
	        map.overlayMapTypes.setAt(0, null);
	        $(".legendsquarewrapper").hide();
	        var height = legend_landoff + (isMobile() || isMenuVisible() ? legend_pad : 0);
	        $("#legend").css('height', height + 'px');
	        $("#showHideLands").text('Show Lands');
	    }
	    else {
	        map.overlayMapTypes.setAt(0, regionLayer);
	        $(".legendsquarewrapper").show();
	        var height = legend_landon + (isMobile() || isMenuVisible() ? legend_pad : 0);
	        $("#legend").css('height', height + 'px');

	        $("#showHideLands").text('Hide Lands');

	    }
	    showingLands = !showingLands;

	    updateShortURL();
	}

		var shortURLs =
		[
		{ carrier: "att", lands: false, url: "http://goo.gl/Atqyci" },
		{ carrier: "sprint", lands: false, url: "http://goo.gl/NEMiYr" },
		{ carrier: "tmobile", lands: false, url: "http://goo.gl/h624iZ" },
		{ carrier: "verizon", lands: false, url: "http://goo.gl/HEJ5m3" },
		{ carrier: "wifi", lands: false, url: "http://goo.gl/zrgs5X" },
		{ carrier: "overall", lands: false, url: "http://goo.gl/C9dZPQ" },
		{ carrier: "att", lands: true, url: "http://goo.gl/pgzbMg" },
		{ carrier: "sprint", lands: true, url: "http://goo.gl/oUjZHq" },
		{ carrier: "tmobile", lands: true, url: "http://goo.gl/mgoi61" },
		{ carrier: "verizon", lands: true, url: "http://goo.gl/KvD8mA" },
		{ carrier: "wifi", lands: true, url: "http://goo.gl/maez6s" },
		{ carrier: "overall", lands: true, url: "http://goo.gl/197hET" },

		];


		function updateShortURL() {

		    var op = $("#carrier").val();
		    var shareURL = 'http://www.gwsolutions.com/disney/index.html?op=' + op;
		    var fbURL = shareURL;
        
		    if (!showingLands) shareURL += '&lands=off';
		        //copyToClipboard(shareURL);
		        for (var i = 0; i < shortURLs.length; i++) {
		        if (op == shortURLs[i].carrier && showingLands == shortURLs[i].lands)
		        shareURL = shortURLs[i].url;
		    }
		    //copyToClipboard(shareURL);
		    $("#copyLink").text(shareURL);
		    $("#shareFB").attr('data-href', fbURL);
		    $("#shareTW").attr('data-url', shareURL);
		    try {
		        FB.XFBML.parse();           // need to refresh the FB share button
		    }
		    catch (ex) {
		    // do nothing - this is incase Facebook can't be loaded
		}
		    $.getScript('http://platform.twitter.com/widgets.js');
		}

		function selectText(containerid) {
		    if (document.selection) {
		    var range = document.body.createTextRange();
		        range.moveToElementText(document.getElementById(containerid));
		        range.select();
		    } else if (window.getSelection) {
		        var range = document.createRange();
		        range.selectNode(document.getElementById(containerid));
		        window.getSelection().addRange(range);
		    }
		}

		function copyToClipboard(text) {
		    window.prompt("Copy to clipboard: Ctrl+C, Enter", text);
		}

		

    var popupContainer = '<div class="point_details">{0}</div>';
    var popupRow = '<div class="point_caption">{0}</div><div class="point_value">{1}</div>';

    if (!String.prototype.format) {
        String.prototype.format = function () {
            var args = arguments;
            return this.replace(/{(\d+)}/g, function (match, number) {
                return typeof args[number] != 'undefined'
            ? args[number]
            : match
          ;
            });
        };
    }

    function arrMatching(arr,field,match)
    {
        for(var i = 0; i < arr.length; i++)
        {
          if(arr[i][field] == match)
          {
            return arr[i];
          }
        }
        return null;
    }

    function colorTile(rgb) {
        return '<div class=\"color_tile\" style=\"background-color: RGB(' + rgb + ')\"></div>';
    }

    function clearAndReload() {

        map.overlayMapTypes.setAt(LAYER_COV, maptiler);
        updateShortURL();
        $("#carrier").blur();
        //map.overlapMapTypes.setAt(LAYER_REG, regionLayer);
    }


    $(document).ready(function () {

        initialize();

        $("#showDebug").change(function () {
            if ($("#showDebug").is(':checked')) {
                map.overlayMapTypes.setAt(2, debugLayer);
            }
            else
                map.overlayMapTypes.setAt(2, null);
        });

    });



    /*
    Math helper
    */
    // Closure
    (function () {
        /**
        * Decimal adjustment of a number.
        *
        * @param {String}  type  The type of adjustment.
        * @param {Number}  value The number.
        * @param {Integer} exp   The exponent (the 10 logarithm of the adjustment base).
        * @returns {Number} The adjusted value.
        */
        function decimalAdjust(type, value, exp) {
            // If the exp is undefined or zero...
            if (typeof exp === 'undefined' || +exp === 0) {
                return Math[type](value);
            }
            value = +value;
            exp = +exp;
            // If the value is not a number or the exp is not an integer...
            if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {
                return NaN;
            }
            // Shift
            value = value.toString().split('e');
            value = Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp)));
            // Shift back
            value = value.toString().split('e');
            return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp));
        }

        // Decimal round
        if (!Math.round10) {
            Math.round10 = function (value, exp) {
                return decimalAdjust('round', value, exp);
            };
        }
        // Decimal floor
        if (!Math.floor10) {
            Math.floor10 = function (value, exp) {
                return decimalAdjust('floor', value, exp);
            };
        }
        // Decimal ceil
        if (!Math.ceil10) {
            Math.ceil10 = function (value, exp) {
                return decimalAdjust('ceil', value, exp);
            };
        }
    })();


    String.prototype.replaceAll = function (find, replace) {
        var str = this;
        return str.replace(new RegExp(find, 'g'), replace);
    }


    function getParameterByName(name) {
        name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
        var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
        return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
    }
		
	function pct(value) {
        if (value == "1") return 100;
        else return Math.round10(value*100,0);
    }
    	
	function toOrdinal (value) {
        if (value.substr(0,1) == "*")
            value = value.replace('*','<span class="asterisk">*</span>');

		var s = String(value),
		  len = s.length,
		  end  = s.substr(len - 1, 1),
		  teen = len > 1 && s.substr(len - 2, 1) === "1",
		  ord = "th";
		if (end === "1" && !teen) {
		  ord = "st";
		} else if (end === "2" && !teen) {
		  ord = "nd";
		} else if (end === "3" && !teen) {
		  ord = "rd";
		}
		return value + '' + ord;
	 }

	String.prototype.replaceAll = function (find,replace) {
		var str = this;
		return str.replace(new RegExp(find,'g'), replace);
	}

Anon7 - 2021