var VG=VG||{};VG.Zoomer=VG.Zoomer||{};VG.Zoomer=function(f,p,aa){var h=this;var s;var E;var L;var k;var C;var ag;var g;var q;var n;var o;var N;var af;var ad;var l;var d;var m;var X;(function W(){s=f;E=p;L=aa;L=L||{};if(!L.bBoxRatio&&!L.bBoxMargin&&!L.bBoxSize){L.bBoxRatio="1"}if(!L.fitType){L.fitType=VG.C.FIT_NONE}if(!L.fitDeltaRatio&&!L.fitDeltaPixel){L.fitDeltaRatio="0"}if(!L.scrollMode){L.scrollMode="mouse"}if(!L.moveInterval){L.moveInterval=10}if(!L.scrollSpeed){L.scrollSpeed="30"}if(!L.forceScroll){L.forceScroll=false}if(!L.closePulsAlign){L.closePulsAlign=VG.C.TR}if(!L.containerId&&!L.containerTag){L.containerTag="body"}ab()})();h.enter=function(){};h.exit=function(){};function ab(){ai();Z();aj();ac();r();G();Q();Y();b();e();V()}function w(){V()}function ai(){document.body.style.overflow="hidden"}function B(){document.body.style.overflow="visible"}function Z(){if(L.containerTag){k=document.getElementsByTagName(L.containerTag)[0]}else{k=document.getElementById(L.containerId)}C=document.createElement("div");C.id=s+"_Container";T();S()}function T(){}function S(){k.appendChild(C)}function aj(){if(!L.bgColor&&!L.bgImage){return}ag=document.createElement("div");ag.id=s+"_Bg";ag.style.position="absolute";ag.style.overflow="hidden";if(L.bgColor){ag.style.backgroundColor=L.bgColor}if(L.bgImage){ag.style.backgroundImage="url("+L.bgImage+")"}O();P()}function O(){if(!L.bgColor&&!L.bgImage){return}ag.style.width=VG.utils.pageWidth()+"px";ag.style.height=VG.utils.pageHeight()+"px";ag.style.left=0+"px";ag.style.top=0+"px"}function P(){C.appendChild(ag)}function ac(){g=new Object();c()}function c(){var ak;var al;if(L.bBoxSize){ak=L.bBoxSize.w;al=L.bBoxSize.h}else{if(L.bBoxMargin){ak=VG.utils.pageWidth()+(L.bBoxMargin.marginX*2);al=VG.utils.pageHeight()+(L.bBoxMargin.marginY*2)}else{ak=VG.utils.pageWidth()*L.bBoxRatio;al=VG.utils.pageHeight()*L.bBoxRatio}}g.w=ak;g.h=al;g.x=(VG.utils.pageWidth()-ak)*0.5;g.y=(VG.utils.pageHeight()-al)*0.5}function D(){}function r(){q=document.createElement("div");q.id=s+"_ImgCont";q.style.position="absolute";q.style.overflow="hidden";if(L.bBoxBgColor){q.style.backgroundColor=L.bBoxBgColor}if(L.bBoxBgImage){q.style.backgroundImage="url("+L.bBoxBgImage+")"}t();v()}function t(){q.style.width=g.w+"px";q.style.height=g.h+"px";q.style.left=g.x+"px";q.style.top=g.y+"px"}function v(){C.appendChild(q)}function V(){n=document.createElement("img");n.src=E;n.id=s+"_Img";n.style.position="absolute";n.style.backgroundRepeat="no-repeat";n.style.visibility="hidden";l=new Object();l.x=0;l.y=0;l.w=0;l.h=0;R();H()}function H(){if(!n){return}if(n.width!=0&&n.height!=0){l.w=Number(n.width);l.h=Number(n.height)}else{return}if(!L.forceScroll&&l.w<g.w&&l.h<g.h){K()}n.style.visibility="visible";if(L.fitType==VG.C.FIT_IN){ae()}else{if(L.fitType==VG.C.FIT_OUT){i()}else{if(L.fitType==VG.C.FIT_NONE){z()}}}if(L.scrollMode=="mouse"){ah()}else{if(L.scrollMode=="gesture"){a()}else{if(L.scrollMode=="fixed"){K()}}}n.style.width=l.w+"px";n.style.height=l.h+"px";n.style.left=l.x+"px";n.style.top=l.y+"px"}function R(){q.appendChild(n)}function i(){var am=l.w/l.h;var an;var ak;if(L.fitDeltaPixel){an=Number(g.w)+Number(L.fitDeltaPixel);ak=Number(g.h)+Number(L.fitDeltaPixel)}else{if(L.fitDeltaRatio){an=Number(g.w)+(Number(g.w)*Number(L.fitDeltaRatio));ak=Number(g.h)+(Number(g.h)*Number(L.fitDeltaRatio))}}var al=new Object();al.w=an;al.h=an/am;if(al.h<ak){al.h=ak;al.w=ak*am}l.w=al.w;l.h=al.h}function ae(){var am=l.w/l.h;var an;var ak;if(L.fitDeltaPixel){an=Number(g.w)+Number(L.fitDeltaPixel);ak=Number(g.h)+Number(L.fitDeltaPixel)}else{if(L.fitDeltaRatio){an=Number(g.w)+Number(g.w)*Number(L.fitDeltaRatio);ak=Number(g.h)+Number(g.h)*Number(L.fitDeltaRatio)}}var al=new Object();al.w=an;al.h=an/am;if(al.h>ak){al.h=ak;al.w=ak*am}l.w=al.w;l.h=al.h}function z(){}function ah(){var ao=af-g.x;var an=ad-g.y;if(isNaN(ao)||isNaN(an)){return}var am=g.w-l.w;var ap=g.h-l.h;var al=(ao*am)/g.w;var ak=(an*ap)/g.h;l.x=l.x+((al-l.x)/L.scrollSpeed);l.y=l.y+((ak-l.y)/L.scrollSpeed);if(!L.forceScroll&&l.w<g.w&&l.h<g.h){K()}}function a(){}function K(){l.x=(g.w-l.w)*0.5;l.y=(g.h-l.h)*0.5}function G(){if(!L.preloaderSrc){return}d=new Image();d.src=L.preloaderSrc;d.id=s+"_Preloader";d.style.position="absolute";d.style.visibility="hidden";A();y()}function y(){if(!d){return}d.style.left=(g.w-Number(d.width))*0.5+"px";d.style.top=(g.h-Number(d.height))*0.5+"px";d.style.visibility="visible"}function A(){q.appendChild(d)}function Q(){if(!L.closePuls){return}o=document.createElement("img");o.src=L.closePuls;o.id=s+"_ClosePuls";o.onclick=function(){j()};o.style.position="absolute";o.style.visibility="hidden";o.style.cursor="pointer";N=new Object();N.x=0;N.y=0;N.w=0;N.h=0;F();I()}function j(){B();k.removeChild(C)}function I(){if(!L.closePuls){return}if(X){window.clearTimeout(X)}if(Number(o.width)!=0&&Number(o.height)!=0){N.w=Number(o.width);N.h=Number(o.height)}else{X=window.setTimeout(I,500);return}var ak=VG.utils.pageWidth();var al=VG.utils.pageHeight();switch(L.closePulsAlign){case VG.C.TL:N.x=0;N.y=0;break;case VG.C.TR:N.x=ak-N.w;N.y=0;break;case VG.C.BR:N.x=ak-N.w;N.y=al-N.h;break;case VG.C.BL:N.x=0;N.y=al-N.h;break}o.style.width=N.w+"px";o.style.height=N.h+"px";o.style.left=N.x+"px";o.style.top=N.y+"px";o.style.visibility="visible"}function F(){C.appendChild(o)}function Y(){if(window.attachEvent){q.attachEvent("onmousemove",x)}else{q.addEventListener("mousemove",x)}}function x(ak){af=ak.clientX;ad=ak.clientY}function M(){try{m=new ActiveXObject("Microsoft.XMLHTTP")}catch(ak){m=new XMLHttpRequest()}m.onreadystatechange=function(){J()};try{m.open("GET",E,true);m.send(null)}catch(ak){w()}}function J(){if(m.readyState==4){if(m.status==200){}else{}w()}else{}}function b(){window.onresize=function(){U()}}function U(){O();c();t();H();I();y()}function e(){timer=setInterval(u,L.moveInterval)}function u(){H()}};
