/*!
 * FSI TouchZoom
 * Copyright (c) 2000-2015 NeptuneLabs GmbH - All rights reserved.
 *
 * info@neptunelabs.com
 * www.neptunelabs.com
 *
 * VERSION: 1.1.0
 * 
 * IMPORTANT NOTE
 * ------------------------------------------------------
 * Usage limited to the terms of the NeptuneLabs Software 
 * END-USER LICENSE AGREEMENT.
 * ------------------------------------------------------
 *
 */

if(typeof($FSI)=="undefined"){$FSI={};$FSI.init=function(){$FSI.oSupportedViewers={};if(typeof(console.error)!="function"){$FSI.console={};$FSI.console.log=$FSI.fnDoNothing;$FSI.console.warn=$FSI.fnDoNothing;$FSI.console.error=$FSI.fnDoNothing;$FSI.console.dir=$FSI.fnDoNothing}else{$FSI.console=console}try{if(typeof(top.window.alert)=="function"){$FSI.topWindow=top.window}else{$FSI.topWindow=window}}catch(e){$FSI.console.warn("FSI: top.window is not accessible. This is likely due to cross domain security restrictions. Viewer functionality might be limited.");$FSI.topWindow=window}$FSI.oInstanceCreated={};$FSI.ClassDef=function(instance,strClassName,version,build){var self=this;this.instance=instance;this.strClassName=strClassName;this.version=version;this.build=build;var strVersionString=strClassName+" "+version+" build "+build;var getVersion=function(){return strVersionString};var getBuild=function(){return build};instance.getVersion=getVersion;instance.getBuild=getBuild;if(!$FSI.oInstanceCreated[strClassName]){$FSI.oInstanceCreated[strClassName]=true;if(instance.getBuild()!=$FSI.getBuild()){$FSI.console.error("FSI version mismatch: "+getVersion()+" and "+$FSI.getVersion())}}};var classDef=new $FSI.ClassDef($FSI,"FSI Core","1.1.2","16.02.08");$FSI.SVGNameSpaceURL="http://www.w3.org/2000/svg";$FSI.regexPlusToSpace=/\+/g;$FSI.regExServerRenderer=/([?&])(renderer|profile)=([^&]*)/i;$FSI.nViewerInstanceID=0;$FSI.bHTTPS=(document.location.protocol=="https:");$FSI.getViewerInstanceID=function(){return ++$FSI.nViewerInstanceID};$FSI.BoolTable={"0":false,"false":false,"1":true,"true":true};$FSI.makeBool=function(value,def){var ret;var t=typeof(value);if(t=="boolean"){ret=value}else{if(t=="string"){value=value.toLowerCase()}ret=$FSI.BoolTable[value];if(ret==undefined){ret=def}}return ret};$FSI.changeRendererInURL=function(url,strRenderer){url=url.replace($FSI.regExServerRenderer,"$1renderer="+strRenderer);return url};$FSI.loadSkinCSS=function(skinName,scope,fnReady){if(typeof($FSI.iLoaderCSSSkin)!="object"){if(typeof($FSI.LoaderCSSSkin)!="function"){$FSI.console.error("Class $FSI.LoaderCSSSkin missing.");fnReady.call(scope,false);return}$FSI.iLoaderCSSSkin=new $FSI.LoaderCSSSkin()}return $FSI.iLoaderCSSSkin.load(skinName,scope,fnReady)};$FSI.addedCSSBlocks={};$FSI.cssClassExists=function(cssID){return(typeof($FSI.addedCSSBlocks[cssID])!="undefined")};$FSI.addCSSClass=function(cssID,strCode){if($FSI.cssClassExists(cssID)){return false}var node=$FSI.addCSSNode(cssID);if(node){try{node.innerHTML=strCode;$FSI.addedCSSBlocks[cssID]=node}catch(e){$FSI.console.error("FSI: addCSSClass failed")}}};$FSI.addCSSNode=function(cssID){var node=null;try{node=document.createElement("style");node.setAttribute("x-generated-by","FSI");node.setAttribute("x-generated-for",cssID);node.appendChild(document.createTextNode(""));if(document.head.firstChild){document.head.insertBefore(node,document.head.firstChild)}else{document.head.appendChild(node)}}catch(e){$FSI.console.error("FSI: FAILED to create <style> node for "+cssID);$FSI.console.error(e.message)}return node};$FSI.addCSSRule=function(selector,rules,index){if($FSI.oInsertedCSS==undefined){$FSI.oInsertedCSS=$FSI.addCSSNode("FSI.Core")}if($FSI.oInsertedCSS!=undefined){try{if($FSI.oInsertedCSS&&$FSI.oInsertedCSS.sheet){if("insertRule" in $FSI.oInsertedCSS.sheet){$FSI.oInsertedCSS.sheet.insertRule(selector+"{"+rules+"}",index)}else{if("addRule" in $FSI.oInsertedCSS.sheet){$FSI.oInsertedCSS.sheet.addRule(selector,rules,index)}}}}catch(e){$FSI.console.error("FSI: FAILED to add css rule for "+selector);$FSI.console.error(e.message)}}};$FSI.setStyleAttr=function(el,strStyle){
/*@cc_on
			@if (@_jscript_version < 9)
				el.style.setAttribute('cssText', strStyle);
			@else @*/
el.setAttribute("style",strStyle);
/*@end
			@*/
};$FSI.documentDomain=document.location.hostname;$FSI.regCors=new RegExp("//"+$FSI.documentDomain+"[:/]");$FSI.isCrossDomain=function(url){if(!url||url.indexOf("http")!=0){return false}return url.match($FSI.regCors)==null};$FSI.loadImageCors=function(img,url){if($FSI.isCrossDomain(url)){img.crossOrigin="";img.src=url}else{img.src=url}};$FSI.getSVGID=function(){return"$FSI.SVGID_"+$FSI.SVGID++};$FSI.BrowserSupports={};$FSI.BrowserSupports[false]=function(){return false};$FSI.BrowserSupports[true]=function(){return true};$FSI.osVersion=[0,0,0];$FSI.SVGID=0;$FSI.initialWindowWith=window.innerWidth;$FSI.bElementPosRespectsScroll=true;var lastTime=0;var vendors=["ms","moz","webkit","o"];for(var x=0;x<vendors.length&&!window.requestAnimationFrame;++x){window.requestAnimationFrame=window[vendors[x]+"RequestAnimationFrame"];window.cancelAnimationFrame=window[vendors[x]+"CancelAnimationFrame"]||window[vendors[x]+"CancelRequestAnimationFrame"]}if(!window.requestAnimationFrame||!window.cancelAnimationFrame){window.requestAnimationFrame=function(callback,element){var currTime=new Date().getTime();var timeToCall=Math.max(0,16-(currTime-lastTime));var id=window.setTimeout(function(){callback(currTime+timeToCall)},timeToCall);lastTime=currTime+timeToCall;return id};window.cancelAnimationFrame=function(id){clearTimeout(id)}}var uagent=$FSI.userAgent=navigator.userAgent.toLowerCase();var result;if(uagent.search(/iphone|ipad|ipod|android|symbian|mobile|phone|windows ce|opera mini|opera mobi/i)>-1){result=true;if(uagent.search("android")>-1){$FSI.mobileOS="android";$FSI.isTouch=true;$FSI.noMouse=true;var t=uagent.match(/android (\S*)/);if(t&&t.length>1){t=t[1].split(".");for(var i=0;i<t.length;i++){t[i]=parseInt(t[i])}$FSI.osVersion=[].concat(t)}}else{if(uagent.indexOf("mac os")!=-1){$FSI.mobileOS="ios";$FSI.isTouch=true;$FSI.noMouse=true;var t=uagent.match(/ os (\S*)/);if(t&&t.length>1){t=t[1].split("_");for(var i=0;i<t.length;i++){t[i]=parseInt(t[i])}$FSI.osVersion=[].concat(t)}}}}else{result=false}$FSI.isMobileDevice=result;$FSI.isSmallMobileDevice=(uagent.search(/iphone|ipod|phone|mobile safari|iemobile|opera mini|opera mobi/i)>-1);$FSI.isInternetExplorer=false;if(uagent.search("msie")>-1){$FSI.isInternetExplorer=true;var t=uagent.match(/msie ([^;]*)/);if(t&&t.length>1){$FSI.versionInternetExplorer=parseFloat(t[1])}}else{if(navigator.userAgent.match(/Trident.*rv:(\d+\.)/gi)){$FSI.isInternetExplorer=true;$FSI.versionInternetExplorer=parseFloat(RegExp.$1)}else{$FSI.isInternetExplorer=(typeof(window.onmsgestureend)!="undefined");$FSI.versionInternetExplorer=12}}if(window.navigator.msPointerEnabled){$FSI.isIETouch=(window.navigator.msMaxTouchPoints>1)}if($FSI.isIETouch){$FSI.bElementPosRespectsScroll=false}if(!$FSI.isTouch){$FSI.isTouch=(window.navigator.maxTouchPoints>1||window.navigator.msMaxTouchPoints>1)}if(uagent.search("safari")>-1&&uagent.search("chrome")<1){$FSI.isSafari=true}else{if(uagent.search("firefox")>-1){$FSI.isFirefox=true}else{if(uagent.search("opera")>-1){$FSI.isOpera=true}}}if(uagent.search("mac os")>-1){$FSI.isMac=true}if(typeof(window.pageYOffset)=="number"){$FSI.getDocumentScroll=function(wnd){return{x:wnd.pageXOffset,y:wnd.pageYOffset}}}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){$FSI.getDocumentScroll=function(wnd){return{x:wnd.document.body.scrollLeft,y:wnd.document.body.scrollTop}}}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){$FSI.getDocumentScroll=function(wnd){return{x:wnd.document.documentElement.scrollLeft,y:wnd.document.documentElement.scrollTop}}}}}$FSI.getDocumentScaleNone=function(){return 1};$FSI.getCachedScrollBarWidth=function(el,oReg,w){var cst;var cssOverflowY="";try{cst=top.window.getComputedStyle(el);cssOverflowY=cst["overflow-y"]}catch(e){return 0}if(cssOverflowY=="scroll"||el.scrollHeight>top.window.innerHeight){var orgStyle=el.style.overflowY;var styleID=orgStyle;styleID="S_"+styleID;if(1==1||oReg[styleID]==undefined){el.style.overflowY="hidden";var w2=$FSI.___elementScaleCheck.offsetWidth;if(w2-w>1){oReg[styleID]=w2-w}}}if(!isNaN(oReg[styleID])){ret=oReg[styleID]}else{ret=-1}return ret};$FSI.__getMediaMinScreenWidthCount=0;$FSI.__getMediaMinScreenWidthLoopCount=0;$FSI.oMatchMedia=$FSI.topWindow.matchMedia||$FSI.topWindow.msMatchMedia;$FSI.getMediaMinScreenWidth=function(step){var init=$FSI.topWindow.document.documentElement.clientWidth;if($FSI.__LastGetMediaMinScreenWidth==$FSI.topWindow.document.documentElement.clientWidth){return $FSI.__LastGetMediaMinScreenWidthResult}$FSI.__LastGetMediaMinScreenWidth=$FSI.topWindow.document.documentElement.clientWidth;$FSI.__getMediaMinScreenWidthCount++;var step=10;while($FSI.oMatchMedia.call(window,"(min-width:"+(init+=step)+"px)")["matches"]){$FSI.__getMediaMinScreenWidthLoopCount++}init-=step;step=5;while($FSI.oMatchMedia.call(window,"(min-width:"+(init+=step)+"px)")["matches"]){$FSI.__getMediaMinScreenWidthLoopCount++}init-=step;step=1;while($FSI.oMatchMedia.call(window,"(min-width:"+(init+=step)+"px)")["matches"]){$FSI.__getMediaMinScreenWidthLoopCount++}$FSI.__LastGetMediaMinScreenWidthResult=$FSI.__getDocumentScaleReferenceWidth=init-step;return $FSI.__LastGetMediaMinScreenWidthResult};$FSI.getDocumentScaleInit=function(){$FSI.getDocumentScale=$FSI.getDocumentScaleNone;if($FSI.topWindow.innerWidth==undefined){$FSI.documentScaleMethod="none";return $FSI.getDocumentScale()}if(window.orientation!=undefined){if(!window.outerWidth){$FSI.documentScaleMethod="screen.width / window.innerWidth";$FSI.getDocumentScale=function(){$FSI.__getDocumentScaleReferenceWidth=(window.orientation%180==0)?screen.width:screen.height;return $FSI.__getDocumentScaleReferenceWidth/window.innerWidth};return $FSI.getDocumentScale()}$FSI.documentScaleMethod="window.outerWidth / window.innerWidth";$FSI.getDocumentScale=function(){$FSI.__getDocumentScaleReferenceWidth=window.outerWidth;return window.outerWidth/window.innerWidth};return $FSI.getDocumentScale()}if($FSI.oMatchMedia&&$FSI.topWindow.document.documentElement.clientWidth>0){var w=$FSI.getMediaMinScreenWidth("min-width","px");if(!isNaN(w)){$FSI.documentScaleMethod="CSS Media Query";$FSI.getDocumentScale=function(){var res=$FSI.getMediaMinScreenWidth("min-width","px")/$FSI.topWindow.innerWidth;if(isNaN(res)){res=1}return res};return $FSI.getDocumentScale()}}$FSI.getDocumentScale=function(){return $FSI.topWindow.outerWidth/$FSI.topWindow.innerWidth};return $FSI.getDocumentScale()};$FSI.getDocumentScale=$FSI.getDocumentScaleInit;if(typeof(window.devicePixelRatio)!="undefined"){$FSI.getDevicePixelRatio=function(){return window.devicePixelRatio||1}}else{$FSI.getDevicePixelRatio=function(){return 1}}$FSI.getDocumentScaleWithPixelRatio=function(){return $FSI.getDocumentScale()*$FSI.getDevicePixelRatio()};$FSI.fnDoNothing=function(){};$FSI.preventDefaultEvent=function(evt){if(evt.preventDefault){evt.preventDefault()}evt.returnValue=false;return false};$FSI.getElementDimension=function(elem){return{width:elem.offsetWidth,height:elem.offsetHeight}};$FSI.getElementInnerDimension=function(elem){var ret={width:elem.clientWidth,height:elem.clientHeight};var padding=$FSI.getElementPaddings(elem);ret.width-=padding.left+padding.right;ret.height-=padding.top+padding.bottom;return ret};$FSI.getViewportSize=function(wnd){return{width:wnd.innerWidth,height:wnd.innerHeight}};$FSI.mergeObjects=function(o1,o2){for(var o in o2){o1[o]=o2[o]}return o1};$FSI.cloneArray=function(ar){if(ar==undefined||ar.length==undefined){return[]}return ar.concat([])};$FSI.cloneValue=function(val){var ret;switch(typeof(val)){case"object":if(val!=null&&typeof(val.push)=="function"){ret=$FSI.cloneArray(val)}else{ret=$FSI.cloneObject(val)}break;default:ret=val}return ret};$FSI.cloneObject=function(obj){var ret={};for(var o in obj){ret[o]=$FSI.cloneValue(obj[o])}return ret};$FSI.cloneParameters=function(parameters){return $FSI.cloneObject(parameters)};$FSI.removeChild=function(parent,child){try{parent.removeChild(child)}catch(e){$FSI.console.error(e.message);$FSI.console.log(parent);$FSI.console.log(child)}};$FSI.oCustomEventListenerClasses={};$FSI.oCustomEventListenerInstances={};$FSI.oCustomEventListeners={};$FSI.nCustomEventListeners=0;$FSI.nCustomEventListenerID=0;$FSI.addCustomEvent=function(myObj,myEvent,myFunc,bCapturingPhase){var obj,listenerID;var listener=$FSI.oCustomEventListenerInstances[myEvent];if(!listener){if(typeof($FSI.oCustomEventListenerClasses[myEvent])=="undefined"){$FSI.console.error("$FSI.oCustomEventListenerClass for '"+myEvent+"' is undefined.");return false}listener=$FSI.oCustomEventListenerInstances[myEvent]=new $FSI.oCustomEventListenerClasses[myEvent](myObj,myFunc)}obj=listener.addListener(myObj,myFunc);if(obj!=undefined){listenerID=obj.nCustomEventListenerID=$FSI.nCustomEventListenerID++;$FSI.oCustomEventListeners[obj.nCustomEventListenerID]=obj;$FSI.nCustomEventListeners++}else{$FSI.console.error("Failed to add custom event listener: "+myEvent)}return listenerID};$FSI.removeCustomEvent=function(myObj,myEvent,myFunc,bCapturingPhase){var listener=$FSI.oCustomEventListenerInstances[myEvent];if(!listener){return false}var obj=listener.removeListener(myObj,myFunc);if(obj&&$FSI.oCustomEventListeners[obj.nCustomEventListenerID]!=undefined){delete $FSI.oCustomEventListeners[obj.nCustomEventListenerID];$FSI.nCustomEventListeners--}else{$FSI.console.error("Failed to remove custom event listener")}};$FSI.setCustomEventListenerProperty=function(listenerID,nam,val){var obj=$FSI.oCustomEventListeners[listenerID];if(!obj||!obj.instanceListener){return}obj.instanceListener.setListenerProps.call(obj.instanceListener,obj.uniqueID,nam,val)};$FSI.enableCustomEventListener=function(listenerID,bEnable){var obj=$FSI.oCustomEventListeners[listenerID];if(!obj||!obj.instanceListener){return}obj.instanceListener.enableListener.call(obj.instanceListener,obj.uniqueID,bEnable)};$FSI.pauseCustomEventListener=function(listenerID,bPause){var obj=$FSI.oCustomEventListeners[listenerID];if(!obj||!obj.instanceListener){return}obj.instanceListener.pauseListener.call(obj.instanceListener,obj.uniqueID,bPause)};$FSI.triggerCustomEvent=function(listenerID){var obj=$FSI.oCustomEventListeners[listenerID];if(!obj||!obj.instanceListener){return}obj.instanceListener.triggerEvent.call(obj.instanceListener,obj.uniqueID)};$FSI.removeEvent=function(myObj,myEvent,myFunc,bCapturingPhase){if(window.removeEventListener&&myObj){if(bCapturingPhase==undefined){bCapturingPhase=true}myObj.removeEventListener(myEvent,myFunc,bCapturingPhase)}else{if(window.detachEvent&&myObj){myObj.detachEvent("on"+myEvent,myFunc)}}};$FSI.addEvent=function(myObj,myEvent,myFunc,bCapturingPhase){if(window.addEventListener&&myObj){if(bCapturingPhase==undefined){bCapturingPhase=true}myObj.addEventListener(myEvent,myFunc,bCapturingPhase)}else{if(window.attachEvent&&myObj){myObj.attachEvent("on"+myEvent,myFunc)}}};$FSI.getScriptTagByFileName=function(strScriptName){var tag;if(typeof(document.querySelector)=="function"){var strSelector="script[src$='"+strScriptName+"']";tag=document.querySelector(strSelector)}else{var tmp=$FSI.escapeRegEx(strScriptName);var regEx=new RegExp("(^|/)"+tmp+"s*$");var scripts=document.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){var src=scripts[i].src;if(src.match(regEx)){tag=scripts[i];break}}}return tag};$FSI.getScriptPath=function(strScriptName,depth){depth++;var ret="";var scripts=document.getElementsByTagName("script");var t="/"+strScriptName;var tag=$FSI.getScriptTagByFileName(strScriptName);if(tag){src=tag.src.split("/");src.splice(src.length-depth,depth);ret=src.join("/")}return ret};$FSI.guessFSIViewerLocation=function(strScriptName,depth){if($FSI._FSIViewerLocation!=undefined){return $FSI._FSIViewerLocation}var ret=$FSI.getScriptPath(strScriptName,depth);if(ret){$FSI._FSIViewerLocation=ret}return ret};$FSI.createJavascriptLoader=function(){if(typeof($FSI.iLoaderJavascript)!="object"){if(typeof($FSI.LoaderJavascript)!="function"){$FSI.console.error("Class $FSI.LoaderJavascript missing.");return false}$FSI.iLoaderJavascript=new $FSI.LoaderJavascript()}return true};$FSI.loadJavascript=function(strScriptPath,idInstance,argScope,fnOnLoad,oPassThroigh){if(!$FSI.createJavascriptLoader()){return false}return $FSI.iLoaderJavascript.load(strScriptPath,idInstance,argScope,fnOnLoad,oPassThroigh)};$FSI.releaseLoadJavascript=function(strScriptPath,idInstance){if(!$FSI.createJavascriptLoader()){return false}return $FSI.iLoaderJavascript.release(strScriptPath,idInstance)};$FSI.customTags={};$FSI.bCustomTagsAdded=false;$FSI.customTagDimFromAttributes=function(el){var rpl=function(nam){var tmp=el.getAttribute(nam);if(typeof(tmp)=="string"&&tmp.length>0){if(!tmp.match(/[^0-9\s]/)){tmp+="px"}el.style[nam]=tmp}};rpl("width");rpl("height")};$FSI.setParameters=function(node,parameters){if(!node||typeof(node.tagName)!="string"){return false}var t=typeof(parameters);if(t!="object"&&t!="function"){return false}node._fsi_parameters=parameters};$FSI.getParameters=function(node){if(!node||typeof(node.tagName)!="string"){return false}return node._fsi_parameters};$FSI.initCustomNode=function(node){if($FSI.BrowserSupports.registerElement()){return true}if(!node||typeof(node.tagName)!="string"){return false}var strTagName=node.tagName.toLowerCase();var oCustomTag=$FSI.customTags[strTagName];if(!oCustomTag||typeof(oCustomTag.replaceTag)!="function"){return false}if(oCustomTag.replaceTagInit){oCustomTag.replaceTagInit();delete oCustomTag.replaceTagInit}oCustomTag.replaceTag(node);return true};$FSI.initCustomTags=function(){if($FSI.BrowserSupports.registerElement()){return}for(var o in $FSI.customTags){$FSI.initCustomTag(o)}};$FSI.initCustomTag=function(strTagName){if($FSI.BrowserSupports.registerElement()){return}var oCustomTag=$FSI.customTags[strTagName];if(!oCustomTag||typeof(oCustomTag.replaceTag)!="function"){return false}var ar=document.getElementsByTagName(strTagName);if(ar&&ar.length>0){if(oCustomTag.replaceTagInit){oCustomTag.replaceTagInit();delete oCustomTag.replaceTagInit}for(var i=0;i<ar.length;i++){oCustomTag.replaceTag(ar[i])}}};$FSI.registerCustomTag=function(strTagName,oFunctions){var oCustomTag=$FSI.customTags[strTagName];if(oCustomTag){return false}oCustomTag=$FSI.customTags[strTagName]={};if($FSI.BrowserSupports.registerElement()){oCustomTag.bRegistered=true;oFunctions.registerElement()}else{oCustomTag.bRegistered=false;oCustomTag.replaceTag=oFunctions.replaceTag;if(typeof(oFunctions.replaceTagInit)=="function"){oCustomTag.replaceTagInit=oFunctions.replaceTagInit}if(!$FSI.bCustomTagsAdded){$FSI.bCustomTagsAdded=true;$FSI.addEvent(window,"DOMContentLoaded",$FSI.initCustomTags)}}return true};$FSI.attributes2parameters=function(node){var ret={};if(!node||typeof(node.attributes)!="object"){return ret}var attr;var attrs=node.attributes;for(var i=0;i<attrs.length;i++){attr=attrs[i];ret[attr.name]=attr.value}return ret};$FSI.oViewerClassCSSRules={};$FSI.addViewerClassCSSRule=function(strClass,strRule){if(typeof(strClass)!="string"||strClass.length<1){return}if(typeof(strRule)!="string"||strRule.length<1){return}var res=$FSI.oViewerClassCSSRules[strClass];if(res==strRule){return}$FSI.addCSSRule(strClass,strRule,0);$FSI.oViewerClassCSSRules[strClass]=strRule};$FSI.getWindowOffset=function(el){var ofsX=0;var ofsY=0;try{if(el.frameElement){var w=el;while(w.frameElement){var node=w.frameElement;var nodePos=$FSI.getElementPosition(node);ofsX+=nodePos.left;ofsY+=nodePos.top;w=w.parent}}}catch(e){}return{x:ofsX,y:ofsY}};$FSI.getElementPaddings=function(element){var ret={left:0,top:0,right:0,bottom:0};try{var style=window.getComputedStyle(element,null);ret.left=parseFloat(style.paddingLeft);ret.top=parseFloat(style.paddingTop);ret.right=parseFloat(style.paddingRight);ret.bottom=parseFloat(style.paddingBottom)}catch(e){}return ret};$FSI.getElementMargins=function(element){var ret={left:0,top:0,right:0,bottom:0};try{var style=window.getComputedStyle(element,null);ret.left=parseFloat(style.marginLeft);ret.top=parseFloat(style.marginTop);ret.right=parseFloat(style.marginRight);ret.bottom=parseFloat(style.marginBottom)}catch(e){}return ret};$FSI.getBoundingClientRect=function(el){var ret;try{ret=el.getBoundingClientRect()}catch(e){ret={top:0,left:0,right:0,bottom:0,width:0,height:0}}return ret};$FSI.getElementClientDim=function(element){var rc=$FSI.getBoundingClientRect(element);return{width:(rc.right-rc.left),height:(rc.bottom-rc.top)}};$FSI.getElementClientPos=function(element){return $FSI.getBoundingClientRect(element)};$FSI.getElementPosition=function(element){var node=element;var rc=$FSI.getBoundingClientRect(element);var bl=element.clientLeft;var bt=element.clientTop;var br=0;var bb=0;var pl=0;var pr=0;var pt=0;var pb=0;try{var style=window.getComputedStyle(element,null);pl=parseFloat(style.paddingLeft);pr=parseFloat(style.paddingRight);pt=parseFloat(style.paddingTop);pb=parseFloat(style.paddingBottom);bl=parseFloat(style.borderLeftWidth);br=parseFloat(style.borderRightWidth);bt=parseFloat(style.borderTopWidth);bb=parseFloat(style.borderBottomWidth)}catch(e){}var x1=rc.left+bl+pl;var y1=rc.top+bt+pt;var x2=rc.right-br-pr;var y2=rc.bottom-bb-pb;return{left:x1,top:y1,right:x2,bottom:y2}};$FSI.trim=function(s){if(!s||typeof(s)!="string"||s.length<1){return s}return s.replace(/(^\s+)|(\s+$)/g,"")};$FSI.escapeRegEx=function(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")};$FSI.addClass=function(el,strClass){if(!el||typeof(el.className)!="string"){return}if(typeof(strClass)!="string"){return}strClass=$FSI.trim(strClass);if(strClass.length<1){return}var needle=$FSI.escapeRegEx(strClass);var regex=new RegExp("(^|\\s+)"+needle+"(\\s+|$)");var strCurrent=$FSI.trim(el.className);var bFound=strCurrent.match(regex);if(!bFound){if(strCurrent.length>0){strCurrent+=" "+strClass}else{strCurrent+=strClass}el.className=strCurrent}};$FSI.removeClass=function(el,strClass){if(!el||typeof(el.className)!="string"){return}if(typeof(strClass)!="string"){return}strClass=$FSI.trim(strClass);if(strClass.length<1){return}var needle=$FSI.escapeRegEx(strClass);var regex=new RegExp("(^|\\s+)"+needle+"(\\s+|$)","g");var str=$FSI.trim(el.className.replace(regex," "));if(str.length>0){el.className=str}else{el.removeAttribute("class")}};$FSI.urlDecode=function(str){str=str.replace($FSI.regexPlusToSpace," ");return decodeURIComponent(str)};$FSI.getCSSTransformStyleName=function(){if($FSI._CSSTransformStyleName!=undefined){return $FSI._CSSTransformStyleName}var ret="transform";var ar=["transform","webkitTransform","msTransform","MozTransform","OTransform"];var div=document.createElement("DIV");for(var i=0;i<ar.length;i++){div.style[ar[i]]="translate( 0 , 0)";if(div.style[ar[i]]!="translate( 0 , 0)"){ret=ar[i];break}}div=null;$FSI._CSSTransformStyleName=ret;return ret};$FSI.getFSIServerImageDim=function(wSource,hSource,wTarget,hTarget,range,keepAspectRatio){var sourceDim={width:wSource,height:hSource};var targetDim={width:wTarget,height:hTarget};$FSI.calcFSIServerImageDim(sourceDim,targetDim,range,keepAspectRatio);return targetDim};$FSI.calcFSIServerImageDim=function(sourceDimension,targetDimension,range,keepAspectRatio){if(typeof(range)!="object"){range={left:0,top:0,width:1,height:1}}else{range.left=range.left<0?0:range.left>1?1:range.left;range.top=range.top<0?0:range.top>1?1:range.top;range.width=range.width<0?1-range.left:range.width+range.left>1?1-range.left:range.width;range.height=range.height<0?1-range.top:range.height+range.top>1?1-range.top:range.height}targetDimension.width=targetDimension.width<=0||targetDimension.width===undefined?-1:targetDimension.width;targetDimension.height=targetDimension.height<=0||targetDimension.height===undefined?-1:targetDimension.height;var scale={};if(targetDimension.width!=-1&&targetDimension.height!=-1){scale.x=targetDimension.width/(sourceDimension.width*range.width);scale.y=targetDimension.height/(sourceDimension.height*range.height)}else{if(targetDimension.height==-1){scale.x=targetDimension.width/(sourceDimension.width*range.width);scale.y=scale.x}else{scale.y=targetDimension.height/(sourceDimension.height*range.height);scale.x=scale.y}}if(targetDimension.width==-1||targetDimension.height==-1){var scaleFactor=Math.min(scale.x,scale.y);if(targetDimension.width==-1){targetDimension.width=Math.round(sourceDimension.width*range.width*scaleFactor)}else{if(targetDimension.height==-1){targetDimension.height=Math.round(sourceDimension.height*range.height*scaleFactor)}}scale.x=scaleFactor;scale.y=scaleFactor}if(keepAspectRatio&&Math.abs(scale.x-scale.y)>1e-7){if(scale.x>scale.y){var preciseTargetWidth=targetDimension.height*sourceDimension.width*range.width/(sourceDimension.height*range.height);scale.x=preciseTargetWidth/sourceDimension.width;targetDimension.width=Math.round(preciseTargetWidth)}else{var preciseTargetHeight=targetDimension.width*sourceDimension.height*range.height/(sourceDimension.width*range.width);scale.y=preciseTargetHeight/sourceDimension.height;targetDimension.height=Math.round(preciseTargetHeight)}}targetDimension.width=targetDimension.width==0?1:targetDimension.width;targetDimension.height=targetDimension.height==0?1:targetDimension.height;return scale};if(typeof(window.JSON)=="undefined"){$FSI.JSON={};$FSI.JSON._emulated=true}else{$FSI.JSON=JSON}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof $FSI.JSON.stringify!=="function"){$FSI.JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof $FSI.JSON.parse!=="function"){$FSI.JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());$FSI.BrowserSupports.registerElement=function(){var res=false;try{if(typeof(document.registerElement)=="function"){res=true}}catch(e){}$FSI.BrowserSupports.registerElement=$FSI.BrowserSupports[res];return res};$FSI.BrowserSupports.canvas=function(){var res=false;try{var cv=document.createElement("canvas");var ctx=cv.getContext("2d");if(ctx&&ctx.clearRect!=undefined){res=true}}catch(e){}$FSI.BrowserSupports.canvas=$FSI.BrowserSupports[res];return res};$FSI.BrowserSupports.cssTouchAction=function(){var res=false;try{if($FSI.isTouch){if(typeof(window.getComputedStyle)=="function"){var stl=window.getComputedStyle(document.body);res=(typeof(stl.touchAction)=="string")}}}catch(e){}$FSI.BrowserSupports.cssTouchAction=$FSI.BrowserSupports[res];return res};var ret=($FSI.isMobileDevice||$FSI.isIETouch||$FSI.isTouch||($FSI.isMac&&$FSI.isSafari))?true:false;$FSI.BrowserSupports.documentZoom=$FSI.BrowserSupports[ret];return true}()}$FSI.Rect=function(c,e,f,a){var d=this;d.left=(isNaN(c))?0:c;d.top=(isNaN(e))?0:e;d.right=(isNaN(f))?0:f;d.bottom=(isNaN(a))?0:a;this.width=function(){var b=d.right-d.left;return(b<0)?-b:b};this.height=function(){var b=d.bottom-d.top;return(b<0)?-b:b};this.offsetRect=function(g,b){d.left+=g;d.right+=g;d.top+=b;d.bottom+=b};this.inflateRect=function(h,g){var b=h/2;var i=g/2;d.left-=b;d.top-=i;d.right+=b;d.bottom+=i};this.normalizeRect=function(){var b;if(d.left>d.right){b=d.left;d.left=d.right;d.right=b}if(d.top>d.bottom){b=d.top;d.top=d.bottom;d.bottom=b}};this.setRect=function(h,i,j,g){d.left=h;d.top=i;d.right=j;d.bottom=g};this.scaleRect=function(b){if(b==1){return}d.left*=b;d.top*=b;d.right*=b;d.bottom*=b};this.scaleRectXY=function(g,b){d.left*=g;d.top*=b;d.right*=g;d.bottom*=b};this.scaleRectInt=function(b){if(b==1){return}d.left=Math.round(d.left*b);d.top=Math.round(d.top*b);d.right=Math.round(d.right*b);d.bottom=Math.round(d.bottom*b)};this.interSectRect=function(j){d.normalizeRect();j.normalizeRect();var i=Math.max(d.left,j.left);var b=Math.max(d.top,j.top);var g=Math.min(d.right,j.right);var h=Math.min(d.bottom,j.bottom);d.setRect(i,b,g,h)};this.interSectRectValidate=function(b){d.interSectRect(b);if(d.right<d.left){d.left=d.right=0}if(d.bottom<d.top){d.top=d.bottom=0}};this.isInsideRect=function(b){return(d.left>=b.left&&d.top>=b.top&&d.right<=b.right&&d.bottom<=b.bottom)};this.isRectInsideMe=function(b){return(d.left<=b.left&&d.top<=b.top&&d.right>=b.right&&d.bottom>=b.bottom)};this.getBoundingRect=function(k){d.normalizeRect();k.normalizeRect();var j=Math.min(d.left,k.left);var b=Math.min(d.top,k.top);var h=Math.max(d.right,k.right);var i=Math.max(d.bottom,k.bottom);var g=new $FSI.Rect(j,b,h,i);return g};this.equalRect=function(b){if(d.left==b.left&&d.top==b.top&&d.right==b.right&&d.bottom==b.bottom){return true}else{return false}};this.copyRect=function(b){d.setRect(b.left,b.top,b.right,b.bottom)};this.duplicateRect=function(){return new $FSI.Rect(d.left,d.top,d.right,d.bottom)};this.round=function(b){var g=function(i,h){i*=h;i=(i>=0)?Math.floor(i+0.5):Math.ceil(i-0.5);return i/h};if(isNaN(b)){b=1000000}d.left=g(d.left,b);d.top=g(d.top,b);d.right=g(d.right,b);d.bottom=g(d.bottom,b)};this.toString=function(){return d.left+","+d.top+","+d.right+","+d.bottom};this.getRange=function(){var b={};b.left=d.left;b.top=d.top;b.width=d.width();b.height=d.height();return b}};$FSI.ObjectCollection=function(){var b=this;var d;var f;var a=0;var e;var c;this.reset=function(){a=0;b.empty()};this.empty=function(){d=[];f={};e=0;c=false};this.getCount=function(){return e};this.add=function(h){if(!h){return}a++;f[a]=h;h.__id=a;h.__arrayPos=d.length;d.push(h);e++;return a};this.deleteObject=function(h){if(!h||!h.__id){return}return b.deleteObjectById(h.__id)};this.deleteObjectById=function(h){if(!f[h]){console.error("ObjectCollection deleteObjectById "+h+" failed.");return}e--;delete f[h];c=true;return true};this.replace=function(h,i){if(!h||!i){return}return b.replaceById(h.__id,i)};this.replaceById=function(k,j){if(f[k]==undefined||j==undefined){return}var i=f[k];var h=f[k].__arrayPos;delete f[k];a++;j.__id=a;j.__arrayPos=h;d[h]=j;f[a]=j;return true};var g=function(){if(!c){return}d=new Array(e);var j=0;for(var i in f){var h=f[i];h.__arrayPos=j;d[j]=h;j++}c=false};this.getById=function(h){return f[h]};this.getArray=function(){if(c){g()}return d};this.getObjects=function(){return f};b.empty()};$FSI.ImageTagCollection=function(a,k){$FSI.ObjectCollection.prototype.constructor.apply(this,arguments);var m=this;var l=false;var g=false;var j=false;var n;var b,d;this.init=function(){if(typeof(a.NameID)=="string"){n=a.NameID}else{n="$FSI_ImageTagID"}if(typeof(k.fnFilterImageSource)=="function"){g=k.fnFilterImageSource}if(typeof(k.addCSSClass)=="string"){j=k.addCSSClass}if(typeof(k.enableByCSSClass)=="string"&&k.enableByCSSClass.length>0){d={};var p=k.enableByCSSClass.split(",");for(var o=0;o<p.length;o++){d[p[o]]=true}}if(typeof(k.disableByCSSClass)=="string"&&k.disableByCSSClass.length>0){b={};var p=k.disableByCSSClass.split(",");for(var o=0;o<p.length;o++){b[p[o]]=true}}l=(b!=undefined||d!=undefined)};var i=this.isValidFSIImageServerImageSource=function(o){if(typeof(o)!="string"){return false}if(o.length<1||o.search(/[?,&]type=image|directoryimage/i)==-1||o.search(/[?,&]source=/i)==-1){return false}return true};var f=this.createObjectForImageTag=function(q,t){var p=false;var r=q.src;if(t==undefined){r=t=q.src;if(g!=false){p=true;t=g(t,q)}}if(!i(t)){return}if(!c(q)){return}if(j){$FSI.addClass(q,j)}var s={};s.img=q;s.src=t;s.orgSrc=r;if(p){s.bIgnoreSourceChange=true}return s};this.addBaseMethod=this.add;this.add=function(p,r){if(p[n]!=undefined){return}var q=f(p,r);if(q){this.addBaseMethod(q);p[n]=q.__id}return q};this.replaceBaseMethod=this.replace;this.replace=function(o,p){if(m.replaceBaseMethod(o,p)){p.img[n]=p.__id}};var h=this.releaseImage=function(q){if(!q||!q.img){return false}var p=q.img;if(!p[n]==undefined||p[n]!=q.__id){return}if(j){$FSI.removeClass(p,j)}return true};var e=this.remove=function(p){if(!this.deleteObject(p)){return false}h(p);return true};var c=this.isImageEnabledByCSSClass=function(o){if(!l){return true}var p=false;var r=o.className;if(typeof(r)!="string"){r=[]}else{r=r.split(" ")}if(b){p=true;for(var q=0;q<r.length;q++){if(b[r[q]]){p=false;break}}}if(d){for(var q=0;q<r.length;q++){if(d[r[q]]){p=true;break}}}return p}};$FSI.EmptyDebugger=function(){this.log=this.error=this.dir=this.setPrefix=function(){};this.on=false};$FSI.Debugger=function(){var a="FSI";this.on=true;this.doNothing=function(){};this.log=this.doNothing;this.error=this.doNothing;this.dir=this.doNothing;try{if(console&&console.log){this.log=function(c){console.log(a+c)}}if(console&&console.error){this.error=function(c){console.error(a+c)}}if(console&&console.dir){this.dir=function(c){console.dir(c)}}}catch(b){}this.setPrefix=function(c){a=c+"> "}};$FSI.CustomEventListener=function(i){var k=this;var b=[];var e={};var f={};var g=0;k._strClassName="$FSI.CustomEventListener";var j=function(){if($FSI.eventFunctionID==undefined){$FSI.eventFunctionID=0}if($FSI.eventElementID==undefined){$FSI.eventElementID=0}};var h=this.destroy=function(){for(var l=0;l<b.length;l++){var m=b[l];d(m.element,m.fn)}b=[];e={};f={};k.onDestroy()};this.fireEvent=function(l,m){if(!l||!l.enabled){return false}if(typeof(m)!="object"){m={}}if(l.paused){m.FSI_paused=true}m.FSI_custom_event=true;m.FSI_type=i;m.FSI_target=l.element;l.fn.call(l.element,m);return true};this.fireEvents=function(m){if(typeof(m)!="object"){m={}}m.FSI_custom_event=true;m.FSI_type=i;for(var n=0;n<b.length;n++){var l=b[n];if(l.enabled){if(l.paused){m.FSI_paused=true}else{if(m.FSI_paused){delete m.FSI_paused}}m.FSI_target=l.element;l.fn.call(l.element,m)}}};var a=this.addListener=function(p,o){if(typeof(p)!="object"||typeof(o)!="function"){$FSI.console.error(k._strClassName+": Invalid parameters for addListener");return}if(p.__FSI==undefined){p.__FSI={}}if(p.__FSI.eventElementID==undefined){p.__FSI.eventElementListenerCount=1;p.__FSI.eventElementID=$FSI.eventElementID++}else{p.__FSI.eventElementListenerCount++}if(o.__FSIEventFunctionID==undefined){o.__FSIEventFunctionListenerCount=1;o.__FSIEventFunctionID=$FSI.eventFunctionID++}else{o.__FSIEventFunctionListenerCount++}var m=p.__FSI.eventElementID;var n=o.__FSIEventFunctionID;if(e[m]==undefined){var l=e[m]={};l.nFunction=0;l.oFunctions={}}if(e[m].oFunctions[n]==undefined){e[m].nFunction++;e[m].oFunctions[n]=[]}else{$FSI.console.warn(k._strClassName+": There is already a listener for this exact element and function");$FSI.console.log(p);$FSI.console.log(o)}var q={};q.element=p;q.elementID=m;q.fn=o;q.fnID=n;q.instanceListener=k;q.enabled=true;q.paused=false;q.uniqueID=g++;e[m].oFunctions[n].push(q);b.push(q);f[q.uniqueID]=q;k._onListenerAdd(q);k._onListenerCountChange(b.length);return q};this.setListenerProps=function(o,m,n){var l=f[o];if(!l){return false}if(l.props==undefined){l.props={}}l.props[m]=n;return true};this.enableListener=function(n,m){var l=f[n];if(l==undefined||l.enabled==m){return}l.enabled=m};this.pauseListener=function(n,m){var l=f[n];if(l==undefined||l.paused==m){return}l.paused=m};var d=this.removeListener=function(p,o){if(typeof(p)!="object"||typeof(o)!="function"){$FSI.console.error(k._strClassName+": Invalid parameters for removeListener");return}if(p.__FSI==undefined||p.__FSI.eventElementID==undefined||o.__FSIEventFunctionID==undefined){if(o.__FSIEventFunctionID==undefined){$FSI.console.error(k._strClassName+": Function not registered for listener in removeListener")}else{$FSI.console.error(k._strClassName+": Element not registered for listener in removeListener")}return}var l=p.__FSI.eventElementID;var n=o.__FSIEventFunctionID;if(!e[l]){$FSI.console.error(k._strClassName+": No registered listener for this element in removeListener");return}var m=e[l].oFunctions[n];if(m==undefined||typeof(m.pop)!="function"){$FSI.console.error(k._strClassName+": No registered listener for this function in removeListener");return}var q=m.pop();q.fn.__FSIEventFunctionListenerCount--;q.element.__FSI.eventElementListenerCount--;if(q.element.__FSI.eventElementListenerCount==0){delete q.element.__FSI.eventElementListenerCount;delete q.element.__FSI.eventElementID}if(q.fn.__FSIEventFunctionListenerCount==0){delete q.fn.__FSIEventFunctionListenerCount;delete q.fn.__FSIEventFunctionID}if(m.length==0){delete e[l].oFunctions[n];e[l].nFunction--;if(e[l].nFunction==0){delete e[l]}}delete f[q.uniqueID];c();k._onListenerRemove(q);k._onListenerCountChange(b.length);return q};this.getEventListenerByID=function(l){return f[l]};this.getListenerObjectByID=function(l){return f[l]};this.getListenersArray=function(){return b};this.getListenerCount=function(){return b.length};var c=function(){b=[];for(var m in e){var o=e[m].oFunctions;for(var n in o){var l=o[n];b=b.concat(l)}}};this.dump=function(){$FSI.console.dir(e);$FSI.console.dir(b)};this._onListenerCountChange=function(l){};this._onListenerAdd=function(m,l){};this._onListenerRemove=function(m,l){};this.triggerEvent=function(l){};this.triggerEvents=function(){};this.setListenerProps=function(n,l,m){};this.onDestroy=function(){};j()};$FSI.CustomEventListenerDocumentZoom=$FSI.oCustomEventListenerClasses.FSIDocumentZoomChange=function(){var l=this;var a=false;var d;var e;var k=0;var i=0;var c=false;var b;$FSI.CustomEventListener.prototype.constructor.call(l,"FSIDocumentZoomChange");l._strClassName="$FSI.CustomEventListenerDocumentZoom";var g=function(){if(a){return}a=true;$FSI.addEvent(window,"orientationchange",j);b=0;e=setInterval(j,50);d=$FSI.getDocumentScaleWithPixelRatio()};var f=function(){if(!a){return}a=false;$FSI.removeEvent(window,"orientationchange",j);clearInterval(e);e=undefined};this.onDestroy=function(){f()};this._onListenerCountChange=function(m){var n=(m>0);if(n!=a){if(n){g()}else{f()}}};var j=function(){var m;var n=$FSI.getDocumentScaleWithPixelRatio();if(d!=n){if(c==false){b=0;clearInterval(e);e=setInterval(j,50)}i=0;d=n;h(n);m=true}else{m=false;if(b<3){i++;if(i==20){b=1;clearInterval(e);e=setInterval(j,150)}else{if(i==40){b=2;clearInterval(e);e=setInterval(j,300)}else{if(i==50){b=3;clearInterval(e);e=setInterval(j,600)}}}}}return m};this.triggerEvent=function(o){var m=l.getEventListenerByID(o);if(!m){return}var n={};n.FSI_scale=$FSI.getDocumentScale();n.FSI_scale_with_pixel_ratio=$FSI.getDocumentScaleWithPixelRatio();l.fireEvent(m,n)};this.triggerEvents=function(){h($FSI.getDocumentScaleWithPixelRatio())};var h=function(n){var m={};m.FSI_scale=$FSI.getDocumentScale();m.FSI_scale_with_pixel_ratio=n;l.fireEvents(m)}};$FSI.CustomEventListenerViewport=$FSI.oCustomEventListenerClasses.FSIViewport=function(){var k=this;var b=false;var g=new $FSI.Rect(0,0,0,0);var h=new $FSI.Rect(0,0,0,0);var l=new $FSI.Rect(0,0,0,0);var F=new $FSI.Rect(0,0,0,0);var t={left:0,top:0};var Q;var A;var B="";var c=false;var o=undefined;var x;var i=1;var n=1;var q=10;var E;var s=0;var u;var D;var P=0;var a=100;var n=1;var y=1;var L=32;var w;var p;try{p=window.frameElement}catch(N){}$FSI.CustomEventListener.prototype.constructor.call(k,"FSIViewport");k._strClassName="$FSI.CustomEventListenerViewport";this.onDestroy=function(){m()};var K=function(){if(b){return}b=true;f($FSI.addEvent);E=$FSI.addCustomEvent(k,"FSIDocumentZoomChange",G);n=$FSI.getDocumentScale();y=n*$FSI.getDevicePixelRatio()};var m=function(){if(!b){return}b=false;f($FSI.removeEvent);$FSI.removeCustomEvent(k,"FSIDocumentZoomChange",G);E=undefined;if(o){clearInterval(o);o=undefined}r();s=0;if(w!=undefined){clearTimeout(w);w=undefined}};var f=function(R){var e=window;R(e.document,"scroll",j,false);R(e,"resize",j,false);if($FSI.isTouch&&!$FSI.isIETouch&&p){R(e,"touchmove",O,false)}while(e.frameElement){e=e.parent.window;if(e){R(e.document,"scroll",j,false);if($FSI.isTouch&&!$FSI.isIETouch&&e.frameElement){R(e,"touchmove",O,false)}R(e,"resize",j,false)}}R(window,"orientationchange",j,false)};this.setListenerProps=function(T,R,S){if(typeof(R)!="string"){return false}var e=k.getListenerObjectByID(T);if(!e){return false}switch(R){case"treshold":if(e.tresholdEnd!=undefined){s--;e.tresholdEnd=undefined}if(S&&S>0){s++;e.tresholdEnd=S}break;case"fireTresholdEventOnly":e.fireTresholdEventOnly=S;break}};this._onListenerRemove=function(e){if(e.tresholdEnd!=undefined){s--}};this._onListenerCountChange=function(e){var R=(e>0);if(R!=b){if(R){K()}else{m()}}};var G=function(e){n=e.FSI_scale;y=e.FSI_scale_with_pixel_ratio;j()};var j=function(){if(w!=undefined){return}w=setTimeout(I,L);I()};var I=function(){if(w!=undefined){clearTimeout(w);w=undefined}var e=false;var R=J();if(B!=R){B=R;e=true;d()}return e};var H=function(){n=$FSI.getDocumentScale();y=n*$FSI.getDevicePixelRatio();J()};this.triggerEvent=function(S){var e=k.getEventListenerByID(S);if(!e){return}H();var R=M();k.fireEvent(e,R)};this.triggerEvents=function(){H();d()};var d=this.fireEvents=function(){var R=M();var S=k.getListenersArray();for(var T=0;T<S.length;T++){var e=S[T];if(!e.fireTresholdEventOnly){k.fireEvent(e,R)}}z()};var M=function(){var e={};e.FSI_scale=$FSI.getDocumentScale();e.FSI_scale_with_pixel_ratio=e.FSI_scale*$FSI.getDevicePixelRatio();e.FSI_viewport_rect=h;e.FSI_scroll=t;e.FSI_client_rect_body_top=Q;e.FSI_viewport_size_top=A;return e};var J=function(){A=$FSI.getViewportSize($FSI.topWindow);Q=$FSI.getBoundingClientRect($FSI.topWindow.document.documentElement);g.left=$FSI.topWindow.pageXOffset;g.top=$FSI.topWindow.pageYOffset;g.right=g.left+A.width;g.bottom=g.top+A.height;if(p){var e=$FSI.getViewportSize(window);var R=$FSI.getWindowOffset(window);h.left=0;h.top=0;h.right=h.left+e.width;h.bottom=h.top+e.height;t.left=-window.pageXOffset;t.top=-window.pageYOffset;l.copyRect(h);l.left=-R.x+g.left+Q.left;l.top=-R.y+g.top+Q.top;l.right=l.left+A.width;l.bottom=l.top+A.height;h.interSectRectValidate(l);var S=$FSI.getBoundingClientRect(window.document.body);F.copyRect(h);F.offsetRect(R.x+S.top,R.y+S.left)}else{t.left=Q.left;t.top=Q.top;F.copyRect(g);h.copyRect(g);h.offsetRect(Q.left,Q.top)}return n+"_"+F.toString()+" "+A.width+" x "+A.height};var O=function(){x=q;if(o!=undefined){return}o=setInterval(v,100)};var v=function(){if(!I()){x--}else{x=q}if(x<1){clearInterval(o);o=undefined}};var r=function(){if(D!=undefined){clearInterval(D);D=undefined;u=undefined}};var z=function(){r();if(s>0){D=setInterval(C,a)}};var C=function(){P+=a;if(u==undefined){P=a;u=[];var S=k.getListenersArray();for(var T=0;T<S.length;T++){var e=S[T];if(e.tresholdEnd>0){u.push(e)}}}var R;for(var T=u.length-1;T>-1;T--){var e=u[T];if(e.tresholdEnd<=P){if(k.getEventListenerByID(e.uniqueID)!=undefined){if(R==undefined){R=M();R.FSI_after_treshold=true}k.fireEvent(e,R)}u.splice(T,1)}}if(u.length==0){r()}}};$FSI.TouchZoom=function(r){var C=new $FSI.ClassDef(this,"FSI TouchZoom","1.1.2","16.02.08");var ah=C.instance;$FSI.guessFSIViewerLocation("fsitouchzoom.js",3);if(!$FSI._FSIViewerLocation){$FSI.guessFSIViewerLocation("FSI.TouchZoom.js",3)}var W=$FSI.getViewerInstanceID();var z=(r)?$FSI.cloneParameters(r):{};var X=(!$FSI.BrowserSupports.documentZoom()&&!$FSI.makeBool(z.enableDesktopBrowsers,true));var G=$FSI.makeBool(z.useImageTiles,true);var F=$FSI.makeBool(z.fadeImageTiles,true);var aa;var aj;var R;var a;var ax={};var M={};var ak=false;var s;var L=1;var ag=1;var S={};var ac=false;var av=4;var i;var aA=4000000;var ao=900;var an=900;var q;var ar=0;var n;var u=0;var e=0;var T;var p;var af=false;var j;var Y=/((\?)|&)(width|height)=[^&]*/ig;var Z=/((\?)|&)(rect|pixelRange|referenceWidth|referenceHeight)=[^&]*/ig;var A=/[?&]effects=[^&]*pad|flip|distort\(/i;var o=/[?&]referencewidth=([^&]*)/i;var U=/[?&]referenceheight=([^&]*)/i;var I;var Q=$FSI.makeBool(z.debug,false);var al=false;var g="position:absolute!important;display:block;border:0px none!important;margin:0px!important;padding:0px!important;-webkit-transform:none!important;-ms-transform:none!important;transform:none!important";if(Q){s=new $FSI.Debugger();s.setPrefix(C.strClassName)}else{s=new $FSI.EmptyDebugger()}s.log(ah.getVersion());this.init=function(aC){if(typeof($FSI._FSITouchZoomInstance)=="object"){$FSI.console.error("An initialized FSI TouchZoom instance already exists, aborting init(). Scanning for new images and returning the existing instance.");$FSI._FSITouchZoomInstance.scanForNewImages();return $FSI._FSITouchZoomInstance}if(al){ah.destroy()}if(ah.bAutoInitialized){s.log("Init (auto initialized)")}else{s.log("Init")}if(X){return}al=true;af=false;T=true;ac=$FSI.mobileOS=="ios";if(!a){var aG={NameID:"$FSITouchZoom_TagID"};a=new $FSI.ImageTagCollection(aG,z);a.init()}$FSI._FSITouchZoomInstance=ah;if(G){if(navigator.userAgent.match(/Windows Phone/gi)&&navigator.userAgent.match(/Trident/gi)){G=false}}ak=$FSI.makeBool(z.useDevicePixelRatio,true);if(z.headers==undefined){z.headers="cors"}if(z.headers.length>0){i="&headers="+z.headers}else{i=""}if(z.zoomPrecision!=undefined){var aH=parseInt(z.zoomPrecision);if(isNaN(aH)||(aH<1&&aH!=0)){}else{av=aH}}I=false;if($FSI.makeBool(z.debugTiles,false)){I=true;ao=300;an=300}var aB=document.getElementsByTagName("img");if(Q){s.log("Parameters: ");s.log("zoomPrecision: "+av);s.log("useTiledImages: "+G);s.log("useDevicePixelRatio: "+$FSI.makeBool(z.useDevicePixelRatio,true)+" (ratio: "+$FSI.getDevicePixelRatio()+")");s.log("enableByCSSClass: "+z.enableByCSSClass);s.log("disableByCSSClass: "+z.disableByCSSClass);var aE=$FSI.makeBool(z.loadingImage);if(z.loadingImage==undefined||aE===true){aE="images/loading.gif"}else{aE=z.loadingImage}s.log("loadingImage: "+aE);s.log("Preparing images (total images: "+aB.length+")")}var aF=aB.length;for(var aD=0;aD<aF;aD++){ap(aB[aD])}ay();s.log(a.getCount()+" images have been prepared for FSI TouchZoom.")};this.destroy=function(){if(!al){return}al=false;p=false;T=false;$FSI._FSITouchZoomInstance=undefined;$FSI.removeCustomEvent(ah,"FSIViewport",f);clearTimeout(q);var aB=a.getArray();var aD=a.getCount();for(var aC=0;aC<aD;aC++){aq(aB[aC])}a.empty();p=undefined;R=undefined;s.log("instance destroyed.")};var ay=function(){if(p){return false}if(a.getCount()>0){var aF=C.strClassName;if(!$FSI.cssClassExists(aF)){var aC="fsi_touch_zoom img{"+g+"}\n";aC+="fsi_touch_zoom_tiles.root{ position:relative;left:0px;top:0px}\n";aC+="img.fsi_touch_zoom_background_image{position:absolute!important;left:0px;top:0px;}\n";aC+="fsi_touch_zoom_tiles{ position:absolute;display:block;overflow:hidden;white-space:nowrap;border:0px none;margin:0px;padding:0px;zoom:1;-webkit-transform:none;-ms-transform:none;transform:none}\n";aC+="@keyframes fsifadetilesin{from {opacity:0} to {opacity:1}}\n";aC+="@-webkit-keyframes fsifadetilesin{from {opacity:0} to {opacity:1}}\n";aC+="img.__FSITouchZoomLoading{opacity:0}\n";aC+="img.__FSITouchZoomLoadingFadeIn{animation-name: fsifadetilesin; animation-duration: 1.0s;animation-delay:0.5s; animation-iteration-count: 1;animation-fill-mode: forwards;animation-timing-function:ease-out;-webkit-animation-name: fsifadetilesin; -webkit-animation-duration: 1.0s;-webkit-animation-delay:0.5s; -webkit-animation-iteration-count: 1;-webkit-animation-fill-mode: forwards;-webkit-animation-timing-function:ease-out}\n";aC+="fsi_touch_zoom img.fadein{animation-name:fsifadetilesin; animation-duration: 0.3s;animation-iteration-count: 1;animation-timing-function:ease-out;-webkit-animation-name:fsifadetilesin; -webkit-animation-duration: 0.3s;-webkit-animation-iteration-count: 1;-webkit-animation-timing-function:ease-out}\n";$FSI.addCSSClass(aF,aC)}if(z.loadingImage==undefined){z.loadingImage=$FSI.makeBool(z.loadingImage,false)}if(z.loadingImage){var aD;if(typeof(z.loadingImage)=="string"&&z.loadingImage.length>0){aD=z.loadingImage}else{var aB="images/";if($FSI._FSIViewerLocation!=undefined){aB=$FSI._FSIViewerLocation+"/applications/touchzoom/images/"}aD=aB+"loading.gif"}var aE=n=document.createElement("img");aE.style.position="absolute";aE.style.zIndex="90000";aE.style.left="0px";aE.style.top="0px";aE.className="__FSITouchZoomLoading";aE.src=aD}v();return true}else{return false}};var v=function(){if(p){return}aa=$FSI.addCustomEvent(ah,"FSIViewport",f);$FSI.setCustomEventListenerProperty(aa,"treshold",150);$FSI.setCustomEventListenerProperty(aa,"fireTresholdEventOnly",true);$FSI.triggerCustomEvent(aa);p=true};var w=function(aB,aD,aC){if(!aC){aC=new Object()}aC.img=aB;aC.bLoading=false;aC.orgSrc=aC.srcCurrent=aD;aC.elPosition=aC.img;$FSI.addEvent(aB,"load",V,false);$FSI.addEvent(aB,"error",m,false);return aC};var x=function(aC){if(!aC){return}delete M[aC.FSITouchZoom_ID];if(aC.bLoading){O(aC,false)}var aB=aC.img;if(!aB){return}$FSI.removeEvent(aB,"load",V,false);$FSI.removeEvent(aB,"error",m,false);aB.$FSITouchZoom_ID=undefined;delete aB.$FSITouchZoom_ID;aB.$FSITouchZoom_TagID=undefined;delete aB.$FSITouchZoom_TagID};var aq=function(aC){if(!a.releaseImage(aC)){return}if(aC.bZoomed){H(aC)}x(aC);var aB=aC.img;if(aC.bWaitingForRestore){if(!aB.oAfterRelease){aB.oAfterRelease={};aB.oAfterRelease.img=aB;aB.oAfterRelease.FSITouchZoom_ID=aC.FSITouchZoom_ID;aB.oAfterRelease.orgAttrWidth=aC.orgAttrWidth;aB.oAfterRelease.orgAttrHeight=aC.orgAttrHeight;$FSI.addEvent(aB,"load",N,false);$FSI.addEvent(aB,"error",N,false)}}else{J(aC)}};var N=function(aB){var aC=aB.srcElement;if(!aC){aC=aB.target}$FSI.removeEvent(aC,"load",N,false);$FSI.removeEvent(aC,"error",N,false);if(aC.oAfterRelease){var aD=aC.oAfterRelease;delete aC.oAfterRelease;J(aD)}};var J=function(aC){var aB=aC.img;if(!aB||aB.oAfterRelease){return}if(aC.orgAttrWidth){aB.setAttribute("width",aC.orgAttrWidth,0)}else{aB.removeAttribute("width")}if(aC.orgAttrHeight){aB.setAttribute("height",aC.orgAttrHeight,0)}else{aB.removeAttribute("height")}};this.removeImages=function(aB,aD){if(!al){return}if(aB==undefined){if(!aD){s.error("removeImages: invalid argument (img dom element or array of img dom elements required)")}return}if(typeof(aB.join)!="function"){aB=[aB]}var aH=0;var aF=aB.length;for(var aE=0;aE<aF;aE++){var aC=aB[aE];if(aC&&aC.$FSITouchZoom_TagID){var aG=a.getById(aC.$FSITouchZoom_TagID);if(aG){a.deleteObjectById(aC.$FSITouchZoom_TagID);aq(aG);aH++}}}if(aH>0){au()}if(!aD){s.log("removeImages: "+aH+" images have been removed, total images for TouchZoom now: "+a.getCount()+" images.")}return aH};this.addImage=function(aB,aD){if(!al){return}if(!aB||!aB.src){s.log("Image NOT added. Invalid img argument.");return}var aC=t(aB);if(aC){s.log("Image NOT added. Image already added to FSI TouchZoom.");return}aC=ap(aB,aD);if(aC){s.log("Image added. Total images for TouchZoom now: "+a.getCount()+" images.");ai()}else{s.error("The requested image has not been added. Total images for TouchZoom now: "+a.getCount()+" images.")}return(aC!=undefined)};var ai=function(){ay();au()};var ap=function(aB,aD){var aC=a.add(aB,aD);if(aC){w(aB,aC.src,aC);y(aC,aC.__id)}return aC};var y=function(aC,aB){M[aB]=aC;aC.FSITouchZoom_ID=aB;aC.img.$FSITouchZoom_ID=aB};var t=function(aB){if(!aB||!aB.$FSITouchZoom_ID){return}return M[aB.$FSITouchZoom_ID]};var k=function(aC){if(!aC||!aC.img){return}var aB=aC.img;aC.src=aw(aC.orgSrc);aC.tileSrc=B(aC.src);if(!aB.oAfterRelease){if(aB.width!=undefined&&aB.width>0){aC.width=aB.width}if(aB.height!=undefined&&aB.height>0){aC.height=aB.height}}if(aC.width>0&&aC.height>0){D(aC)}else{aC.bFinishOnLoad=true}aC.bPrepared=true;return aC};var D=function(aC){if(aC.width<1||aC.height<1){return}aC.orgAttrWidth=aC.img.getAttribute("width");aC.orgAttrHeight=aC.img.getAttribute("height");aC.ready=true;aC.wOrg=aC.width;aC.hOrg=aC.height;if(aC.wLast==undefined){aC.wLast=aC.width}if(!aC.img.getAttribute("width")){aC.img.setAttribute("width",aC.width,0)}if(!aC.img.getAttribute("height")){aC.img.setAttribute("height",aC.height,0)}if(G){var aB=aC.src.search(A);if(aB!=-1){aC.bDoNotTile=true}else{if(aC.orgSrc.search(/[?,&]renderer=animate/i)!==-1){aC.bDoNotTile=true}}}else{aC.bDoNotTile=true}};var aw=function(aB){return aB.replace(Y,"$2")};var B=function(aB){return aB.replace(Z,"$2")};var f=function(aB){if(af||!T){return}if(R!=aB.FSI_scale_with_pixel_ratio){R=aB.FSI_scale_with_pixel_ratio;if(ak){L=aB.FSI_scale_with_pixel_ratio}else{L=aB.FSI_scale}if(av>0){ag=Math.round(L*av)/av}else{ag=L}}S=aB.FSI_scroll;aj=aB.FSI_viewport_rect;am()};var au=this.triggerRefresh=function(){if(!al){return}clearTimeout(q);q=setTimeout(l,100)};this.updateImagePositions=function(){if(!al){return}au()};var l=function(){clearTimeout(q);$FSI.triggerCustomEvent(aa)};var at=function(aE){if(aE.bIgnoreSourceChange){return false}if(aE.bLocked){aE.bSourceChangeOnUnlock=true}else{aE.bSourceChangeOnUnlock=undefined;s.log("Image src change detected for image #"+aE.__id+":");s.log("OLD: "+aE.srcCurrent);s.log("NEW: "+aE.img.src);var aB=aE;var aD=aE.__id;aq(aB);var aC=a.createObjectForImageTag(aB.img);if(!aC){a.deleteObjectById(aD);s.error("New image not applicable for TouchZoom, removing existing image from TouchZoom");return}a.replace(aB,aC);y(aC,aC.__id);w(aC.img,aC.src,aC);if(aB.bInfo&&aB.bLockedSourceDimension){aC.bInfo=true;aC.sourceWidth=aB.sourceWidth;aC.sourceHeight=aB.sourceHeight;k(aC);ae(aC)}if(!aC.bLocked){au()}}return true};var m=function(aB){var aC=aB.srcElement;if(!aC){aC=aB.target}var aD=t(aC);if(!aD){return}O(aD,false);aD.ready=false};var V=function(aB){var aC=aB.srcElement;if(!aC){aC=aB.target}var aD=t(aC);if(!aD){return}delete aD.bWaitingForRestore;if(aD.bTile){if(F){aC.className="fadein"}aD.img.style.visibility=""}if(aD.bFinishOnLoad){delete aD.bFinishOnLoad;aD.width=aC.width;aD.height=aC.height;D(aD);P(aD)}else{O(aD,false);if(!aD.bTile&&aD.img.src!=aD.srcCurrent){at(aD)}}};this.resetImage=function(aB){if(!al){return}var aC=t(aB);if(aC){H(aC)}};var H=function(aB){if(!aB.bZoomed){return}aB.bZoomed=false;delete ax[aB.FSITouchZoom_ID];O(aB,false);if(aB.bTiled){c(aB)}aB.wLast=aB.wOrg;if(aB.bTile){return}if(aB.srcCurrent!=aB.img.src){return}if(aB.img.src!=aB.orgSrc){aB.bWaitingForRestore=true;aB.img.src=aB.orgSrc}aB.srcCurrent=aB.orgSrc};var az=function(aE){if(!aE||aE.bInfo!=undefined){return}aE.bInfo=false;var aD=aE.src.split("?");var aC=aD[0]+"?type=info&tpl=info.json"+i;if(aD.length>1){aC+="&"+aD[1]}var aB=new XMLHttpRequest();aB.onload=function(aF){E(aE,aB.responseText)};aB.open("GET",aC,true);aB.send(null)};var E=function(aE,aC){var aB;if(!M[aE.FSITouchZoom_ID]){return}try{aB=$FSI.JSON.parse(aC);aE.sourceWidth=aB.width;aE.sourceHeight=aB.height;ae(aE)}catch(aD){}if(aE.ready){P(aE)}};var ae=function(aB){if(!aB.sourceWidth||!aB.sourceHeight){aB.ready=false;return}if(!aB.bTile){ad(aB)}if(aB.rectWidth){aB.maxWidth=Math.round(aB.rectWidth*aB.sourceWidth);aB.maxHeight=Math.round(aB.rectHeight*aB.sourceHeight)}else{aB.maxWidth=aB.sourceWidth;aB.maxHeight=aB.sourceHeight}aB.bInfo=true};var ad=function(aH){if(!aH||aH.bCropChecked){return}aH.rectWidth=aH.rectHeight=1;aH.rectLeft=aH.rectTop=0;var aD=aH.src.match(Z);if(aD){aD=aD[0].toLowerCase();var aC=aD.indexOf("=");var aE=aD.substr(0,aC);aE=aE.substr(1);var aF=aD.substr(aC+1).split(",");if(aF.length==4){for(var aI=0;aI<aF.length;aI++){aF[aI]=parseFloat(aF[aI])}if(aE=="pixelrange"){var aG=aH.src.match(o);if(aG&&aG.length>1){aG=parseInt(aG[1]);if(isNaN(aG)||aG<1){aG=undefined}}else{aG=undefined}var aB=aH.src.match(U);if(aB&&aB.length>1){aB=parseInt(aB[1]);if(isNaN(aB)||aB<1){aB=undefined}}else{aB=undefined}if(aG==undefined&&aB==undefined){aG=aH.sourceWidth;aB=aH.sourceHeight}else{if(aG==undefined){aG=Math.round(aB/aH.sourceHeight*aH.sourceWidth)}else{if(aB==undefined){aB=Math.round(aG/aH.sourceWidth*aH.sourceHeight)}}}aF[0]/=aG;aF[1]/=aB;aF[2]/=aG;aF[3]/=aB}aH.rectLeft=aF[0];aH.rectTop=aF[1];aH.rectWidth=aF[2];aH.rectHeight=aF[3]}}aH.bCropChecked=true};var am=function(){var aB=a.getArray();var aD=a.getCount();for(var aC=0;aC<aD;aC++){P(aB[aC])}};var P=function(aB){if(aB.bLocked){return"locked"}if(ag<=1){if(aB.bZoomed){H(aB)}return"viewport not zoomed"}var aE=$FSI.getBoundingClientRect(aB.elPosition);if(!aB.img.parentNode||aE.right<aj.left||aE.bottom<aj.top||aE.left>aj.right||aE.top>aj.bottom){if(aB.bZoomed){H(aB)}return"not in viewport"}if(!aB.bPrepared){k(aB)}if(!aB.ready){return"not ready"}var aI=Math.ceil(aB.width*ag);var aF=Math.ceil(aB.height*ag);if(ac&&aB.bDoNotTile){if((aI*aF)>aA){var aG=Math.sqrt(aA/(aI*aF));aI=Math.floor(aI*aG);aF=Math.floor(aF*aG)}}if(!aB.bTile&&(aI>aB.maxWidth||aF>aB.maxHeight)){aI=aB.maxWidth;aF=aB.maxHeight}if(!aB.bInfo&&aB.wLast!=aI){az(aB);return"no info"}if(!aB.bDoNotTile&&(aI>ao||aF>an)&&(aB.wOrg>3&&aB.hOrg>3)){if(!aB.bTiled){ab(aB)}h(aB);var aC=aB.arImages.length;for(var aD=0;aD<aC;aD++){P(aB.arImages[aD])}if(aB.bLoading){O(aB,false)}}else{if(aB.bTiled){c(aB)}if(!aB.bTile&&aB.img.src!=aB.srcCurrent){if(at(aB)){return}}if(aB.wLast==aI){return true}aB.wLast=aI;var aH=false;if(aB.bTile){aH=b(aB)}else{var aJ=aB.src+"&width="+aI+"&height="+aF;if(aB.srcCurrent!=aJ){aB.srcCurrent=aB.img.src=aJ;aH=true}}if(aH){O(aB,true)}}ax[aB.FSITouchZoom_ID]=aB;aB.bZoomed=true;return true};var O=function(aD,aB){if(aB==aD.bLoading){return}aD.bLoading=aB;if(aB){ar++}else{ar--}if(!n){return}if(!aB){if(aD.elLoading){$FSI.removeChild(aD.elLoading.parentNode,aD.elLoading);aD.elLoading=undefined;$FSI.removeClass(aC,"fadeIn")}}else{if(aD.elLoading==undefined){if(!u&&n.width>0){u=n.width;e=n.height}aD.elLoading=n.cloneNode(true);document.body.appendChild(aD.elLoading)}var aC=aD.elLoading;var aE=$FSI.getBoundingClientRect(aD.img);aC.style.left=(aE.left-S.left)+"px";aC.style.top=(aE.top-S.top)+"px";aC.style.width=Math.round(u/L)+"px";aC.style.height=Math.round(e/L)+"px";$FSI.addClass(aC,"__FSITouchZoomLoadingFadeIn")}};var h=function(aB){if(aB.refScale==ag){return}aB.refScale=ag;if(!aB.bTile){aB.refWidth=Math.min(aB.sourceWidth,Math.round(aB.wOrg*ag/aB.rectWidth));aB.refHeight=Math.min(aB.sourceHeight,Math.round(aB.hOrg*ag/aB.rectHeight));aB.resultingWidth=Math.min(aB.maxWidth,Math.round(aB.wOrg*ag));aB.resultingHeight=Math.min(aB.maxHeight,Math.round(aB.hOrg*ag));aB.tileWidth=Math.floor(aB.resultingWidth/aB.tilesX);aB.tileHeight=Math.floor(aB.resultingHeight/aB.tilesY);aB.containerOffsetX=Math.round(aB.rectLeft*aB.refWidth);aB.containerOffsetY=Math.round(aB.rectTop*aB.refHeight);aB.refQuery="&referenceWidth="+aB.refWidth+"&referenceHeight="+aB.refHeight}else{var aC=aB.parentImage;aB.containerOffsetX=aC.containerOffsetX+aB.tilePosX*aC.tileWidth;aB.containerOffsetY=aC.containerOffsetY+aB.tilePosY*aC.tileHeight;aB.resultingWidth=(!aB.bRestX)?aC.tileWidth:aC.tileWidth+aC.resultingWidth%aC.tileWidth;aB.resultingHeight=(!aB.bRestY)?aC.tileHeight:aC.tileHeight+aC.resultingHeight%aC.tileHeight;aB.tileWidth=Math.floor(aC.tileWidth/aB.tilesX);aB.tileHeight=Math.floor(aC.tileHeight/aB.tilesY)}};var b=function(aC){var aE=aC.parentImage;if(aC.parentRefScale==aE.refScale){return}aC.parentRefScale=aE.refScale;var aG=aE.containerOffsetX+aC.tilePosX*aE.tileWidth;var aF=aE.containerOffsetY+aC.tilePosY*aE.tileHeight;var aH=(!aC.bRestX)?aE.tileWidth:aE.tileWidth+aE.resultingWidth%aE.tileWidth;var aD=(!aC.bRestY)?aE.tileHeight:aE.tileHeight+aE.resultingHeight%aE.tileHeight;var aI="&pixelRange="+aG+","+aF+","+aH+","+aD;var aJ=aC.rootImage.tileSrc+aI+aC.rootImage.refQuery;if(aJ==aC.srcCurrent){return false}else{if(I){var aB=Math.round(360*Math.random());aJ+="&effects=Colorize("+aB+",100,0)"}aC.srcCurrent=aC.img.src=aJ}return true};var ab=function(aW){var aP=document.createElement("fsi_touch_zoom_tiles");var aV=false;var aZ;aW.refScale=undefined;if(!aW.bTile){var aC=document.createElement("fsi_touch_zoom");aP.className="root";aW.outerContainer=aC;aZ=aW;if(typeof(getComputedStyle)=="function"){var aN=getComputedStyle(aW.img);if(typeof(aN.msUserSelect)!="undefined"&&aN.cssText.length<1){aV=true;for(var aE in aN){var a4=aN[aE];if(typeof(a4)=="string"&&a4.length>0){aC.style[aE]=a4}}}else{if(aN.cssText.length>0){aV=true;aC.setAttribute("style",aN.cssText)}}}if(!aV){if(aW.img.currentStyle){aV=true;var aQ=aW.img.currentStyle;for(var aF in aQ){if(typeof(aQ[aF])=="string"&&aF!="cssText"){aC.style[aF]=aQ[aF]}}}}if(!aV){aC.style.display=aW.img.style.display}var aD=aC.style.display;if(aD==undefined||aD=="inline"){aC.style.display="inline-block"}aC.appendChild(aP)}else{aC=aP;aZ=aW.rootImage;aP.style.left=aW.px+"px";aP.style.top=aW.py+"px"}aP.style.width=aW.wOrg+"px";aP.style.height=aW.hOrg+"px";var aH,aG;if(aW.parentImage&&aW.parentImage.childTilesX!=undefined){aH=aW.parentImage.childTilesX;aG=aW.parentImage.childTilesY}else{if(aW.wOrg>aW.hOrg){aH=3;aG=Math.max(1,Math.round(aW.hOrg/aW.wOrg*aH))}else{aG=3;aH=Math.max(1,Math.round(aW.wOrg/aW.hOrg*aG))}if(aW.parentImage){aW.parentImage.childTilesX=aH;aW.parentImage.childTilesY=aG}}aW.tilesX=aH;aW.tilesY=aG;var a2=aH-1;var aM=aG-1;var aB=Math.floor(aW.wOrg/aH);var aJ=Math.floor(aW.hOrg/aG);var aU=document.createElement("img");aU.style.visibility="hidden";aU.setAttribute("width",aB);aU.setAttribute("height",aJ);var aT,aY;var aO,a3;var aL,aK;aW.arImages=new Array();aT=aJ;var a1=false;var a0=false;var aS=0;var aR=0;var aI=aW.FSITouchZoom_ID+"_";if(!aW.bTile&&aW.img.src){var aX=document.createElement("img");aX.src=aW.img.src;aX.setAttribute("width",aW.img.getAttribute("width"));aX.setAttribute("height",aW.img.getAttribute("height"));aX.className="fsi_touch_zoom_background_image";aP.appendChild(aX)}for(aK=0;aK<aG;aK++){aY=aB;a1=false;aS=0;if(aK==aM){aT=aJ+aW.hOrg%aG;a0=true;aU.setAttribute("height",aT)}aU.style.top=aR+"px";for(aL=0;aL<aH;aL++){a3=aU.cloneNode();a3.style.left=aS+"px";if(aL==a2){aY=aB+aW.wOrg%aH;a1=true;a3.setAttribute("width",aY)}aO=w(a3,aZ.src);if(aO){y(aO,aI+aL+"x"+aK);aO.px=aS;aO.py=aR;aO.srcCurrent=undefined;aO.rootImage=aZ;aO.parentImage=aW;aO.bTile=true;aO.wLast=0;aO.tilePosX=aL;aO.tilePosY=aK;aO.bRestX=a1;aO.bRestY=a0;aO.sourceWidth=aW.sourceWidth;aO.sourceHeight=aW.sourceHeight;ae(aO);aW.arImages.push(aO)}aP.appendChild(a3);aS+=aY}aR+=aT}aW.orgDisplay=aW.img.style.display;aW.img.style.display="none";aW.img.parentNode.insertBefore(aC,aW.img);aW.bTiled=true;aW.container=aW.elPosition=aP};var c=function(aD){if(!aD.bTiled){return}aD.bTiled=false;var aB=aD.arImages.length;for(var aE=0;aE<aB;aE++){var aC=aD.arImages[aE];c(aC);x(aC);delete ax[aC.FSITouchZoom_ID]}$FSI.removeChild(aD.container.parentNode,aD.container);aD.img.style.display=aD.orgDisplay;aD.elPosition=aD.img;delete aD.container;delete aD.arImages;if(aD.outerContainer){$FSI.removeChild(aD.outerContainer.parentNode,aD.outerContainer);delete aD.outerContainer}};this.setZoomPrecision=function(aB){if(isNaN(aB)||(aB<1&&aB!=0)){return false}R=undefined;av=aB;au();return true};this.lockImageSourceDimension=function(aB,aC){if(!al||!aB){return}var aD=t(aB);if(!aD||aD.bLockedSourceDimension==aC){return}aD.bLockedSourceDimension=aC};this.lockImage=function(aB,aC){if(!al||!aB){return}var aD=t(aB);if(!aD||aD.bLocked==aC){return}aD.bLocked=aC;if(aD.bSourceChangeOnUnlock==true){aD.bSourceChangeOnUnlock=false;at(aD)}if(!aC){au()}else{H(aD)}};var d=this.lockUpdates=function(aB){if(!aB&&af){au()}af=aB};var K=this.enable=function(aB){if(!al){return}if(T==aB){return}if(!aB){L=ag=1;l();T=false}else{T=true;R=undefined;l()}};this.scanForNewImages=function(){if(!al){return}var aB=document.getElementsByTagName("img");var aC=0;s.log("...scanning for new images: "+aB.length+" image(s) in total");for(var aD=0;aD<aB.length;aD++){if(aB[aD].$FSITouchZoom_ID==undefined){if(ap(aB[aD])){aC++}}}s.log(aC+" new image(s) found");if(aC>0){ay();au()}}};$FSI.addEvent(window,"DOMContentLoaded",function(){if(typeof($FSI.touchZoomParameters)!="object"||$FSI.makeBool($FSI.touchZoomParameters.autoInit,true)){if(typeof($FSI.touchZoom)=="object"&&typeof($FSI.touchZoom.destroy)=="function"){$FSI.touchZoom.destroy()}var a;if(typeof($FSI.touchZoomParameters)=="object"){a=$FSI.touchZoomParameters}$FSI.touchZoom=new $FSI.TouchZoom(a);$FSI.touchZoom.bAutoInitialized=true;$FSI.touchZoom.init()}});