(function ($, Drupal, drupalSettings) {

  'use strict';

  Drupal.behaviors.panoMapsNetwork = {
    attach: function (context, drupalSettings) {
      once('embedNetworkMap', 'html', context).forEach( function () {
        var modulePath = drupalSettings.pano_maps.path;
  
        embedpano(
          {
            swf: '/' +
              modulePath + '/pano-swf/network/network-map-aga.swf',
            xml: '/' +
              modulePath + '/pano-swf/network/network-map-aga.xml',
            target: 'pano-canvas',
            html5: 'prefer+css3d',
            passQueryParameters: true
          }
        );
      });
    }
  };
})(jQuery, Drupal, drupalSettings);
