
CustomViewControl = function() {
    var AW = MQA.browser;
    this.map = null;
    this.imgUrl = "/images/com/mapping/mapviewcontrol-dotcom2.png";
    this.positionWithCSS = true;
    this.elem = document.createElement("div");
    this.elem.style.position = "absolute";
    this.elem.style.right = "5px";
    this.elem.style.overflow = "visible";
    this.elem.className = "dotcom-view-ctrl3";
    this.eStreetClick = null;
    this.eStreetMouseOver = null;
    this.eStreetMouseOut = null;
    this.eArialClick = null;
    this.eArialMouseOver = null;
    this.eArialMouseOut = null;
    this.eHybridChkBxClick = null;
    this.ul = document.createElement("ul");
    this.ul.className = "map-view screen";
    this.elem.appendChild(this.ul);
    this.li1 = document.createElement("li");
    this.li1.className = "map-view-street";
    this.ul.appendChild(this.li1);
    this.streetview = document.createElement("img");
    this.streetview.className = "";
    this.streetview.border = 0;
    this.streetview.src = this.imgUrl;
    this.streetview.alt = "View Street Map";
    this.streetview.title = "View Street Map";
    this.li1.appendChild(this.streetview);
    this.li2 = document.createElement("li");
    this.li2.className = "map-view-aerial";
    this.ul.appendChild(this.li2);
    this.aerialview = document.createElement("img");
    this.aerialview.className = "";
    this.aerialview.border = 0;
    this.aerialview.src = this.imgUrl;
    this.aerialview.alt = "View Aerial Image";
    this.aerialview.title = "View Aerial Image";
    this.li2.appendChild(this.aerialview);
    this.li3 = document.createElement("li");
    this.li3.className = "map-view-hybrid";
    this.ul.appendChild(this.li3);
    this.hybridview = document.createElement("img");
    this.hybridview.className = "";
    this.hybridview.border = 0;
    this.hybridcontent = document.createElement("div");
    this.hybridcontent.className = "hybrid-content";
    this.hybridcontent.innerHTML = "<form action='javascript:void(0);'><input id='hybrid_cbx' type='checkbox' checked='true' /><label for='hybrid_cbx'>Show labels</label></form>";
    this.hybridview.src = this.imgUrl;
    if (AW.name == "msie" && AW.version > 5) {
        this.hybridcontent.childNodes[0].style.marginTop = "5px";
    }
    this.hybridview.alt = "View Hybrid Map";
    this.hybridview.title = "View Hybrid Map";
    this.li3.appendChild(this.hybridview);
    this.li3.appendChild(this.hybridcontent);
};

CustomViewControl.prototype = new MQA.Control();
CustomViewControl.prototype.constructor = CustomViewControl;
CustomViewControl.prototype.initialize = function(AW) {
    this.position = new MQA.MapCornerPlacement(MQA.MapCorner.TOP_RIGHT, new MQA.Size(5, 0));
    this.map = AW;
    this.type = MQA.CONTROL_TYPE;
    this.eStreetClick = MQA._prEvent.EventCallback(this, "eventmonitor");
    this.eStreetMouseOver = MQA._prEvent.EventCallback(this, "eventmonitor");
    this.eStreetMouseOut = MQA._prEvent.EventCallback(this, "eventmonitor");
    MQA._prEvent.observe(this.streetview, "click", this.eStreetClick);
    MQA._prEvent.observe(this.streetview, "mouseover", this.eStreetMouseOver);
    MQA._prEvent.observe(this.streetview, "mouseout", this.eStreetMouseOut);
    this.eArialClick = MQA._prEvent.EventCallback(this, "eventmonitor");
    this.eArialMouseOver = MQA._prEvent.EventCallback(this, "eventmonitor");
    this.eArialMouseOut = MQA._prEvent.EventCallback(this, "eventmonitor");
    MQA._prEvent.observe(this.aerialview, "click", this.eArialClick);
    MQA._prEvent.observe(this.aerialview, "mouseover", this.eArialMouseOver);
    MQA._prEvent.observe(this.aerialview, "mouseout", this.eArialMouseOut);
    this.eHybridChkBxClick = MQA._prEvent.EventCallback(this, "eventmonitor");
    MQA._prEvent.observe(this.hybridcontent.childNodes[0].childNodes[0], "click", this.eHybridChkBxClick);
    switch (this.map.getMapType()) {
        case MQA.MAP_TYPE.MAP:
            this.updateControl(MQA.MAP_TYPE.MAP);
            break;
        case MQA.MAP_TYPE.SAT:
            this.updateControl(MQA.MAP_TYPE.SAT);
            break;
        case MQA.MAP_TYPE.HYB:
            this.updateControl(MQA.MAP_TYPE.HYB);
            break
    }
};

CustomViewControl.prototype.dispose = function() {
    this.map = null;
    this.position = null;
    this.type = null;
    MQA._prEvent.stopObserving(this.streetview, "click", this.eStreetClick);
    MQA._prEvent.stopObserving(this.streetview, "mouseover", this.eStreetMouseOver);
    MQA._prEvent.stopObserving(this.streetview, "mouseout", this.eStreetMouseOut);
    MQA._prEvent.stopObserving(this.aerialview, "click", this.eArialClick);
    MQA._prEvent.stopObserving(this.aerialview, "mouseover", this.eArialMouseOver);
    MQA._prEvent.stopObserving(this.aerialview, "mouseout", this.eArialMouseOut);
    MQA._prEvent.stopObserving(this.hybridcontent.childNodes[0].childNodes[0], "click", this.eHybridChkBxClick);
    this.streetview.src = "";
    MQA.Util._deleteDOMObject(this.streetview);
    this.streetview = null;
    this.aerialview.src = "";
    MQA.Util._deleteDOMObject(this.aerialview);
    this.aerialview = null;
    this.hybridcontent.innerHTML = null;
    this.hybridcontent.outerHTML = "";
    this.hybridcontent = null;
    MQA.Util._deleteDOMObject(this.hybridview);
    this.hybridview = null;
    this.li1.innerHTML = null;
    this.li1.outerHTML = "";
    MQA.Util._deleteDOMObject(this.li1);
    this.li1 = null;
    this.li2.innerHTML = null;
    this.li2.outerHTML = "";
    MQA.Util._deleteDOMObject(this.li2);
    this.li2 = null;
    this.li3.innerHTML = null;
    this.li3.outerHTML = "";
    MQA.Util._deleteDOMObject(this.li3);
    this.li3 = null;
    this.ul.innerHTML = null;
    this.ul.outerHTML = "";
    MQA.Util._deleteDOMObject(this.ul);
    this.ul = null;
    this.elem.innerHTML = null;
    this.elem.outerHTML = "";
    MQA.Util._deleteDOMObject(this.elem);
    this.elem = null
};

CustomViewControl.prototype.eventmonitor = function(AW) {
    //var AX = W(AW);
    var AX = AW.target || AW.srcElement;

    switch (AW.type) {
        case "click":
            if (AX == this.streetview) {
                this.selectMode("street");
                //                $pv("MQ08Street", "r")
            }
            else {
                if (AX == this.aerialview && this.map.getMapType() != MQA.MAP_TYPE.HYB) {
                    this.selectMode("hybrid");
                    //                    $pv("MQ08Hybrid", "r")
                }
                else {
                    if (AX.checked == true) {
                        this.selectMode("hybrid");
                        //                        $pv("MQ08Hybrid", "r")
                    }
                    else {
                        if (AX.checked == false) {
                            this.selectMode("aerial");
                            //                            $pv("MQ08Aerial", "r")
                        }
                    }
                }
            }
            break;
        case "mouseover":
            if (AX.className != "a") {
                AX.className = "o"
            }
            break;
        case "mouseout":
            if (AX.className == "o") {
                AX.className = ""
            }
            break
    }
};


CustomViewControl.prototype.updateControl = function(AX) {
    var AW = this.hybridcontent.childNodes[0].childNodes[0];
    switch (AX) {
        case MQA.MAP_TYPE.MAP: this.streetview.className = "a";
            this.aerialview.className = "";
            AW.checked = false;
            this.hybridview.parentNode.style.display = "none";
            break;
        case MQA.MAP_TYPE.SAT: this.streetview.className = "";
            this.aerialview.className = "a";
            AW.checked = false;
            this.hybridview.parentNode.style.display = "block";
            break;
        case MQA.MAP_TYPE.HYB: this.streetview.className = "";
            this.aerialview.className = "a";
            AW.checked = true;
            this.hybridview.parentNode.style.display = "block";
            break
    }
};

CustomViewControl.prototype.selectMode = function(AY) {
    var AX = this.map.getMapType();
    var AW = "noChange";
    if (AY == "street" && AX != MQA.MAP_TYPE.MAP) { AW = MQA.MAP_TYPE.MAP }
    if (AY == "aerial" && AX != MQA.MAP_TYPE.SAT) { AW = MQA.MAP_TYPE.SAT }
    if (AY == "hybrid" && AX != MQA.MAP_TYPE.HYB) { AW = MQA.MAP_TYPE.HYB }
    if (AW != "noChange") {
        this.map.setMapType(AW);
        this.map.placeControl(this, true);
        this.map.logos[MQA.MapLogo.NAVTEQ_COPYRIGHT].style.display = "none";
        this.map.logos[MQA.MapLogo.ICUBED_COPYRIGHT].style.display = "none"
    }
};
CustomViewControl.prototype.getHeight = function() {
    var AW = (this.hybridview.parentNode.style.display == "block") ? (this.hybridview.parentNode.offsetHeight - 15) : 0;
    return (this.streetview.parentNode.offsetHeight + AW)
};

CustomViewControl.prototype.getWidth = function() {
    return (this.elem.childNodes[0].offsetWidth)
};









m = function(AW) {
    try {
        AW.cancelBubble = true;
        if (AW.preventDefault) {
            AW.preventDefault();
            AW.stopPropagation()
        }
        else {
            AW.returnValue = false
        }
    }
    catch (AX) { }
};



CustomZoomControl = function(Ak) {
    MQA.Base.call(this);
    var Az = 45;
    var A1 = 254;
    var Am = new MQA.Icon("/App_Themes/LogicOfLennar/images/slidezoom_sprite.png", 128, 259);
    var Ai = { x: 93, y: 42, width: 15, height: 15 };
    var Aj = { x: 93, y: 63, width: 15, height: 15 };
    var A0 = 44;
    var Aq = { x: 93, y: 83, width: 15, height: 15 };
    var As = { x: 93, y: 104, width: 15, height: 15 };
    var A5 = 229;
    var AW = { x: 91, y: 8, width: 20, height: 9 };
    var AY = { x: 91, y: 22, width: 20, height: 9 };
    var Ad = { x: 48, y: 5, width: 33, height: 33 };
    var BA = [];
    BA[0] = { x: 48, y: 41, width: 33, height: 33 };
    BA[1] = { x: 48, y: 77, width: 33, height: 33 };
    BA[2] = { x: 48, y: 113, width: 33, height: 33 };
    BA[3] = { x: 48, y: 149, width: 33, height: 33 };
    BA[4] = { x: 48, y: 185, width: 33, height: 33 };
    var Ar = 7;
    var An = [];
    An[0] = { x: 10, y: 0, width: 13, height: 8, tip: "Pan North" };
    An[1] = { x: 25, y: 10, width: 8, height: 13, tip: "Pan East" };
    An[2] = { x: 10, y: 25, width: 13, height: 8, tip: "Pan South" };
    An[3] = { x: 0, y: 10, width: 8, height: 13, tip: "Pan West" };
    An[4] = { x: 9, y: 9, width: 15, height: 15, tip: "Fit to Screen" };
    var A3 = { x: 91, y: 8, width: 20, height: 9 };
    var A4 = { x: 91, y: 22, width: 20, height: 9 };
    var Ah = [];
    var Ab = 63;
    var Af = { x: 16, y: 63, width: 12, height: 164 };
    var Av = null;
    var Au = null;
    var Ae = null;
    var Al = null;
    var Ac = null;
    var AZ = null;
    var Ao = null;
    var Ay = null;
    var Ag = [];
    var Ap = null;
    var A2 = null;
    var A9 = null;
    var Ax = null;
    var At = null;
    var A7 = null;
    var A8 = null;
    var Aa = null;
    var A6 = false;
    var AX = null;
    var Aw = null;
    this.controlVersion = "2.0";
    this.type = MQA.CONTROL_PANZOOM;
    this.className = "CustomZoomControl";
    this.map = null;
    this.width = Az;
    this.height = A1;
    this.position = (typeof (Ak) == "undefined" ? new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT, new MQA.Size(0, 0)) : Ak);
    this._facio = function(BC, BB) {
        switch (BC) {
            case "width":
                this.width = Az;
                break;
            case "height":
                this.height = A1;
                break;
            case "position":
                if (Av) {
                    var BD = this._getPositionXY(BB);
                    Av.style.left = BD.x + "px";
                    Av.style.top = BD.y + "px"
                }
                break
        }
    };
    this._duco = function(BB) {
        switch (BB) { }
    };

    this.draw = function() {
        if (Av) {
            this.dispose(false)
        }
        var BB = this._getPositionXY(this.position);
        Av = document.createElement("div");
        Av.id = "CustomZoomControl_cControlBox";
        Av.style.position = "absolute";
        Av.style.overflow = "hidden";
        Av.style.display = "block";
        Av.style.background = 'url("' + Am.imageURL + '") no-repeat';
        Av.style.left = BB.x + "px";
        Av.style.top = BB.y + "px";
        Av.style.width = this.getValue("width") + "px";
        Av.style.height = this.getValue("height") + "px";
        Av.style.zindex = 95;
        Au = document.createElement("div");
        Au.id = "CustomZoomControl_cPanBox";
        Au.style.position = "absolute";
        Au.style.overflow = "hidden";
        Au.style.display = "block";
        Au.style.width = Ad.width + "px";
        Au.style.height = Ad.height + "px";
        Au.style.left = (this.getValue("width") - Ad.width) / 2 + "px";
        Au.style.top = Ar + "px";
        Ae = document.createElement("img");
        Ae.id = "CustomZoomControl_cPanImage";
        Ae.width = Am.width;
        Ae.height = Am.height;
        Ae.src = Am.imageURL;
        Ae.style.marginLeft = -Ad.x + "px";
        Ae.style.marginTop = -Ad.y + "px";
        Au.appendChild(Ae);
        for (var BC = 0; BC < 5; BC++) {
            Ag[BC] = document.createElement("div");
            Ag[BC].id = "LargeZoomControl_" + this.guid + "_panButton_" + BC;
            Ag[BC].style.position = "absolute";
            Ag[BC].style.overflow = "hidden";
            Ag[BC].style.background = 'url("/App_Themes/LogicOfLennar/images/1pixel_clear.gif") repeat';
            Ag[BC].style.zindex = 100;
            Ag[BC].style.width = An[BC].width + "px";
            Ag[BC].style.height = An[BC].height + "px";
            Ag[BC].style.left = An[BC].x + "px";
            Ag[BC].style.top = An[BC].y + "px";
            Ag[BC].title = An[BC].tip;
            Ag[BC].style.cursor = "pointer";
            Au.appendChild(Ag[BC])
        }
        Av.appendChild(Au);
        Al = document.createElement("div");
        Al.id = "CustomZoomControl_cZoomInBox";
        Al.style.position = "absolute";
        Al.style.overflow = "hidden";
        Al.style.display = "block";
        Al.style.width = Ai.width + "px";
        Al.style.height = Ai.height + "px";
        Al.style.left = (this.getValue("width") - Ai.width) / 2 + "px";
        Al.style.top = A0 + "px";
        Al.title = "Zoom In";
        Al.style.cursor = "pointer";
        Ac = document.createElement("img");
        Ac.width = Am.width;
        Ac.height = Am.height;
        Ac.src = Am.imageURL;
        Ac.style.marginLeft = -Ai.x + "px";
        Ac.style.marginTop = -Ai.y + "px";
        Al.appendChild(Ac);
        Av.appendChild(Al);
        AZ = document.createElement("div");
        AZ.id = "CustomZoomControl_cZoomOutBox";
        AZ.style.position = "absolute";
        AZ.style.overflow = "hidden";
        AZ.style.display = "block";
        AZ.style.width = Aq.width + "px";
        AZ.style.height = Aq.height + "px";
        AZ.style.left = (this.getValue("width") - Aq.width) / 2 + "px";
        AZ.style.top = A5 + "px";
        AZ.title = "Zoom Out";
        AZ.style.cursor = "pointer";
        Ao = document.createElement("img");
        Ao.width = Am.width;
        Ao.height = Am.height;
        Ao.src = Am.imageURL;
        Ao.style.marginLeft = -Aq.x + "px";
        Ao.style.marginTop = -Aq.y + "px";
        AZ.appendChild(Ao);
        Av.appendChild(AZ);
        Ap = document.createElement("div");
        Ap.style.position = "absolute";
        Ap.style.display = "block";
        Ap.style.background = 'url("/App_Themes/LogicOfLennar/images/1pixel_clear.gif") repeat';
        Ap.style.zindex = 100;
        Ap.style.width = Af.width + "px";
        Ap.style.height = Af.height + "px";
        Ap.style.left = Af.x + "px";
        Ap.style.top = Af.y + "px";
        Av.appendChild(Ap);
        A2 = document.createElement("div");
        A2.style.position = "absolute";
        A2.style.overflow = "hidden";
        A2.style.display = "block";
        A2.style.zindex = 100;
        A2.style.width = A3.width + "px";
        A2.style.height = A3.height + "px";
        A2.style.left = Math.ceil((this.getValue("width") - A3.width) / 2) + "px";
        A2.style.top = this._getNewSliderYPosition(this.map.getZoomLevel()) + "px";
        A2.style.cursor = "pointer";
        A2.title = "Zoom Level " + this.map.getZoomLevel();
        A9 = document.createElement("img");
        A9.width = Am.width;
        A9.height = Am.height;
        A9.src = Am.imageURL;
        A9.style.marginLeft = -A3.x + "px";
        A9.style.marginTop = -A3.y + "px";
        A2.appendChild(A9);
        Av.appendChild(A2);
        this.map.parent2.appendChild(Av);
        Ax = MQA._prEvent.EventCallback(this, "zoomInHandler");
        MQA._prEvent.observe(Al, "mouseover", Ax);
        MQA._prEvent.observe(Al, "mouseout", Ax);
        MQA._prEvent.observe(Al, "click", Ax);
        At = MQA._prEvent.EventCallback(this, "zoomOutHandler");
        MQA._prEvent.observe(AZ, "mouseover", At);
        MQA._prEvent.observe(AZ, "mouseout", At);
        MQA._prEvent.observe(AZ, "click", At);
        A7 = MQA._prEvent.EventCallback(this, "panHandler");
        for (var BC = 0; BC < 5; BC++) {
            MQA._prEvent.observe(Ag[BC], "mouseover", A7);
            MQA._prEvent.observe(Ag[BC], "mouseout", A7);
            MQA._prEvent.observe(Ag[BC], "click", A7)
        }
        A8 = MQA._prEvent.EventCallback(this, "sliderBarHandler");
        MQA._prEvent.observe(Ap, "click", A8);
        Aa = MQA._prEvent.EventCallback(this, "sliderHandleHandler");
        MQA._prEvent.observe(A2, "mouseover", Aa);
        MQA._prEvent.observe(A2, "mouseout", Aa);
        MQA._prEvent.observe(A2, "mousedown", Aa);
        MQA._prEvent.observe(A2, "mouseup", Aa);
        eMouseActionCallback = MQA._prEvent.EventCallback(this, "mouseActionHandler");
        MQA._prEvent.observe(Av, "mousemove", eMouseActionCallback);
        MQA._prEvent.observe(Av, "mouseout", eMouseActionCallback);
        MQA._prEvent.observe(Av, "mouseup", eMouseActionCallback);

        MQA.EventManager.addListener(this.map, "zoomend", this.onZoomEnd, this);
        //AL(this.map, "zoomend", this.onZoomEnd, this)
    };

    this.dispose = function(BB) {
        var BB = (typeof (BB) != "undefined" ? BB : false);
        MQA._prEvent.stopObserving(Al, "mouseover", Ax);
        MQA._prEvent.stopObserving(Al, "mouseout", Ax);
        MQA._prEvent.stopObserving(Al, "click", Ax);
        MQA._prEvent.stopObserving(AZ, "mouseover", At);
        MQA._prEvent.stopObserving(AZ, "mouseout", At);
        MQA._prEvent.stopObserving(AZ, "click", At);
        for (var BC = 0; BC < 5; BC++) {
            MQA._prEvent.stopObserving(Ag[BC], "mouseover", A7);
            MQA._prEvent.stopObserving(Ag[BC], "mouseout", A7);
            MQA._prEvent.stopObserving(Ag[BC], "click", A7)
        }
        MQA._prEvent.stopObserving(Ap, "click", A8);
        MQA._prEvent.stopObserving(A2, "mouseover", Aa);
        MQA._prEvent.stopObserving(A2, "mouseout", Aa);
        MQA._prEvent.stopObserving(A2, "mousedown", Aa);
        MQA._prEvent.stopObserving(A2, "mouseup", Aa);
        MQA._prEvent.stopObserving(Av, "mousemove", eMouseActionCallback);
        MQA._prEvent.stopObserving(Av, "mouseup", eMouseActionCallback);
        MQA.EventManager.removeListener(this.map, "zoomend", this.onZoomEnd, this);
        Ax = null;
        At = null;
        A7 = null;
        A8 = null;
        Aa = null;
        Av.innerHTML = "";
        MQA.Util._setOuterHTMLToEmptyString(Av);
        MQA.Util._deleteDOMObject(Av);
        Av = null;
        Au = null;
        Ae = null;
        Al = null;
        Ac = null;
        AZ = null;
        Ao = null;
        Ay = null;
        for (var BC = 0; BC < 5; BC++) {
            Ag[BC] = null
        }
        Ag = [];
        Ap = null;
        A2 = null;
        A9 = null;
        this.map = null
    };
    this.zoomInHandler = function(BB) {
        switch (BB.type) {
            case "mouseover":
                Ac.style.marginLeft = -Aj.x + "px";
                Ac.style.marginTop = -Aj.y + "px";
                break;
            case "mouseout":
                Ac.style.marginLeft = -Ai.x + "px";
                Ac.style.marginTop = -Ai.y + "px";
                break;
            case "click":
                this._changeZoomLevel(this.map.getZoomLevel() + 1);
                //$pv("MQ08ZoomIn", "r");
                break
        }
    };
    this.zoomOutHandler = function(BB) {
        switch (BB.type) {
            case "mouseover":
                Ao.style.marginLeft = -As.x + "px";
                Ao.style.marginTop = -As.y + "px";
                break;
            case "mouseout":
                Ao.style.marginLeft = -Aq.x + "px";
                Ao.style.marginTop = -Aq.y + "px";
                break;
            case "click":
                this._changeZoomLevel(this.map.getZoomLevel() - 1);
                //$pv("MQ08ZoomOut", "r");
                break
        }
    };
    this.panHandler = function(BC) {
        var BD = (MQA.browser.name == "msie" ? BC.srcElement.id : BC.target.id);
        var BB = parseInt(BD.substr(BD.length - 1, 1));
        switch (BC.type) {
            case "mouseover":
                Ae.style.marginLeft = -BA[BB].x + "px";
                Ae.style.marginTop = -BA[BB].y + "px";
                break;
            case "mouseout":
                Ae.style.marginLeft = -Ad.x + "px";
                Ae.style.marginTop = -Ad.y + "px";
                break;
            case "click":
                switch (BB) {
                    case 0:
                        this.map.panNorth(50);
                        break;
                    case 1:
                        this.map.panEast(50);
                        break;
                    case 2:
                        this.map.panSouth(50);
                        break;
                    case 3:
                        this.map.panWest(50);
                        break;
                    case 4:
                        this._doBestFit();
                        break
                }
                //$pv("MQ08CompassPan", "r");
                break
        }
    };
    this.sliderBarHandler = function(BD) {
        var BB = (MQA.browser.name == "msie" ? BD.offsetY : BD.layerY);
        var BC = 17 - Math.round(BB / 10);
        this.map.setZoomLevel(BC);
        this._setZoomSlider(BC);
        this.logZoomLevel(BC)
    };
    this.sliderHandleHandler = function(BB) {
        switch (BB.type) {
            case "mouseover":
                A9.style.marginLeft = -A4.x + "px";
                A9.style.marginTop = -A4.y + "px";
                break;
            case "mouseout":
                A9.style.marginLeft = -A3.x + "px";
                A9.style.marginTop = -A3.y + "px";
                m(BB);
                break;
            case "mousedown":
                A6 = true;
                AX = BB.clientY;
                Aw = parseInt(A2.style.top);
                A2.style.cursor = this.map.grabbing_mousecursor;
                m(BB);
                break;
            case "mouseup":
                A6 = false;
                A2.style.cursor = "pointer";
                this._setZoomLevelFromSliderPosition();
                break
        }
    };
    this.mouseActionHandler = function(BC) {
        if (!A6) { return }
        switch (BC.type) {
            case "mousemove":
                var BB = BC.clientY - AX;
                var BD = Aw + BB;
                if (BD < Ab) { BD = Ab }
                if (BD > (Ab + 150)) { BD = Ab + 150 }
                A2.style.top = BD + "px";
                m(BC);
                break;
            case "mouseout":
                if (MQA.Util.isMouseLeaveOrEnter(BC, Av)) { this._finishDragging() }
                break;
            case "mouseup":
                A6 = false;
                A2.style.cursor = "pointer";
                this._setZoomLevelFromSliderPosition();
                break
        }
    };

    this._finishDragging = function() {
        A6 = false;
        A2.style.cursor = "pointer";
        this._setZoomLevelFromSliderPosition()
    };
    this._getPositionXY = function(BF) {
        var BG = this.getValue("width");
        var BE = this.getValue("height");
        var BC, BD;
        var BH = BF.offsetSize.width;
        var BB = BF.offsetSize.height;
        switch (BF.getMapCorner()) {
            case MQA.MapCorner.TOP_LEFT:
                BC = 0;
                BD = 0;
                if (BH > (this.map.width - BG)) {
                    BH = (this.map.width - BG) - 3
                }
                break;
            case MQA.MapCorner.TOP_RIGHT:
                BC = this.map.width - BG;
                BD = 0;
                break;
            case MQA.MapCorner.BOTTOM_LEFT:
                BC = 0;
                BD = this.map.height - BE;
                if (BH > (this.map.width - BG)) {
                    BH = (this.map.width - BG) - 3
                }
                break;
            case MQA.MapCorner.BOTTOM_RIGHT:
                BC = this.map.width - BG;
                BD = this.map.height - BE;
                break
        }
        BC += BH;
        BD += BB;
        return new MQA.PointXY(BC, BD)
    };
    this._changeZoomLevel = function(BB) {
        BB = (BB > 16 ? 16 : BB);
        BB = (BB < 1 ? 1 : BB);
        this.map.setZoomLevel(BB);
        this._setZoomSlider(BB)
    };
    this._doBestFit = function() {
        var BF = this.map.routerect;
        var BG = this.map._getAllShapes(true, false);
        var BC = BG.getSize();
        if (BF && (BC > 0)) {
            var BB = new MQA.RectLL(new MQA.PointLL(BG.getAt(0).getValue("latLng").getLatitude(), BG.getAt(0).getValue("latLng").getLongitude()), new MQA.PointLL(BG.getAt(0).getValue("latLng").getLatitude(), BG.getAt(0).getValue("latLng").getLongitude()));
            for (var BE = 1; BE < BC; BE++) {
                var BD = BG.getAt(BE).getValue("latLng");
                BB.ul.lat = Math.max(BD.lat, Math.max(BB.ul.lat, BF.ul.lat));
                BB.ul.lng = Math.min(BD.lng, Math.min(BB.ul.lng, BF.ul.lng));
                BB.lr.lat = Math.min(BD.lat, Math.min(BB.lr.lat, BF.lr.lat));
                BB.lr.lng = Math.max(BD.lng, Math.max(BB.lr.lng, BF.lr.lng))
            }
            this.map._bestFit(BB, false, 1, 16);
            this._setZoomSlider(this.map.getZoomLevel())
        }
        else {
            if (BF && (BC == 0)) {
                this.map.bestFitRoute();
                this._setZoomSlider(this.map.getZoomLevel())
            }
            else {
                if (!BF && (BC > 1)) {
                    this.map.bestFit();
                    this._setZoomSlider(this.map.getZoomLevel())
                }
                else {
                    if (!BF && (BC == 1)) {
                        this.map.setCenter(this.map.savedCenter)
                    }
                    else {
                        this.map.setCenter(this.map.savedCenter)
                    }
                }
            }
        }
    };
    this._setZoomSlider = function(BB) {
        A2.style.top = this._getNewSliderYPosition(BB) + "px";
        A2.title = "Zoom Level " + BB
    };
    this._getNewSliderYPosition = function(BB) {
        var BC = (16 - BB) * 10;
        return BC + Ab
    };
    this._setZoomLevelFromSliderPosition = function() {
        var BB = (parseInt(A2.style.top) - Ab) + (A3.height / 1.75);
        var BC = 17 - Math.round(BB / 10);
        this._setZoomSlider(BC);
        this.map.setZoomLevel(BC);
        this.logZoomLevel(BC)
    };
    this.onZoomEnd = function(BB) {
        var BC = this.map.getZoomLevel();
        this._setZoomSlider(BC)
    };
    this.logZoomLevel = function(BB) {
        //        if (BB < 5) { $pv("MQ08ZoomCountry", "r") }
        //        else {
        //            if (BB < 9) { $pv("MQ08ZoomRegion", "r") }
        //            else {
        //                if (BB < 13) { $pv("MQ08ZoomCity", "r") }
        //                else { $pv("MQ08ZoomStreet", "r") }
        //            }
        //        } 
    };
    this.initialize = function(BB) {
        this.map = BB;
        this.draw()
    };

    this.setZoom = function(level) {
        //return this._changeZoomLevel(level);
    };

    this.unselectZoom = function(level) {

    };

    this.getWidth = function() { return this.getValue("width") };
    this.getHeight = function() { return this.getValue("height") };
    this.destructor = function() { this.dispose(false) };
    this.getPosition = function() { return this.getValue("position") }
};

