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

    
  <!-- Spot Style - Default Point Spot Style -->


  <style name="IconDefaultPointSpotStyle"
         url="%FIRSTXML%/spots/hotspot_neutral_user_defaultpoint0.png"
         visible="false"
         edge="center"
         onhover="onhoverIconDefaultPointSpotStyle"
         onout="onoutIconDefaultPointSpotStyle"


         />
  <action name="onhoverIconDefaultPointSpotStyle">
    showtooltip('hotspot');
  </action>
  <action name="onoutIconDefaultPointSpotStyle">
    hideTooltip();



  </action>



    
  <!-- Spot Style - Hours -->


  <style name="IconHours"
         url="%FIRSTXML%/spots/hotspot_information_user_defaultpoint1.png"
         visible="false"
         edge="center"
         onhover="onhoverIconHours"
         onover="onoverIconHours"
         onout="onoutIconHours"


         />
  <action name="onhoverIconHours">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconHours">
tween(scale, 1.2);

pauseautorotation(forcehotspot);

  </action>
  <action name="onoutIconHours">
    hideTooltip();
    tween(scale, 1);

resumeautorotation(forcehotspot);

  </action>



    
  <!-- Spot Style - Codenames -->


  <style name="IconCodenames"
         url="%FIRSTXML%/spots/hotspot_information_user_defaultpoint2.png"
         visible="false"
         edge="center"
         onhover="onhoverIconCodenames"
         onover="onoverIconCodenames"
         onout="onoutIconCodenames"


         />
  <action name="onhoverIconCodenames">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconCodenames">
tween(scale, 1.2);

pauseautorotation(forcehotspot);

  </action>
  <action name="onoutIconCodenames">
    hideTooltip();
    tween(scale, 1);

resumeautorotation(forcehotspot);

  </action>



    
  <!-- Spot Style - Catan -->


  <style name="IconCatan"
         url="%FIRSTXML%/spots/hotspot_information_user_defaultpoint3.png"
         visible="false"
         edge="center"
         onhover="onhoverIconCatan"
         onover="onoverIconCatan"
         onout="onoutIconCatan"


         />
  <action name="onhoverIconCatan">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconCatan">
tween(scale, 1.2);

pauseautorotation(forcehotspot);

  </action>
  <action name="onoutIconCatan">
    hideTooltip();
    tween(scale, 1);

resumeautorotation(forcehotspot);

  </action>



    
  <!-- Spot Style - Dragon -->


  <style name="IconDragon"
         url="%FIRSTXML%/spots/hotspot_information_user_defaultpoint4.png"
         visible="false"
         edge="center"
         onhover="onhoverIconDragon"
         onover="onoverIconDragon"
         onout="onoutIconDragon"


         />
  <action name="onhoverIconDragon">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconDragon">
tween(scale, 1.2);

pauseautorotation(forcehotspot);

  </action>
  <action name="onoutIconDragon">
    hideTooltip();
    tween(scale, 1);

resumeautorotation(forcehotspot);

  </action>



    
  <!-- Spot Style - Paint -->


  <style name="IconPaint"
         url="%FIRSTXML%/spots/hotspot_information_user_defaultpoint5.png"
         visible="false"
         edge="center"
         onhover="onhoverIconPaint"
         onover="onoverIconPaint"
         onout="onoutIconPaint"


         />
  <action name="onhoverIconPaint">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconPaint">
tween(scale, 1.2);

pauseautorotation(forcehotspot);

  </action>
  <action name="onoutIconPaint">
    hideTooltip();
    tween(scale, 1);

resumeautorotation(forcehotspot);

  </action>



    
  <!-- Spot Style - Rent -->


  <style name="IconRent"
         url="%FIRSTXML%/spots/hotspot_information_user_defaultpoint6.png"
         visible="false"
         edge="center"
         onhover="onhoverIconRent"
         onover="onoverIconRent"
         onout="onoutIconRent"


         />
  <action name="onhoverIconRent">
    showtooltip('hotspot');
  </action>
  <action name="onoverIconRent">
tween(scale, 1.2);

pauseautorotation(forcehotspot);

  </action>
  <action name="onoutIconRent">
    hideTooltip();
    tween(scale, 1);

resumeautorotation(forcehotspot);

  </action>



<!-- ********* -->
<!-- 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>

  <action name="displayImage">
    if (layer[displayedStandardImage],
      if(layer[displayedStandardImage].doNotDeleteMe,
        set(layer[displayedStandardImage].currentCall, false);
        set(layer[displayedStandardImage].doNotDeleteMe, false);
        
        if (%1 == layer[displayedStandardImage].url,
          applyDisplayedImageObjectAnimation(%8);
        ,
          setDisplayedImageObjectParameters(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10);
        );
      ,
        set(layer[displayedStandardImage].currentCall, false);
        set(layer[displayedStandardImage].doNotDeleteMe, true);
        events.dispatch(onremovedisplayedobject);
        delayedcall(0.2,displayImage(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12););
      );
    ,
      if(%10,
        addlayer(displayedStandardImageOverlay);
        set(layer[displayedStandardImageOverlay].keep, false);
        set(layer[displayedStandardImageOverlay].width, 100%);
        set(layer[displayedStandardImageOverlay].height, 100%);
        set(layer[displayedStandardImageOverlay].type, container);
        set(layer[displayedStandardImageOverlay].zorder, 98);
        set(layer[displayedStandardImageOverlay].visible, false);
        set(layer[displayedStandardImageOverlay].onclick, applyDisplayedImageObjectAnimation(%8););
        set(layer[displayedStandardImageOverlay].bgcolor, "0x%11");
        set(layer[displayedStandardImageOverlay].bgalpha, %12);
        set(layer[displayedStandardImageOverlay].bgcapture, true);
      );
      addlayer(displayedStandardImage);
      set(layer[displayedStandardImage].keep, false);
      set(layer[displayedStandardImage].onclick, applyDisplayedImageObjectAnimation(%8););
      set(layer[displayedStandardImage].zorder , 99);
      set(layer[displayedStandardImage].currentCall, true);
      set(layer[displayedStandardImage].doNotDeleteMe, true);
      set(layer[displayedStandardImage].onloaded, resizeDisplayedImageObject());
      events.dispatch(onremovedisplayedobject);
      delayedcall(0.2,displayImage(%1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12););
      set(layer[displayedStandardImage].visible, false);
    );
  </action>
  <action name="applyDisplayedImageObjectAnimation">resumeautorotation(forcehotspot);

    if (%1,
      stoptween(layer[displayedStandardImage].width, layer[displayedStandardImage].height);
      tween(layer[displayedStandardImage].width|layer[displayedStandardImage].height, 1|1, 1, easeOutQuad, WAIT);
      if(layer[displayedStandardImage].overlay,removelayer(displayedStandardImageOverlay););removelayer(displayedStandardImage);
    ,
      if(layer[displayedStandardImage].overlay,removelayer(displayedStandardImageOverlay););removelayer(displayedStandardImage);
    );
  </action>
  <action name="setDisplayedImageObjectParameters">
    set(layer[displayedStandardImage].url       , %1);
    set(layer[displayedStandardImage].align     , %2);
    set(layer[displayedStandardImage].x         , %3);
    set(layer[displayedStandardImage].y         , %4);
    set(layer[displayedStandardImage].imgwidth  , %5);
    set(layer[displayedStandardImage].imgheight , %6);
    set(layer[displayedStandardImage].animated  , %8);
    set(layer[displayedStandardImage].applyratio, %9);
    set(layer[displayedStandardImage].overlay   , %10);
    if (%7,pauseautorotation(forcehotspot);
);
  </action>
  <action name="resizeDisplayedImageObject">
    if(layer[displayedStandardImage].url,
    set(layer[displayedStandardImage].fullwidth, get(layer[displayedStandardImage].width));
    set(layer[displayedStandardImage].fullheight, get(layer[displayedStandardImage].height));
    if(layer[displayedStandardImage].animated,
      set(layer[displayedStandardImage].width , 1);
      set(layer[displayedStandardImage].height, 1);
    );
    if(layer[displayedStandardImage].imgwidth != "" AND layer[displayedStandardImage].imgheight != "",
      if(layer[displayedStandardImage].imgwidth == "prop",
        set(tempDisplayedImageObjectHeight, get(layer[displayedStandardImage].imgheight));
        indexoftxt(tempDisplayedImageObjectHeightPercent, get(tempDisplayedImageObjectHeight), "%");
        if(tempDisplayedImageObjectHeightPercent GT 0,
          txtreplace(tempDisplayedImageObjectHeight, '%', '');
          mul(tempDisplayedImageObjectHeight, get(stageheight));
          div(tempDisplayedImageObjectHeight, 100);
          Math.round(tempDisplayedImageObjectHeight);
        );
        mul(flyingImgWidth,get(layer[displayedStandardImage].fullwidth),get(tempDisplayedImageObjectHeight));
        div(flyingImgWidth,get(layer[displayedStandardImage].fullheight));
        Math.round(flyingImgWidth);
        set(layer[displayedStandardImage].imgwidth , get(flyingImgWidth));
        set(layer[displayedStandardImage].imgheight, get(tempDisplayedImageObjectHeight));
      ,
        if(layer[displayedStandardImage].imgheight == "prop",
          set(tempDisplayedImageObjectWidth, get(layer[displayedStandardImage].imgwidth));
          indexoftxt(tempDisplayedImageObjectWidthPercent, get(tempDisplayedImageObjectWidth), "%");
          if(tempDisplayedImageObjectWidthPercent GT 0,
            txtreplace(tempDisplayedImageObjectWidth, '%', '');
            mul(tempDisplayedImageObjectWidth, get(stagewidth));
            div(tempDisplayedImageObjectWidth, 100);
            Math.round(tempDisplayedImageObjectWidth);
          );
          mul(flyingImgHeight,get(layer[displayedStandardImage].fullheight),get(tempDisplayedImageObjectWidth));
          div(flyingImgHeight,get(layer[displayedStandardImage].fullwidth));
          Math.round(flyingImgHeight);
          set(layer[displayedStandardImage].imgwidth , get(tempDisplayedImageObjectWidth));
          set(layer[displayedStandardImage].imgheight , get(flyingImgHeight));
        ,
          set(tempDisplayedImageObjectWidth, get(layer[displayedStandardImage].imgwidth));
          set(tempDisplayedImageObjectHeight, get(layer[displayedStandardImage].imgheight));
          indexoftxt(tempDisplayedImageObjectWidthPercent, get(tempDisplayedImageObjectWidth), "%");
          indexoftxt(tempDisplayedImageObjectHeightPercent, get(tempDisplayedImageObjectHeight), "%");
          if(tempDisplayedImageObjectWidthPercent GT 0,
            txtreplace(tempDisplayedImageObjectWidth, '%', '');
            mul(tempDisplayedImageObjectWidth, get(stagewidth));
            div(tempDisplayedImageObjectWidth, 100);
            Math.round(tempDisplayedImageObjectWidth);
          );
          if(tempDisplayedImageObjectHeightPercent GT 0,
            txtreplace(tempDisplayedImageObjectHeight, '%', '');
            mul(tempDisplayedImageObjectHeight, get(stageheight));
            div(tempDisplayedImageObjectHeight, 100);
            Math.round(tempDisplayedImageObjectHeight);
          );
          set(layer[displayedStandardImage].imgwidth , get(tempDisplayedImageObjectWidth));
          set(layer[displayedStandardImage].imgheight, get(tempDisplayedImageObjectHeight));
        );
      );
    ,
      set(layer[displayedStandardImage].imgwidth , get(layer[displayedStandardImage].fullwidth));
      set(layer[displayedStandardImage].imgheight, get(layer[displayedStandardImage].fullheight));
    );
    
    set(resizedwidth, get(layer[displayedStandardImage].imgwidth));
    set(resizedheight, get(layer[displayedStandardImage].imgheight));
    if(layer[displayedStandardImage].applyratio,
      sub(resizedstagewidth, get(stagewidth), get(layer[displayedStandardImage].x));
      sub(resizedstageheight, get(stageheight), get(layer[displayedStandardImage].y));
      Math.abs(resizedstagewidth);
      Math.abs(resizedstageheight);
      if(resizedwidth GT resizedstagewidth,
        mul(tempresizedheight, get(resizedheight), get(resizedstagewidth));
        div(tempresizedheight, get(resizedwidth));
        Math.round(tempresizedheight);
        set(resizedwidth, get(resizedstagewidth));
        set(resizedheight, get(tempresizedheight));
      );
      if(resizedheight GT resizedstageheight,
        mul(tempresizedwidth, get(resizedwidth), get(resizedstageheight));
        div(tempresizedwidth, get(resizedheight));
        Math.round(tempresizedwidth);
        set(resizedheight, get(resizedstageheight));
        set(resizedwidth, get(tempresizedwidth));
      );
    );
    
    if(layer[displayedStandardImage].animated,
      set(layer[displayedStandardImage].animated, false);
      tween(layer[displayedStandardImage].width , get(resizedwidth), 1, easeOutQuad);
      tween(layer[displayedStandardImage].height, get(resizedheight), 1, easeOutQuad);
    ,
      set(layer[displayedStandardImage].width , get(resizedwidth));
      set(layer[displayedStandardImage].height, get(resizedheight));
    );
    if(layer[displayedStandardImage].overlay,set(layer[displayedStandardImageOverlay].visible, true););
    set(layer[displayedStandardImage].visible, true);
    ,
      delayedcall(0.2,resizeDisplayedImageObject(););
    );
  </action>
  <events name="displayedImageObjectEvents" keep="true" onremovedisplayedobject="displayedImageObjectOnRemoveDisplayedObject" onresize="if(layer[displayedStandardImage],resizeDisplayedImageObject());" />
  <action name="displayedImageObjectOnRemoveDisplayedObject">
    ifnot(layer[displayedStandardImage].currentCall,if(layer[displayedStandardImage].visible,resumeautorotation(forcehotspot);

      if(layer[displayedStandardImage].overlay,removelayer(displayedStandardImageOverlay););
      removelayer(displayedStandardImage);
    ););
  </action>


</krpano>