<?xml version="1.0" encoding="UTF-8"?>
<krpano version="1.19-pr16">

<!-- ********* -->
<!-- Gyroscope -->
<!-- ********* -->


<plugin name="gyroscope"
        url="%FIRSTXML%/graphics/gyro2.js"
        keep="true"
        devices="no-desktop.and.html5"

        onunavailable="checkGyroUnavailable();"
        sensor_mode="1"
        friction="auto"
        autocalibration="true"
        touch_mode="full"
        onavailable="delayedcall(1, checkGyroAvailability(););"
        enabled="false"
        activated="false"
        />

<events name="gyroscopeEvents" onnewpano="planarGyroscopeTest();" keep="true" />

<action name="planarGyroscopeTest">
  if(plugin[gyroscope],
    if(scene[get(xml.scene)].full360,
      set(sceneisfull360, false);
      sub(viewhfov, panoview.hmax, panoview.hmin);
      if (viewhfov == 360,
        sub(viewvfov, panoview.vmax, panoview.vmin);
        if (viewvfov == 180,
          set(sceneisfull360, true);
        );
      );
      if (sceneisfull360,
        set(plugin[gyroscope].camroll, true);
      ,
        set(plugin[gyroscope].camroll, false);
      );
    ,
      set(plugin[gyroscope].camroll, false);
    );
  );
</action>

<action name="changeGyroscopeState">
  if(plugin[gyroscope],
    if (plugin[gyroscope].isavailable,
      if(%1,
        set(plugin[gyroscope].activated,true);
      ,
        set(plugin[gyroscope].activated,false);
      );
      if (%1 != plugin[gyroscope].enabled,
        if(plugin[gyroscope].activated,
          switch(plugin[gyroscope].enabled);
        ,
          set(plugin[gyroscope].enabled, false);
        );
        if (plugin[gyroscope].enabled, events.dispatch(ongyroscopeon);, events.dispatch(ongyroscopeoff););
      );
    );
  );
</action>

<action name="checkGyroAvailability">
  if(plugin[gyroscope],
    if (plugin[gyroscope].isavailable,
      
      set(sceneisfull360, false);
      if (scene[get(xml.scene)].full360,
        sub(viewhfov, panoview.hmax, panoview.hmin);
        if (viewhfov == 360,
          sub(viewvfov, panoview.vmax, panoview.vmin);
          if (viewvfov == 180,
            set(sceneisfull360, true);
          );
        );
      );
      set(delaythegyrocheck, false);
      if (sceneisfull360 AND tour_firstlittleplanet, set(delaythegyrocheck, true));

      ifnot(delaythegyrocheck,
        switch(plugin[gyroscope].enabled);
        set(plugin[gyroscope].activated,true);
        set(tour_gyroscopedevices, true);
        events.dispatch(ongyroscopeavailable);
      ,
        delayedcall(1, checkGyroAvailability(););
      );
    ,
      set(tour_gyroscopedevices, false);
    );
    if (plugin[gyroscope].enabled, events.dispatch(ongyroscopeon);, events.dispatch(ongyroscopeoff););
  ,
    checkGyroUnavailable();
  );
</action>

<action name="checkGyroUnavailable">
  set(plugin[gyroscope].activated, false);
  set(plugin[gyroscope].enabled, false);
  set(tour_gyroscopedevices, false);
  events.dispatch(ongyroscopeunavailable);
</action>

<!-- ********** -->
<!-- Logo -->
<!-- id : logo -->
<!-- ********** -->


  <layer align="top"
         x="10"
         y="10"
         zorder="2"
         name="logo"
         keep="true"
         visible="false"
         capture="false"

			tooltip="logotooltipText"
			onhover="showTooltip('plugin');"
			onout="hideTooltip();"
         url="%FIRSTXML%/graphics/logo/logo.png" 
         handcursor="false"


         />

  <events name="logoevents" 
    onTourStart="showlogo();"
    keep="true" />

  <action name="hidelogo">
    set(layer[logo].visible, false);
  </action>
  <action name="showlogo">
      set(layer[logo].visible, true);
  </action>





<!-- ********** -->
<!-- İçerik menüsü -->
<!-- id : contextmenu -->
<!-- ********** -->
  <contextmenu fullscreen="false" versioninfo="false" touch="true">
    <item name="author" onclick="getmessage(urltoopen,project_author_url);openurl(get(urltoopen),_blank);" />
    <item name="website1"  />
    <item name="website2"  />
    <item name="fullscreenentry" onclick="enterFullscreen();
" separator="true"/>
    <item name="vrmodeentry" onclick="if(scene[get(xml.scene)].full360 AND disableCurrentSceneVrConservation !== true,
    js(accessWebVr(get(xml.scene),get(videoscenestarttime)));
,
    js(accessWebVr(null));
);" />
  </contextmenu>

  <events name="contextmenuevents" keep="true" 
    onenterfullscreen="updateContextMenu" onexitfullscreen="updateContextMenu" 
    onxmlcomplete="updateContextMenu" 
    changetourlanguage="updateContextMenu" 
    />
  <events name="contextmenuvrevents" keep="true" 
    onvravailable="updateContextMenu();" onvrunavailable="updateContextMenu();"
    devices="html5"
    />
  <action name="updateContextMenu">
    getmessage(contextmenu.item[author].caption, project_author_name);
    getmessage(contextmenu.item[website1].caption, contextmenuopenwebsitelabel1);
    getmessage(contextmenu.item[website2].caption, contextmenuopenwebsitelabel2);
    if (device.fullscreensupport,
      if(tour_fullscreen,
        getmessage(contextmenu.item[fullscreenentry].caption, contextmenucloseFsLabel);
        set(contextmenu.item[fullscreenentry].onclick, exitFullscreen();
);
       ,
        getmessage(contextmenu.item[fullscreenentry].caption, contextmenuopenFsLabel);
        set(contextmenu.item[fullscreenentry].onclick, enterFullscreen();
);
      );
     ,
      set(contextmenu.item[fullscreenentry].visible, false);
    );
    if (device.html5 AND tour_vrdevices,
      getmessage(contextmenu.item[vrmodeentry].caption, contextmenuopenVrLabel);
      set(contextmenu.item[vrmodeentry].onclick, if(scene[get(xml.scene)].full360 AND disableCurrentSceneVrConservation !== true,
    js(accessWebVr(get(xml.scene),get(videoscenestarttime)));
,
    js(accessWebVr(null));
););
     ,
      set(contextmenu.item[vrmodeentry].visible, false);
    );
  </action>

<!-- ********** -->
<!-- Panorama listeli kutusu -->
<!-- id : panoramacombobox -->
<!-- ********** -->

  <!-- path to the scrollarea plugin -->
  <panoramacombobox_kr_scrollareaplugin
    url.html5="%FIRSTXML%/graphics/scrollarea.js"
    url.flash="%FIRSTXML%/graphics/scrollarea.swf"
    />

  <!-- core internal layer styles -->
  <style name="panoramacombobox_kr_container_style" type="container" maskchildren="true" bgcapture="true" visible="false" onclick="panoramacombobox_kr_onclick_event();" mergedalpha="false" alpha="1.0" />
  <style name="panoramacombobox_kr_marker_style" type="text" align="righttop" edge="center" html="▼" havemarkersize="false" onautosized="set(havemarkersize,true);" mergedalpha="false" alpha="1.0" />
  <style name="panoramacombobox_kr_item_style"  type="text" wordwrap="false" vcenter="true" align="lefttop" onover="if(!combbox_item_pressed,onoveritem());asyncloop(hovering,,if(!combbox_item_pressed,onoutitem()));" ondown="onoveritem(); set(combbox_item_pressed,true);" onup="onoutitem(); set(combbox_item_pressed,false);" onoveritem="set(bg,true);" onoutitem="set(bg,false);" mergedalpha="false" alpha="1.0" />

  <panoramacombobox_kr_design name="glas" margin="2" open_close_speed="0.25">
    <style name="panoramacombobox_kr_container_style" bgcolor="0xEEEEEE" bgalpha="0.5" bgborder="1 0x333333 0.5" bgroundedge="5" bgshadow="0 4 10 0x000000 0.3" height="50" />
    <style name="panoramacombobox_kr_marker_style" css="color:#222222;" alpha="0.7" bg="false" txtshadow="" />
    <style name="panoramacombobox_kr_item_style" css="color:#222222;" padding="4" bg="false" bgborder="1 0x333333 0.0" bgcolor="0xFFFFFF" bgalpha="1" bgroundedge="3" txtshadow="0 0 4 0xFFFFFF 1" onoveritem="set(bg,true); set(bgborder, '1 0x333333 0.5');" onoutitem="set(bg,false); set(bgborder, '1 0x333333 0.0');" />
  </panoramacombobox_kr_design>

  <!-- internal events -->
  <events name="panoramacombobox_kr_xml_plugin_events" keep="true"
    onxmlcomplete="panoramacombobox_kr_parse_xml_elements();"
    onresize="panoramacombobox_kr_closelist();"
    />

  <!-- krpano version check -->
  <action name="panoramacombobox_kr_versioncheck" autorun="preinit">
    if(build LT '2017-09-13',
      error('combobox.xml - too old krpano version!');
      set(events[panoramacombobox_kr_xml_plugin_events].name, null);
      set(action[panoramacombobox_kr_addComboboxLayer].content, '');
      set(action[panoramacombobox_kr_removeComboboxLayer].content, '');
    );
  </action>

  <action name="panoramacombobox_kr_parse_xml_elements" scope="local">
        copy(cb, combobox["panoramacombobox"]);
        if(cb AND cb.name AND cb.parsed != true,
          set(cb.parsed, true);
          panoramacombobox_kr_addComboboxLayer(get(cb.name), get(cb.design));
          copy(ly, layer[get(cb.name)]);
          copyattributes(get(ly), get(cb));
          set(ly.keep, true);
          def(item_cnt, integer, get(cb.item.count));
          if(item_cnt GT 0,
            def(item_i, integer, 0);
            loop(item_i LT  item_cnt,
              panoramacombobox_kr_additem(get(ly.name), get(cb.item[get(item_i)].name), get(cb.item[get(item_i)].caption), get(cb.item[get(item_i)].onclick));
              inc(item_i);
            );
          );
        );
  </action>

  <!-- dynamically add a combobox layer -->
  <action name="panoramacombobox_kr_addComboboxLayer" scope="local" args="cbname, design">
    <!-- create the layer -->
    addlayer(get(cbname));
    copy(cb, layer[get(cbname)]);
    set(cb.keep, true);

    <!-- copy the design settings (or set defaults) -->
    if(!panoramacombobox_kr_design[get(design)].name, set(design,'default'));
    copy(cb.cbdesign, panoramacombobox_kr_design[get(design)]);
    calc(cb.margin, cb.cbdesign.margin !== null ? cb.cbdesign.margin : 2);
    calc(cb.open_close_speed, cb.cbdesign.open_close_speed !== null ? cb.cbdesign.open_close_speed : 0.25);
    <!-- load the styles and copy the design style settings -->
    cb.loadstyle(panoramacombobox_kr_container_style);
    copyattributes(get(cb), get(cb.cbdesign.style[panoramacombobox_kr_container_style]));

    <!-- add/build/map actions -->
    calc(cb.addItem,          'panoramacombobox_kr_additem(' + cbname + ', null, "%%1", "%%2");');
    calc(cb.addNamedItem,     'panoramacombobox_kr_additem(' + cbname + ', "%%1", "%%2", "%%3");');
    calc(cb.addIdItem,        'panoramacombobox_kr_additem(' + cbname + ', "%%1", "%%2", "%%3");');
    calc(cb.selectItem,       'panoramacombobox_kr_finditem(' + cbname + ', "%%1", __cb_fi); if(__cb_fi GE 0, panoramacombobox_kr_selectitem(' + cbname + ', get(__cb_fi))); delete(__cb_fi);');
    calc(cb.selectItemByName, 'panoramacombobox_kr_selectitem(' + cbname + ', "%%1");');
    calc(cb.selectIdItem,     'panoramacombobox_kr_selectitem(' + cbname + ', "%%1");');
    calc(cb.removeAll,        'panoramacombobox_kr_removeitems(' + cbname + ');');
    calc(cb.openList,         'panoramacombobox_kr_openlist(' + cbname + ');');
    calc(cb.closeList,        'panoramacombobox_kr_closelist(' + cbname + ');');

    <!-- create sub-layers -->
    def(saname, string, 'panoramacombobox_kr_%1_scrollarea');
    addlayer(get(saname));
    copy(sa, layer[get(saname)]);
    copy(sa.parent, cbname);
    copy(sa.url, panoramacombobox_kr_scrollareaplugin.url);
    copy(sa.keep, true);
    copy(sa.align, lefttop);
    set(sa.direction, v);
    set(sa.enabled, false);
    set(sa.width, 100%);
    set(sa.height, 100%);
    copy(cb.scrollarea, sa);

    def(mkname, string, 'panoramacombobox_kr_%1_marker');
    addlayer(get(mkname));
    copy(mk, layer[get(mkname)]);
    copy(mk.parent, saname);
    copy(mk.keep, true);
    mk.loadstyle(panoramacombobox_kr_marker_style);
    copyattributes(get(mk), get(cb.cbdesign.style[panoramacombobox_kr_marker_style]));
    copy(cb.marker, mk);

    <!-- item data array -->
    cb.createarray('item');

    <!-- item autosizing information -->
    set(cb.autosize_i, 0);
    set(cb.autosize_cnt, 0);
    set(cb.autosize_max_w, 0);
    set(cb.autosize_max_h, 0);

    set(cb.lastselecteditemindex, 0);
    set(cb.selecteditemindex, 0);
  </action>


  <!-- dynamically remove a combobox element -->
  <action name="panoramacombobox_kr_removeComboboxLayer" scope="local" args="cbname">
    if(layer[get(cbname)],
      copy(cb, layer[get(cbname)]);
      if(cb === global.openedcombobox, delete(global.openedcombobox));
      if(cb,
        removelayer(get(cbname), true);
      );
    );
  </action>


  <!-- default onclick event for combobox elements: open the list -->
  <action name="panoramacombobox_kr_onclick_event">
    panoramacombobox_kr_openlist(get(name));
  </action>


  <!-- dynamically add items -->
  <action name="panoramacombobox_kr_additem" scope="local" args="cbname, itemname, itemcaption, itemonclick">
    copy(cb, layer[get(cbname)]);

    <!-- when no item name is set, generate an automatic one -->
    if(itemname === null, calc(itemname, 'autoname_' + cb.item.count); );

    <!-- save the item caption and onclick event -->
    copy(cb.item[get(itemname)].caption, itemcaption);
    copy(cb.item[get(itemname)].onclick, itemonclick);

    inc(cb.autosize_cnt);

    <!-- create the item layer/textfield -->
    calc(itemlayername, 'comboboxitem_' + cbname + '_' + itemname);
    addlayer(get(itemlayername));
    copy(li, layer[get(itemlayername)]);



    li.loadstyle(panoramacombobox_kr_item_style);
    copyattributes(get(li), get(cb.cbdesign.style[panoramacombobox_kr_item_style]));




    copy(li.parent, cb.scrollarea.name);
    copy(li.keep, true);
    copy(li.cblayername, cb.name);
    copy(li.itemname, itemname);
    copy(li.html, itemcaption);
    set(li.onautosized, delayedcall(0,panoramacombobox_kr_item_autosize_update()) );
    set(li.onclick, panoramacombobox_kr_item_onclick() );

    copy(cb.item[get(itemname)].itemlayername, itemlayername);
  </action>


  <!-- onautosized callback from the item textfield -->
  <action name="panoramacombobox_kr_item_autosize_update" scope="local">
    copy(cb, layer[get(caller.cblayername)]);
    inc(cb.autosize_i);
    Math.max(cb.autosize_max_w, caller.width);
    Math.max(cb.autosize_max_h, caller.height);
    if(cb.autosize_i == cb.autosize_cnt, panoramacombobox_kr_align_items(get(cb.name)); );
  </action>


  <!-- align the image and set the combobox size -->
  <action name="panoramacombobox_kr_align_items" scope="local" args="cbname">
    copy(cb, layer[get(cbname)]);
    if(cb.marker.havemarkersize == false OR cb.scrollarea.loaded == false,
      <!-- wait until everything is ready -->
      delayedcall(calc(cb.name + '_waitformarkersize'), 0.01, panoramacombobox_kr_align_items(get(cbname)) );
      ,
      <!-- set the item positions and the combobox size -->
      if(global.openedcombobox === cb, panoramacombobox_kr_closelist() );
      copy(sa, cb.scrollarea);
      calc(itemwidth, cb.margin GT 0 ? -2 * cb.margin : '100%');
      copy(mk_w, cb.marker.width);
      copy(item_cnt, cb.autosize_cnt);

      for(def(item_i, integer, 0), item_i LT item_cnt, inc(item_i),
        copy(li, layer[get(cb.item[get(item_i)].itemlayername)]);
        set(li.x, get(cb.margin));
        copy(li.width, itemwidth);
        copy(li.height, cb.autosize_max_h);
        calc(li.y, cb.margin + item_i * (cb.autosize_max_h + cb.margin));
      );

      if(cb.width == null OR cb.width == cb.lastautosizedwidth,
        <!-- no combobox width (or an autosized width) set - set the largest item width -->
        calc(cb.width, cb.margin + cb.autosize_max_w + 2 + mk_w + cb.margin);
        copy(cb.lastautosizedwidth, cb.width);
      );

      calc(cb.height, 2*cb.margin + cb.autosize_max_h);
      calc(sa.height, cb.margin + item_cnt*(cb.margin+cb.autosize_max_h));
      calc(sa.y, -(cb.selecteditemindex * (cb.autosize_max_h + cb.margin)));
      calc(cb.marker.x, cb.margin + mk_w/2);
      tween(layer[get(cb.name)].marker.y, calc(cb.margin + cb.selecteditemindex*(cb.autosize_max_h + cb.margin) + cb.autosize_max_h/2), 0.1);
    );
  </action>


  <!-- default onclick event for items: select the current item, close the list and call the item onclick event -->
  <action name="panoramacombobox_kr_item_onclick" scope="local">
    copy(cb, layer[get(caller.cblayername)]);
    copy(itemname, caller.itemname);
    panoramacombobox_kr_selectitem(get(cb.name), get(itemname));

    if(global.openedcombobox === cb, panoramacombobox_kr_closelist() );

    if(cb.item[get(itemname)].onclick,
      <!-- call the onclick event after the combobox has closed -->
      delayedcall(get(cb.open_close_speed),
        copy(cb.curitem, cb.item[get(itemname)]);
        callwith(cb,
          cb.item[get(itemname)].onclick();
        );
      );
    );
  </action>


  <!-- select an item -->
  <action name="panoramacombobox_kr_selectitem" scope="local" args="cbname, itemname">
    if(global.combbox_item_pressed != true,
      copy(cb, layer[get(cbname)]);
      copy(cb.lastselecteditemindex, cb.selecteditemindex);
      copy(cb.selecteditemindex, cb.item[get(itemname)].index);
      <!-- call onchange event on selection change -->
      if(cb.lastselecteditemindex != cb.selecteditemindex AND cb.onchange,
        callwith(cb, onchange() );
      );
      if(global.openedcombobox === cb,
        <!-- when opened, just close to the selected item -->
        panoramacombobox_kr_closelist();
        ,
        if(layer[get(cbname)].scrollarea.loaded,
          layer[get(cbname)].scrollarea.stopscrolling();
          calc(offset, cb.selecteditemindex*(cb.autosize_max_h + cb.margin));
          tween(layer[get(cbname)].marker.y, calc(cb.margin + offset + cb.autosize_max_h/2), 0);
          tween(layer[get(cbname)].scrollarea.y, calc(-offset), 0, default, layer[get(cbname)].scrollarea.update(); );
        );
      );
    );
  </action>


  <!-- find an item by its caption, the global variable defined in 'returnvariable' will contain the index  -->
  <action name="panoramacombobox_kr_finditem" scope="local" args="cbname, itemcaption, returnvariable">
    copy(cb, layer[get(cbname)]);
    copy(item_cnt, cb.item.count);
    set(calc('global.' + returnvariable), -1);
    for(def(item_i, integer, 0), item_i LT  item_cnt, inc(item_i),
      if(cb.item[get(item_i)].caption == itemcaption,
        copy(calc('global.' + returnvariable), item_i);
        copy(item_i, item_cnt);
      );
    );
  </action>


  <!-- remove all items (to be able to add new ones) -->
  <action name="panoramacombobox_kr_removeitems" scope="local" args="cbname">
    copy(cb, layer[get(cbname)]);
    if(global.openedcombobox === cb, panoramacombobox_kr_closelist() );

    <!-- remove all item layers -->
    calc(item_i, cb.item.count - 1);
    loop(item_i GE 0,
      removelayer(get(cb.item[get(item_i)].itemlayername));
      dec(item_i);
    );

    <!-- reset the item information -->
    set(cb.item.count, 0);
    set(cb.autosize_i,0);
    set(cb.autosize_cnt, 0);
    set(cb.autosize_max_w, 0);
    set(cb.autosize_max_h, 0);
    set(cb.selecteditemindex, 0);
    set(cb.lastselecteditemindex, 0);
    if(cb.width == cb.lastautosizedwidth, set(cb.width, null));
  </action>


  <!-- open the combobox list -->
  <action name="panoramacombobox_kr_openlist" scope="local" args="cbname">
    <!-- if another combobox is already open, close that one first -->
    if(global.openedcombobox !== null, panoramacombobox_kr_closelist() );

    copy(cb, layer[get(cbname)]);
    copy(global.openedcombobox, cb);

    <!-- find the available screen space above or below the combobox -->
    calc(cbheight, 2*cb.margin + cb.autosize_max_h);
    set(lx1, 0);
    set(ly1, 0);
    copy(lx2, cb.pixelwidth);
    copy(ly2, cbheight);
    layertoscreen(get(cbname), lx1,ly1, lx1,ly1);
    layertoscreen(get(cbname), lx2,ly2, lx2,ly2);
    calc(space_above, ly1 - area.pixely);
    calc(space_below, area.pixelheight - (ly2 - area.pixely));

    <!-- the required space for full opening: -->
    calc(openheight, cb.margin + cb.autosize_cnt*(cb.margin+cb.autosize_max_h) );

    <!-- vertical centered alignment? -->
    calc(cb_edge, cb.edge ? cb.edge : cb.align);
    calc(iscentered, cb_edge == 'left' OR cb_edge == 'center' OR cb_edge == 'right');
    if(iscentered,
      calc(openheight_max, space_above + space_below);
      ,
      Math.max(openheight_max, space_above, space_below);
    );

    <!-- limit the height to the available space (minus some margin) -->
    Math.min(openheight, calc(openheight_max + cbheight - 20));

    <!-- need vertical offset? (depending on the available space and the align/edge setting) -->
    set(yoffset, null);
    calc(top_overflow, -ly1 + area.pixely + openheight/2);
    calc(bottom_overflow, ly2 - area.pixely + openheight/2 - area.pixelheight);
    if(cb.parent,
      <!-- no vertical offset inside other layers, do only a height clipping -->
      Math.max(max_overflow, top_overflow, bottom_overflow, 0);
      sub(openheight, max_overflow);
      ,
      if(iscentered,
        if(openheight GE (area.pixelheight - 20),
          set(yoffset,0);
          ,
          if(top_overflow GT 0, calc(yoffset, cb.y + top_overflow); );
          if(bottom_overflow GT 0, calc(yoffset, cb.y - bottom_overflow); );
        );
      ,
        indexoftxt(isbottomalign, get(cb_edge), 'bottom');
        if(space_above GT space_below,
          if(isbottomalign LT 0, calc(yoffset, cb.y - openheight + cbheight); );
          ,
          if(isbottomalign GE 0, calc(yoffset, cb.y - openheight + cbheight); );
        );
      );
    );
    if(yoffset != null,
      copy(cb.ybackup, cb.y);
      tween(layer[get(cbname)].y, calc(yoffset), get(cb.open_close_speed));
    );

    <!-- center the opened list at the selected item -->
    calc(centeritem_y, -1 * (cb.margin + cb.selecteditemindex*(cb.margin+cb.autosize_max_h) + cb.autosize_max_h/2 - openheight/2));
    clamp(centeritem_y, calc(openheight - cb.scrollarea.height), 0);

    <!-- apply the changes now -->
    tween(layer[get(cbname)].height, get(openheight), get(cb.open_close_speed));
    tween(layer[get(cbname)].scrollarea.y, get(centeritem_y), get(cb.open_close_speed), default, layer[get(cbname)].scrollarea.update(); );

    <!-- special html5/flash case:
       rotating textfields (the marker symbol here) are not possible in
       flash (a flashplayer limitation), so use a rotated symbol instead.
    -->
    if(device.html5,
      tween(layer[get(cbname)].marker.rotate, 90, get(cb.open_close_speed));
      ,
      set(layer[get(cbname)].marker.html, '◀');
    );

    <!-- enable the scrollarea to allow the user to drag it -->
    set(cb.scrollarea.enabled, true);

    <!-- install a global onmousedown event to close the list when clicking at the pano -->
    set(events[panoramacombobox_kr_xml_plugin_events].onmousedown, panoramacombobox_kr_closelist() );
  </action>


  <!-- close the current open list -->
  <action name="panoramacombobox_kr_closelist" scope="local">
    if(global.openedcombobox !== null,
      copy(cb, global.openedcombobox);
      delete(global.openedcombobox);

      <!-- clear the global onmousedown event -->
      set(events[panoramacombobox_kr_xml_plugin_events].onmousedown, null);

      <!-- disable the dragging -->
      set(cb.scrollarea.enabled, false);

      <!-- closing animations -->
      calc(offset, cb.selecteditemindex*(cb.autosize_max_h + cb.margin));
      if(cb.ybackup !== null, tween(cb.y, get(cb.ybackup), get(cb.open_close_speed)));
      layer[get(cb.name)].scrollarea.stopscrolling();
      tween(layer[get(cb.name)].height, calc(2*cb.margin + cb.autosize_max_h), get(cb.open_close_speed));
      tween(layer[get(cb.name)].scrollarea.y, calc(-offset), get(cb.open_close_speed), default, layer[get(cb.name)].scrollarea.update(); );
      tween(layer[get(cb.name)].marker.y, calc(cb.margin + offset + cb.autosize_max_h/2), get(cb.open_close_speed));
      <!-- special html5/flash case: rotate marker or change symbol -->
      if(device.html5,
        tween(layer[get(cb.name)].marker.rotate, 0, get(cb.open_close_speed));
        ,
        set(layer[get(cb.name)].marker.html, '▼');
      );
    );
  </action>

  <events name="panoramacomboboxStartTourEvents" onTourStart="set(layer[panoramacombobox].isStarted, true);if(layer[panoramacombobox].isLoaded,panoramacomboboxShow(););" keep="true" />


  <combobox name="panoramacombobox"
    design=""
    keep="true"
    visible="false"
    zorder="4"
    align="bottom"
    x="0" y="50"
    onloaded="panoramacomboboxLoaded();"
    isStarted="false"
    isLoaded="false"
    />

  <action name="panoramacomboboxLoaded">

    layer[panoramacombobox].removeAll();


    panoramacomboboxAddItem(pano2926_title, pano2926, pano2926, false);
    panoramacomboboxAddItem(pano2941_title, pano2941, pano2941, false);
    panoramacomboboxAddItem(pano2942_title, pano2942, pano2942, false);
    panoramacomboboxAddItem(pano2940_title, pano2940, pano2940, false);
    panoramacomboboxAddItem(pano2945_title, pano2945, pano2945, false);
    panoramacomboboxAddItem(pano2943_title, pano2943, pano2943, false);
    panoramacomboboxAddItem(pano2944_title, pano2944, pano2944, false);
    panoramacomboboxAddItem(pano2946_title, pano2946, pano2946, false);
    panoramacomboboxAddItem(pano2949_title, pano2949, pano2949, false);
    panoramacomboboxAddItem(pano2948_title, pano2948, pano2948, false);
    panoramacomboboxAddItem(pano2947_title, pano2947, pano2947, false);
    panoramacomboboxAddItem(pano2938_title, pano2938, pano2938, false);
    panoramacomboboxAddItem(pano2936_title, pano2936, pano2936, false);
    panoramacomboboxAddItem(pano2939_title, pano2939, pano2939, false);
    panoramacomboboxAddItem(pano2924_title, pano2924, pano2924, false);
    panoramacomboboxAddItem(pano2925_title, pano2925, pano2925, false);
    panoramacomboboxAddItem(pano2937_title, pano2937, pano2937, false);
    panoramacomboboxAddItem(pano2935_title, pano2935, pano2935, false);
    panoramacomboboxAddItem(pano2932_title, pano2932, pano2932, false);
    panoramacomboboxAddItem(pano2934_title, pano2934, pano2934, false);
    panoramacomboboxAddItem(pano2931_title, pano2931, pano2931, false);
    panoramacomboboxAddItem(pano2933_title, pano2933, pano2933, false);
    panoramacomboboxAddItem(pano2930_title, pano2930, pano2930, false);
    panoramacomboboxAddItem(pano2929_title, pano2929, pano2929, false);
    panoramacomboboxAddItem(pano2927_title, pano2927, pano2927, false);
    panoramacomboboxAddItem(pano2928_title, pano2928, pano2928, false);
    set(layer[panoramacombobox].isLoaded, true);

    if(layer[panoramacombobox].isStarted,
      panoramacomboboxShow();
    );
  </action>


  <action name="panoramacomboboxAddItem">
    getmessage(caption, %1);

    indexoftxt(found, get(caption), '&amp;');
    if(found GE 0,
      subtxt(part1, get(caption), 0, get(found));
      add(found, 1);
      subtxt(part2, get(caption), get(found), get(caption.length));
      txtadd(caption, get(part1), '&amp;', get(part2));
    );
    if(%4,
      txtadd(title, "&#x00A0;&#x00A0;&#x00A0;", get(caption));
    ,
      set(title, get(caption));
    );

    layer[panoramacombobox].addNamedItem(%2, get(title), mainloadscene(%3));
  </action>

  <action name="panoramacomboboxUpdateLanguage">
    layer[panoramacombobox].closeList();
    layer[panoramacombobox].removeAll();

    panoramacomboboxAddItem(pano2926_title, pano2926, pano2926, false);
    panoramacomboboxAddItem(pano2941_title, pano2941, pano2941, false);
    panoramacomboboxAddItem(pano2942_title, pano2942, pano2942, false);
    panoramacomboboxAddItem(pano2940_title, pano2940, pano2940, false);
    panoramacomboboxAddItem(pano2945_title, pano2945, pano2945, false);
    panoramacomboboxAddItem(pano2943_title, pano2943, pano2943, false);
    panoramacomboboxAddItem(pano2944_title, pano2944, pano2944, false);
    panoramacomboboxAddItem(pano2946_title, pano2946, pano2946, false);
    panoramacomboboxAddItem(pano2949_title, pano2949, pano2949, false);
    panoramacomboboxAddItem(pano2948_title, pano2948, pano2948, false);
    panoramacomboboxAddItem(pano2947_title, pano2947, pano2947, false);
    panoramacomboboxAddItem(pano2938_title, pano2938, pano2938, false);
    panoramacomboboxAddItem(pano2936_title, pano2936, pano2936, false);
    panoramacomboboxAddItem(pano2939_title, pano2939, pano2939, false);
    panoramacomboboxAddItem(pano2924_title, pano2924, pano2924, false);
    panoramacomboboxAddItem(pano2925_title, pano2925, pano2925, false);
    panoramacomboboxAddItem(pano2937_title, pano2937, pano2937, false);
    panoramacomboboxAddItem(pano2935_title, pano2935, pano2935, false);
    panoramacomboboxAddItem(pano2932_title, pano2932, pano2932, false);
    panoramacomboboxAddItem(pano2934_title, pano2934, pano2934, false);
    panoramacomboboxAddItem(pano2931_title, pano2931, pano2931, false);
    panoramacomboboxAddItem(pano2933_title, pano2933, pano2933, false);
    panoramacomboboxAddItem(pano2930_title, pano2930, pano2930, false);
    panoramacomboboxAddItem(pano2929_title, pano2929, pano2929, false);
    panoramacomboboxAddItem(pano2927_title, pano2927, pano2927, false);
    panoramacomboboxAddItem(pano2928_title, pano2928, pano2928, false);

    panoramacomboboxUpdateList();
  </action>

  <events name="panoramacomboboxEvents"
    hidetourcontrols="panoramacomboboxHide();"
    showtourcontrols="panoramacomboboxShow();"
    onnewpano="panoramacomboboxOnPanorama();"
    changetourlanguage="panoramacomboboxUpdateLanguage();"
    keep="true"
    />

  <action name="panoramacomboboxHide">
    set(layer[panoramacombobox].visible, false);
  </action>

  <action name="panoramacomboboxShow">
  if(layer[panoramacombobox].isLoaded,
    if (layer[panoramacombobox].item.count GT 0,
      set(layer[panoramacombobox].visible, true);
    ,
      set(layer[panoramacombobox].visible, false);
    );
  ,
    set(layer[panoramacombobox].visible, false);
  );
  </action>

  <action name="panoramacomboboxOnPanorama">
    if(layer[panoramacombobox].isLoaded,
      panoramacomboboxUpdateList();
    ,
      delayedcall(0.2, panoramacomboboxOnPanorama);
    );
  </action>

  <action name="panoramacomboboxUpdateList">
    set(itemtoselect, get(scene[get(xml.scene)].name));
    layer[panoramacombobox].selectItemByName(get(itemtoselect));
  </action>

  <action name="panoramacomboboxOpenComboboxList">
    layer[panoramacombobox].openList();
  </action>

  <action name="panoramacomboboxCloseComboboxList">
    layer[panoramacombobox].closeList();
  </action>

<!-- ********** -->
<!-- Circles Control Bar -->
<!-- id : CirclesControlBar -->
<!-- ********** -->

  <krpano CirclesControlBarbarbuilt="false" CirclesControlBarbackgroundwidthwhenclosed="0" CirclesControlBarbackgroundwidthwhenopened="0" CirclesControlBarIsOpened="false" />
  <events name="CirclesControlBarevents" 
    onxmlcomplete="CirclesControlBarbuildMenuBar();" 


    keep="true" />



  <action name="CirclesControlBarbuildMenuBar">
    ifnot (CirclesControlBarbarbuilt, CirclesControlBarbuildMenu(); set(CirclesControlBarbarbuilt, true););
  </action>

  <style name="CirclesControlBar_btn_style"
         keep="true"
         edge="right"
         align="right"
         x="0" y="0"
         width="40" height="40"
         crop="0|0|60|60"
         onovercrop="0|60|60|60"
         ondowncrop="0|120|60|60"
         />
  <style name="CirclesControlBar_btn_style_off"
         keep="true"
         edge="right"
         align="right"
         x="0" y="0"
         width="40" height="40"
         />

  <layer name="CirclesControlBar_menu_bg"
         keep="true"
         type="container"
         zorder="5"
         width="40"
         height="40"
         align="bottom"
         x="0" y="10"
         maskchildren="true"
         rotate="0"
         visible="false"
         >


    <layer name="CirclesControlBarbtn_left"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_move_left.png"
            ondown="viewControlMoveLeft(false);
"
            onup="viewControlMoveHoriStop();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            devices="desktop"
            />
    <layer name="CirclesControlBarbtn_right"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_move_right.png"
            ondown="viewControlMoveRight(false);
"
            onup="viewControlMoveHoriStop();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            devices="desktop"
            />

    <layer name="CirclesControlBarbtn_up"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_move_up.png"
            ondown="viewControlMoveUp(false);
"
            onup="viewControlMoveVertStop();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            devices="desktop"
            />
    <layer name="CirclesControlBarbtn_down"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_move_down.png"
            ondown="viewControlMoveDown(false);
"
            onup="viewControlMoveVertStop();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            devices="desktop"
            />



    <layer name="CirclesControlBarbtn_prev_pano"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_previous_scene.png"
            onclick="loadPreviousScene();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            />
    <layer name="CirclesControlBarbtn_next_pano"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_next_scene.png"
            onclick="loadNextScene();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            />



    <layer name="CirclesControlBarbtn_openfs"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_enter_fs.png"
            onclick="enterFullscreen();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            devices="fullscreensupport"
            />
    <layer name="CirclesControlBarbtn_closefs"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_close_fs.png"
            onclick="exitFullscreen();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            devices="fullscreensupport"
            />

    <layer name="CirclesControlBarbtn_autorotate_on"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_start_autorotation.png"
            onclick="resumeautorotation();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            />
    <layer name="CirclesControlBarbtn_autorotate_off"
            url="%FIRSTXML%/graphics/circlescontrolbar/btn_stop_autorotation.png"
            onclick="pauseautorotation();
"
            style="CirclesControlBar_btn_style"
            visible="false"
            />





    <layer name="CirclesControlBarbtn_hidecontrols"
           url="%FIRSTXML%/graphics/circlescontrolbar/btn_hide_controls.png"
           style="CirclesControlBar_btn_style"
           onclick="CirclesControlBarhideMenuControls();hideTourControls();
"
           visible="false"
           />
    <layer name="CirclesControlBarbtn_showcontrols"
           url="%FIRSTXML%/graphics/circlescontrolbar/btn_show_controls.png"
           style="CirclesControlBar_btn_style"
           onclick="CirclesControlBarshowMenuControls();showTourControls();
"
           visible="false"
           />
 </layer>






  <action name="CirclesControlBarhideMenuControls">
    set(CirclesControlBarIsOpened, false);
    set(layer[CirclesControlBarbtn_hidecontrols].visible, false);
    set(layer[CirclesControlBarbtn_showcontrols].visible, true);
if (scene.count GT 1,
	set(layer[CirclesControlBarbtn_next_pano].visible, false);
	set(layer[CirclesControlBarbtn_prev_pano].visible, false);
);


if (device.desktop,
	set(layer[CirclesControlBarbtn_up].visible, false);
	set(layer[CirclesControlBarbtn_down].visible, false);
);
if (device.desktop,
	set(layer[CirclesControlBarbtn_left].visible, false);
	set(layer[CirclesControlBarbtn_right].visible, false);
);
	CirclesControlBarupdateFullscreenButtons();


	CirclesControlBarupdateAutorotationButtons();






	set(layer[CirclesControlBar_menu_bg].width, get(CirclesControlBarbackgroundwidthwhenclosed));

	set(layer[CirclesControlBar_menu_bg].visible, true);
  </action>
  <action name="CirclesControlBarshowMenuControls">
    set(CirclesControlBarIsOpened, true);
    set(layer[CirclesControlBarbtn_hidecontrols].visible, true);
    set(layer[CirclesControlBarbtn_showcontrols].visible, false);
	set(layer[CirclesControlBar_menu_bg].visible, true);
if (scene.count GT 1,
	set(layer[CirclesControlBarbtn_next_pano].visible, true);
	set(layer[CirclesControlBarbtn_prev_pano].visible, true);
);


if (device.desktop,
	set(layer[CirclesControlBarbtn_up].visible, true);
	set(layer[CirclesControlBarbtn_down].visible, true);
);
if (device.desktop,
	set(layer[CirclesControlBarbtn_left].visible, true);
	set(layer[CirclesControlBarbtn_right].visible, true);
);
	CirclesControlBarupdateFullscreenButtons();


	CirclesControlBarupdateAutorotationButtons();





    set(layer[CirclesControlBar_menu_bg].width, get(CirclesControlBarbackgroundwidthwhenopened));
  </action>




  <events name="CirclesControlBarmenufullscreenchangeevent"
          onenterfullscreen="CirclesControlBarupdateFullscreenButtons();"
          onexitfullscreen="CirclesControlBarupdateFullscreenButtons();"
          keep="true"/>
	<action name="CirclesControlBarHideFullscreenButtons">
		set(layer[CirclesControlBarbtn_openfs].visible , false);
		set(layer[CirclesControlBarbtn_closefs].visible, false);
	</action>
	<action name="CirclesControlBarShowFullscreenButtons">
		if (device.fullscreensupport,
			if(tour_fullscreen,
				set(layer[CirclesControlBarbtn_openfs].visible , false);
				set(layer[CirclesControlBarbtn_closefs].visible, true);
			,
				set(layer[CirclesControlBarbtn_openfs].visible ,true);
				set(layer[CirclesControlBarbtn_closefs].visible,false);
			);
		,
			CirclesControlBarHideFullscreenButtons();
		);
	</action>
	<action name="CirclesControlBarupdateFullscreenButtons">
		if (CirclesControlBarIsOpened,
			CirclesControlBarShowFullscreenButtons();
		,
			CirclesControlBarHideFullscreenButtons();
		);
	</action>

	<events name="CirclesControlBarAutorotationEvents"
		onstartautorotation="CirclesControlBarupdateAutorotationButtons();"
		onresumeautorotation="CirclesControlBarupdateAutorotationButtons();"
		onstopautorotation="CirclesControlBarupdateAutorotationButtons();"
		onpauseautorotation="CirclesControlBarupdateAutorotationButtons();"
		keep="true"/>
	<action name="CirclesControlBarHideAutorotationButtons">
		set(layer[CirclesControlBarbtn_autorotate_off].visible, false);
		set(layer[CirclesControlBarbtn_autorotate_on].visible , false);
	</action>
	<action name="CirclesControlBarShowAutorotationButtons">
		if(autorotate.enabled == false,
			set(layer[CirclesControlBarbtn_autorotate_off].visible, false);
			set(layer[CirclesControlBarbtn_autorotate_on].visible , true);
		,
			set(layer[CirclesControlBarbtn_autorotate_off].visible, true);
			set(layer[CirclesControlBarbtn_autorotate_on].visible , false);
		);
	</action>
	<action name="CirclesControlBarupdateAutorotationButtons">
		if (CirclesControlBarIsOpened,
			CirclesControlBarShowAutorotationButtons();
		,
			CirclesControlBarHideAutorotationButtons();
		);
	</action>



  <action name="CirclesControlBarbuildMenu">
    
    set(CirclesControlBarbutton_pos, 0);

	set(CirclesControlBarbackgroundwidthwhenclosed, 40);
    set(layer[CirclesControlBarbtn_hidecontrols].x, get(CirclesControlBarbutton_pos));
    set(layer[CirclesControlBarbtn_showcontrols].x, get(CirclesControlBarbutton_pos));
    inc(CirclesControlBarbutton_pos, 45);



      if (device.fullscreensupport,
        set(layer[CirclesControlBarbtn_openfs].x , get(CirclesControlBarbutton_pos));
        set(layer[CirclesControlBarbtn_closefs].x, get(CirclesControlBarbutton_pos));
        inc(CirclesControlBarbutton_pos, 45);
      );



      set(layer[CirclesControlBarbtn_autorotate_on].x , get(CirclesControlBarbutton_pos));
      set(layer[CirclesControlBarbtn_autorotate_off].x, get(CirclesControlBarbutton_pos));
      inc(CirclesControlBarbutton_pos, 45);







      if (device.desktop,
        set(layer[CirclesControlBarbtn_right].x, get(CirclesControlBarbutton_pos));
        inc(CirclesControlBarbutton_pos, 45);
        set(layer[CirclesControlBarbtn_left].x, get(CirclesControlBarbutton_pos));
        inc(CirclesControlBarbutton_pos, 45);
      );

      if (device.desktop,
        set(layer[CirclesControlBarbtn_down].x, get(CirclesControlBarbutton_pos));
        inc(CirclesControlBarbutton_pos, 45);
        set(layer[CirclesControlBarbtn_up].x, get(CirclesControlBarbutton_pos));
        inc(CirclesControlBarbutton_pos, 45);
      );

    if (scene.count GT 1,
        set(layer[CirclesControlBarbtn_next_pano].x, get(CirclesControlBarbutton_pos));
        inc(CirclesControlBarbutton_pos, 45);
        set(layer[CirclesControlBarbtn_prev_pano].x, get(CirclesControlBarbutton_pos));
        inc(CirclesControlBarbutton_pos, 45);
      );



      dec(CirclesControlBarbutton_pos, 5);

      set(CirclesControlBarbackgroundwidthwhenopened, get(CirclesControlBarbutton_pos));


    
      set(layer[CirclesControlBar_menu_bg].width, get(CirclesControlBarbackgroundwidthwhenopened));
	
	
	
    </action>

	<events name="CirclesControlBarStartTourEvents" onTourStart="CirclesControlBarCallOnStartTour();" keep="true" />
	
	<action name="CirclesControlBarCallOnStartTour">
		
		CirclesControlBarshowMenuControls();
	</action>



	<!-- WebVR plugin for VR availability tests -->

	<plugin name="ptpvrmode" devices="html5" keep="true"
		url="%FIRSTXML%/graphics/webvr.js"
		mobilevr_support="true"
		mobilevr_fake_support="false"
		vr_cursor=""
		vr_cursor_enabled="false"
		onavailable="delayedcall(1, checkVrAvailability(););"
		onunavailable="checkVrUnavailable();"
		/>
	<action name="checkVrAvailability">
		if(plugin[ptpvrmode],
			if (plugin[ptpvrmode].isavailable,
				set(tour_vrdevices, true);
				events.dispatch(onvravailable);
			,
				set(tour_vrdevices, false);
			);
		,
			checkVrUnavailable();
		);
	</action>
	<action name="checkVrUnavailable">
		set(tour_vrdevices, false);
		events.dispatch(onvrunavailable);
	</action>
  <!-- Fullscreen Management -->
  <action name="exitFullScreen" devices="fullscreensupport">set(tour_fullscreen,false);set(fullscreen,false);</action>
  <action name="enterFullScreen" devices="fullscreensupport">set(tour_fullscreen,true);set(fullscreen,true);</action>
  <action name="switchFullScreen">if(tour_fullscreen,exitFullScreen();,enterFullScreen(););</action>

  
  <events name="krpanoExitFullscreenEvent"
    onexitfullscreen="if(tour_fullscreen,exitFullScreenChangeEvent(););"
    keep="true" />

  <action name="exitFullScreenChangeEvent" devices="fullscreensupport">set(tour_fullscreen,false);events.dispatch(onexitfullscreen);</action>

<action name="viewControlMoveUp">
	if(%1,
		if(%2,
			set(isfullvertical, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewvfov, panoview.vmax, panoview.vmin);
				if (viewvfov == 180,
					set(isfullvertical, true);
				);
			);
			if(isfullvertical == false AND calc(view.vlookat-%2) LT view.vlookatmin,
				moveto(get(view.hlookat), get(view.vlookatmin));
			,
				moveto(get(view.hlookat), calc(view.vlookat-%2));
			);
		,
			set(vlookat_moveforce, -1);
			delayedcall(0.1, viewControlMoveVertStop());
		);
	,
		set(vlookat_moveforce, -1);
	);
</action>
<action name="viewControlMoveDown">
	if(%1,
		if(%2,
			set(isfullvertical, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewvfov, panoview.vmax, panoview.vmin);
				if (viewvfov == 180,
					set(isfullvertical, true);
				);
			);
			if(sceneisfull360 == false AND calc(view.vlookat+%2) GT view.vlookatmax,
				moveto(get(view.hlookat), get(view.vlookatmax));
			,
				moveto(get(view.hlookat), calc(view.vlookat+%2));
			);
		,
			set(vlookat_moveforce, +1);
			delayedcall(0.1, viewControlMoveVertStop());
		);
	,
		set(vlookat_moveforce, +1);
	);
</action>
<action name="viewControlMoveLeft">
	if(%1,
		if(%2,
			set(isfullhorizontal, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewhfov, panoview.hmax, panoview.hmin);
				if (viewhfov == 360,
					set(isfullhorizontal, true);
				);
			);
			if(isfullhorizontal == false AND calc(view.hlookat-%2) LT view.hlookatmin,
				moveto(get(view.hlookatmin), get(view.vlookat));
			,
				moveto(calc(view.hlookat-%2), get(view.vlookat));
			);
		,
			set(hlookat_moveforce, -1);
			delayedcall(0.1, viewControlMoveHoriStop());
		);
	,
		set(hlookat_moveforce, -1);
	);
</action>
<action name="viewControlMoveRight">
	if(%1,
		if(%2,
			set(isfullhorizontal, false);
			ifnot(scene[get(xml.scene)].planar,
				sub(viewhfov, panoview.hmax, panoview.hmin);
				if (viewhfov == 360,
					set(isfullhorizontal, true);
				);
			);
			if(isfullhorizontal == false AND calc(view.hlookat+%2) GT view.hlookatmax,
				moveto(get(view.hlookatmax), get(view.vlookat));
			,
				moveto(calc(view.hlookat+%2), get(view.vlookat));
			);
		,
			set(hlookat_moveforce, +1);
			delayedcall(0.1, viewControlMoveHoriStop());
			
		);
	,
		set(hlookat_moveforce, +1);
	);
</action>
<action name="viewControlMoveHoriStop">
	set(hlookat_moveforce, 0);
</action>
<action name="viewControlMoveVertStop">
	set(vlookat_moveforce, 0);
</action>

  <!-- Hide / Show Controls -->
  <action name="hideTourControls">set(tour_displaycontrols, false);events.dispatch(hidetourcontrols);</action>
  <action name="showTourControls">set(tour_displaycontrols, true); events.dispatch(showtourcontrols);</action>


</krpano>