﻿function AtlasTrafikkInfo() {
    var tiEnabled = false;
    this.tiDisabledCallback;
    this.SetPngIncapable = function() {
        pngincapable = true;
    }
    this.DeterminePngCapable = function(pngincapable) {
        if (pngincapable)
            this.SetPngIncapable();
    }
    this.showTI = function(map) {
        rssHandler = new RSSHandler(map);
       rssHandler.loadGeoRSS('P4TrafikkInfo/P4TrafficInfo.xml');
    }
    this.disableTI = function () {
        if (this.tiDisabledCallback)
            this.tiDisabledCallback();
        var p4Logo = $get('norkartmap1_p4TrafficLogo')
        if (p4Logo != null) {
            p4Logo.style.display = "none";
        }
        //map.clearAnnotations(); // endret 1.12.10 (MH), fjernet også markør for visittkort (nålen) m.m.
        map.removeAnnotationGroup('p4-traffic-group');
        tiEnabled = false;
    }
    this.tiIsEnabled = function() {
        return tiEnabled;
    }
    this.enableTI = function (disableCallback) {
        var p4Logo = $get('norkartmap1_p4TrafficLogo')
        if (p4Logo != null) {
            p4Logo.style.display = "block";
        }
        if (!tiEnabled) {
            this.tiDisabledCallback = disableCallback;
            tiEnabled = true;
        }
    }
   
}


