{% for message in app.flashes('notice') %} 
        <div class="flash-notice"> 
            <div class='notice'>{{ message }}</div> 
        </div> 
    {% endfor %} 
    {% for message in app.flashes('error') %} 
        <div class="flash-error"> 
            <div class='error'>{{ message }}</div> 
        </div> 
    {% endfor %} 
  
    {#    we setup images for 3D space #} 
    {% set gallery3DInfo = [] %} 
    {% set gallery3DInfo = gallery3DInfo|merge({'image_size_horisontal': '4.8 3.2 0.08'}) %} 
    {% set gallery3DInfo = gallery3DInfo|merge({'frame_size_horisontal': '5.2 3.6 0.04'}) %} 
    {% set gallery3DInfo = gallery3DInfo|merge({'image_size_vertical': '3.2 4.8 0.08'}) %} 
    {% set gallery3DInfo = gallery3DInfo|merge({'frame_size_vertical': '3.6 5.2 0.04'}) %} 
 
    {#    we prepare textures #} 
    {% set textureArray = [] %} 
    {% set textureArray = textureArray|merge({'logo-texture-1': ''}) %}         
    {% set textureArray = textureArray|merge({'floor-texture-1': ''}) %} 
    {% set textureArray = textureArray|merge({'floor-texture-2': ''}) %} 
    {% set textureArray = textureArray|merge({'ceil-texture-1': ''}) %} 
    {% set textureArray = textureArray|merge({'wall-texture-1': ''}) %} 
    {% set textureArray = textureArray|merge({'wall-texture-2': ''}) %} 
    {% set textureArray = textureArray|merge({'background-front': ''}) %} 
    {% set textureArray = textureArray|merge({'background-back': ''}) %} 
    {% set textureArray = textureArray|merge({'background-left': ''}) %} 
    {% set textureArray = textureArray|merge({'background-right': ''}) %} 
    {% set textureArray = textureArray|merge({'image-help-1': ''}) %} 
    {% set textureArray = textureArray|merge({'button-play': ''}) %} 
    {% set textureArray = textureArray|merge({'button-home': ''}) %} 
    {% set textureArray = textureArray|merge({'button-help': ''}) %} 
    {% set textureArray = textureArray|merge({'button-exit-1': ''}) %} 
    {% set textureArray = textureArray|merge({'gallery-logo': ''}) %} 
    {% set textureArray = textureArray|merge({'cart-texture-1': ''}) %} 
    {% set textureArray = textureArray|merge({'info-texture-1': ''}) %} 
    {% set textureArray = textureArray|merge({'bg-texture-1': ''}) %} 
    {% set textureArray = textureArray|merge({'bg-texture-2': ''}) %} 
    {% set textureArray = textureArray|merge({'bg-texture-3': ''}) %} 
    {% set textureArray = textureArray|merge({'bg-texture-4': ''}) %} 
 
    {% set imageTotalCount = galleryItemCollection|length %} 
 
    {% set rightAngle = deg2rad(90)|round(3, 'ceil') %} 
    {% set halfCircleAngle = deg2rad(180)|round(3, 'ceil') %} 
    {% set wholeCircleAngle = deg2rad(360)|round(3, 'ceil') %} 
    {% set yAngle = deg2rad(360/imageTotalCount) %} 
 
    {% if textureItemCollection is not defined %}  
        {% set textureItemCollection = [] %} 
    {% endif %} 
 
    {% if gallery3D.guideCycle is defined and gallery3D.guideCycle > 0 %}  
        {% set guideCycle = gallery3D.guideCycle %} 
    {% else %} 
        {% set guideCycle = 30 %} 
    {% endif %} 
  
    {% for textureItem in textureItemCollection %} 
 
        {% if 'http' in textureItem.galleryItemFile %} 
            {% set texturePath = textureItem.galleryItemFile %} 
        {% else %} 
            {% set texturePath = userDirs['web'] ~ '/images/' ~ textureItem.galleryItemFile %} 
        {% endif %} 
 
        {% if textureItem.galleryItemName is defined and textureItem.galleryItemName != '' %} 
            {% set textureKey = textureItem.galleryItemName %} 
{#                {% set textureArray[textureKey] = texturePath %}#} 
            {% set textureArray = textureArray|merge({(textureKey): (texturePath)}) %} 
        {% endif %} 
   
    {% endfor %} 
 
    {% if isFullscreen is defined and isFullscreen %} 
        {% set resizeButton = 'button_fullscreen' %} 
        {% set isFullscreen = true %} 
        {% set screenHeight = '90vh' %} 
    {% else %} 
        {% set resizeButton = 'button_defaultscreen' %} 
        {% set isFullscreen = false %} 
        {% set screenHeight = '323px' %} 
    {% endif %}     
  
        <!-- X3D  --> 
        <div style="width: 100vw; height: {{ screenHeight }}; display:block; right:0; left:0; box-sizing: border-box; position: absolute; left: 0; right: 0; background-color: Black;" id="x3d" class="x3d_container"> 
                <!-- menu --> 
                 
              <div style="position: absolute; left: 0px; width: 100%; height: 40px; display:inline-block; border-right: 1px solid #EA5B0C; background-color: #222; opacity: 0.5; font-family: helvetica, sans-serif; font-weight: bold; font-size: 10px; color: #EA5B0C; padding-left:5px; z-index: 50;" class="x3d_menu" id="x3d_menu"> 
                     
                    <div style="margin-right:7px;padding-top:2px; display:inline-block; text-align: center;"> 
                        <div><big>3D</big></div> 
                        <div><small>menu</small></div> 
                    </div> 
                    <div style="margin-right:7px; display:inline-block" id="x3d_menu_viewpoint_home"> 
                        <button id="button_viewpoint_home" onclick="changeViewpoint('x3d_viewpoint_home'); rotateGallery(0)" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px;  background-image: url( '/images/x3dmenu_home.png' ); background-size: 31px 31px; height: 33px; width: 33px; border: 1px solid silver; border-radius:17px;" title="Home Viewpoint"></button> 
                </div>     
                    <div style="margin-right:7px; display:inline-block" id="x3d_menu_viewpoint_home2"> 
                        <button id="button_viewpoint_home2" onclick="changeViewpoint('x3d_viewpoint_home2'); rotateGallery(0)" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px;  background-image: url( '/images/x3dmenu_home.png' ); background-size: 31px 31px; height: 33px; width: 33px; border: 1px solid silver; border-radius:17px;" title="Home 2 Viewpoint"></button> 
                </div>     
                 
                    <div style="margin-right:7px; display:inline-block" id="x3d_menu_play_guide"> 
                        <button id="button_play_guide" onclick="playGuide('AnimationTimer_header_reverse')" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px;  background-image: url( '/images/x3dmenu_play.png' ); background-size: 31px 31px; height: 33px; width: 33px; border: 1px solid silver; border-radius:17px;" title="Play Guide"></button> 
                </div>                 
                    <div style="margin-right:7px; display:inline-block" id="x3d_menu_stop_guide"> 
                        <button id="button_stop_guide" onclick="stopGuide('AnimationTimer_header_reverse')" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px;  background-image: url( '/images/x3dmenu_stop.png' ); background-size: 31px 31px; height: 33px; width: 33px; border: 1px solid silver; border-radius:17px;" title="Stop Guide"></button> 
                </div>                             
 
              <!-- 
              <div style="margin-right:7px; display:inline-block" id="x3d_menu_tour"> 
                <button id="gallery_button_viewpoint" onclick="changeViewpoint('x3d_viewpoint_tour')" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px;  background-image: url( '/images/x3dmenu_walk.png' ); background-size: 31px 31px; height: 33px; width: 33px; border: 1px solid silver; border-radius:17px;" title="Tour"></button> 
                </div> 
              --> 
 
              {% set itemCount = 0 %} 
              {% set yRotation = 0 %} 
 
                {% for galleryItem in galleryItemCollection %} 
                  {% set itemId = galleryItem.galleryItemId %} 
                  {% set viewpoint = 'gallery_viewpoint_' ~ itemId %} 
 
                  <div style="margin-right:7px; display:inline-block" id="gallery_menu_viewpoint_{{ itemId }}"> 
                <button id="gallery_button_viewpoint_{{ itemId }}" onclick="stopGuide('AnimationTimer_header_reverse'); rotateGallery({{ yRotation }})" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px;  background-image: url( '/images/x3dmenu_eye.png' ); background-size: 31px 31px; height: 33px; width: 33px; border: 1px solid silver; border-radius:17px;" title="Gallery item {{ itemId }}"></button> 
                </div> 
 
              {% endfor %} 
              <div style="margin-right:7px; display:inline-block" id="x3d_menu_defaultscreen"> 
                <button id="button_defaultscreen" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px;  background-image: url( '/images/x3dmenu_defaultscreen.png' ); background-size: 31px 31px; height: 33px; width: 33px; border: 1px solid silver; border-radius:17px;" title="default screen"></button> 
              </div> 
              <div style="margin-right:7px; display:inline-block" id="x3d_menu_fullscreen"> 
                <button id="button_fullscreen" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px; background-image: url( '/images/x3dmenu_fullscreen.png' ); background-size: 31px 31px; height: 33px; width: 33px; border: 1px solid silver; border-radius:17px;" title="full screen"></button> 
                </div> 
 
              </div> 
 
              <div style="position: absolute; right: 0px; width: 0px; height: 100%; display:block; border-left: 1px solid #EFEFEF; background-color: #222; opacity: 0.8; text-align:left; font-family: helvetica, sans-serif; font-weight: bold; font-size: 10px; color: #FFF; padding-top:5px; padding-left:8px; padding-right:15px; z-index: 1;" id="x3d_item_detail"> 
                  <div style="margin-top:1px" id="x3d_item_detail_close" style="tex-align: left; float: left;"> 
                        <button id="button_item_detail_close" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px;  background-image: url( '{{ textureArray['button-exit-1'] }}' ); background-size: 31px 31px; height: 33px; width: 33px;" title="default screen"></button> 
                  </div> 
                  <div id="x3d_item_name" style="font-weight: bold; font-size: 22px; margin-top:8px"></div> 
                  <div style="margin-top:8px"> 
                      <span id="x3d_item_description" style="font-weight: normal; font-size: 16px"></span> 
                  </div>         
                  <div style="margin-top:6px" id="x3d_item_detail_close2" style="tex-align: left; float: left;"> 
                        <button id="button_item_detail_close2" style="font-family: helvetica, sans-serif; font-weight: normal; font-size: 10px; background-color: black; border: 1px solid #333; color: white;padding:2px;  background-image: url( '{{ textureArray['button-exit-1'] }}' ); background-size: 31px 31px; height: 33px; width: 33px; " title="default screen"></button> 
                  </div>                                         
              </div> 
 
                <x3d width='100%' height="{{ screenHeight }}" id="x3d_section" class="x3d" style="height: {{ screenHeight }};background-color: #222;"> 
                <scene id="x3d_scene"> 
                <NavigationInfo headlight="true" visibilityLimit="0.0" type='"EXAMINE", "ANY"' avatarSize="0.25, 1.75, 0.75"></NavigationInfo> 
 
                {% if gallery3D.preferredViewpointPosition is defined %}  
                    {% set preferredViewpointPosition = gallery3D.preferredViewpointPosition %} 
                {% else %} 
                    {% set preferredViewpointPosition = '0 3 0' %} 
                {% endif %} 
 
                {% if gallery3D.isStartGuide is defined and gallery3D.isStartGuide == true %}  
 
                    <Transform DEF='TourAvatarWrapper' id='TourAvatarWrapper'> 
                        <viewpoint orientation='0 1 0 -1.7' position='{{ preferredViewpointPosition }}' DEF='x3d_viewpoint_tour' id='x3d_viewpoint_tour'></viewpoint> 
                    </Transform> 
                    <viewpoint orientation='0 1 0 {{ rightAngle }}' position='{{ preferredViewpointPosition }}' id='x3d_viewpoint_home'></viewpoint> 
                {% else %} 
                    <viewpoint orientation='0 1 0 {{ rightAngle }}' position='{{ preferredViewpointPosition }}' id='x3d_viewpoint_home'></viewpoint>     
                {% endif %} 
                 
                <Transform DEF='AvatarWrapper' id='AvatarWrapper'> 
                    <viewpoint orientation='0 1 0 1.6' position='-5 3 7' DEF='x3d_viewpoint_1' id='x3d_viewpoint_1'></viewpoint> 
                </Transform> 
                <viewpoint orientation='0 1 0 1.6' position='-10 3 0'  id='x3d_viewpoint_2'></viewpoint> 
                <viewpoint orientation='0 1 0 0.5' position='-10 3 -13'  id='x3d_viewpoint_3'></viewpoint> 
                 
                {% if gallery3D.isStartGuide is defined or gallery3D.isStartGuide == false %}  
                    <Transform DEF='TourAvatarWrapper' id='TourAvatarWrapper'> 
                        <viewpoint orientation='0 1 0 1.6' position='0 3 0' DEF='x3d_viewpoint_tour' id='x3d_viewpoint_tour'></viewpoint> 
                    </Transform> 
                {% endif %}             
 
                <DirectionalLight ambientIntensity='0.835991' direction='0.584419 0.286636 0.75914'></DirectionalLight> 
                 
                {% if gallery3D.preferredBackgroundSkyColor is defined and gallery3D.preferredBackgroundSkyColor != '' %} 
                    {% set preferredBackgroundSkyColor = gallery3D.preferredBackgroundSkyColor %} 
                {% else %} 
                    {% set preferredBackgroundSkyColor = '0.8 0.8 0.2 0.8 0.8 0.2 0.1 0.1 0.6 0.1 0.1 0.6 0.1 0.25 0.8 0.6 0.6 0.9' %} 
                {% endif %}     
 
                {% if gallery3D.preferredBackgroundGroundColor is defined and gallery3D.preferredBackgroundGroundColor != '' %} 
                    {% set preferredBackgroundGroundColor = gallery3D.preferredBackgroundGroundColor %} 
                {% else %} 
                    {% set preferredBackgroundGroundColor = '0.2 0.2 0 0.3 0.3 0 0.5 0.5 0.3 0.1 0.3 0.4 0 0.2 0.4' %} 
                {% endif %}                 
                 
                <Background groundColor='{{ preferredBackgroundGroundColor }}' skyAngle='0.04 0.05 0.1 1.309 1.570' skyColor='{{ preferredBackgroundSkyColor }}'></Background> 
 
                <Group DEF='Animation_header'> 
                  <TimeSensor DEF='AnimationTimer_header' 
                      cycleInterval='{{ guideCycle }}' 
                      loop='true' 
                      isActive='false'></TimeSensor>                   
                  <OrientationInterpolator DEF='BoxRotationInterpolator_header' 
                      key='0, 0.25, 0.5, 0.75, 1' 
                      keyValue='0 0 1 0, 0 -1 0 1.5707963267949, 0 -1 0 3.14159253438051, 0 1 0 1.57079644600419, 0 0 1 0'></OrientationInterpolator> 
                  <TimeSensor DEF='AnimationTimer_header_reverse' id='AnimationTimer_header_reverse' 
                      cycleInterval='{{ guideCycle }}' 
                      loop='true' 
                      isActive='true'></TimeSensor>                           
                  <OrientationInterpolator DEF='BoxRotationInterpolator_header_reverse' 
                      key='0, 0.25, 0.5, 0.75, 1' 
                      keyValue='0 0 1 0, 0 1 0 1.57079644600419, 0 -1 0 3.14159253438051, 0 -1 0 1.5707963267949, 0 0 1 0'></OrientationInterpolator> 
                </Group> 
 
                {% if imageTotalCount < 4 %}  
                    {% set bDistance = (imageTotalCount - 0) %} 
                {% elseif imageTotalCount < 10 %} 
                    {% set bDistance = (imageTotalCount - 1.5) %} 
                {% elseif imageTotalCount < 15 %} 
                    {% set bDistance = (imageTotalCount - 2) %}     
                {% else %}     
                    {% set bDistance = (imageTotalCount - 3) %}     
                {% endif %}     
 
                {% set xPos = -15 %}     
                {% set zPos = 2 %} 
                {% set yRotation = 0 %} 
                {% set imageCount = 0 %} 
                {% set imagePanelWidth = 5.2 %} 
                {% set frontWallImageCount = 4 %} 
 
                {% set sideWallImageCount = (imageTotalCount - frontWallImageCount)/2 %} 
                {% set gamma = -(360 / imageTotalCount) %} 
                {% set beta = 90 %} 
                {% set alfa = (360 - beta) - gamma %} 
                {% set curGamma = 0 %} 
                {% set zPosFrontWall = null %} 
 
                {% set yAngle = deg2rad(360/imageTotalCount) %} 
                {% set userTranslationKey = "" %} 
                {% set userTranslationKeyAdd = (1/imageTotalCount)|round(2, 'ceil') %} 
                {% set userTranslationKeyCurr = 0 %} 
                {% set userTranslationValue = "" %} 
 
                {% set firstGamma = gamma * imageCount %} 
                {% set firstAlfa = (360 - beta) - curGamma %} 
                {% set firstGamma = gamma * imageCount %} 
                {% set firstXPos = (bDistance * sin(deg2rad(firstAlfa)))/sin(deg2rad(90)) %} 
                {% set firstZPos = (bDistance * sin(deg2rad(firstGamma)))/sin(deg2rad(90)) %} 
                {% set firstXPosViewPoint = (firstXPos-5)|round(2, 'ceil') %} 
                {% set firstZPosViewPoint = firstZPos|round(2, 'ceil') %} 
 
               
              <viewpoint orientation='0 1 0 {{ (halfCircleAngle + rightAngle) }}' position='{{ firstXPosViewPoint }} 0 {{ firstZPosViewPoint }}' id='x3d_viewpoint_home2'></viewpoint> 
               
              <Transform DEF='ImagesBox' id="ImagesBox" translation='0 0 0' rotation='0 1 0 0'> 
               
              {% for galleryItem in galleryItemCollection %} 
 
                  {% set curGamma = gamma * imageCount %} 
                  {% set curAlfa = (360 - beta) - curGamma %} 
                  {% set xPos = (bDistance * sin(deg2rad(curAlfa)))/sin(deg2rad(90)) %} 
                  {% set zPos = (bDistance * sin(deg2rad(curGamma)))/sin(deg2rad(90)) %} 
                  {% set xPosViewPoint = (xPos-5)|round(2, 'ceil') %} 
                  {% set zPosViewPoint = zPos|round(2, 'ceil') %} 
 
                  {% set userTranslationKey = userTranslationKey ~ " " ~ userTranslationKeyCurr %} 
                  {% set userTranslationKeyCurr = userTranslationKeyCurr + userTranslationKeyAdd %} 
                  {% set userTranslationValue = userTranslationValue ~ " " ~ xPosViewPoint ~ " 0 " ~ zPosViewPoint %} 
 
                  {% if imageCount == 0 %}  
                      {% set firstUserTranslationValue = " " ~ xPosViewPoint ~ " 0 " ~ zPosViewPoint ~ " " %} 
                      <viewpoint orientation='0 1 0 {{ -(yRotation - rightAngle) }}' position='{{ xPosViewPoint }} 3.5 {{ zPosViewPoint }}' id='x3d_viewpoint_home3'></viewpoint> 
                  {% endif %}         
 
                  {% if imageCount == (imageTotalCount-1) %}  
                      {% set userTranslationKey = userTranslationKey ~ " 1" %} 
                      {% set userTranslationValue = firstUserTranslationValue %} 
                  {% endif %}     
 
                  {% set fileID = galleryItem.galleryItemId %} 
                  {% set itemId = galleryItem.galleryItemId %} 
 
                  {% if 'http' in galleryItem.galleryItemFile %} 
                        {% set path = galleryItem.galleryItemFile %} 
                        {% set pathObj = galleryItem.galleryItemFile %} 
                  {% else %}         
                      {% set path = userDirs['web'] ~ '/images/' ~ galleryItem.galleryItemFile %} 
                    {% set pathObj = userDirs['web'] ~ '/images/' ~ galleryItem.galleryItemFile %} 
                {% endif %} 
 
                {% set image = path %} 
 
                {% set img = imagecreatefromstring(file_get_contents(image)) %} 
                {% set imgObj = imagecreatefromstring(file_get_contents(pathObj)) %} 
 
                {% if imgObj and ImageSX(imgObj) > ImageSY(imgObj) %}  
                    {% set boxSize = gallery3DInfo['image_size_horisontal'] %} 
                    {% set frameSize = gallery3DInfo['frame_size_horisontal'] %} 
                {% else %} 
                    {% set boxSize = gallery3DInfo['image_size_vertical'] %} 
                    {% set frameSize = gallery3DInfo['frame_size_vertical'] %} 
                {% endif %} 
 
                <viewpoint orientation='0 1 0 {{ -(yRotation + rightAngle) }}' position='{{ xPosViewPoint }} 0.1 {{ zPosViewPoint }}' id='gallery_viewpoint_{{ fileID }}'></viewpoint> 
 
                <Transform rotation='0 1 0 {{ -(yRotation + rightAngle) }}' translation='{{ xPos }} 0 {{ zPos }}'> 
                 
 
                  <Transform> 
                    <Shape onclick="changeViewpoint('gallery_viewpoint_{{ itemId }}')"> 
                      <Appearance> 
                        <Material></Material> 
                        <ImageTexture url="{{ path }}"></ImageTexture> 
                      </Appearance> 
                      <Box size='{{ boxSize }}'></Box> 
                    </Shape> 
                    <TouchSensor DEF='Image1Sensor'></TouchSensor> 
                  </Transform> 
 
                   
                  <Transform translation='0 0 0.0'> 
                    <Shape> 
                      <Appearance> 
                        <Material diffuseColor='0 0 0' transparency='0.3'></Material> 
                      </Appearance> 
                      <Box size='{{ frameSize }}'></Box> 
                    </Shape> 
                  </Transform> 
                </Transform>  
                <Transform rotation='0 1 0 {{ -(yRotation + rightAngle) }}' translation='{{ xPos }} 1.3 {{ zPos }}'>     
                     
                {% set menuX = 0 %} 
                {% if galleryItem.clickURL is defined and galleryItem.clickURL != '' %}     
 
                  <!-- browse url button --> 
                    <Anchor 
                        description='{{ 'system.browse_url'|trans }}' 
                        id = 'img_url_{{ galleryItem.galleryItemId }}' 
                        url='{{ galleryItem.clickURL }}' 
                        parameter = 'target=_blank'> 
                        <Transform translation='{{ (menuX - 0.8) }} -0.85 0'> 
                          <Shape> 
                            <Appearance> 
                               <Material diffuseColor='0 1 0'></Material> 
                               <ImageTexture url='{{ textureArray['browseurl-texture-1'] }}'></ImageTexture> 
                                   <TextureTransform scale='1 1'></TextureTransform> 
                            </Appearance> 
                            <Box size='1.7 0.7 0.1'></Box> 
                          </Shape> 
                        </Transform>  
                    </Anchor> 
                    {% set menuX = menuX + 0.55 %} 
      
                   {% endif %} 
 
                   {% if galleryItem.galleryItemDescription is defined and galleryItem.galleryItemDescription != '' %} 
 
                      <!--  more info button --> 
                        <Transform translation='{{ (menuX + 0.3) }} -0.85 0'> 
                          <Shape onclick="getGaleryItemDetail('{{ galleryItem.galleryItemName }}','{{ galleryItem.galleryItemDescription }}')"> 
                            <Appearance> 
                               <Material diffuseColor='0 1 0'></Material> 
                               <ImageTexture url='{{ textureArray['browseurl-texture-1'] }}'></ImageTexture> 
                                   <TextureTransform scale='1 1'></TextureTransform> 
                            </Appearance> 
                            <Box size='1.7 0.7 0.1'></Box> 
                          </Shape> 
                        </Transform>  
  
                   {% set menuX = menuX + 0.55 %} 
 
                   {% endif %} 
  
                </Transform>  
 
                {% set yRotation = yRotation + yAngle %} 
                {% set imageCount = imageCount + 1 %} 
               
              {% endfor %} 
               
                <!-- logo 1 --> 
                <Group DEF='Logo_Animation_header'> 
                  <TimeSensor DEF='LogoTimer' 
                      cycleInterval='24' 
                      loop='true' 
                      isActive='true'></TimeSensor> 
                  <OrientationInterpolator DEF='BoxRotationInterpolator' 
                      key='0, 0.25, 0.5, 0.75, 1' 
                      keyValue='0 0 1 0, 0 -1 0 1.5707963267949, 0 -1 0 3.14159253438051, 0 1 0 1.57079644600419, 0 0 1 0'></OrientationInterpolator> 
                </Group> 
                 
                <Transform translation='0 8.5 0' > 
                      <Shape > 
                        <Appearance > 
                          <Material diffuseColor='0.1 0.1 0.1'> 
                          </Material> 
                        </Appearance> 
                        <Cylinder height='0.3' radius='1.5' > 
                        </Cylinder> 
                      </Shape> 
                </Transform>                 
                 
                <Transform DEF='ExamineSensor' translation='0 7 0'> 
                  <Shape> 
                    <Appearance> 
                      <Material ambientIntensity='0.1'></Material> 
                      <ImageTexture url='{{ textureArray['logo-texture-1'] }}'></ImageTexture> 
                      <TextureTransform scale='1 1'></TextureTransform> 
                    </Appearance> 
                    <Box size='3 3 3'></Box> 
                  </Shape> 
                </Transform> 
 
              </Transform> 
 
 
            <!-- Free World --> 
            {% if freeWorld is defined and freeWorld != null %}         
 
                <Transform translation='{{ freeWorld.preferredPosition }}' rotation='{{ freeWorld.preferredRotation }}' scale='{{ freeWorld.preferredScale }}'> 
                   
                      <Inline url='"{{ freeWorld.xmlFile() }}"' > 
                    </Inline> 
                </Transform> 
 
            {% endif %} 
 
     
               
          <ROUTE fromNode='AnimationTimer_header_reverse' fromField='fraction_changed' toNode='BoxRotationInterpolator_header_reverse' toField='set_fraction'></ROUTE> 
          <ROUTE fromNode='BoxRotationInterpolator_header_reverse' fromField='value_changed' toNode='ImagesBox' toField='rotation'></ROUTE>     
          <Route fromNode="CLOCK" fromField ="fraction_changed" toNode="UserTranslation1" toField="set_fraction"> </Route>  
          <Route fromNode="UserTranslation1" fromField ="value_changed" toNode="TourAvatarWrapper" toField="translation"> </Route>   
 
        </scene> 
      </x3d> 
    </div> 
         
        <script> 
            //we setup full screen 3d canvas 
            // var buttonResizeScreen = document.getElementById("button_defaultscreen"); 
      //       buttonResizeScreen.click(); // this will trigger the click event 
 
 
              {% if isFullscreen is defined and isFullscreen %} 
                {% set resizeButton = 'button_defaultscreen' %} 
            {% else %} 
                $( document ).ready(function() { 
                // alert( "ready!" ); 
                    document.getElementById("button_defaultscreen").click();  
                }); 
            {% endif %}     
 
        </script>