﻿var atlasman;
function ZZZZObsoleteMapControlManager() {
    var nkLatLongCenter;
    var veLatLongCenter;
    var originalMap = 'nk';
    var ChangedToRoad = true;
    var mstyle;

    var ImgExt = ".png";

    var btnVN;
    var btnVV;
    var btnBEB;
    var btnTIB;

    this.SetPngIncapablezz = function() {
        ImgExt = ".gif";
    }
    this.DeterminePngCapablezz = function(pngincapable) {
        if (pngincapable)
            this.SetPngIncapable();
    }

    // 22062009 PerK new Method
//    this.GetButtons = function() {
//        if (null == btnVN) {
//            btnVN = document.getElementById('setNorgeskartButton');
//        }
//        if (null == btnVV) {
//            btnVV = document.getElementById('setVerdenskartButton');
//        }

//        if (null == btnBEB) {
//            btnBEB = document.getElementById('setBirdsEyeButton');
//        }
//        if (null == btnTIB) {
//            btnTIB = document.getElementById('toggleTrafikkInfoButton');
//        }
//    }

    // PerK 22062009 - ny Metode
//    this.isBirdsEyeAvail = function() {
//        if (null == btnBEB) {
//            btnBEB = document.getElementById('setBirdsEyeButton');
//        }
//        mapCenter = map.getCenterCoordinate();
//        nkLatLongCenter = map.UTMToLatLon(mapCenter);
//        veLatLongCenter = new VELatLong(nkLatLongCenter.y, nkLatLongCenter.x);
//        nkZoomLevel = map.getZoomLevel();
//        vezoomlevel = 18 - nkZoomLevel;
//        vemap.SetCenterAndZoom(veLatLongCenter, vezoomlevel);
//        if (null != btnBEB) {
//            if (vemap.IsBirdseyeAvailable()) {
//                btnBEB.src = 'images/mnu/sm_Skraafoto' + ImgExt;
//            }
//            else {
//                btnBEB.src = 'images/mnu/sm_SkraafotoD' + ImgExt;
//            }
//        }
//    }

//    this.ZoomIn = function() {
//        if (bVEMap) {
//            vemap.ZoomIn();
//        }
//        else {
//            map.zoomIn();
//        }
//    }

//    this.ZoomOut = function() {
//        if (bVEMap) {
//            vemap.ZoomOut();
//        }
//        else {
//            map.zoomOut();
//        }
//    }

    // PerK 22062009 new Method
//    this.ChangeToVE = function() {

//        atlasman.SetAllMapStyleButtonInActive();

//        if (null == btnVN || null == btnVV || null == btnBEB) {
//            this.GetButtons();
//        }
//        if (null != btnVN) {
//            btnVN.src = 'images/mnu/sm_Norgeskart' + ImgExt;
//        }

//        if (null != btnVV) {
//            btnVV.src = 'images/mnu/sm_VerdenskartA' + ImgExt;
//        }

//        //        if (null == btnBEB) {
//        //            var btnBEB = document.getElementById('setBirdsEyeButton');
//        //        }
//        if (vemap.IsBirdseyeAvailable()) {
//            if (null != btnBEB) {
//                btnBEB.src = 'images/mnu/sm_Skraafoto' + ImgExt; // PerK 22062009 - byttet bilde
//            }
//        }
//        else {
//            if (null != btnBEB) {
//                btnBEB.src = 'images/mnu/sm_SkraafotoD' + ImgExt; // PerK 22062009 - byttet bilde
//            }
//        }

//        vemap.SetMapStyle(VEMapStyle.Shaded);
//        ve.style.visibility = "visible";
//        nk.style.visibility = "hidden";
//        bVEMap = true;
//        originalMap = 've';

//    }

    // 22062009 PerK new Method
//    this.ChangeToNK = function() {
//        atlasman.SetAllMapStyleButtonInActive();
//        this.DisableGPSAndWeather();
//        if (null == btnVN || null == btnVV || null == btnBEB) {
//            this.GetButtons();
//        }

//        if (null != btnVN) {
//            btnVN.src = 'images/mnu/sm_NorgeskartA' + ImgExt;
//        }

//        if (null != btnVV) {
//            btnVV.src = 'images/mnu/sm_Verdenskart' + ImgExt;
//        }

//        //        if (null != btnBEB) {
//        //            btnBEB.src = 'images/mnu/sm_SkraafotoD' + ImgExt; // PerK 22062009 - byttet bilde
//        //        }

//        if (vemap.IsBirdseyeAvailable()) {
//            // PerK 22062009 - Lagt til test
//            if (null != btnBEB) {
//                btnBEB.src = 'images/mnu/sm_Skraafoto' + ImgExt; // PerK 22062009 - byttet bilde
//            }
//        }
//        else {
//            if (null != btnBEB) {
//                btnBEB.src = 'images/mnu/sm_SkraafotoD' + ImgExt; // PerK 22062009 - byttet bilde
//            }
//        }

//        vemap.SetMapStyle(VEMapStyle.Shaded);
//        nk.style.visibility = "visible";
//        ve.style.visibility = "hidden";
//        originalMap = 'nk';
//        bVEMap = false;

//    }


//    this.BirdsEyeOn = function(img) {
//        if (biFlag == false) {
//            return;
//        }
////        if (null == btnBEB) {
////            this.GetButtons();
////        }
//        atlasman.SetMapStyleButtonActive(img, 'images/mnu/sm_SkraafotoA' + ImgExt);
//        this.SetBirdsEyeBtn(1);
//        ChangedToRoad = false;
//        vemap.SetMapStyle(VEMapStyle.BirdseyeHybrid);
//        vemap.SetBirdseyeOrientation(VEOrientation.North);
//        vemap.ShowMiniMap(810, 70);
//        if (originalMap == 'nk') {
//            ve.style.visibility = 'visible';
//            nk.style.visibility = 'hidden';
//            bVEMap = false;
//        }
//        else {
//            bVEMap = true;
//        }
//    }

//    this.BirdsEye = function() {
//        if (biFlag == false) {
//            return;
//        }
//        if (null == btnBEB) {
//            this.GetButtons();
//        }
//        mstyle = vemap.GetMapStyle();
//        //if (ChangeToRoad == false || mstyle == VEMapStyle.BirdseyeHybrid || mstyle == VEMapStyle.Birdeye || mstyle == VEMapStyle.Oblique) {
//        if (ChangedToRoad == false) {
//            var veLatLong = new VELatLong(nkLatLongCenter.y, nkLatLongCenter.x);
//            vemap.SetCenter(veLatLong);
//            vemap.SetMapStyle(VEMapStyle.Shaded);
//            vemap.HideMiniMap();
//            ChangedToRoad = true;
//            this.SetBirdsEyeBtn(0);
//            if (originalMap == 'nk') {
//                ve.style.visibility = 'hidden';
//                nk.style.visibility = 'visible';
//                bVEMap = false;
//            }
//            else {
//                bVEMap = true;
//            }
//        }
//        else {
//            atlasman.SetAllMapStyleButtonInActive();
//            this.SetBirdsEyeBtn(1);
//            ChangedToRoad = false;
//            vemap.SetMapStyle(VEMapStyle.BirdseyeHybrid);
//            vemap.SetBirdseyeOrientation(VEOrientation.North);
//            vemap.ShowMiniMap(810, 70);
//            if (originalMap == 'nk') {
//                ve.style.visibility = 'visible';
//                nk.style.visibility = 'hidden';
//                bVEMap = false;
//            }
//            else {
//                bVEMap = true;
//            }
//        }
//        mstyle = vemap.GetMapStyle();
//    }

//    this.SetBITrue = function() {
//        if (null == btnBEB) {
//            this.GetButtons();
//        }
//        if (null != btnBEB) {
//            btnBEB.src = 'images/mnu/sm_Skraafoto' + ImgExt; // PerK 22062009 - byttet bilde
//        }
//        biFlag = true;
//        return true;
//    }

//    this.SetBIFalse = function() {
//        if (null == btnBEB) {
//            this.GetButtons();
//        }
//        if (ChangedToRoad == false) {
//            if (null != btnBEB) {
//                btnBEB.src = 'images/mnu/sm_SkraafotoD' + ImgExt; // PerK 22062009 - byttet bilde
//            }
//            biFlag = false;
//            //vemap.HideMiniMap();
//            veMiniMapExtender.Hide();
//        }
//        return true;
//    }

//    this.RotateLeft = function() {
//        if (vemap.IsBirdseyeAvailable()) {
//            var be = vemap.GetBirdseyeScene();
//            var orientation = be.GetOrientation();
//            switch (orientation) {
//                case 'North': vemap.SetBirdseyeOrientation(VEOrientation.East);
//                    break;
//                case 'South': vemap.SetBirdseyeOrientation(VEOrientation.West);
//                    break;
//                case 'East': vemap.SetBirdseyeOrientation(VEOrientation.South);
//                    break;
//                default: vemap.SetBirdseyeOrientation(VEOrientation.North);
//                    break;
//            }
//        }
//    }

//    this.RotateRight = function() {
//        if (vemap.IsBirdseyeAvailable()) {
//            var be = vemap.GetBirdseyeScene();
//            var orientation = be.GetOrientation();
//            switch (orientation) {
//                case 'North': vemap.SetBirdseyeOrientation(VEOrientation.West);
//                    break;
//                case 'South': vemap.SetBirdseyeOrientation(VEOrientation.East);
//                    break;
//                case 'East': vemap.SetBirdseyeOrientation(VEOrientation.North);
//                    break;
//                default: vemap.SetBirdseyeOrientation(VEOrientation.South);
//                    break;
//            }
//        }
//    }

//    this.MapStyleChanged = function(e) {
//        return true;
//    }

//    // 22062009 PerK New Method
//    this.SetBirdsEyeBtn = function(status) {
//        if (null == btnBEB) {
//            this.GetButtons();
//        }
//        if (status == 1) {
//            if (null != btnBEB) {
//                if (vemap.IsBirdseyeAvailable()) {
//                    btnBEB.src = 'images/mnu/sm_SkraafotoA' + ImgExt; // PerK 22062009 - byttet bilde
//                }
//                else {
//                    btnBEB.src = 'images/mnu/sm_SkraafotoD' + ImgExt; // PerK 22062009 - byttet bilde
//                }
//            }
//        }
//        else {
//            if (null != btnBEB) {
//                if (vemap.IsBirdseyeAvailable()) {
//                    btnBEB.src = 'images/mnu/sm_Skraafoto' + ImgExt; // PerK 22062009 - byttet bilde
//                }
//                else {
//                    btnBEB.src = 'images/mnu/sm_SkraafotoD' + ImgExt; // PerK 22062009 - byttet bilde
//                }
//            }
//        }
//    }

//    this.DisableGPSAndWeather = function() {
//        if (gpsManager) {
//            gpsManager.disableGps();
//        }
//        this.disableWeather();
//    }

//    this.DisposeMap = function() {
//        if (vemap != null) {
//            vemap.Dispose();
//        }
//    }

}


