/*!
 * FSI QuickZoom
 * 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.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.CORSLoader=function(){var f=this;var b=0;var a={};var d=false;var g;var c=null;if($FSI.isInternetExplorer&&$FSI.versionInternetExplorer<10){g=function(i){var e;if(!$FSI.isCrossDomain(i)){d=false;e=new XMLHttpRequest()}else{d=true;e=new XDomainRequest()}return e}}else{if(typeof XMLHttpRequest!="undefined"){g=function(){return new XMLHttpRequest()}}}if(!g){try{c=new ActiveXObject("Msxml2.XMLHTTP");g=function(){return new ActiveXObject("Msxml2.XMLHTTP")}}catch(h){try{c=new ActiveXObject("Microsoft.XMLHTTP");g=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}catch(h){c=null;g=function(){return null}}}}this.getSupported=function(){return(g()!=null)};this.load=function(k,l,n,p){var j=g(k);if(!j){return}if(n&&j.overrideMimeType){j.overrideMimeType(n)}j._url=k;var m=b;a[b]=j;b++;var i=-1;if(d){j.onerror=function(){delete a[m];if(l==undefined||this.FSIaborted){return}l(this,this.responseText,p,400)};j.onload=function(){delete a[m];if(l==undefined||this.FSIaborted){return}var q=this.responseText;switch(this.contentType){case"application/xml":case"text/xml":try{var r=new ActiveXObject("Microsoft.XMLDOM");r.async=false;r.loadXML(q);q=this.responseXML=r}catch(s){}break}l(this,q,p,200)}}else{j.onreadystatechange=function(e){if(j.readyState!=4){return}delete a[m];if(l==undefined||this.FSIaborted){return}var q=(this.responseXML!=null&&this.responseXML.firstChild)?this.responseXML:this.responseText;l(this,q,p,j.status)}}try{j.open("GET",k,true);j.send(null)}catch(o){l(this,"",p,500)}return j};this.stopPendingRequests=function(){for(var i in a){var e=a[i];if(e){e.FSIaborted=true;if(e.abort){e.abort()}}}};this.destroy=function(){f.reset()};this.reset=function(){this.stopPendingRequests();a={}}};$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.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.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.QuickZoom=function(Q){var Z=new $FSI.ClassDef(this,"FSI QuickZoom","1.1.2","16.02.08");var k=Z.instance;$FSI.guessFSIViewerLocation("fsiquickzoom.js",3);if(!$FSI._FSIViewerLocation){$FSI.guessFSIViewerLocation("FSI.QuickZoom.js",3)}var o=$FSI.getViewerInstanceID();var X=(Q)?$FSI.cloneParameters(Q):{};var E;var B;var aa;var s=false;var j=/((\?)|&)(width|height)=[^&]*/ig;var f;var r={};var ab={};var Y=3;var T;var z=false;var L={x:0,y:0};var l={x:10000000,y:10000000};var F;var w;var g;var S,D;var u;var n=1;var R=false;var y;var H;var d=true;var c=true;var M=$FSI.makeBool(X.useDevicePixelRatio,true);var U=$FSI.makeBool(X.debug,false);if(U){E=new $FSI.Debugger();E.setPrefix(Z.strClassName)}else{E=new $FSI.EmptyDebugger()}E.log(k.getVersion());this.init=function(){if(s){return}s=true;if(typeof(X.fnPositionAndSizeCallback)=="function"){y=X.fnPositionAndSizeCallback;if(X.fnPositionAndSizeCallbackScope){H=X.fnPositionAndSizeCallbackScope}else{H=window}}if($FSI.isMobileDevice&&$FSI.BrowserSupports.documentZoom()){return false}aa=new $FSI.CORSLoader();if($FSI.getDocumentScroll==undefined||!aa.getSupported()){E.error("Unsupported browser. "+aa.getSupported()+" => "+navigator.userAgent);return}if(k.bAutoInitialized){E.log("Init (auto initialized)")}else{E.log("Init")}if($FSI.BrowserSupports.documentZoom()){u=$FSI.addCustomEvent(k,"FSIDocumentZoomChange",e);R=($FSI.getDocumentScale()>1)}if(!B){var ag={NameID:"$FSIQuickZoom_TagID"};B=new $FSI.ImageTagCollection(ag,X);B.init()}$FSI._FSIQuickZoomInstance=this;if(X.headers==undefined){X.headers="cors"}if(X.headers.length>0){f="&headers="+X.headers}else{f=""}Y=C("magnification",2);Y=Math.max(1,Y);l.x=C("maxZoomWindowWidth",l.x);l.y=C("maxZoomWindowHeight",l.y);S=C("minZoomWindowWidth",100);D=C("minZoomWindowHeight",100);L.x=C("skipImageWidth",0);L.y=C("skipImageHeight",0);F=C("pageMargin",18);w=C("zoomImageBorderWidth",-1);g=C("zoomImageOffset",0);if(w<0){try{var af=document.createElement("div");af.style.display="none";$FSI.addClass(af,"FSIQuickZoom");document.body.appendChild(af);var ae=window.getComputedStyle(af,null);var ai=0;ai=Math.max(ai,parseFloat(ae.borderLeftWidth));ai=Math.max(ai,parseFloat(ae.borderRightWidth));ai=Math.max(ai,parseFloat(ae.borderTopWidth));ai=Math.max(ai,parseFloat(ae.borderBottomWidth));w=ai;$FSI.removeChild(document.body,af)}catch(ah){}}var ac=document.getElementsByTagName("img");if(U){E.log("Parameters: ");E.log("magnification: "+Y);E.log("enableByCSSClass: "+X.enableByCSSClass);E.log("disableByCSSClass: "+X.disableByCSSClass);E.log("Preparing images (total images: "+ac.length+")")}for(var ad=0;ad<ac.length;ad++){W(ac[ad])}E.log(B.getCount()+" images have been prepared for FSI QuickZoom");return true};this.destroy=function(){if(u!=undefined){$FSI.removeCustomEvent(k,"FSIDocumentZoomChange",e);u=undefined}I();clearTimeout(T);var ac=B.getArray();for(var ad=0;ad<ac-length;ad++){h(img)}B.empty();s=false};var e=function(ac){var ad=(ac.FSI_scale>1);if(R==ad){return}R=ad;if(ad){I()}};var C=function(ad,ae){var ac=parseFloat(X[ad]);if(isNaN(ac)){ac=ae}return ac};this.removeImages=function(ac){if(ac==undefined){return}if(ac.join==undefined){ac=[ac]}var ad=B.getCount();for(var af=0;af<ac.length;af++){h(ac[af])}var ae=B.getCount();var ag=ad-ae;E.log("removeImages: "+ag+" images have been removed, total zoom images now: "+ae+" images.");return ag};var q=function(ac){if(!ac){return}var ad=B.getById(ac.$FSIQuickZoom_TagID);$FSI.removeEvent(ac,"load",v,false);$FSI.removeEvent(ac,"error",N,false);$FSI.removeEvent(ac,"mouseover",A,false);if(typeof(ab)=="object"&&ab.id==ad.__id){I()}return ad};var h=function(ac){var ad=q(ac);B.remove(ad);ad.img.$FSIQuickZoom_TagID=undefined;delete ad.img.$FSIQuickZoom_TagID};this.addImage=function(ac,af,ad){if(!ac||ac.$FSIQuickZoom_TagID!=undefined){return}var ae=W(ac,af);return(ae!=undefined)};var W=function(ac,ae){var ad=B.add(ac,ae);if(!ad){return}ad.srcCurrent=ad.src;$FSI.addEvent(ac,"load",v,false);$FSI.addEvent(ac,"error",N,false);$FSI.addEvent(ac,"mouseover",A,false);return ad};var P=function(ad){if(!ad||!ad.img||ad.bPrepared==true){return}var ac=ad.img;ad.src=O(ad.src);if(ac.width!=undefined&&ac.width>0){ad.width=ac.width}if(ac.height!=undefined&&ac.height>0){ad.height=ac.height}if(ad.width>0&&ad.height>0){m(ad)}else{ad.bFinishOnLoad=true}ad.bPrepared=true;return ad};var m=function(ac){ac.ready=true;ac.wOrg=ac.width;ac.hOrg=ac.height};var O=function(ac){return ac.replace(j,"$2")};var N=function(){var ac=(!$FSI.isInternetExplorer)?this:window.event.srcElement;var ad=B.getById(ac.$FSIQuickZoom_TagID);if(ad.bLoading){ad.ready=false;ad.bLoading=false}};var v=function(){var ac=(!$FSI.isInternetExplorer)?this:window.event.srcElement;var ae=B.getById(ac.$FSIQuickZoom_TagID);if(!ae.bLoading&&ae.orgSrc!=ac.src){var ad=false;if(typeof(ab)=="object"&&ab.idVisible==ae.__id){ad=true}if(ad){I()}ae.bPrepared=ae.ready=false;ae.bInfo=undefined;O(ae.src);ae.srcCurrent=ae.orgSrc=ac.src;ae.sourceWidth=ae.sourceHeight=undefined;ae.src=O(ae.orgSrc);P(ae);V(ae);if(ad){ab.id=ae.__id}}if(ae.bFinishOnLoad){delete ae.bFinishOnLoad;ae.width=ac.width;ae.height=ac.height;m(ae)}else{if(ae.bLoading){ae.bLoading=false}}};var x=function(ac){r.x=ac.clientX;r.y=ac.clientY};var I=function(){var ad=ab.elDiv;if(!ad){return}var ac=ab.el;ab.src=undefined;ab.id=ab.idVisible=undefined;if(z){$FSI.removeEvent(ad,"mouseover",i,false);$FSI.removeEvent(ad,"mouseout",b,false);$FSI.removeEvent(ad,"mousemove",a,false)}$FSI.removeEvent(ab.elImageFinalZoom,"load",p,false);$FSI.removeEvent(ac,"mousemove",a,false);$FSI.removeEvent(ac,"mouseout",b,false);$FSI.removeChild(ad.parentNode,ad);ab.elDiv=ab.idVisible=undefined;$FSI.removeClass(ac,"FSIQuickZoom")};var t=function(ak,aD){if(!ak.bInfo||R){return}if(M){n=Math.max(1,$FSI.getDevicePixelRatio())}else{n=1}d=c=false;var af=w;var aI=g;var am=ak.img;if(typeof(ab)=="object"&&ab.idVisible==ak.__id){return}var ao=$FSI.getViewportSize(window);var aT=F;var av=ao.width-F-2*af;var at=F;var aP=ao.height-F-2*af;var au=$FSI.getDocumentScroll(window);var ag=$FSI.getElementPosition(am);var aK=G(am);var aV=Math.max(l.x,ak.wOrg);var ah=Math.max(l.y,ak.hOrg);var ad;var aJ;var aw=ao.width-2*F-2*af;var aG=ao.height-2*F-2*af;var aR,aQ;if(aw-aV>aG-ah){aJ=aG;var aF=ag.left-F-aK.left-aI-2*af;var aE=ao.width-ag.right-F-aK.right-aI-2*af;aQ=0;if(aE>aF){ad=aE;aR=1}else{ad=aF;aR=-1}}else{ad=aw;var aC=ag.top-F-aK.top-aI-2*af;var aB=ao.height-ag.bottom-F-aK.bottom-aI-2*af;aR=0;if(aB>aC){aJ=aB;aQ=1}else{aJ=aC;aQ=-1}}aV=Math.min(ad,aV);ah=Math.min(aJ,ah);var ay=Math.round(ak.sourceWidth/n);var aN=Math.min(ay,Math.round(Y*ak.wOrg));ay=Math.round(ak.sourceHeight/n);var aH=Math.min(ay,Math.round(Y*ak.hOrg));var aj=$FSI.getFSIServerImageDim(ak.sourceWidth,ak.sourceHeight,aN,aH,undefined,true);aN=aj.width;aH=aj.height;var ar=Math.min(ak.sourceWidth,Math.round(aN*n));var aM=Math.min(ak.sourceHeight,Math.round(aH*n));var aA=aN/ar;d=(aN<=aV);c=(aH<=ah);if(d){aV=aN}if(c){ah=aH}var an=ak.src+"&width="+ar+"&height="+aM;if(ab.src==an){return}var ai,al;if(aR==0){ai=(ag.right-ag.left)/2-aV/2-af}else{if(aR>0){ai=ag.right-ag.left+aK.right+aI}else{ai=-aK.left-aV-2*af-aI}}var aq=ag.left+ai;var ap=aq+aV;if(aq<aT){ai+=aT-aq}if(ap>av){ai-=ap-av}if(aQ==0){al=(ag.bottom-ag.top)/2-ah/2-af}else{if(aQ>0){al=ag.bottom-ag.top+aK.bottom+aI}else{al=-aK.top-ah-2*af-aI}}var aX=ag.top+al;var aW=aX+ah;if(aX<at){al+=at-aX}if(aW>aP){al-=aW-aP}if(y){var aO={};var aU={};aU.left=ai;aU.top=al;aU.width=aV;aU.height=ah;aU.srcZoomImage=an;aO.sourceElement=am;aO.imageWidth=aN;aO.imageHeight=aH;aO.imageWidthDPR=ar;aO.imageHeightDPR=aM;aO.sourceImageWidth=ak.sourceWidth;aO.sourceImageHeight=ak.sourceHeight;aO.borderWidth=af;aO.imageMargin=aI;aO.minZoomWidth=S;aO.minZoomHeight=D;aO.maxZoomWidth=l.x;aO.maxZoomHeight=l.y;aO.elementPosition=$FSI.cloneObject(ag);aO.imgPaddings=$FSI.cloneObject(aK);aO.scrollPos=$FSI.cloneObject(au);aO.event=aD;y.call(H,aU,aO);ai=aU.left;al=aU.top;aV=aU.width;ah=aU.height;an=aU.srcZoomImage;d=(aN<=aV);c=(aH<=ah)}if(aV<S||ah<D){return}$FSI.addClass(am,"FSIQuickZoom");if(ab.elDiv!=undefined){I()}ab.id=ab.idVisible=ak.__id;ab.el=am;ab.width=am.offsetWidth;ab.height=am.offsetHeight;ab.oImage=ak;ab.elOffsetX=-ag.left-au.x;ab.elOffsetY=-ag.top-au.y;var ac=ab.elImageZoom=document.createElement("img");ac.setAttribute("width",ar);ac.setAttribute("height",aM);ac.style.position="relative";ac.style.border="0px none";ac.style.padding="0px";if(aA!=1){ac.style.width=aN+"px";ac.style.height=aH+"px"}var aS=document.createElement("div");aS.setAttribute("class","FSIQuickZoom");aS.style.position="absolute";aS.style.boxSizing="content-box";aS.style.width=aV+"px";aS.style.height=ah+"px";aS.style.overflow="hidden";aS.style.padding="0px";aS.style.zIndex="10000";aS.style.left=Math.round(au.x+ag.left+ai)+"px";aS.style.top=Math.round(au.y+ag.top+al)+"px";ab.src=an;ab.elDiv=aS;ab.elImageFinalZoom=ac;ab.elImageZoom=ab.elImagePreviewZoom=ac.cloneNode();ab.elImagePreviewZoom.src=am.src;$FSI.addEvent(ab.elImageFinalZoom,"load",p,false);ac.src=an;ab.scaleX=aN/ak.wOrg;ab.scaleY=aH/ak.hOrg;ab.centerX=ab.elOffsetX-ak.wOrg/2;ab.centerY=ab.elOffsetY-ak.hOrg/2;ab.moveFactorX=aN/ak.wOrg;ab.moveFactorY=aH/ak.hOrg;ab.moveOffsetX=Math.round(aV/2);ab.moveOffsetY=Math.round(ah/2);aS.appendChild(ab.elImagePreviewZoom);document.body.appendChild(aS);var az=new $FSI.Rect();var ax=new $FSI.Rect();var ae=$FSI.getElementClientPos(am);az.copyRect(ae);var aL=$FSI.getElementClientPos(aS);ax.copyRect(aL);ax.interSectRectValidate(az);z=(ax.width()>0&&ax.height()>0);if(z){$FSI.addEvent(aS,"mouseover",i,false);$FSI.addEvent(aS,"mouseout",b,false);$FSI.addEvent(aS,"mousemove",a,false)}$FSI.addEvent(am,"mouseout",b,false);$FSI.addEvent(am,"mousemove",a,false);a()};var p=function(){var ac=this;$FSI.removeEvent(ac,"load",p,false);var ad=ab.elImagePreviewZoom;ad.src=ac.src};var i=function(){clearTimeout(T)};var A=function(ac){clearTimeout(T);x(ac);var ad=(!$FSI.isInternetExplorer)?this:window.event.srcElement;var ae=B.getById(ad.$FSIQuickZoom_TagID);if(!ae){return}ab.id=ae.__id;ab.evt=ac;P(ae);V(ae);if(ae.bInfo){t(ae,ac)}};var G=function(ad){var ac={left:0,top:0,right:0,bottom:0};try{var ae=window.getComputedStyle(ad,null);ac.left+=parseFloat(ae.paddingLeft);ac.right+=parseFloat(ae.paddingRight);ac.top+=parseFloat(ae.paddingTop);ac.bottom+=parseFloat(ae.paddingBottom);ac.left+=parseFloat(ae.borderLeftWidth);ac.right+=parseFloat(ae.borderRightWidth);ac.top+=parseFloat(ae.borderTopWidth);ac.bottom+=parseFloat(ae.borderBottomWidth)}catch(af){}return ac};var a=function(ad){if(ad){x(ad)}if(!ab.bInfo){ab.evt=ad}var ag=$FSI.getDocumentScroll(window);var ac,af;if(d){r.x=-ab.centerX-ag.x}if(c){r.y=-ab.centerY-ag.y}ac=r.x+ab.elOffsetX+ag.x;af=r.y+ab.elOffsetY+ag.y;ac=ac*ab.moveFactorX-ab.moveOffsetX;af=af*ab.moveFactorY-ab.moveOffsetY;var ae=ab.elImageZoom;ae.style.left=-Math.round(ac*n)/n+"px";ae.style.top=-Math.round(af*n)/n+"px"};var b=function(ac){clearTimeout(T);if(z){T=setTimeout(I,50)}else{I()}};this.scanForNewImages=function(){var ac=document.getElementsByTagName("img");var ad=0;E.log("...scanning for new images: "+ac.length+" image(s) in total");for(var ae=0;ae<ac.length;ae++){if(ac[ae].$FSIQuickZoom_ID==undefined){if(W(ac[ae])){ad++}}}E.log(ad+" new QuickZoom image(s) added")};var V=function(af){if(!af||af.bInfo!=undefined){return}af.bInfo=false;var ac=af.src;var ad=ac.match(/.*[?]/);var ae=ac.match(/[?&]source=[^&]*/);ac=ad+"type=info&tpl=info.json"+f+ae;aa.load(ac,J,undefined,af)};var J=function(ad,af,ah){var ae;try{ae=$FSI.JSON.parse(af)}catch(ag){E.error("Failed to get image info for "+ah.src);ae={width:4000,height:4000}}ah.sourceWidth=ae.width;ah.sourceHeight=ae.height;K(ah);var ac=false;if(L.x>0&&ah.wOrg<L.x){ac=true}if(L.y>0&&ah.hOrg<L.y){ac=true}if(ac){h(ah.img)}else{if(ab.id==ah.__id){t(ah,ab.evt)}}};var K=function(ac){if(!ac.sourceWidth||!ac.sourceHeight){ac.ready=false;return}if(ac.rectWidth){ac.maxWidth=Math.round(ac.rectWidth*ac.sourceWidth);ac.maxHeight=Math.round(ac.rectHeight*ac.sourceHeight)}else{ac.maxWidth=ac.sourceWidth;ac.maxHeight=ac.sourceHeight}ac.bInfo=true}};$FSI.addEvent(window,"DOMContentLoaded",function(){if(typeof($FSI.quickZoomParameters)!="object"||$FSI.makeBool($FSI.quickZoomParameters.autoInit,true)){if(typeof($FSI.quickZoom)=="object"&&typeof($FSI.quickZoom.destroy)=="function"){$FSI.quickZoom.destroy()}var a;if(typeof($FSI.quickZoomParameters)=="object"){a=$FSI.quickZoomParameters}$FSI.quickZoom=new $FSI.QuickZoom(a);$FSI.quickZoom.bAutoInitialized=true;$FSI.quickZoom.init()}});