/**
 * 3D Rotate Tool by YoFLA.com
 *
 * @author Matus Laco, www.yofla.com
 * @description Script for rotating images to provide a 3D look of an object
 * @sicne 06/2010
 * @updated 2017-04-03
 * @version 2.1.6
 * @homepage http://www.yofla.com/3d-rotate/
 *
 * @license : You many not delete/modify this license or authorship info
 * @license_type : Free License, You may not remove the YoFLA link in the top left corner.
 * @licensed_to : Licensed to user who downloaded the 3DRT SetupUtility from http://www.yofla.com/3d-rotate/
 * @authorized_domains : Free version can be run on unlimited websites.
 *
 * 3rd Party licenses:
 * Wave Pre-loader: MIT (https://github.com/tobiasahlin/SpinKit)
 *
 */

var RotateTool="object"===typeof RotateTool?RotateTool:{instances:{},logLevel:"none",isLogEnabled:!1,isLogToScreen:!1,isInitialized:!1,isTouchDevice:!1,isSupportedBrowser:null,isFullscreenBrowserAPISupported:!1,isCustomEventSupported:!1,isCanvasSupported:!1,isChrome:!1,isIE:!1,isFF:!1,authorizedDomains:"Free version can be run on unlimited websites.",scriptVersion:"2.1.6",licenseType:"Free License, You may not remove the YoFLA link in the top left corner.",eventsTouchStart:{forMouse:"mousedown",forTouch:"touchstart"},eventsTouchEnd:{forMouse:"mouseup",forTouch:"touchend"},
eventsTouchMove:{forMouse:"mousemove",forTouch:"touchmove"},eventsMouseOver:{forMouse:"mouseover",forTouch:void 0},eventsMouseOut:{forMouse:"mouseout",forTouch:void 0},eventsMouseLeave:{forMouse:"mouseleave",forTouch:void 0},listeners:[],ON_IMAGE:"3drt_on_image",ROTATION_START:"3drt_rotation_start",ROTATION_STOP:"3drt_rotation_stop",ZOOM_START:"3drt_zoom_start",ZOOM_STOP:"3drt_zoom_stop",ZOOM_CHANGE:"3drt_zoom_change",ZOOM_RESET:"3drt_zoom_reset",PAN_START:"3drt_pan_start",PAN_STOP:"3drt_pan_stop",
TURN_START:"3drt_turning_start",TURN_STOP:"3drt_turning_stop",HOTSPOT_HOVER:"3drt_hotspot_hover",HOTSPOT_HOVER_OUT:"3drt_hotspot_hover_out",HOTSPOT_OPEN:"3drt_hotspot_open",TOOLTIP_SHOW:"3drt_tooltip_show",TOOLTIP_HOVER:"3drt_tooltip_hover",TOOLTIP_HOVER_OUT:"3drt_tooltip_hover_out",PRELOADER_LOADED:"3drt_preloader_image_loaded",PRELOADER_PROGRESS:"3drt_preloader_progress",IMAGES_LOADED:"3drt_images_loaded",TOGGLE_ROTATE_MODE:"3drt_toggle_rotate_mode",TOGGLE_PAN_MODE:"3drt_toggle_pan_mode",MOUSEWHEEL_ZOOM:"3drt_mousewheel_zoom",
CLICK_OBJECT:"3drt_click_object",BUTTON_PLAY_PAUSE_CLICK:"3drt_button_play_pause_click",BUTTON_ARROW_LEFT_CLICK:"3drt_button_arrow_left_click",BUTTON_ARROW_RIGHT_CLICK:"3drt_button_arrow_right_click",BUTTON_FULLSCREEN_CLICK:"3drt_button_fullscreen_click",BUTTON_ZOOMSLIDER_CLICK:"3drt_button_zoomslider_click",BUTTON_ROTATE_CLICK:"3drt_button_toggle_rotate_click",BUTTON_PAN_CLICK:"3drt_button_toggle_pan_click",BUTTON_ZOOM_OUT_CLICK:"3drt_button_toggle_zoom_out_click",BUTTON_ZOOM_IN_CLICK:"3drt_button_toggle_zoom_in_click",
BUTTON_START_CLICK:"3drt_start_click",CONTEXMENU_SHOW:"3drt_contex-menu_show",zIndex:{images:5,imageShown:6,imageHidden:4,canvas:7,preloaderImage:9,preloader:10,customLayer:15,clickPane:20,buttons:30,hotspots:40,preloaderLarge:45,toolTip:50,overlay:100,hotspotImage:110,hotspotVideo:110,hotspotIframe:110,hotspotTitle:120,customLogo:130,contexMenu:150,hotspotCloseButton:1100,info:900},initialize:function(){this.isInitialized||(this.defaultGAevents=[this.CLICK_OBJECT,this.BUTTON_PLAY_PAUSE_CLICK,this.BUTTON_ARROW_LEFT_CLICK,
this.BUTTON_ARROW_RIGHT_CLICK,this.BUTTON_FULLSCREEN_CLICK,this.BUTTON_ZOOMSLIDER_CLICK,this.BUTTON_ROTATE_CLICK,this.BUTTON_PAN_CLICK,this.HOTSPOT_HOVER,this.HOTSPOT_OPEN,this.CONTEXMENU_SHOW,this.ZOOM_START],this.addPolyFills(),this.detectBrowsers(),this.isSupportedBrowser=this.supportedBrowserCheck(),this.isTouchDevice="ontouchstart"in document.documentElement,this.isMobileDevice=this.mobileCheck(),this.isFullscreenBrowserAPISupported=this.fullscreenBrowserCheck(),this.isRunningInIframe=this.isInIframe(),
this.isCustomEventSupported=this.detectCustomEventSupport(),this.isCanvasSupported=this.detectCanvasSupport(),this.yofla_360_is_preview=!1,this.addDefaultStyleSheets(),this.addTabInactivityObserver(),window.addEventListener?window.addEventListener("load",this.onPageLoaded,!1):window.attachEvent("onload",this.onPageLoaded),this.addGlobalFunctions(),this.isInitialized=!0)},addDefaultStyleSheets:function(){var a;a="div.rotate-tool-instance{";a+="}";a+="img.rotate-tool-image";a+="{";a+="    max-width: none;";
a+="    vartical-align: none;";a+="    -moz-box-sizing: none;";a+="}";a+="div.rotate-tool-spacer{";a+="    background-image: url(https://www.yofla.com/cdn/rotatetool/spacer.gif);";a+="    background-repeat: no-repeat";a+="}";a+="div.rotate-tool-hotspot-default{";a+="}";a+=".rotate-tool-unselectable{";a+="    -moz-user-select: none;";a+="    -webkit-user-select: none;";a+="    -ms-user-select: none;";a+="    user-select: none;";a+="    -webkit-user-drag: none;";a+="    user-drag: none;";a+="}";a+=
"\t\t.yp_wave {";a+="\t\t\tmargin: 100px auto;";a+="\t\t\twidth: 50px;";a+="\t\t\theight: 30px;";a+="\t\t\ttext-align: center;";a+="\t\t\tfont-size: 10px;";a+="\t\t}";a+="\t\t.yp_wave > div {";a+="\t\t\tbackground-color: #333;";a+="\t\t\theight: 100%;";a+="\t\t\twidth: 6px;";a+="\t\t\tdisplay: inline-block;";a+="\t\t\t-webkit-animation: stretchdelay 1.2s infinite ease-in-out;";a+="\t\t\tanimation: stretchdelay 1.2s infinite ease-in-out;";a+="\t\t}";a+="\t\t.yp_wave .rect2 {";a+="\t\t\t-webkit-animation-delay: -1.1s;";
a+="\t\t\tanimation-delay: -1.1s;";a+="\t\t}";a+="\t\t.yp_wave .rect3 {";a+="\t\t\t-webkit-animation-delay: -1.0s;";a+="\t\t\tanimation-delay: -1.0s;";a+="\t\t}";a+="\t\t.yp_wave .rect4 {";a+="\t\t\t-webkit-animation-delay: -0.9s;";a+="\t\t\tanimation-delay: -0.9s;";a+="\t\t}";a+="\t\t.yp_wave .rect5 {";a+="\t\t\t-webkit-animation-delay: -0.8s;";a+="\t\t\tanimation-delay: -0.8s;";a+="\t\t}";a+="\t\t@-webkit-keyframes stretchdelay {";a+="\t\t\t0%, 40%, 100% { -webkit-transform: scaleY(0.4) }";a+="\t\t20% { -webkit-transform: scaleY(1.0) }";
a+="\t\t}";a+="\t\t@keyframes stretchdelay {";a+="\t\t\t0%, 40%, 100% {";a+="\t\t\t\ttransform: scaleY(0.4);";a+="\t\t\t-webkit-transform: scaleY(0.4);";a+="\t\t} 20% {";a+="\t\t\ttransform: scaleY(1.0);";a+="\t\t\t-webkit-transform: scaleY(1.0);";a+="\t\t\t}";a+="\t\t}";a+="span.rotate-tool-tooltip{";a+="    font-family: sans-serif;";a+="    font-size: 13px;";a+="    color: #0c0c0c;";a+="    padding: 5px;";a+="    opacity: 0.85;";a+="    filter: Alpha(Opacity=85);";a+="    border-radius: 5px;";a+=
"    border: 1px solid gray;";a+="    background-color: rgba(230,230,230,0.5);";a+="}";a+="ul.rotate-tool-contex-menu {";a+="border:0px solid #666;";a+="min-width:150px;";a+="max-width:350px;";a+="list-style:none;";a+="padding:0;";a+="margin:0;";a+="cursor:pointer;";a+="}";a+="ul.rotate-tool-contex-menu li {";a+="text-align:left;";a+="padding:3px 10px 3px 5px;";a+="margin:0;";a+="cursor:pointer;";a+='font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;';a+="text-decoration:none;";
a+="color:#fff;";a+="font-size:12px;";a+="border-top:1px solid #fff;";a+="border-left:1px solid #fff;";a+="border-bottom:1px solid #999;";a+="border-right:1px solid #999;";a+="background-color: rgba(0,0,0,.7);";a+="}";a+="ul.rotate-tool-contex-menu li.selected,";a+="ul.rotate-tool-contex-menu li:hover {";a+="color:#fff;";a+="background-color: rgba(56,117,215,.7);";a+="cursor:pointer;";a+="}";a+="ul.rotate-tool-contex-menu li.selected:hover {";a+="color:#333;";a+="background-color:#eee;";a+="cursor:pointer;";
a+="}";a+="ul.rotate-tool-contex-menu li.disabled,";a+="ul.rotate-tool-contex-menu li:hover.disabled {";a+="background-color: #eee;";a+="color:#999;";a+="cursor:pointer;";a+="}";var d=document.getElementsByTagName("head")[0],b=document.createElement("style");b.type="text/css";b.styleSheet?b.styleSheet.cssText=a:b.appendChild(document.createTextNode(a));d.appendChild(b)},onPageLoaded:function(){RotateTool.execRotateTool()},execRotateTool:function(){if(!1!=RotateTool.isObjectEmpty(RotateTool.instances)&&
document.querySelectorAll)for(var a=document.querySelectorAll("[data-rotate-tool]"),d,b,g,c,h=0;h<a.length;h++){d=a[h];b=d.getAttribute("data-rotate-tool");c=d.getAttribute("id");c||(c="rotate-tool-instance-id-"+Math.round(1E4*Math.random()),d.setAttribute("id",c));try{g=this.parseJSON(b)}catch(e){this.reportUserError('Error parsing data in element with id "'+c+'" : '+e);break}d={target:c,path:g.path,id:g.id,mode:g.mode,configFile:g.configFile,themeUrl:g.themeUrl,size:g.size,gaData:g.gaData?g.gaData:
{}};this.add(d)}},createInstance:function(a){if("undefined"===typeof this.instances[a.target]&&(this.instances[a.target]=this.rotateToolFactory(a),"function"===typeof window.yofla_rotateToolInstanceInitialized))try{window.yofla_rotateToolInstanceInitialized(a.target)}catch(d){}},createPopupLink:function(a){document.getElementById(a.target)},add:function(a){this.isInitialized||this.initialize();var d=this.validateRotationData(a);!0===d?"popup"==a.mode?this.createPopupLink(a):this.createInstance(a):
this.reportUserError(d)},get:function(a){return a?(a=this.instances[a])?a:null:this.getAnonymousInstance()},getInstances:function(){return this.instances},getAnonymousInstance:function(){var a,d;for(d in this.instances){a=this.instances[d];break}return a},reportUserError:function(a){alert("RotateTool Error: "+a)},log:function(a,d){this.isLogEnabled&&-1<this.logLevel.indexOf(a)&&("undefined"===typeof console||!0===this.isLogToScreen?this.logToScreen(d,a):console.log(d))},logToScreen:function(a,d){this.logTarget?
this.logTarget.innerHTML=a.toString()+"<br />"+this.logTarget.innerHTML:this.createLogTarget()},createLogTarget:function(){var a=this.get();a&&a.target&&(this.logTarget=document.createElement("div"),this.logTarget.className="rotate-tool-log-target",this.logTarget.style.position="absolute",this.logTarget.style.width="50%",this.logTarget.style.height="50%",this.logTarget.style.border="1px solid red;",this.logTarget.style.zIndex=999,this.logTarget.style.backgroundColor="yellow",this.logTarget.style.opacity=
"0.65",this.logTarget.style.filter="alpha(Opacity=65)",this.logTarget.style.overflow="scroll",this.logTarget.style.color="black",this.logTarget.style.fontSize="11px",this.logTarget.style.textAlign="left",this.logTarget.innerHTML="test",a.target.appendChild(this.logTarget))},validateRotationData:function(a){return a.target?!0:"Target not defined!"},rotateToolFactory:function(a){var d={THRESHOLD_TIME_ROTATE_PAN_DIF:500,THRESHOLD_TIME_DRAG_STOP_ROTATE:100,elementId:a.target,target:document.getElementById(a.target),
path:a.path,configFile:a.configFile?a.configFile:"config.js",isConfigJsLoaded:!1,productId:a.id,themeUrl:a.themeUrl,forcedSize:a.size,settings:{},originalTargetWidth:null,originalTargetHeight:null,originalTargetRatio:null,targetWidth:400,targetHeight:300,targetRation:null,zIndex:{},buttons:{},vSteps:null,hSteps:null,imageNodes:null,rotateIntervalDuration_original:null,rotateIntervalDuration_current:null,rotateIntervalThresholdStop:null,rotateInterval:null,rotateImages:[],imagesGrid:[],lastImgH:null,
lastImgV:null,newImgH:null,newImgV:null,dx:0,dy:0,previousDx:0,isRotating:!1,wasRotating:!1,currentImage:null,previousImage:null,rotateOnceCounter:0,timeLastImageShown:0,durationMultiplier:1,isZoomed:!1,scaleInPercent:100,relativeX:0.5,relativeY:0.5,isRotationWhenZoomed:!1,zoomStepInPercent:100,zoomStepInRatio:100,zoomSteps:4,maxZoomThreshold:105,objectWidth:400,objectHeight:400,dragInterval:null,touchStart:null,touchMove:null,touchMovePrevious:null,touchMovePreviousDrag:null,isGestureStart:!1,gestureStartValue:null,
lastYatDyChange:null,touchEnd:null,mouseWheelZooms:!1,currentZoomValue:0,zoomInPercent:100,isMouseMoved:!1,imageLoadErrorsString:"",imageLoadErrorCount:0,imagesToLoad:null,imagesLoaded:0,largeImagesLoaded:0,imagesProcessed:0,isImagesLoaded:!1,preloader:null,usingSmallImages:null,startButtonToggled:!1,loadImagesInSequence:!1,hotspotInstances:null,activeHotspot:null,hotspotOverlay:null,hotspotImage:null,isHotspotsVisible:!0,tooltips:{},daggedObject:null,clickPaneTouchMoveReference:null,clickPaneTouchEndReference:null,
requestRescaleFlag:!1,mouseWheelCounter:0,clickPane:null,sliderHandle:null,handleMaxX:null,infoPanel:null,clickPane:null,sliderHandle:null,silderContainer:null,isGAenabled:a.gaData.isEnabled&&"true"==a.gaData.isEnabled.toLowerCase(),gaEnabledEvents:a.gaData.enabledEvents instanceof Array?a.gaData.enabledEvents:RotateTool.defaultGAevents,gaTrackingId:a.gaData.trackingId,gaCategory:a.gaData.category,gaLabel:a.gaData.label,setLevel:function(b){!1!==this.isImagesLoaded&&(this.lastImgV=b,b=this.dx,this.dx=
this.dy=0,this.showNextImage(),this.dx=b)},setImage:function(b,a){a="undefined"!==typeof a?a:!0;if(!isNaN(b)&&!1!==this.isImagesLoaded){var c=this.dx;this.stopRotation();b>this.imagesToLoad-1||(1==this.vSteps||b<this.hSteps?this.lastImgH=b:(this.lastImgV=Math.floor(b/this.hSteps),this.lastImgH=b-this.lastImgV*this.hSteps),this.dx=this.dy=0,this.showNextImage(a),this.dx=c)}},startLoadingImages:function(){this.startButtonToggled=!0;this.generateImages()},isSpinning:function(){return 0!=this.dx},getImageId:function(){return this.currentImage.idNumber},
toggleHotspots:function(){this.isHotspotsVisible?this.showHotspots(!1):this.showHotspots(!0)},showHotspots:function(b){this.isHotspotsVisible=b?!0:!1;this.redrawHotspots()},onTabActivityChange:function(b){this.imagesLoaded&&(b?(RotateTool.isFF&&this.hideAllImages(),isNaN(this.lastDx)||(this.dx=this.lastDx)):(this.lastDx=this.dx,this.dx=0));this.hasTabFocus=b},initialize:function(){var b=this.target.clientHeight;0<this.target.clientWidth&&0<b?this.initialize_sizeOk():setTimeout(RotateTool.bind(this,
this.initialize),250)},initialize_sizeOk:function(){if(this.target){this.path=RotateTool.fixPathVariable(this.path);var b=this.path+this.configFile;this.zIndex=RotateTool.zIndex;this.setDefaultTargetStyles();this.loadStyles(this.themeUrl);this.storeTargetDimensions();this.target.innerHTML="";this.gaCategory=this.gaCategory&&""!=this.gaCategory?this.gaCategory:"YOFLA_360";var g=this.productId?this.productId:this.elementId;this.gaLabel=this.gaLabel&&""!==this.galabel?this.gaLabel:"YOFLA_360_"+g;!1===
RotateTool.isSupportedBrowser?this.reportBrowserNotSupported():"config.xml"==this.configFile?RotateTool.loadXMLFile(b,this.configXmlLoaded,this):RotateTool.loadScript(b,this.configJsLoaded,this)}else RotateTool.reportUserError("Could not locate target element with id:"+a.target)},setDefaultTargetStyles:function(){this.target.style.position="relative";this.target.style.minWidth="150px";this.target.style.minHeight="150px";this.target.style.overflow="hidden";this.target.className="rotate-tool-instance";
this.target.className+=" rotate-tool-spacer";this.target.className+=" rotate-tool-unselectable";RotateTool.isTouchDevice&&(this.target.className+=" rotate-tool-touch-device");this.originalTargetWidth=this.target.clientWidth;this.originalTargetHeight=this.target.clientHeight;this.originalTargetRatio=this.originalTargetWidth/this.originalTargetHeight;if("undefined"===typeof this.forcedSize?0:2==this.forcedSize.length){var b=Math.min(this.forcedSize[0],window.innerWidth||document.body.clientWidth),a=
b/this.forcedSize[0]*this.forcedSize[1],b=parseInt(b),a=parseInt(a);this.target.style.width=b+"px";this.target.style.height=a+"px";this.target.style.minWidth=b+"px";this.target.style.minHeight=a+"px";this.originalTargetWidth=b;this.originalTargetHeight=a;this.originalTargetRatio=b/a}this.updateTargetStyles()},updateTargetStyles:function(){var b="undefined"===typeof this.forcedSize?!1:2==this.forcedSize.length?!0:!1;if(RotateTool.isFullscreen())this.target.style.width="100%",this.target.style.height=
"100%";else if(RotateTool.isRunningInIframe&&!1==b)this.target.style.width="100%",this.target.style.height="100%";else{var a=(this.target.parentElement||document.documentElement).clientWidth;a<this.originalTargetWidth?(this.target.style.width=a+"px",this.target.style.height=Math.floor(a/this.originalTargetRatio)+"px"):(this.target.style.width=this.originalTargetWidth+"px",this.target.style.height=this.originalTargetHeight+"px");b&&(b=Math.min(this.forcedSize[0],window.innerWidth||document.body.clientWidth),
a=b/this.forcedSize[0]*this.forcedSize[1],this.target.style.width=b+"px",this.target.style.height=a+"px")}this.storeTargetDimensions()},storeTargetDimensions:function(){this.targetWidth=Math.min(this.target.clientWidth,document.documentElement.clientWidth);this.targetHeight=Math.max(200,this.target.clientHeight);this.objectWidth=Math.floor(this.targetWidth);this.objectHeight=Math.floor(this.targetHeight);this.targetRatio=this.targetWidth/this.targetHeight;this.canvas&&(this.canvas.width=this.targetWidth,
this.canvas.height=this.targetHeight)},loadStyles:function(b){var a=document;"undefined"===typeof b||""==b.length?b=this.path+"assets/styles.css":0<b.indexOf("styles.css")||(b=RotateTool.fixPathVariable(b)+"styles.css");if(!a.getElementById("rotate-tool-styles")){var c=a.getElementsByTagName("head")[0],a=a.createElement("link");a.id="rotate-tool-styles";a.rel="stylesheet";a.type="text/css";a.href=b;a.media="all";c.appendChild(a)}},setInfo:function(){var b=this.createInfoIcon();this.target.appendChild(b);
RotateTool.addClickOrTouchListener(b,{forTouch:"touchend",forMouse:"click"},function(){window.open("//www.yofla.com/3d-rotate/player-about/?ref=player_trial","_blank")})},createInfoIcon:function(){var b=document.createElement("div");b.className="rotate-tool-info-image";b.style.position="absolute";b.style.top="5px";b.style.left="5px";b.style.width="25px";b.style.height="25px";b.style.cursor="pointer";b.style.border="0px";b.style.zIndex=this.zIndex.info;b.style.backgroundImage="url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAMAAADzN3VRAAAAaVBMVEUAAADq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urq6urm39/i1NTeycnbvr3TpqXPmZjLjIrHf33EcG7BYl+9Uk65QDq1LCKxGQIgeu/UAAAAInRSTlMAARMVFzAyPVRqi4ysrrK9wsvP2ubo6evt8PLz9ff4+vz9cPxJuAAAANBJREFUKM99UtkOhCAMrDfeit31dpH//8gVBKqJcZ5aJqXTaQFOhCyreMerjIVwRZDWaFGnARFxgVcUsSWSFu9ok5OIuHn4ztu+6ohHivBLQ4y7PNDruPQBvNT+oYnFJKkHQWOZWcrfaJMmAIbPYJBTMi7CtDmQQ2XDQag+7rsK+E2AHGzKobPhJEj0gY5qcFMMUo3rg6pGIPUhbapkQ9Lm5ukVM1/mcR4MumYgD5xvk1a9km/Oa80Io1p57fbTC7mNH7zs52WnL3fwcjuP9/YHpzIqZ7oB1g0AAAAASUVORK5CYII=')";
return b},addContexMenu:function(){this.addContexMenuListener();this.addContexMenuContainer();this.setContexMenuItems(this.getContexMenuItems())},getContexMenuItems:function(){var b=[],a={title:"Disable this menu",action:"CONTEXMENU_DISABLE",data:null};b.push({title:"About this 360&deg; viewer",action:"URL_OPEN",data:"http://www.yofla.com/3d-rotate/player-about/?v="+RotateTool.scriptVersion});if("3DRTFLEXIPRO"==RotateTool.licenseType||"3DRTFLEXIPROWL"==RotateTool.licenseType){var c=RotateTool.getCurrentDomain().toLocaleLowerCase();
0<c.length&&0>RotateTool.authorizedDomains.indexOf(c)&&"localhost"!==c&&b.unshift({title:"Domain not authorized!",action:"URL_OPEN",data:"http://www.yofla.com/3d-rotate/support/domain-not-authorized/"})}0<b.length&&b.push(a);return b},addContexMenuListener:function(){var b=this;this.funcRefContexMenuShow=function(a){a.preventDefault();b.showContexMenu(a)};this.funcRefContexMenuShowIE=function(){window.event.returnValue=!1;b.showContexMenu(window.event)};this.target.addEventListener?this.target.addEventListener("contextmenu",
this.funcRefContexMenuShow,!1):this.target.attachEvent("oncontextmenu",this.funcRefContexMenuShowIE)},disableContexMenu:function(){this.target.addEventListener?this.target.removeEventListener("contextmenu",this.funcRefContexMenuShow,!1):this.target.detachEvent("oncontextmenu",this.funcRefContexMenuShowIE)},addContexMenuContainer:function(){this.contexMenu=document.createElement("ul");this.contexMenu.style.zIndex=this.zIndex.contexMenu;this.contexMenu.style.position="absolute";this.contexMenu.style.display=
"none";this.contexMenu.style.left="100px";this.contexMenu.style.top="100px";this.contexMenu.className="rotate-tool-contex-menu";this.target.appendChild(this.contexMenu);RotateTool.addClickOrTouchListener(this.contexMenu,RotateTool.eventsMouseLeave,RotateTool.bind(this,this.hideContexMenu))},setContexMenuItems:function(b){this.contexMenu.innerHTML="";for(var a=this,c,d,e,f=0;f<b.length;f++)c=document.createElement("li"),d=b[f],e=function(b){return function(c){a.onContexMenuItemSelected(c,b)}}(d),c.innerHTML=
d.title,RotateTool.addClickOrTouchListener(c,{forMouse:"click"},e),this.contexMenu.appendChild(c)},onContexMenuItemSelected:function(b,a){this.hideContexMenu();switch(a.action){case "URL_OPEN":window.open(a.data,"_blank");break;case "CONTEXMENU_DISABLE":this.disableContexMenu()}},showContexMenu:function(b){this.dispatchEvent(RotateTool.CONTEXMENU_SHOW);var a;try{a=RotateTool.getLocalMousePosition(b)}catch(c){}isNaN(a.x)||isNaN(a.y)||(this.contexMenu.style.display="block",this.contexMenu.style.left=
a.x+"px",this.contexMenu.style.top=a.y+"px")},hideContexMenu:function(){this.contexMenu&&(this.contexMenu.style.display="none")},configJsLoaded:function(){RotateTool.yofla_360_is_preview=0<navigator.userAgent.indexOf("AdobeAIR")?!0:!1;if(!this.isConfigJsLoaded){this.isConfigJsLoaded=!0;var b;try{b=eval("productRotationData_"+this.productId)}catch(a){try{b=eval("RotationData_"+this.productId)}catch(c){try{b=eval("RotationData")}catch(d){return RotateTool.reportUserError("Error evaluating config.js!"),
!1}}}if(void 0===b)return RotateTool.reportUserError("Error accessing settings in config.js!"),!1;try{this.parseSettings(b)}catch(e){RotateTool.reportUserError("Error parsing settings, maybe a typo? Error: "+e)}}},onSettingsInitialized:function(){this.addWindowResizeListener();this.addFullscreenListener();this.initCustomLogo();this.addContexMenu();this.initHotspots();this.initRotation();this.addPlayerInfo()},configXmlLoaded:function(b){var a={settings:{rotation:{multilevel:{}},preloader:{},userInterface:{},
control:{},hotspots:{}},images:{}},c=b[0].getElementsByTagName("settings")[0],d={rotatePeriod:parseFloat(c.getElementsByTagName("rotation")[0].getAttribute("rotatePeriod")),rotate:c.getElementsByTagName("rotation")[0].getAttribute("rotate"),rotateDirection:parseInt(c.getElementsByTagName("rotation")[0].getAttribute("rotateDirection")),bounce:"true"==c.getElementsByTagName("rotation")[0].getAttribute("bounce"),multilevel:{}};a.settings.rotation=d;d={showToggleRotateButton:"true"==c.getElementsByTagName("userInterface")[0].getAttribute("showToggleRotateButton"),
showTogglePlayButton:"true"==c.getElementsByTagName("userInterface")[0].getAttribute("showTogglePlayButton"),showZoombar:"true"==c.getElementsByTagName("userInterface")[0].getAttribute("showZoombar"),showArrows:"true"==c.getElementsByTagName("userInterface")[0].getAttribute("showArrows"),showToggleFullscreenButton:"true"==c.getElementsByTagName("userInterface")[0].getAttribute("showToggleFullscreenButton"),showMouseWheelToolTip:"true"==c.getElementsByTagName("userInterface")[0].getAttribute("showMouseWheelToolTip"),
showZoomButtons:"true"==c.getElementsByTagName("userInterface")[0].getAttribute("showZoomButtons")};a.settings.userInterface=d;d={maxZoom:parseInt(c.getElementsByTagName("control")[0].getAttribute("maxZoom")),maxZoomAuto:"true"==c.getElementsByTagName("control")[0].getAttribute("maxZoomAuto"),reverseDrag:"true"==c.getElementsByTagName("control")[0].getAttribute("reverseDrag"),enableSwing:"true"==c.getElementsByTagName("control")[0].getAttribute("enableSwing"),mouseWheelZooms:"true"==c.getElementsByTagName("control")[0].getAttribute("mouseWheelZooms")};
a.settings.control=d;c={image:c.getElementsByTagName("preloader")[0].getAttribute("image")};a.settings.preloader=c;c=b[0].getElementsByTagName("images")[0];0==c.getElementsByTagName("image").length&&(c=b[0].getElementsByTagName("images")[1]);b=c.getElementsByTagName("image");for(var c=b.length,d=[],e=0;e<c;e++){var f={},k,l;k=b[e].getAttribute("src");l=b[e].getAttribute("srcLarge");f.src=k;l&&(f.srcLarge=l);d.push(f)}a.images=d;this.parseSettings(a)},parseSettings:function(b){this.settings.rotation=
{rotatePeriod:b.settings.rotation.rotatePeriod,rotateOnStart:"true"==b.settings.rotation.rotate||!0===b.settings.rotation.rotate,rotateDirection:b.settings.rotation.rotateDirection,bounce:b.settings.rotation.bounce,rotateOnce:"once"==b.settings.rotation.rotate,multilevel:{}};this.bounce=this.settings.rotation.bounce;"undefined"===typeof b.settings.rotation.multilevel?(this.settings.rotation.multilevel.reverseDrag=!1,this.settings.rotation.multilevel.disableDrag=!1,this.settings.rotation.multilevel.verticalSensitivity=
5):(this.settings.rotation.multilevel.verticalSensitivity=isNaN(b.settings.rotation.multilevel.verticalSensitivity)?20:b.settings.rotation.multilevel.verticalSensitivity,this.settings.rotation.multilevel.reverseDrag="undefined"===typeof b.settings.rotation.multilevel.reverseDrag?!1:b.settings.rotation.multilevel.reverseDrag,this.settings.rotation.multilevel.disableDrag="undefined"===typeof b.settings.rotation.multilevel.disableDrag?!1:b.settings.rotation.multilevel.disableDrag);this.settings.preloader=
{type:"undefined"===typeof b.settings.preloader.type?"default":b.settings.preloader.type,color1:"undefined"===typeof b.settings.preloader.color1?"#333333":b.settings.preloader.color1,image:"undefined"===typeof b.settings.preloader.image?"first":b.settings.preloader.image,showStartButton:"undefined"===typeof b.settings.preloader.showStartButton?!1:b.settings.preloader.showStartButton,showStartButtonMobile:"undefined"===typeof b.settings.preloader.showStartButtonMobile?!1:b.settings.preloader.showStartButtonMobile,
showLoadedImages:"undefined"===typeof b.settings.preloader.showLoadedImages?!1:b.settings.preloader.showLoadedImages,background:"undefined"===typeof b.settings.preloader.background?{enabled:!0,alpha:0.5,color:"#FFFFFF"}:b.settings.preloader.background,largeImagesPreloader:"undefined"===typeof b.settings.preloader.largeImagesPreloader?!1:b.settings.preloader.largeImagesPreloader};RotateTool.isMobileDevice&&!0==this.settings.preloader.showStartButtonMobile&&(this.settings.preloader.showStartButton=
!0);this.settings.userInterface={showTogglePlayButton:b.settings.userInterface.showTogglePlayButton,showZoomButtons:b.settings.userInterface.showZoomButtons,showArrows:b.settings.userInterface.showArrows,showToggleFullscreenButton:b.settings.userInterface.showToggleFullscreenButton,showToggleRotateButton:b.settings.userInterface.showToggleRotateButton,showMouseWheelToolTip:"undefined"===typeof b.settings.userInterface.showMouseWheelToolTip?!0:b.settings.userInterface.showMouseWheelToolTip,showZoomSlider:b.settings.userInterface.showZoombar};
!1==this.settings.userInterface.showMouseWheelToolTip&&(this.toolTipOnMouseWheelShown=!0);this.settings.control={maxZoom:b.settings.control.maxZoom?b.settings.control.maxZoom:200,maxZoomAuto:"undefined"===typeof b.settings.control.maxZoomAuto?!1:b.settings.control.maxZoomAuto,dragSpeed:b.settings.control.dragSpeed,rotateOnClick:"undefined"===typeof b.settings.control.rotateOnClick?!0:!!b.settings.control.rotateOnClick,zoomSetsPan:"undefined"===typeof b.settings.control.zoomSetsPan?!0:!!b.settings.control.zoomSetsPan,
zoomInStopsRotation:"undefined"===typeof b.settings.control.zoomInStopsRotation?!0:!!b.settings.control.zoomInStopsRotation,reverseDrag:b.settings.control.reverseDrag,enableSwing:b.settings.control.enableSwing,rotateOnMouseHover:b.settings.control.rotateOnMouseHover,clickUrl:b.settings.control.clickUrl,clickUrlTarget:b.settings.control.clickUrlTarget,touchPageScroll:"undefined"===typeof b.settings.control.touchPageScroll?!1:b.settings.control.touchPageScroll,disableMouseControl:b.settings.control.disableMouseControl,
disableMouseWheel:b.settings.control.disableMouseWheel,switchToPanOnYmovement:"undefined"===typeof b.settings.control.switchToPanOnYmovement?!1:b.settings.control.switchToPanOnYmovement,mouseWheelZooms:b.settings.control.mouseWheelZooms};this.isRotationWhenZoomed=!1==this.settings.control.zoomSetsPan;this.settings.hotspots=b.hotspots;this.hSteps=this.imagesToLoad=b.images.length;this.vSteps=1;"undefined"===typeof this.vSteps&&(this.vSteps=1);this.hSteps=this.imagesToLoad/this.vSteps;this.imageNodes=
b.images;this.settings.hotspots=b.hotspots;this.settings.custom=b.custom;this.zoomStepInPercent=Math.round(this.settings.control.maxZoom/this.zoomSteps);this.zoomStepInRatio=1/this.zoomSteps;this.settings.stylesVersion=0;b.stylesVersion&&(this.settings.stylesVersion=parseInt(b.stylesVersion));this.settings.preloader.showLoadedImages&&(this.loadImagesInSequence=!0);this.loadImagesInChunk=!0;this.usingSmallImages=!1;this.onSettingsInitialized()},setLargeImagesSize:function(b,a){this.largeImagesSize=
{width:b,height:a};this.updateMaxZoom()},updateMaxZoom:function(){if(this.settings.control.maxZoomAuto){var b=this.computeMaxZoomAuto();this.settings.control.maxZoom=b;b<this.maxZoomThreshold?(RotateTool.hideElement(this.silderContainer),RotateTool.hideElement(this.buttonZoomIn),RotateTool.hideElement(this.buttonZoomOut)):(RotateTool.showElement(this.silderContainer),RotateTool.showElement(this.buttonZoomIn),RotateTool.showElement(this.buttonZoomOut))}},computeMaxZoomAuto:function(){if(this.currentImage)return Math.max(100,
100*(1/(this.targetRatio<this.currentImage.ratio?this.targetWidth/this.currentImage.originalWidth:this.targetHeight/this.currentImage.originalHeight)))},addWindowResizeListener:function(){var b=this;this.resizeListenerReference=function(a){b.windowResizeListener(a)};var a=RotateTool.debounce(this.resizeListenerReference,250);RotateTool.addEventSimple(window,"resize",a)},addFullscreenListener:function(){document.addEventListener&&(document.addEventListener("fullscreenchange",RotateTool.bind(this,this.fullscrentChangedListener)),
document.addEventListener("webkitfullscreenchange",RotateTool.bind(this,this.fullscrentChangedListener)),document.addEventListener("mozfullscreenchange",RotateTool.bind(this,this.fullscrentChangedListener)),document.addEventListener("MSFullscreenChange",RotateTool.bind(this,this.fullscrentChangedListener)))},initRotation:function(){this.updateTargetStyles();this.settings.preloader.showLoadedImages?this.generateImages():this.showPreloaderImage(this.settings.preloader.image,this.generateImages)},showPreloaderImage:function(b,
a){var c,d;if(RotateTool.isIE8)a.apply(this);else if(isNaN(b))switch(b){case "first":c=this.path+this.imageNodes[0].src;this.createPreloaderImage(c,a);break;case "splash":c=this.path+"splash.jpg";this.createPreloaderImage(c,a);break;case "splash.png":c=this.path+"splash.png";this.createPreloaderImage(c,a);break;default:a.apply(this)}else d=parseInt(b),d<this.imageNodes.length?(c=this.path+this.imageNodes[d].src,this.imageNodes[d].srcLarge&&600<this.targetWidth&&(c=this.path+this.imageNodes[d].srcLarge),
this.createPreloaderImage(c,a)):a.apply(this)},createPreloaderImage:function(b,a){var c=document.createElement("img");this.target.appendChild(c);c.className="rotate-tool-preloader-image";c.style.position="absolute";c.style.display="block";c.style.visibility="hidden";c.style.zIndex=this.zIndex.preloaderImage;c.onload=this.preloaderImageLoaded.apply(this,[c,a]);c.onerror=null;c.src=b;this.preloaderImage=c},preloaderImageLoaded:function(b,a){var c=this;return function(){c.processLoadedPreloaderImage(b,
a)}},processLoadedPreloaderImage:function(b,a){this.dispatchEvent(RotateTool.PRELOADER_LOADED);b.scaled=!1;b.ratio=b.width/b.height;b.originalWidth=b.width;b.originalHeight=b.height;this.setScale(100,b);b.style.visibility="visible";a.apply(this)},generateImages:function(){!0==this.settings.preloader.showStartButton&&!1==this.startButtonToggled?this.showStartButton():(this.addPreloader(this.settings.preloader.type),setTimeout(RotateTool.bind(this,this.generateImagesContinued),100))},generateImagesContinued:function(){for(var b=
0,a=0;a<this.imagesToLoad;a++){var c,d,e;c=this.path+this.imageNodes[a].src;d=this.imageNodes[a].srcLarge?this.path+this.imageNodes[a].srcLarge:!1;e=this.imageNodes[a].srcSmall?this.path+this.imageNodes[a].srcSmall:!1;var f=document.createElement("img");f.id="rotate-image-"+a;f.idNumber=a;f.className="rotate-tool-image";f.fileName=RotateTool.baseName(c);void 0===this.imagesGrid[b]&&(this.imagesGrid[b]=[]);this.imagesGrid[b].push(a);f.data=this.imageNodes[a];f.hotspots=this.processImageDataHotspots(f.data.hotspots);
f.srcNormal=c;f.srcLarge=d;f.srcSmall=e;f.style.display="block";f.style.zIndex=this.zIndex.imageHidden;f.onload=this.imageLoaded.apply(this,[f]);f.onerror=this.imageError.apply(this,[f]);this.rotateImages[a]=f;!1==this.loadImagesInSequence&&!1==this.loadImagesInChunk&&(this.usingSmallImages=!1,RotateTool.setImageSource(f,c));0===(a+1)%this.hSteps&&b++}if(this.loadImagesInChunk)if(10<this.rotateImages.length){this.chunkSize=Math.min(10,this.rotateImages.length);this.chunks=[];this.chunksCount=Math.ceil(this.rotateImages.length/
this.chunkSize);for(a=0;a<this.rotateImages.length;a++)b=Math.floor(a/this.chunkSize),this.chunks[b]||(this.chunks[b]=[]),this.chunks[b].push(this.rotateImages[a]);this.currentChunkId=0;this.loadNextChunk()}else this.loadImagesInSequence=!0;this.loadImagesInSequence&&(this.usingSmallImages=!1,f=this.rotateImages[0],RotateTool.setImageSource(f,f.srcNormal));f.srcLarge&&(this.hasLargeImages=!0)},loadNextChunk:function(){this.currentChunkId=Math.floor(this.imagesLoaded/this.chunkSize);for(i=0;i<this.chunks[this.currentChunkId].length;i++)image=
this.chunks[this.currentChunkId][i],!0!==image.loaded&&RotateTool.setImageSource(image,image.srcNormal)},showStartButton:function(){return this.generateButton("rotate-tool-button-start",this.startButtonClickListener)},startButtonClickListener:function(b){this.dispatchEvent(RotateTool.BUTTON_START_CLICK);b.target.style.display="none";this.startLoadingImages()},addPreloader:function(b){if("function"==typeof rotateToolCustomPreloader)this.preloader=rotateToolCustomPreloader(this.elementId,this.settings.preloader);
else{switch(b){case "wave":RotateTool.browserSupportsCSSProperty("animation")?this.preloader=RotateTool.wavePreloader(this.elementId,this.settings.preloader):this.preloader=RotateTool.defaultPreloader(this.elementId,this.settings.preloader);break;default:this.preloader=RotateTool.defaultPreloader(this.elementId,this.settings.preloader)}window.requestAnimationFrame?window.requestAnimationFrame(RotateTool.bind(this,this.updatePreloaderOnAnimationFrame)):this.preloaderTimer=setInterval(this.updatePreloader.apply(this),
250)}},updatePreloaderOnAnimationFrame:function(){this.imagesLoaded||(this.updatePreloader(),window.requestAnimationFrame(RotateTool.bind(this,this.updatePreloaderOnAnimationFrame)))},processImageDataHotspots:function(b){var a=null;if(!RotateTool.isObjectEmpty(b)){var a=[],c;for(c in b){var d={};d.id=b[c].id;d.rx=b[c].rx;d.ry=b[c].ry;a.push(d)}}return a},imageLoaded:function(b){var a=this;return function(){a.imagesLoaded++;a.processLoadedImage(b);a.increaseImagesProcessedCount();a.loadImagesInSequence&&
a.loadNextImage()}},loadNextImage:function(){var b=this.rotateImages[this.imagesLoaded];b&&(b.src=b.srcNormal)},imageNormalLoaded:function(b){var a=this;return function(){a.processLoadedImageNormal(b)}},loadLargeImage:function(b,a){if(!0!==this.isLoadingLargeImage){this.isLoadingLargeImage=!0;var c=document.createElement("img");c.onload=this.imageLargeLoaded.apply(this,[c,b]);RotateTool.setImageSource(c,b.srcLarge)}},imageLargeLoaded:function(b,a){var c=this;return function(){c.processLoadedImageLarge(b,
a)}},imageError:function(b){var a=this;return function(){a.imageLoadErrorsString+=b.src+"\n";a.imageLoadErrorCount+=1;a.increaseImagesProcessedCount()}},increaseImagesProcessedCount:function(){this.imagesProcessed++;this.updatePreloader();this.checkImagesProcessed()},checkImagesProcessed:function(){if(this.imagesProcessed==this.imagesToLoad){this.destroyPreloader();if(this.imagesLoaded==this.imagesToLoad)this.onAllImagesSuccesfullyLoaded();this.preloaderImage&&(this.preloaderImage.style.display="none")}else 0==
this.imagesLoaded%this.chunkSize&&this.loadImagesInChunk&&this.loadNextChunk()},updatePreloader:function(){var b=Math.round(100*(this.imagesProcessed/this.imagesToLoad));this.preloader&&this.preloader.update&&this.preloader.update(b);this.dispatchEvent(RotateTool.PRELOADER_PROGRESS,parseInt(b))},destroyPreloader:function(){this.preloader&&this.preloader.destroy&&this.preloader.destroy()},processLoadedImage:function(b){this.target.appendChild(b);b.style.position="absolute";b.style.zIndex=this.zIndex.imageHidden;
b.style.overflow="hidden";!0==this.settings.control.disableMouseControl?(b.style.pointerEvents="none",b.setAttribute&&b.setAttribute("draggable","false")):b.style.cursor="pointer";b.scaled=!1;b.ratio=b.width/b.height;b.originalWidth=b.width;b.originalHeight=b.height;b.normalImageWidth=b.width;b.normalImageHeight=b.height;b.onload=null;b.loaded=!0;RotateTool.isIE||RotateTool.isFF?this.setScale(100,b):b.style.opacity=0},processLoadedImageNormal:function(b){var a=this.rotateImages[b.id];a.originalWidth=
a.width;a.originalHeight=a.height;a.normalImageWidth=a.width;a.normalImageHeight=a.height;a.scaled=!1;a.onload=null;a.src=b.src},processLoadedImageLarge:function(b,a){this.isLoadingLargeImage=!1;a.onload=null;a.originalWidth=b.width;a.originalHeight=b.height;a.largeImageWidth=b.width;a.largeImageHeight=b.height;a.scaled=!1;this.setScale(this.scaleInPercent,a);setTimeout(RotateTool.bind(this,this.loadNextLargeImage),100);this.largeImagesSize||this.setLargeImagesSize(b.width,b.height);this.largeImagesLoaded++;
this.settings.preloader.largeImagesPreloader&&this.updateLargeImagesPreloader(this.largeImagesLoaded/this.imagesToLoad)},updateLargeImagesPreloader:function(b){this.largeImagesPreloader||this.addLargeImagesPreloader();var a=Math.round(100*b)+"%";this.largeImagesPreloaderInnerBar.style.width=a;if(1==b){var c=this;c.largeImagesPreloader.className="rotate-tool-largeimages-preloader loaded";setTimeout(function(){c.largeImagesPreloader.style.display="none"},1E3)}},addLargeImagesPreloader:function(){this.largeImagesPreloader=
document.createElement("div");this.largeImagesPreloader.className="rotate-tool-largeimages-preloader";this.largeImagesPreloader.style.zIndex=this.zIndex.preloaderLarge;this.target.appendChild(this.largeImagesPreloader);this.largeImagesPreloaderInnerBar=document.createElement("div");this.largeImagesPreloaderInnerBar.className="rotate-tool-largeimages-preloader-inner-bar";this.largeImagesPreloader.appendChild(this.largeImagesPreloaderInnerBar)},loadNextLargeImage:function(){var b=this.getNextUnloadedLargeImage();
b&&this.loadLargeImage(b)},getNextUnloadedLargeImage:function(){if(!this.currentImage.srcLarge)return!1;for(var b,a=0;a<this.hSteps;a++)if(b=this.rotateImages[this.imagesGrid[this.newImgV][a]],b.srcLarge&&"undefined"==typeof b.largeImageWidth)return b;for(a=0;a<this.rotateImages.length;a++)if(b=this.rotateImages[a],b.srcLarge&&"undefined"==typeof b.largeImageWidth)return b;return!1},onAllImagesSuccesfullyLoaded:function(){clearInterval(this.preloaderTimer);this.dispatchEvent(RotateTool.IMAGES_LOADED,
this.imagesLoaded);this.isImagesLoaded=!0;if("function"===typeof window.rotateToolInstanceLoaded)try{window.rotateToolInstanceLoaded(this.elementId)}catch(b){}if("function"===typeof window.yofla_rotateToolInstanceLoaded)try{window.yofla_rotateToolInstanceLoaded(this.elementId)}catch(a){}this.onImagesInitialized()},initLoadedImages:function(){for(var b=0;b<this.rotateImages.length;b++);setTimeout(RotateTool.bind(this,this.onImagesInitialized),250)},hideAllImages:function(){for(var b,a=0;a<this.rotateImages.length;a++)b=
this.rotateImages[a],RotateTool.isIE||RotateTool.isFF?b.style.visibility="hidden":b.style.opacity=0},onImagesInitialized:function(){this.hideAllImages();this.customLayer=document.createElement("div");this.customLayer.className="rotate-tool-custom-layer";this.customLayer.style.zIndex=this.zIndex.customLayer;this.target.appendChild(this.customLayer);(this.useCanvas=RotateTool.isCanvasSupported)&&this.addCanvas();this.addControls();this.initRotationVariables();this.setFirstImage();this.showNextImage();
this.repositionFixedHotspots();this.updateMaxZoom();window.requestAnimationFrame?this.rotateLoop():this.rotateInterval=setInterval(RotateTool.bind(this,this.rotateLoop),17);this.settings.rotation.rotateOnStart||this.settings.rotation.rotateOnce?!1===this.hasTabFocus?this.lastDx=this.getWorkingDx():this.startRotation():this.dx=0;this.usingSmallImages&&setTimeout(RotateTool.bind(this,this.loadNormalImages),150)},setFirstImage:function(){var b=this.settings.preloader.image,a;"first"===b&&(b=0);"number"==
typeof b&&(1==this.vSteps?b<this.hSteps&&(this.lastImgH=b-this.dx):(a=b%this.hSteps,b=Math.floor(b/this.hSteps),this.lastImgH=a-this.dx,this.lastImgV=b,this.dy=0))},loadNormalImages:function(){for(var b=0;b<this.rotateImages.length;b++){var a=document.createElement("img");a.id=b;a.onload=this.imageNormalLoaded.apply(this,[a]);RotateTool.setImageSource(a,this.rotateImages[b].srcNormal)}},initRotationVariables:function(){this.rotateIntervalDuration_current=this.rotateIntervalDuration_original=Math.floor(1E3*
this.settings.rotation.rotatePeriod/this.hSteps);this.rotateIntervalThresholdStop=3*this.rotateIntervalDuration_original;this.lastImgH=null;this.newImgV=this.lastImgV=this.newImgH=0;this.dx=this.settings.rotation.rotateDirection;!1==this.settings.rotation.rotateOnStart&&(this.dx=0);this.previousDx=this.dx;this.dy=0},initCustomLogo:function(){},addCustomLogo:function(b,a,c){},initHotspots:function(){},initHotspotInstance:function(b){},positionFixedHotspot:function(b){var a=b.data,c,d,e;if(b.isFixed&&
a.position){var f=function(b){var a;return b&&2<b.length&&(a=b.slice(-1),"%"==a)?(b=b.substr(0,b.length-1),parseFloat(b)):!1},k=function(b){var a,c;return b&&3<b.length&&(a=b.slice(-1),c=b.substr(0,1),"%"==a&&"i"==c)?(b=b.substr(1,b.length-2),parseFloat(b)):!1};a.position.top&&(d=c=a.position.top,e=f(c),!1!==e&&(d=e/100*this.targetHeight),c=k(c),!1!==c&&this.currentImage&&this.currentImage.width&&(d=c/100*this.currentImage.height+parseInt(this.currentImage.style.top)),b.style.top=d+"px");a.position.left&&
(d=c=a.position.left,e=f(c),!1!==e&&(d=e/100*this.targetWidth),c=k(c),!1!==c&&this.currentImage&&this.currentImage.width&&(d=c/100*this.currentImage.width+parseInt(this.currentImage.style.left)),b.style.left=d+"px");a.position.right&&(b.style.right=a.position.right+"px");a.position.bottom&&(b.style.bottom=a.position.bottom+"px")}},addHotspotEvents:function(b,a){},hotspotMouseOverListener:function(b){if(b&&b.target){var a=b.target.data;this.dispatchEvent(RotateTool.HOTSPOT_HOVER,{originalEvent:b});
a&&this.showToolTip(a,b.target)}},hotspotMouseOutListener:function(b){this.dispatchEvent(RotateTool.HOTSPOT_HOVER_OUT,{originalEvent:b});this.hideToolTipsInterval=setTimeout(RotateTool.bind(this,this.hideToolTips),250)},showToolTip:function(b,a,c){if(!b)return null;(b=this.getToolTip(b,a))&&b.show(c)},getToolTip:function(b,a){var c;this.tooltips[b.id]?c=this.tooltips[b.id]:(c=this.createToolTip(b,a),this.tooltips[b.id]=c);return c},hideToolTips:function(b){for(var a in this.tooltips)this.tooltips.hasOwnProperty(a)&&
this.tooltips[a].htmlElement&&"block"==this.tooltips[a].htmlElement.style.display&&b!=a&&!this.tooltips[a].timeoutToolTipOnHideCompleted&&!this.tooltips[a].keepVisible&&this.tooltips[a].hide()},createToolTip:function(b,a){if("object"!==typeof b.toolTip&&!b.title)return null;var c=this;return new function(b,d){this.htmlElement;this.positioning="CENTER_TO_HOTSPOT";this.keepVisible=this.timeoutToolTipOnHideCompleted=!1;this.createHtmlToolTip=function(){if(!b.toolTip.html.content)return null;this.htmlElement=
this.createToolTipWrapper();this.htmlElement.innerHTML=RotateTool.fixPathsInHtml(b.toolTip.html.content,RotateTool.fixPathVariable(c.path))};this.createSimpleToolTip=function(){if(!b.title)return null;this.htmlElement=this.createToolTipWrapper();this.positioning="NEXT_TO_HOTSPOT";this.htmlElement.innerHTML='<span class="rotate-tool-tooltip">'+b.title.text.toString()+"</span>"};this.positionToolTip=function(){var c=10,k=10,l,n=this.htmlElement.offsetWidth,m=this.htmlElement.offsetHeight;if(!(n>=d.targetWidth||
m>=d.targetHeight)){a instanceof Array&&2==a.length?(c=a[0],k=a[1],l=20):("IMG"==a.tagName&&(a=a.parentNode),k=a.offsetTop,c=a.offsetLeft,l=a.offsetWidth);switch(this.positioning){case "CENTER_TO_HOTSPOT":c=Math.floor(c-0.5*n);k=Math.floor(k-0.5*m);break;default:c=c+l+5,"mousewheel_tooltip"==b.id&&(k+=10)}c=Math.max(c,10);k=Math.max(k,10);c=Math.min(c,d.targetWidth-n-10);k=Math.min(k,d.targetHeight-m-10)}this.htmlElement.style.left=c+"px";this.htmlElement.style.top=k+"px"};this.createToolTipWrapper=
function(){var b=document.createElement("div");d.target.appendChild(b);b.className="rotate-tool-tooltip-wrapper rotate-tool-unselectable";b.style.position="absolute";b.style.zIndex=RotateTool.zIndex.toolTip;b.style.display="none";b.style.opacity=0;b.style.cursor="pointer";RotateTool.addClickOrTouchListener(b,RotateTool.eventsTouchEnd,RotateTool.bind(this,this.mouseOrTouchEnd));RotateTool.addClickOrTouchListener(b,RotateTool.eventsMouseLeave,RotateTool.bind(this,this.mouseLeave));RotateTool.addClickOrTouchListener(b,
RotateTool.eventsMouseOver,RotateTool.bind(this,this.mouseOver));return b};this.mouseOrTouchEnd=function(){this.hide();RotateTool.isTouchDevice||(this.activeHotspot=null,d.executeHotspot(b))};this.mouseLeave=function(){this.hide();c.dispatchEvent(RotateTool.TOOLTIP_HOVER_OUT,{tooltipObject:this})};this.mouseOver=function(){clearTimeout(d.hideToolTipsInterval);c.dispatchEvent(RotateTool.TOOLTIP_HOVER,{tooltipObject:this})};this.show=function(a){this.htmlElement&&(d.hideToolTips(b.id),this.timeoutToolTipOnHideCompleted?
(this.htmlElement.style.opacity=1,this.htmlElement.style.display="block",clearTimeout(this.timeoutToolTipOnHideCompleted),this.timeoutToolTipOnHideCompleted=null):(this.htmlElement.style.display="block",this.positionToolTip(),this.htmlElement.style.MozTransition="opacity 0.4s ease-in-out",this.htmlElement.style.WebkitTransition="opacity 0.4s ease-in-out",this.htmlElement.style.opacity=1,this.timeoutToolTipOnHideCompleted=null,c.dispatchEvent(RotateTool.TOOLTIP_SHOW,{hotspotData:b,tooltipElement:this.htmlElement}),
a&&(a=parseInt(a),this.autoHideTimout=setTimeout(RotateTool.bind(this,this.hide),a))))};this.hide=function(){this.htmlElement.style.MozTransition="opacity 0.3s ease-in-out";this.htmlElement.style.WebkitTransition="opacity 0.3s ease-in-out";this.htmlElement.style.opacity=0;this.timeoutToolTipOnHideCompleted=setTimeout(RotateTool.bind(this,this.onHideCompleted),300)};this.onHideCompleted=function(){this.htmlElement.style.display="none";this.timeoutToolTipOnHideCompleted=null};this.initialize=function(){!0==
b.keepVisible&&(this.keepVisible=!0);b.toolTip&&typeof("object"==b.toolTip.html)?this.createHtmlToolTip():b.title&&this.createSimpleToolTip()};this.initialize()}(b,this)},hotspotTouchStartListener:function(b,a){},hotspotTouchEndListener:function(b,a){},executeHotspot:function(b,a){},executeJavascriptHotspot:function(b,a){},executeUrlHotspot:function(b){},executeIframeHotspot:function(b){},showIframe:function(b){},hideIframeHotspot:function(){this.hideHotspotCloseButton();this.target.removeChild(this.hotspotOverlay);
this.target.removeChild(this.iframe);this.iframe=null},executeImageHotspot:function(b){},executeVideoHotspot:function(b){},showHotspotCloseButton:function(b){this.closeHotspotButton||this.createHotspotCloseButton();this.closeHotspotButton.style.display="block";this.hotspotCloseButtonCallback=b?b:null},hideHotspotCloseButton:function(){this.closeHotspotButton&&(this.closeHotspotButton.style.display="none")},createHotspotCloseButton:function(){var b=document.createElement("div");b.className="rotate-tool-close-hotspot-button-wrapper";
var a=document.createElement("div");a.className="rotate-tool-close-hotspot-button-content";a.innerHTML="&#x2716;";b.appendChild(a);b.style.zIndex=this.zIndex.hotspotCloseButton;b.style.display="none";this.target.appendChild(b);RotateTool.addClickOrTouchListener(b,{forTouch:"touchend",forMouse:"click"},RotateTool.bind(this,this.onButtonHotspotCloseListener));this.closeHotspotButton=b},onButtonHotspotCloseListener:function(){this.hotspotCloseButtonCallback?this.hotspotCloseButtonCallback():(this.hideHotspotCloseButton(),
this.hideVideoHotspot())},createHotspotOvelay:function(){},loadHotspotImage:function(b){},hotspotImageError:function(b){},hotspotImageLoaded:function(b){},fitHotspotImageToTarget:function(b){},addHotspotTitle:function(b){},hideImageHotspot:function(){},hideVideoHotspot:function(){},redrawHotspots:function(){},hideAllHotspots:function(){},showFixedHotspots:function(){},showHotspot:function(b){},getWorkingDx:function(){return 0!=this.previousDx?this.previousDx:0>this.settings.rotation.rotateDirection?
-1:1},startRotation:function(){this.dispatchEvent(RotateTool.ROTATION_START);0==this.dx&&(this.dx=this.getWorkingDx());this.isRotating=!0;this.rotateIntervalDuration_current=this.rotateIntervalDuration_original},stopRotation:function(){0!=this.dx&&(this.dispatchEvent(RotateTool.ROTATION_STOP),this.isRotating=!1,this.previousDx=this.dx,this.dx=0,this.setScale(this.scaleInPercent,this.currentImage))},stopRotationSmooth:function(){this.dispatchEvent(RotateTool.ROTATION_STOP);this.durationMultiplier=
1.05},startRotationSmooth:function(){this.dispatchEvent(RotateTool.ROTATION_START);this.dx=this.getWorkingDx();this.rotateIntervalDuration_current=1.5*this.rotateIntervalDuration_original;this.durationMultiplier=0.95},rotateLoop:function(){1!=this.durationMultiplier&&(this.rotateIntervalDuration_current*=this.durationMultiplier,this.rotateIntervalDuration_current>this.rotateIntervalDuration_original&&(this.rotateIntervalDuration_current=this.rotateIntervalDuration_original,this.durationMultiplier=
1));window.requestAnimationFrame&&window.requestAnimationFrame(RotateTool.bind(this,this.rotateLoop));this.okNextImage()&&this.showNextImage()},showNextImage:function(b){null==this.lastImgH?this.newImgV=this.newImgH=0:(this.newImgH=this.lastImgH+this.dx,this.newImgV=this.lastImgV+this.dy);this.newImgH>=this.hSteps&&(this.newImgH=0,this.bounce&&(this.newImgH=this.hSteps-1,this.dx=-this.dx));0>this.newImgH&&(this.newImgH=this.hSteps-1,this.bounce&&(this.newImgH=0,this.dx=-this.dx));this.newImgV>=this.vSteps&&
(this.newImgV=this.vSteps-1);0>this.newImgV&&(this.newImgV=0);try{if(this.currentImage=this.rotateImages[this.imagesGrid[this.newImgV][this.newImgH]],!this.currentImage)return}catch(a){return}if(!this.isDragging||!this.currentImage||this.currentImage!=this.previousImage){this.requestRescaleFlag&&this.setRescaleFlag();var c={imgH:this.newImgH,imgV:this.newImgV,imgSrc:this.currentImage.src,imageId:this.currentImage.idNumber,fileName:this.currentImage.fileName};!1===("undefined"===typeof b?!1:b)&&this.dispatchEvent(RotateTool.ON_IMAGE,
c);this.setScale(this.scaleInPercent,this.currentImage);this.useCanvas?this.redrawCanvas():(this.previousImage&&(RotateTool.isIE||RotateTool.isFF?this.previousImage.style.visibility="hidden":this.previousImage.style.opacity=0),this.currentImage&&(RotateTool.isIE||RotateTool.isFF?this.currentImage.style.visibility="visible":this.currentImage.style.opacity=1));this.hideToolTips();this.previousImage=this.currentImage;this.redrawHotspots();this.lastImgH=this.newImgH;this.lastImgV=this.newImgV;this.settings.rotation.rotateOnce&&
(this.rotateOnceCounter++,this.settings.rotation.bounce?this.rotateOnceCounter==2*(this.hSteps+1)&&(this.stopRotation(),this.settings.rotation.rotateOnce=!1):this.rotateOnceCounter==this.hSteps+1&&(this.stopRotation(),this.settings.rotation.rotateOnce=!1));this.timeLastImageShown=Date.now()}},redrawCanvas:function(){this.useCanvas&&this.currentImage&&this.currentImage.complete&&(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.drawImage(this.currentImage,parseInt(this.currentImage.style.left)||
0,parseInt(this.currentImage.style.top)||0,parseInt(this.currentImage.style.width),parseInt(this.currentImage.style.height)))},okNextImage:function(){var b=Date.now()-this.timeLastImageShown;if(!this.previousImage)return!0;if(0==this.dx&&0==this.dy)return!1;if(b>this.rotateIntervalDuration_current)return!0},setScale:function(b,a){if(a&&!a.scaled&&b){b=Math.max(100,b);this.scaleInPercent=b=Math.min(b,this.settings.control.maxZoom);var c=1,c=this.targetRatio<a.ratio?this.targetWidth/a.originalWidth:
this.targetHeight/a.originalHeight,c=c*(b/100);this.settings.control.maxZoomAuto&&100<b&&a.srcCurrent==a.srcLarge&&1<c&&(c=1);var d;d=Math.floor(a.originalHeight*c);c=Math.floor(a.originalWidth*c);("undefined"===typeof this.forcedSize?0:2==this.forcedSize.length)&&!RotateTool.isFullscreen()&&(c=Math.min(this.forcedSize[0],window.innerWidth||document.body.clientWidth),d=c/this.forcedSize[0]*this.forcedSize[1]);a.style.width=c+"px";a.style.height=d+"px";a.actualWidth=c;this.objectWidth=Math.floor(0.9*
c);this.objectHeight=Math.floor(0.8*d);if(100<b){c=-this.relativeX*c+0.5*this.targetWidth;d=-this.relativeY*d+0.5*this.targetHeight;var e=parseInt(this.currentImage.style.width),f=parseInt(this.currentImage.style.height),k=this.targetWidth-e-0,l=this.targetHeight-f-0;e>this.targetWidth&&(c=Math.min(c,0),c=Math.max(c,k));f>this.targetHeight&&(d=Math.min(d,0),d=Math.max(d,l));a.style.top=""+d+"px";a.style.left=""+c+"px"}else this.relativeY=this.relativeX=0.5,c<this.targetWidth&&d<this.targetHeight&&
(a.style.top=Math.floor(0.5*(this.targetHeight-d))+"px",a.style.left=Math.floor(0.5*(this.targetWidth-c))+"px"),c==this.targetWidth&&d==this.targetHeight&&(a.style.left="0px",a.style.top="0px"),c<this.targetWidth&&d==this.targetHeight&&(a.style.left=Math.floor(0.5*(this.targetWidth-c))+"px",a.style.top="0px"),c==this.targetWidth&&d<this.targetHeight&&(a.style.top=Math.floor(0.5*(this.targetHeight-d))+"px",a.style.left="0px");a.correctLeft=a.style.left;this.updateSrcOfImage(a);this.redrawHotspots()}},
setRescaleFlag:function(){for(var a=0;a<this.rotateImages.length;a++)this.rotateImages[a].scaled=!1;this.requestRescaleFlag=!1},addCanvas:function(){this.canvas=document.createElement("canvas");this.canvas.style.zIndex=this.zIndex.canvas;this.canvas.style.position="absolute";this.canvas.style.left="0px";this.canvas.style.right="0px";this.canvas.width=this.targetWidth;this.canvas.height=this.targetHeight;this.ctx=this.canvas.getContext("2d");this.target.appendChild(this.canvas)},addControls:function(){this.settings.userInterface.showTogglePlayButton&&
this.addPlayPauseButton();this.settings.userInterface.showZoomSlider&&this.addZoomSlider();this.settings.userInterface.showArrows&&this.addArrowButtons();this.settings.userInterface.showZoomButtons&&this.addZoomButtons();this.settings.userInterface.showToggleFullscreenButton&&RotateTool.isFullscreenBrowserAPISupported&&this.addFullscreenButton();RotateTool.yofla_360_is_preview&&this.settings.userInterface.showToggleFullscreenButton&&this.addFullscreenButton();if("true"==this.settings.userInterface.showToggleRotateButton||
!0==this.settings.userInterface.showToggleRotateButton||"zoom"==this.settings.userInterface.showToggleRotateButton)this.addToggleRotateButton(),this.addTogglePanButton(),this.toggleRotationInZoomMode(this.isRotationWhenZoomed),"zoom"==this.settings.userInterface.showToggleRotateButton?this.toggleToggleRotatePanButtons(!1):this.toggleToggleRotatePanButtons(!0);this.settings.control.disableMouseControl||(this.addClickPane(),this.addClickPaneTouchControls())},addPlayPauseButton:function(){return this.generateButton("rotate-tool-button-play",
this.playButtonClickListener)},playButtonClickListener:function(a){this.dispatchEvent(RotateTool.BUTTON_PLAY_PAUSE_CLICK);this.toggleRotation();RotateTool.pauseEvent(a)},addToggleRotateButton:function(){return this.generateButton("rotate-tool-button-toggle-rotate",this.toggleRotateButtonClickListener)},toggleRotateButtonClickListener:function(a){a.stopPropagation();this.dispatchEvent(RotateTool.BUTTON_ROTATE_CLICK);this.toggleRotationInZoomMode(!0)},addTogglePanButton:function(){return this.generateButton("rotate-tool-button-toggle-pan",
this.togglePanButtonClickListener)},togglePanButtonClickListener:function(a){a.stopPropagation();this.dispatchEvent(RotateTool.BUTTON_PAN_CLICK);this.toggleRotationInZoomMode(!1)},toggleRotationInZoomMode:function(a){var d=this.buttons["rotate-tool-button-toggle-pan"],c=this.buttons["rotate-tool-button-toggle-rotate"],h;c&&(h=(h=this.buttons["rotate-tool-button-toggle-rotate"].offsetWidth)?h:22);a?(this.isRotationWhenZoomed=!0,this.dispatchEvent(RotateTool.TOGGLE_ROTATE_MODE),d&&(d.style.backgroundPosition=
"0px"),c&&(c.style.backgroundPosition="-"+h+"px")):(this.isRotationWhenZoomed=!1,this.dispatchEvent(RotateTool.TOGGLE_PAN_MODE),d&&(d.style.backgroundPosition="-"+h+"px"),c&&(c.style.backgroundPosition="0px"))},addFullscreenButton:function(){return this.generateButton("rotate-tool-button-fullscreen",this.fullscreenButtonClickListener)},fullscreenButtonClickListener:function(a){a.stopPropagation();a=this.target;this.dispatchEvent(RotateTool.BUTTON_FULLSCREEN_CLICK);RotateTool.yofla_360_is_preview?
alert("Please preview fullscreen in a browser (requires iframe embed)."):(this.requestRescaleFlag=!0,this.isZoomed&&this.resetZoom(),RotateTool.isFullscreen()?(RotateTool.exitFullscreen(a),this.target.className=this.targetClassNameBeforeFullscreen):(RotateTool.launchFullscreen(a),this.targetClassNameBeforeFullscreen=this.target.className,this.target.className+=" in-fullscreen"))},addArrowButtons:function(){this.generateButton("rotate-tool-button-left",this.leftButtonClickListener,this.leftButtonMouseDownListener,
this.leftRightButtonMouseUpListener);this.generateButton("rotate-tool-button-right",this.rightButtonClickListener,this.rightButtonMouseDownListener,this.leftRightButtonMouseUpListener);1<this.vSteps&&(this.generateButton("rotate-tool-button-up",this.upButtonClickListener),this.generateButton("rotate-tool-button-down",this.downButtonClickListener))},addZoomButtons:function(){this.buttonZoomIn=this.generateButton("rotate-tool-button-zoom-in",this.zoomInButtonClickListener);this.buttonZoomOut=this.generateButton("rotate-tool-button-zoom-out",
this.zoomOutButtonClickListener)},leftButtonClickListener:function(a){this.dispatchEvent(RotateTool.BUTTON_ARROW_LEFT_CLICK);a.stopPropagation();this.stopRotation();this.dx=1;this.dy=0;this.settings.control.reverseDrag&&(this.dx=-this.dx);this.previousDx=this.dx;this.showNextImage();this.dx=0},leftButtonMouseDownListener:function(a){this.leftRightMouseDownListener(a,1)},rightButtonMouseDownListener:function(a){this.leftRightMouseDownListener(a,-1)},leftRightMouseDownListener:function(a,d){a.stopPropagation();
this.stopRotation();this.dx=d;this.dy=0;this.settings.control.reverseDrag&&(this.dx=-this.dx);this.previousDx=this.dx;this.dx=0;clearTimeout(this.buttonMouseDownTimer);this.buttonMouseDownTimer=setTimeout(RotateTool.bind(this,this.startRotation),250)},leftRightButtonMouseUpListener:function(){clearTimeout(this.buttonMouseDownTimer);this.stopRotation()},rightButtonClickListener:function(a){this.dispatchEvent(RotateTool.BUTTON_ARROW_RIGHT_CLICK);a.stopPropagation();this.stopRotation();this.dx=-1;this.dy=
0;this.settings.control.reverseDrag&&(this.dx=-this.dx);this.previousDx=this.dx;this.showNextImage();this.dx=0},upButtonClickListener:function(a){a.stopPropagation();this.resetZoom();this.stopRotation();this.dx=0;this.dy=1;this.settings.rotation.multilevel.reverseDrag&&(this.dy*=-1);this.showNextImage();this.dy=0},downButtonClickListener:function(a){a.stopPropagation();this.resetZoom();this.stopRotation();this.dx=0;this.dy=-1;this.settings.rotation.multilevel.reverseDrag&&(this.dy*=-1);this.showNextImage();
this.dy=0},zoomInButtonClickListener:function(a){this.dispatchEvent(RotateTool.BUTTON_ZOOM_IN_CLICK);a.stopPropagation();this.zoomStepHandler("zoomIn")},zoomOutButtonClickListener:function(a){this.dispatchEvent(RotateTool.BUTTON_ZOOM_OUT_CLICK);a.stopPropagation();this.zoomStepHandler("zoomOut")},zoomStepHandler:function(a){var d=this.settings.control.maxZoom,c;"zoomIn"===a?(c=this.currentZoomValue+this.zoomStepInRatio,c=Math.min(c,d/100)):(c=this.currentZoomValue-this.zoomStepInRatio,c=Math.max(c,
0));var h=this.currentZoomValue,e=0,f;clearInterval(this.zoomInterval);this.zoomInterval=setInterval(RotateTool.bind(this,function(){e++;21<=e?(clearInterval(this.zoomInterval),this.zoomRatioChangeListener(c,"zoomButton")):(f=RotateTool.Quad_easeOut(e,h,c-h,21),this.zoomRatioChangeListener(f,"zoomButton"))}),700/30)},generateButton:function(a,d,c,h){var e=document.createElement("div");e.className="rotate-tool-button "+a;e.style.zIndex=this.zIndex.buttons;e.style.position="absolute";this.target.appendChild(e);
RotateTool.addClickOrTouchListener(e,{forTouch:"touchend",forMouse:"click"},RotateTool.bind(this,d));c&&RotateTool.addClickOrTouchListener(e,{forTouch:null,forMouse:"mousedown"},RotateTool.bind(this,c));h&&RotateTool.addClickOrTouchListener(e,{forTouch:null,forMouse:"mouseup"},RotateTool.bind(this,h));return this.buttons[a]=e},addZoomSlider:function(){},createSliderContainer:function(){},createSliderHandle:function(){},updateSliderHandlePosition:function(a){},addClickPane:function(){var a=document.createElement("div");
a.style.width="100%";a.style.height="100%";a.style.background="white";a.style.opacity="0";a.style.filter="alpha(Opacity=0)";a.style.display="block";a.style.position="absolute";a.style.left="0px";a.style.top="0px";a.style.cursor="pointer";a.style.zIndex=this.zIndex.clickPane;this.target.appendChild(a);this.clickPane=a},addClickPaneTouchControls:function(){RotateTool.addClickOrTouchListener(this.clickPane,RotateTool.eventsTouchMove,RotateTool.bind(this,this.clickPaneMouseOrTouchMove));RotateTool.addClickOrTouchListener(this.clickPane,
RotateTool.eventsTouchStart,RotateTool.bind(this,this.clickPaneMouseOrTouchStart));RotateTool.addClickOrTouchListener(this.clickPane,RotateTool.eventsTouchEnd,RotateTool.bind(this,this.clickPaneMouseOrTouchEnd));RotateTool.addClickOrTouchListener(document,RotateTool.eventsTouchEnd,RotateTool.bind(this,this.clickPaneMouseOrTouchEnd));this.settings.control.rotateOnMouseHover&&!RotateTool.isTouchDevice&&this.addRotateOnHoverActions();!1!=RotateTool.isTouchDevice||this.settings.control.disableMouseWheel||
(this.clickPane.addEventListener?(this.clickPane.addEventListener("mousewheel",RotateTool.bind(this,this.MouseWheelHandler),!1),this.clickPane.addEventListener("DOMMouseScroll",RotateTool.bind(this,this.MouseWheelHandler),!1)):this.clickPane.attachEvent("onmousewheel",RotateTool.bind(this,this.MouseWheelHandler)))},clickPaneMouseOrTouchStart:function(a){a=a||window.event;this.hideContexMenu();this.hideToolTips();this.wasRotating=0!=this.dx;this.stopRotation();if(a.button&&2==a.button)return a.preventDefault&&
a.preventDefault(),!1;this.isTouchOrMouseDown=!0;this.touchMovePreviousDrag=this.touchMovePrevious=this.touchMove=this.touchStart=RotateTool.getMousePosition(a);this.isMouseMoved=!1;this.windowYPositionAtTouchStart=(window.pageYOffset||document.documentElement.scrollTop)-(document.documentElement.clientTop||0);this.windowXPositionAtTouchStart=(window.pageXOffset||document.documentElement.scrollLeft)-(document.documentElement.clientLeft||0);if(RotateTool.isRunningInIframe)try{this.windowYPositionAtTouchStart=
(window.parent.pageYOffset||window.parent.document.documentElement.scrollTop)-(window.parent.document.documentElement.clientTop||0),this.windowXPositionAtTouchStart=(window.parent.pageXOffset||window.parent.document.documentElement.scrollLeft)-(window.parent.document.documentElement.clientLeft||0)}catch(d){}this.touchStart.lastImgH=this.lastImgH;this.touchStart.lastImgV=this.lastImgV;this.currentImage.startOffsetX=parseInt(this.currentImage.style.left,10);this.currentImage.startOffsetY=parseInt(this.currentImage.style.top,
10);this.isZoomed?this.isRotationWhenZoomed?this.dispatchEvent(RotateTool.TURN_START,this.lastImgH):this.dispatchEvent(RotateTool.PAN_START,this.lastImgH):this.dispatchEvent(RotateTool.TURN_START,this.lastImgH);RotateTool.isTouchDevice&&a.touches&&2==a.touches.length&&(this.isGestureStart=!0);RotateTool.isTouchDevice&&a.preventDefault()},clickPaneMouseOrTouchMove:function(a){this.isTouchOrMouseDown&&(this.touchMove=RotateTool.getMousePosition(a),RotateTool.isTouchDevice&&a.preventDefault(),this.isGestureStart?
this.handleMultiTouchGesture(a):(this.isZoomed&&this.isTouchOrMouseDown&&this.evalClickPaneTouchMove(this.touchStart,this.touchMove),this.isDragging||this.startDragListener(this.touchMove),this.isDragging&&this.dragListener(a)),this.touchMovePrevious=this.touchMove)},clickPaneMouseOrTouchEnd:function(a){this.isGestureStart=!1;this.gestureStartValue=null;if(!0==this.isTouchOrMouseDown){this.isTouchOrMouseDown=!1;this.touchEnd=RotateTool.getMousePosition(a);var d=this.evalClickPaneTouchEnd(this.touchStart,
this.touchEnd);this.isDragging&&this.stopDragListener(a);!1==d?100==this.scaleInPercent?this.dispatchEvent(RotateTool.TURN_STOP,this.lastImgH):this.isRotationWhenZoomed?this.dispatchEvent(RotateTool.TURN_STOP,this.lastImgH):(this.dispatchEvent(RotateTool.PAN_STOP,this.lastImgH),!0===this.wasRotationWhenZoomed&&(this.toggleRotationInZoomMode(!0),this.wasRotationWhenZoomed=null)):this.evalClickOnPane(this.touchEnd);this.settings.control.rotateOnMouseHover&&!1==RotateTool.isTouchDevice&&this.clickPaneMouseOrTouchStart(a)}},
handleMultiTouchGesture:function(a){},addRotateOnHoverActions:function(){this.clickPane.addEventListener("mouseenter",RotateTool.bind(this,this.clickPaneMouseOver),!0);this.clickPane.addEventListener("mouseleave",RotateTool.bind(this,this.clickPaneMouseOut),!0)},clickPaneMouseOver:function(a){this.clickPaneMouseOrTouchStart(a)},clickPaneMouseOut:function(a){this.clickPaneMouseOrTouchEnd(a)},clickPaneMouseMove:function(a){},startDragListener:function(a){this.isZoomed&&!1==this.isRotationWhenZoomed||
(this.lastYatDyChange=a.y,this.rotateIntervalDuration_current=this.rotateIntervalDuration_original*this.settings.control.dragSpeed,this.isDragging=!0,this.touchMovePreviousDrag=this.touchStart,this.dx=0)},stopDragListener:function(a){this.isDragging=!1;this.dy=0;this.dx=this.getWorkingDx();this.rotateIntervalDuration_current<this.rotateIntervalDuration_original/10&&(this.rotateIntervalDuration_current=this.rotateIntervalDuration_original/5);this.rotateIntervalDuration_current<=this.rotateIntervalDuration_original&&
(this.durationMultiplier=1.015);if(a.timeStamp-this.touchMove.timeStamp>this.THRESHOLD_TIME_DRAG_STOP_ROTATE||!1==this.settings.control.enableSwing)this.dy=this.dx=0,this.rotateIntervalDuration_current=this.rotateIntervalDuration_original},dragListener:function(a){var d=a=0,c=0.5;this.bounce&&(c=1);if(!this.isGestureStart&&this.touchStart&&this.touchMove){a=this.touchStart.y-this.touchMove.y;var d=this.touchStart.x-this.touchMove.x,h=RotateTool.signum(this.touchMovePreviousDrag.x-this.touchMove.x);
this.previousDx=h;0==this.previousDx&&(this.previousDx=RotateTool.signum(d));this.settings.control.reverseDrag&&(d*=-1,this.previousDx*=-1);c=Math.floor(this.hSteps*(d/this.objectWidth)*c);c=0<=c?c%this.hSteps:-(Math.abs(c)%this.hSteps);c=this.touchStart.lastImgH+c;0>c?(c+=this.hSteps,this.bounce&&(c=0)):c>=this.hSteps&&(c%=this.hSteps,this.bounce&&(c=this.hSteps-1));var e=this.lastImgV;if(1<this.vSteps&&!1==this.settings.rotation.multilevel.disableDrag){var f=Math.floor(this.vSteps*(a/(0.5*this.objectHeight))),
k=1;this.settings.rotation.multilevel.reverseDrag&&(k=-1);0==h&&(e=this.touchStart.lastImgV+f*k,isNaN(e)&&(e=0),0>e&&(e=0),e>=this.vSteps&&(e=this.vSteps-1))}if(1==this.vSteps&&25>Math.abs(d)&&100==this.scaleInPercent&&!0==RotateTool.isTouchDevice){d=window;RotateTool.isRunningInIframe&&(d=window.parent);try{d.scrollTo(this.windowXPositionAtTouchStart,this.windowYPositionAtTouchStart+a)}catch(l){}}this.dy=this.dx=0;this.lastImgH=c;this.lastImgV=e;a=this.timeLastImageShown;this.showNextImage();this.rotateIntervalDuration_current=
Date.now()-a;this.touchMovePreviousDrag=this.touchMove}},evalClickPaneTouchEnd:function(a,d){var c=!1,h=1;if(d&&a){var e=Math.abs(d.x-a.x),f=Math.abs(d.y-a.y);RotateTool.isTouchDevice&&(h=8);e+f<=h&&(c=!0);return c}},evalClickPaneTouchMove:function(a,d){var c=d.x-a.x,h=d.y-a.y,e=!1;if(!(RotateTool.isTouchDevice&&10>=Math.abs(c)+Math.abs(h))){Math.abs(h)>Math.abs(c)&&1==this.vSteps&&(e=!0);var f=d.timeStamp-a.timeStamp;!1==this.isMouseMoved&&(f>this.THRESHOLD_TIME_ROTATE_PAN_DIF||e&&this.settings.control.switchToPanOnYmovement)&&
this.isRotationWhenZoomed&&(this.wasRotationWhenZoomed=!0,this.toggleRotationInZoomMode(!1));if(!this.isRotationWhenZoomed){var c=this.currentImage.startOffsetX+c,h=this.currentImage.startOffsetY+h,e=parseInt(this.currentImage.style.width),f=parseInt(this.currentImage.style.height),k=this.targetWidth-e-0,l=this.targetHeight-f-0;e>this.targetWidth&&(c=Math.min(c,0),c=Math.max(c,k));f>this.targetHeight&&(h=Math.min(h,0),h=Math.max(h,l));c>0.5*this.targetWidth&&(c=Math.floor(0.5*this.targetWidth));h>
0.5*this.targetHeight&&(h=Math.floor(0.5*this.targetHeight));c+e<0.5*this.targetWidth&&(c=Math.floor(0.5*this.targetWidth)-e);h+f<0.5*this.targetHeight&&(h=Math.floor(0.5*this.targetHeight)-f);if(this.currentImage)try{this.currentImage.style.left=c+"px",this.currentImage.style.top=h+"px",this.relativeX=-(c-0.5*this.targetWidth)/parseInt(e),this.relativeY=-(h-0.5*this.targetHeight)/parseInt(f),this.useCanvas&&(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.drawImage(this.currentImage,
parseInt(this.currentImage.style.left),parseInt(this.currentImage.style.top),parseInt(this.currentImage.style.width),parseInt(this.currentImage.style.height)))}catch(n){}this.setRescaleFlag()}this.redrawHotspots();this.isMouseMoved=!0}},evalClickOnPane:function(a){this.dispatchEvent(RotateTool.CLICK_OBJECT);this.settings.control.clickUrl?(this.stopRotation(),this.openClickUrl()):(this.dx=this.wasRotating?this.getWorkingDx():0,this.checkDoubleClick(a)&&100!=this.scaleInPercent&&this.resetZoom(),!1==
this.settings.control.rotateOnClick&&(this.dx=this.wasRotating?0:this.getWorkingDx()),this.toggleRotation())},checkDoubleClick:function(a){var d=a.timeStamp;if(this.previousTouchEndTime&&(a=d-this.previousTouchEndTime,300>a))return!0;this.previousTouchEndTime=d;return!1},openClickUrl:function(){var a=this.settings.control.clickUrl,d=this.settings.control.clickUrlTarget;a&&(d||(d="_top"),window.open(a,d))},MouseWheelHandler:function(a){a=window.event||a;var d=Math.max(-1,Math.min(1,a.wheelDelta||-a.detail));
try{a.preventDefault()}catch(c){}this.settings.control.mouseWheelZooms||a.ctrlKey||a.metaKey?(a=this.settings.control.maxZoom,this.settings.control.zoomInStopsRotation&&this.stopRotation(),d=1/(a-100)*(this.scaleInPercent-10*d)-100*(1/(a-100)),isNaN(d)||this.zoomRatioChangeListener(d,"mouseWheel")):(!0!==this.toolTipOnMouseWheelShown&&!1==RotateTool.isTouchDevice&&(a=RotateTool.getLocalMousePosition(a),this.showToolTip({id:"mousewheel_tooltip",keepVisible:!0,title:{text:"Tip: use MouseWheel+Ctrl for Zooming"}},
[a.x,a.y],3E3),this.toolTipOnMouseWheelShown=!0),this.stopRotation(),this.dx=d,this.mouseWheelCounter++,0==this.mouseWheelCounter%4&&this.showNextImage())},toggleRotation:function(){0==this.dx?this.startRotation():this.stopRotation()},windowResizeListener:function(a){this.wasRotating=0!=this.dx;this.stopRotation();this.resetZoom();this.updateTargetStyles();this.updateMaxZoom();this.imagesLoaded&&(this.currentImage&&(this.currentImage.scaled=!1),this.updateScalesOfImages(),this.redrawCanvas(),this.wasRotating?
(this.dx=this.getWorkingDx(),this.startRotation()):(this.setScale(100,this.currentImage),this.showNextImage()),this.repositionFixedHotspots())},repositionFixedHotspots:function(){if(this.hotspotInstances)for(var a in this.hotspotInstances)this.hotspotInstances[a].isFixed&&this.positionFixedHotspot(this.hotspotInstances[a])},updateScalesOfImages:function(){if(this.imagesLoaded)for(var a,d=0;d<this.rotateImages.length;d++)a=this.rotateImages[d],this.setScale(this.scaleInPercent,a)},updateSrcOfImage:function(a){if(a.srcLarge&&
this.isImagesLoaded)if(a.width>a.normalImageWidth)a.srcCurrent!=a.srcLarge&&(a.largeImageWidth?(a.originalWidth=a.largeImageWidth,a.originalHeight=a.largeImageHeight,a.scaled=!1,RotateTool.setImageSource(a,a.srcLarge),!1==this.isSpinning()&&a.srcLarge==this.currentImage.srcLarge&&this.showNextImage()):this.loadLargeImage(a,!0));else if(a.srcCurrent!=a.srcNormal&&(RotateTool.setImageSource(a,a.srcNormal),a.originalWidth=a.normalImageWidth,a.originalHeight=a.normalImageHeight,wasScaled=a.scaled=!1,
!1==this.isSpinning()&&a.srcNormal==this.currentImage.srcNormal)){var d=this;setTimeout(function(){d.currentImage.onload=function(){d.showNextImage()};d.currentImage.src=d.currentImage.srcNormal},300)}},fullscrentChangedListener:function(){RotateTool.isFullscreen();this.windowResizeListener()},zoomRatioChangeListener:function(a,d){if("undefined"!=typeof a&&!isNaN(a)){this.settings.control.zoomInStopsRotation&&this.stopRotation();a=Math.max(0,a);this.currentZoomValue=a=Math.min(1,a);var c=100+(this.settings.control.maxZoom-
100)*a;this.dispatchEvent(RotateTool.ZOOM_CHANGE,this.lastImgH);0==a&&this.dispatchEvent(RotateTool.ZOOM_RESET,this.lastImgH);this.currentImage&&(this.currentImage.scaled=!1,this.setScale(c,this.currentImage),this.currentImage.scaled=!1,this.useCanvas&&(this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.ctx.drawImage(this.currentImage,parseInt(this.currentImage.style.left),parseInt(this.currentImage.style.top),parseInt(this.currentImage.style.width),parseInt(this.currentImage.style.height))));
this.requestRescaleFlag=!0;this.isZoomed=0!==a;"sliderHandle"!=d&&this.updateSliderHandlePosition(a);"zoom"==this.settings.userInterface.showToggleRotateButton&&this.toggleToggleRotatePanButtons(0!=a)}},toggleToggleRotatePanButtons:function(a){this.buttons["rotate-tool-button-toggle-pan"]&&this.buttons["rotate-tool-button-toggle-rotate"]&&(a?(this.buttons["rotate-tool-button-toggle-pan"].style.display="block",this.buttons["rotate-tool-button-toggle-rotate"].style.display="block"):(this.buttons["rotate-tool-button-toggle-pan"].style.display=
"none",this.buttons["rotate-tool-button-toggle-rotate"].style.display="none"))},resetZoom:function(){this.zoomRatioChangeListener(0,null);this.requestRescaleFlag=!0},reportBrowserNotSupported:function(){this.target.innerHTML='<span class="rotate-tool-browser-not-supported">Your browser does not support this 360&deg; object rotation script.</span>'},addPlayerInfo:function(){var a=document.createElement("div"),d=document.createElement("a");d.href="http://www.yofla.com/3d-rotate/player-about/";d.target=
"_blank";d.innerHTML="360 by YoFLA";d.style.textDecoration="none";d.style.color="navy";d.style.fontFamily="sans-serif";d.style.fontSize="10px";d.style.paddingLeft="5px";d.style.paddingRight="5px";a.appendChild(d);this.target.appendChild(a);a.style.position="absolute";a.style.top="2px";a.style.right="4px";a.style.zIndex=this.zIndex.info+1;a.style.background="white";a.style.borderRadius="5px";a.style.opacity=0.75;a.style.filter="alpha(Opacity=75)";setTimeout(function(){a.style.display="none"},5500)},
addEventListener:function(a,d,c){c="undefined"===typeof c?!1:c;!1===RotateTool.isCustomEventSupported?document.addEventListener(a,d,c):this.target.addEventListener(a,d,c)},removeEventListener:function(a,d,c){c="undefined"===typeof c?!1:c;!1===RotateTool.isCustomEventSupported?document.removeEventListener(a,d,c):this.target.removeEventListener(a,d,c)},dispatchEvent:function(a,d){this.detectZoomStart(a);this.isGAenabled&&this.reportGAevent(a,d);if(!1===RotateTool.isCustomEventSupported)try{var c=document.createEvent("Event");
c.initEvent(a,!0,!0);c.detail=d;document.dispatchEvent(c)}catch(h){}else c=new CustomEvent(a,{detail:d}),c.bubbles=!0,this.target.dispatchEvent(c)},detectZoomStart:function(a){a==RotateTool.ZOOM_CHANGE&&this.lastEventName!=RotateTool.ZOOM_CHANGE&&this.dispatchEvent(RotateTool.ZOOM_START);this.lastEventName=a},reportGAevent:function(a,d){},rotateToolInstanceLast:"no colon"};d.initialize();return d},fixPathVariable:function(a){if(a&&0<a.length){var d=a.substr(a.length-1);"/"!=d&&"\\"!=d&&(a+="/")}else a=
"";return a},loadScript:function(a,d,b){var g=document.getElementsByTagName("head")[0],c=document.createElement("script");c.type="text/javascript";c.onreadystatechange=function(){if("loaded"===c.readyState||"complete"===c.readyState)c.onreadystatechange=null,d.apply(b)};c.onload=function(){d.apply(b)};c.src=a;g.appendChild(c)},loadXMLFile:function(a,d,b){b.isXMLLoaded=!1;(new RotateTool.XMLloader).loadXML(a,d,!0,b)},parseJSON:function(a){if("string"!==typeof a||!a)return null;if(window.JSON&&window.JSON.parse)return window.JSON.parse(a);
if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return(new Function("return "+a))();throw"Invalid JSON: "+a;},addEventSimple:function(a,d,b){a.addEventListener?a.addEventListener(d,b,!1):a.attachEvent&&a.attachEvent("on"+d,b)},removeEventSimple:function(a,d,b){a.removeEventListener?a.removeEventListener(d,b,!1):a.detachEvent&&a.detachEvent("on"+d,b)},getMousePosition:function(a){if("undefined"===
typeof a)return null;var d={x:null,y:null};a.changedTouches?(d.x=a.changedTouches[0].screenX,d.y=a.changedTouches[0].screenY):(d.x=a.clientX,d.y=a.clientY);d.timeStamp=a.timeStamp;return d},getLocalMousePosition:function(a){a=a||window.event;var d=a.target||a.srcElement;d.currentStyle||window.getComputedStyle(d,null);d=d.getBoundingClientRect();return{x:a.clientX-d.left,y:a.clientY-d.top}},defaultPreloader:function(a,d){var b=this,g=d.color1,c=d.background.alpha,h=Math.floor(100*c),e={percentDiv:null,
targetDiv:null,containerDiv:null,initialize:function(a){this.containerDiv=document.createElement("div");this.containerDiv.className="rotate-tool-preloader";this.containerDiv.style.webkitTransform="translateZ(0)";this.containerDiv.style.MozTransform="translateZ(0)";this.containerDiv.style.msTransform="translateZ(0)";this.containerDiv.style.OTransform="translateZ(0)";this.containerDiv.style.transform="translateZ(0)";this.containerDiv.style.width="100%";this.containerDiv.style.height="100%";this.containerDiv.style.position=
"absolute";this.containerDiv.style.zIndex=b.zIndex.preloader;this.targetDiv=document.getElementById(a);this.targetDiv.appendChild(this.containerDiv);this.backgroundDiv=document.createElement("div");this.backgroundDiv.style.left="0px";this.backgroundDiv.style.zIndex=b.zIndex.preloader;this.backgroundDiv.style.position="absolute";this.backgroundDiv.style.top=Math.round(this.targetDiv.offsetHeight/2)-40+"px";this.backgroundDiv.style.width="100%";this.backgroundDiv.style.height="50px";d.background.enabled&&
(this.backgroundDiv.style.backgroundColor=d.background.color,this.backgroundDiv.style.opacity=c,this.backgroundDiv.style.filter="alpha(Opacity="+h+")");this.containerDiv.appendChild(this.backgroundDiv);this.progressBar=document.createElement("div");this.progressBar.style.left="0px";this.progressBar.style.zIndex=b.zIndex.preloader;this.progressBar.style.position="absolute";this.progressBar.style.top=Math.round(this.targetDiv.offsetHeight/2)-40+"px";this.progressBar.style.width="0%";this.progressBar.style.height=
"50px";this.progressBar.style.backgroundColor="#909090";this.progressBar.style.opacity=0.5;this.progressBar.style.filter="alpha(Opacity=50)";this.containerDiv.appendChild(this.progressBar);this.percentDiv=document.createElement("div");this.percentDiv.style.fontSize="32px";this.percentDiv.style.fontFamily="verdana, arial, sans-serif";this.percentDiv.style.lineHeight="50px";this.percentDiv.style.textAlign="center";this.percentDiv.style.width="100%";this.percentDiv.style.top=Math.round(this.targetDiv.offsetHeight/
2)-40+"px";this.percentDiv.style.zIndex=b.zIndex.preloader+1;this.percentDiv.style.position="absolute";this.percentDiv.style.color=g;this.percentDiv.style.opacity=1;this.percentDiv.style.filter="alpha(Opacity=100)";this.percentDiv.innerHTML="&nbsp; 0%";this.percentDiv.setAttribute("id","preloader_"+this.targetDiv.id);this.containerDiv.appendChild(this.percentDiv)},update:function(a){var b="";10>a&&(b="&nbsp; ");this.percentDiv&&(this.percentDiv.innerHTML=b+a+"%");this.progressBar&&(this.progressBar.style.width=
a+"%")},destroy:function(){this.percentDiv.innerHTML="";this.percentDiv.style.display="none";this.containerDiv.removeChild(this.percentDiv);this.containerDiv.removeChild(this.backgroundDiv);this.containerDiv.removeChild(this.progressBar);this.targetDiv.removeChild(this.containerDiv);this.containerDiv=this.targetDiv=this.percentDiv=this.progressBar=this.backgroundDiv=null}};e.initialize(a);return e},wavePreloader:function(a,d){var b=this,g=Number(d.background.alpha),c=Math.floor(100*g),h={percentDiv:null,
targetDiv:null,containerDiv:null,initialize:function(a,f){this.containerDiv=document.createElement("div");this.containerDiv.className="rotate-tool-preloader";this.containerDiv.style.webkitTransform="translateZ(0)";this.containerDiv.style.MozTransform="translateZ(0)";this.containerDiv.style.msTransform="translateZ(0)";this.containerDiv.style.OTransform="translateZ(0)";this.containerDiv.style.transform="translateZ(0)";this.containerDiv.style.width="100%";this.containerDiv.style.height="100%";this.containerDiv.style.position=
"absolute";this.containerDiv.style.zIndex=b.zIndex.preloader;this.targetDiv=document.getElementById(a);this.targetDiv.appendChild(this.containerDiv);this.backgroundDiv=document.createElement("div");this.backgroundDiv.style.left="0px";this.backgroundDiv.style.zIndex=b.zIndex.preloader;this.backgroundDiv.style.position="absolute";this.backgroundDiv.style.top=Math.round(this.targetDiv.offsetHeight/2)-33+"px";this.backgroundDiv.style.width="100%";this.backgroundDiv.style.height="50px";d.background.enabled&&
(this.backgroundDiv.style.backgroundColor=d.background.color,this.backgroundDiv.style.opacity=g,this.backgroundDiv.style.filter="alpha(Opacity="+c+")");this.containerDiv.appendChild(this.backgroundDiv);this.percentDiv=document.createElement("div");this.percentDiv.style.zIndex=b.zIndex.preloader+1;this.percentDiv.style.position="relative";var k;k=""+('<div class="yp_wave" style="margin-top: '+(Math.floor(0.5*this.targetDiv.clientHeight)-20)+'px;">');k=k+('\t<div class="rect1" style="background-color: '+
f+'"></div>')+('\t<div class="rect2" style="background-color: '+f+'"></div>');k+='\t<div class="rect3" style="background-color: '+f+'"></div>';k+='\t<div class="rect4" style="background-color: '+f+'"></div>';k+='\t<div class="rect5" style="background-color: '+f+'"></div>';k+="</div>";this.percentDiv.innerHTML=k;this.percentDiv.setAttribute("id","preloader_"+this.targetDiv.id);this.containerDiv.appendChild(this.percentDiv)},update:function(a){},destroy:function(){this.percentDiv.innerHTML="";this.percentDiv.style.display=
"none";this.containerDiv.removeChild(this.percentDiv);this.containerDiv.removeChild(this.backgroundDiv);this.targetDiv.removeChild(this.containerDiv);this.containerDiv=this.targetDiv=this.percentDiv=this.progressBar=this.backgroundDiv=null}};h.initialize(a,d.color1);return h},addClickOrTouchListener:function(a,d,b){this.isTouchDevice?void 0!==d.forTouch&&this.addEventSimple(a,d.forTouch,b):void 0!==d.forMouse&&this.addEventSimple(a,d.forMouse,b)},removeClickOrTouchListener:function(a,d,b){this.isTouchDevice?
this.removeEventSimple(a,d.forTouch,b):this.removeEventSimple(a,d.forMouse,b)},bind:function(a,d,b){return function(){d.apply(a,arguments)}},signum:function(a){return 0<a?1:0>a?-1:0},detectBrowsers:function(){var a=navigator.userAgent,d;this.isChrome=-1<a.toLowerCase().indexOf("chrome");if(this.isIE=-1<a.indexOf("MSIE"))d=/MSIE ([0-9]{1,}[.0-9]{0,})/,null!=d.exec(a)&&(RotateTool.ieversion=parseInt(RegExp.$1),10==RotateTool.ieversion&&(this.isIE10=!0),8==RotateTool.ieversion&&(this.isIE8=!0),9==RotateTool.ieversion&&
(this.isIE9=!0));d=/rv:([0-9]{1,}[.0-9]{0,})/;null!=d.exec(a)&&(a=parseInt(RegExp.$1),11==a&&(this.isIE11=this.isIE=!0));this.isFF="undefined"!==typeof InstallTrigger},supportedBrowserCheck:function(){"undefined"==typeof RotateTool.isIE&&RotateTool.detectBrowsers();return this.isIE?isNaN(RotateTool.ieversion)?!0:8<=RotateTool.ieversion:!0},fullscreenBrowserCheck:function(){var a=document.documentElement,d=!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||
document.msFullscreenEnabled);return a.requestFullscreen||a.webkitRequestFullScreen||a.mozRequestFullScreen||a.msRequestFullScreen||d?!0:!1},mobileCheck:function(){var a=!1,d=navigator.userAgent||navigator.vendor||window.opera;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(d)||
/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(d.substr(0,
4)))a=!0;return a},browserSupportsCSSProperty:function(a){var d=document.createElement("div");a=a.toLowerCase();if(void 0!=d.style[a])return!0;a=a.charAt(0).toUpperCase()+a.substr(1);for(var b=["Webkit","Moz","ms","O"],g=0;g<b.length;g++)if(void 0!=d.style[b[g]+a])return!0;return!1},isObjectEmpty:function(a){if(void 0===a)return!0;var d=Object.prototype.hasOwnProperty;if(a.length&&0<a.length)return!1;if(a.length&&0===a.length)return!0;for(var b in a)if(d.call(a,b))return!1;return!0},launchFullscreen:function(a){a.requestFullscreen?
a.requestFullscreen():a.mozRequestFullScreen?a.mozRequestFullScreen():a.webkitRequestFullscreen?a.webkitRequestFullscreen():a.msRequestFullscreen&&a.msRequestFullscreen()},exitFullscreen:function(a){document.exitFullscreen?document.exitFullscreen():document.cancelFullscreen?document.cancelFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen()},isFullscreen:function(){return!!(document.fullscreenElement||
document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement)},isInIframe:function(){try{return window.self!==window.top}catch(a){return!0}},addGlobalFunctions:function(){window.yofla_setColor=this.yofla_setColor;window.yofla_setLevel=this.yofla_setColor},yofla_setColor:function(a){var d,b=0;"string"===typeof a?0<=a.indexOf(",")?(b=a.split(","),d=b[0],b=b[1]):b=parseInt(a):b=parseInt(a);(d=RotateTool.get(d))?d.setLevel(b):alert("Unable to locate 3DRT instance!")},
detectCanvasSupport:function(){return!!document.createElement("canvas").getContext},detectCustomEventSupport:function(){try{return new CustomEvent("blank"),!0}catch(a){return!1}},baseName:function(a){var d=a.charAt(a.length-1);if("/"===d||"\\"===d)a=a.slice(0,-1);a=a.replace(/^.*[\/\\]/g,"");"string"===typeof suffix&&a.substr(a.length-suffix.length)==suffix&&(a=a.substr(0,a.length-suffix.length));return a},isGAloaded:function(a){if("function"===typeof ga)return!0;if("undefined"!==typeof a&&!0!==this.gaCodeWritten){var d=
"auto";"localhost"==document.location.hostname&&(d={cookieDomain:"none"});(function(a,d,c,h,e,f,k){a.GoogleAnalyticsObject=e;a[e]=a[e]||function(){(a[e].q=a[e].q||[]).push(arguments)};a[e].l=1*new Date;f=d.createElement(c);k=d.getElementsByTagName(c)[0];f.async=1;f.src=h;k.parentNode.insertBefore(f,k)})(window,document,"script","//www.google-analytics.com/analytics.js","ga");ga("create",a,d);this.gaCodeWritten=!0}return!1},addPolyFills:function(){this.addIndexOf();this.addDatePolyFill()},addIndexOf:function(){Array.prototype.indexOf||
(Array.prototype.indexOf=function(a,d){var b=this.length>>>0,g=Number(d)||0,g=0>g?Math.ceil(g):Math.floor(g);for(0>g&&(g+=b);g<b;g++)if(g in this&&this[g]===a)return g;return-1})},addDatePolyFill:function(){Date.now||(Date.now=function(){return(new Date).valueOf()})},getCurrentDomain:function(){var a=window.location!=window.parent.location?document.referrer:document.location,d=document.createElement("a");d.href=a;return(a=d.hostname)&&4<a.length?(a=a.split("."),a=a.slice(-2).join(".")):""},setImageSource:function(a,
d){a.srcCurrent=d;a.src=d;return a},Quad_easeOut:function(a,d,b,g){return-b*((a=a/g-1)*a*a*a-1)+d},pauseEvent:function(a){a.stopPropagation&&a.stopPropagation();a.preventDefault&&a.preventDefault();a.cancelBubble=!0;return a.returnValue=!1},XMLloader:function(){var a,d,b,g,c,h;this.loadXML=function(b,f,g,m){h=m;a=f;d=g;c=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");c.onreadystatechange=e;c.open("GET",b,!0);c.send("")};var e=function(){if(4==c.readyState&&(200==c.status||
304==c.status)){if(d){var e=c.responseXML;b=[];f(e,0);for(i=b.length-1;0<=i;i--)nodeRef=b[i],nodeRef.parentNode.removeChild(nodeRef)}g=c.responseXML;"function"==typeof a?a.call(h,[g]):alert("undefined type of functionToCall")}},f=function(a,c){for(i=0;i<a.childNodes.length;i++)3!=a.childNodes[i].nodeType||/[^\t\n\r ]/.test(a.childNodes[i].data)||(b[b.length]=a.childNodes[i]),a.childNodes[i].hasChildNodes()&&f(a.childNodes[i],i);i=c}},addTabInactivityObserver:function(){function a(a){a=a||window.event;
RotateTool.onTabActivityChange(a.type in{focus:"visible",focusin:"visible",pageshow:"visible",blur:"hidden",focusout:"hidden",pagehide:"hidden"}?"visible"==a.type:!1==this[d])}var d="hidden";d in document?document.addEventListener("visibilitychange",a):(d="mozHidden")in document?document.addEventListener("mozvisibilitychange",a):(d="webkitHidden")in document?document.addEventListener("webkitvisibilitychange",a):(d="msHidden")in document?document.addEventListener("msvisibilitychange",a):"onfocusin"in
document?document.onfocusin=document.onfocusout=a:window.onpageshow=window.onpagehide=window.onfocus=window.onblur=a},onTabActivityChange:function(a){RotateTool.notifyInstances("onTabActivityChange",[a])},notifyInstances:function(a,d){var b,g;for(g in RotateTool.instances){b=RotateTool.instances[g];var c=b[a];"function"==typeof c&&c.apply(b,d)}},fixPathsInHtml:function(a,d){if(!/^(\/\/|http)/i.test(d))return a;var b=/src=(['"])(?!http|\/\/)([^'"]+)(\1)/i.exec(a);return b?(b=a.indexOf(b[2]),a=[a.slice(0,
b),d,a.slice(b)].join(""),RotateTool.fixPathsInHtml(a,d)):a},showElement:function(a){a&&(a.style.visibility="visible")},hideElement:function(a){a&&(a.style.visibility="hidden")},debounce:function(a,d,b){var g;return function(){var c=this,h=arguments,e=b&&!g;clearTimeout(g);g=setTimeout(function(){g=null;b||a.apply(c,h)},d);e&&a.apply(c,h)}},last:"none"};RotateTool.initialize();
