var vuzit={getNode:function(m){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)elements.push(vuzit.getNode(arguments[i]));return elements;}if(typeof m=='string')m=document.getElementById(m);return m;},clone:function(object){return vuzit.extend({},object);},extend:function(destination,source){for(var property in source){destination[property]=source[property];}return destination;}};vuzit.extend(Function.prototype,{bind:function(){if(arguments.length<2&&arguments[0]===undefined)return this;var fz=this,args=vuzitArray(arguments),object=args.shift();return function(){return fz.apply(object,args.concat(vuzitArray(arguments)));}}});vuzit.Prototype={Version:'1.6.0_pre1',Browser:{IE: ! !(window.attachEvent&& !window.opera),Opera: ! !window.opera,WebKit:navigator.userAgent.indexOf('AppleWebKit/')> -1,Gecko:navigator.userAgent.indexOf('Gecko')> -1&&navigator.userAgent.indexOf('KHTML')== -1,MobileSafari: ! !navigator.userAgent.match(/iPhone.*Mobile.*Safari/)},BrowserFeatures:{XPath: ! !document.evaluate,ElementExtensions: ! !window.HTMLElement,SpecificElementExtensions:document.createElement('div').fw!==document.createElement('form').fw},K:function(x){return x}};if(vuzit.Prototype.Browser.MobileSafari)vuzit.Prototype.BrowserFeatures.SpecificElementExtensions=false;vuzit.Enumerable={};vuzit.extend(vuzit.Enumerable,{map:vuzit.Enumerable.collect,find:vuzit.Enumerable.detect,select:vuzit.Enumerable.findAll,filter:vuzit.Enumerable.findAll,member:vuzit.Enumerable.include,entries:vuzit.Enumerable.toArray,every:vuzit.Enumerable.all,some:vuzit.Enumerable.any});function vuzitArray(iterable){if(!iterable)return[];if(iterable.toArray)return iterable.toArray();else{var results=[];for(var i=0,length=iterable.length;i<length;i++)results.push(iterable[i]);return results;}};if(vuzit.Prototype.Browser.WebKit){function vuzitArray(iterable){if(!iterable)return[];if(!(typeof iterable=='function'&&iterable=='[object NodeList]')&&iterable.toArray){return iterable.toArray();}else{var results=[];for(var i=0,length=iterable.length;i<length;i++)results.push(iterable[i]);return results;}}}vuzit.Event={KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,m:function(event){return vuzit.getNode(event.target||event.srcElement);},stop:function(event){if(event.preventDefault){event.preventDefault();event.stopPropagation();}else{event.returnValue=false;event.cancelBubble=true;}},observers:false,fm:function(m,name,observer,useCapture){if(!this.observers)this.observers=[];if(m.addEventListener){this.observers.push([m,name,observer,useCapture]);m.addEventListener(name,observer,useCapture);}else if(m.attachEvent){this.observers.push([m,name,observer,useCapture]);m.attachEvent('on'+name,observer);}},unloadCache:function(){if(!vuzit.Event.observers)return;for(var i=0,length=vuzit.Event.observers.length;i<length;i++){vuzit.Event.stopObserving.apply(this,vuzit.Event.observers[i]);vuzit.Event.observers[i][0]=null;}vuzit.Event.observers=false;},observe:function(m,name,observer,useCapture){m=vuzit.getNode(m);useCapture=useCapture||false;if(name=='keypress'&&(vuzit.Prototype.Browser.WebKit||m.attachEvent))name='keydown';vuzit.Event.fm(m,name,observer,useCapture);},stopObserving:function(m,name,observer,useCapture){m=vuzit.getNode(m);useCapture=useCapture||false;if(name=='keypress'&&(vuzit.Prototype.Browser.WebKit||m.attachEvent))name='keydown';if(m.removeEventListener){m.removeEventListener(name,observer,useCapture);}else if(m.detachEvent){try{m.detachEvent('on'+name,observer);}catch(e){}}}};if(vuzit.Prototype.Browser.IE)vuzit.Event.observe(window,'unload',vuzit.Event.unloadCache,false);vuzit.Base={R:{host:'vuzit.com',port:'80'},aX:{host:'vuzit.com',port:'80'},gF:false,apiKey:'',apiKeySet:function(ai){vuzit.Base.apiKey=ai;},createClass:function(){return function(){this.initialize.apply(this,arguments);}},gD:function(gF){vuzit.Base.gF=gF},webServerSet:function(options){vuzit.extend(vuzit.Base.R,options);},ad:function(show_port){if(vuzit.Base.gF){protocol='https';host="ssl."+vuzit.Base.R.host;port=vuzit.Base.R.port;}else{protocol='http';host=vuzit.Base.R.host;port=vuzit.Base.R.port;}gn=protocol+'://'+host;gn+=((show_port)&&(port!='80')&&(port!='443'))?':'+port:'';return gn;},imageServerSet:function(options){vuzit.extend(vuzit.Base.aX,options);}};ab=(document.all!=undefined);vuzit.Utilities={aK:function(className,title){var newEl=document.createElement("div");newEl.className="vuzit_toolbar_button "+className;newEl.id=className;newEl.title=title;return newEl;},eX:function(m){m.style.display='none';return m;},eW:function(m){m.style.display='';return m;},getBrowser:function(){var fu=navigator.userAgent;if(fu.indexOf('Firefox/3')> -1){return "Firefox3";}else if(fu.indexOf('Firefox')> -1){return "Firefox";}else if(fu.indexOf('MSIE')> -1){return "IE";}else if(fu.indexOf('Chrome')> -1){return "Chrome";}else if(fu.indexOf('Safari')> -1){return "Safari";}else if(fu.indexOf('Opera')> -1){return "Opera";}else{return "Other";}},dB:function(ft,ag,bM,signature,timestamp,includedPages,fg,watermark){var result=vuzit.Base.ad(true);result+=(fg)?'/documents/'+ft+'/pages/'+ag+'.jpg':'/doc/image_url';var eU=(bM== -1)?'?t=thumb':'?z='+bM;eU+='&key='+vuzit.Base.apiKey;if(includedPages!=null){eU+="&included_pages="+includedPages;}if(signature!=null&&timestamp!=null){eU+="&signature="+signature;eU+="&timestamp="+timestamp;}if(watermark!=null){eU+="&watermark="+watermark;}result+=eU;return result;},bT:function(B,self,options){var head=document.getElementsByTagName("head")[0];var script=document.createElement("script");script.type="text/javascript";script.charset="utf-8";var bP='jsonVuzit_'+Math.floor(Math.random()*100000);var url=B;url+='&callback=window.'+bP;script.src=url;window[bP]=self.bq.bind(self);var dD=function(at){if((options!=null)&&((vuzit.Utilities.getBrowser()=="IE")||(vuzit.Utilities.getBrowser()=="Opera"))&&(!self.gM)){if(options.gO!=null){options.gO.call();options.gO=null;}}script.onload=null;var dq=script.parentNode;dq.removeChild(script);delete script;};var fe=function(e){var dx=(e?e:window.event).target?(e?e:window.event).target:(e?e:window.event).srcElement;if(dx.readyState=="loaded"||dx.readyState=="complete"){dx.onreadystatechange=null;dD();}};if(navigator.userAgent.indexOf('Firefox')> -1){script.onload=dD;}else{script.onreadystatechange=fe;}var error=function(e){message='Viewer::loadDataAsynchronous(): '+e+' - '+script.src;if(vuzit.Utilities.getBrowser()=="Firefox"||vuzit.Utilities.getBrowser()=="Firefox3"){console.error(message);}if(options.gO!=null){options.gO.call();options.gO=null;}};script.onerror=error;if(typeof head=="undefined"){document.body.appendChild(script);}else{head.appendChild(script);}},fH:function(fE){var fv=window.onload;if(typeof window.onload!='function'){window.onload=fE;}else{window.onload=function(){fv();fE();}}},hi:function(hq){list=[];hh=hq.split(",");for(i=0;i<hh.length;++i){x=hh[i];hj=x.split("-");if(hj.length==2){min=parseInt(hj.shift());max=parseInt(hj.shift());for(y=min;y<=max;++y){list.push(y);}}else if(hj.length==1){list.push(parseInt(x));}}return list.sort(vuzit.Utilities.hp);},dc:function(src,width,height){if(navigator.userAgent.indexOf("MSIE")!= -1){var m=document.createElement("div");m.style.filter="progid:DXImageTransform.Microsoft."+"AlphaImageLoader(src='"+src+"')";}else{var m=document.createElement("img");m.src=src;m.alt="";}m.style.width=width+"px";m.style.height=height+"px";return m;},hp:function(a,b){return a-b;},cP:function(className,title,dv){var result=document.createElement("div");result.id=className;result.className="vuzit_toolbar_textButton "+className;result.title=title;result.innerHTML=title;result.onclick=dv;return result;}};vuzit.dz=vuzit.Base.createClass();vuzit.extend(vuzit.dz,{cx:0,bG:10,an:5,A:23,az:20,L:164,D:225,ar:100,ao:100,PreviewViewerPanelWidthOffset:35,PreviewViewerPanelHeightOffset:35,PreviewViewerWindowWidthOffset:35,PreviewViewerWindowHeightOffset:60});vuzit.dz.prototype={initialize:function(div,M,options){this.options={page:0,x:0,y:0,zoom:1,height: -1,width: -1,j: -1,g: -1,bx:'jpg',ae:M.getZooms(),onPageChanged:null,includedPages:null,gW:null};this.ci=false;vuzit.extend(this.options,options||{});this.options.page=this.options.page+1;this.Z=(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;this.id=M.getId();this.dw=true;this.as=this.options.as;this.bx=this.options.bx;this.V=M.getPageCount();this.hk=[];this.ht=[];if(this.options.includedPages!=null){includedPages=vuzit.Utilities.hi(this.options.includedPages);for(i=0;i<this.V;++i){this.hk[i]=includedPages[i];this.ht[includedPages[i]]=i;}}else{for(i=0;i<this.V;++i){this.hk[i]=i;this.ht[i]=i;}}this.aa=this.options.page;if(M.isProcessingSuccess()){this.T=M.getWidth(this.options.zoom);this.bS=M.getHeight(this.options.zoom);}else{this.T=0;this.bS=0}this.aJ=this.options.zoom;this.g=this.options.g;this.j=this.options.j;this.af=parseInt(this.bS)+vuzit.dz.bG;this.al=this.getPageTilesCount();this.w=this.bh(this.bS);this.k=div;this.eu();if(this.options.zoom!= -1){this.cU(M);this.dh(M);}this.eI(this.options.x,this.options.y);this.k.style.width=this.g+"px";this.k.style.height=this.j+"px";this.f=document.createElement("div");this.f.id='vuzit_vScroll';this.f.className='vuzit_vScroll';this.f.style.width=vuzit.dz.A+"px";this.f.style.height=this.j+"px";this.f.style.top=0;this.f.style.left=parseInt(this.g-vuzit.dz.A)+"px";if((this.j<this.w)&&(navigator.userAgent.indexOf('MSIE 8.0')> -1)){this.f.style.overflow='scroll';}this.Q=document.createElement("div");this.Q.style.height=this.w+"px";this.Q.style.width=1+"px";this.f.appendChild(this.Q);this.aW=this.T-parseInt(this.f.style.width);if(this.aW<0){this.aW=0;}this.v=document.createElement("div");this.v.id='vuzit_hScroll';this.v.className='vuzit_hScroll';this.v.style.width=this.g+"px";this.v.style.height=vuzit.dz.az+"px";this.v.style.top=parseInt(this.j-vuzit.dz.az)+"px";this.v.style.left=0;if((this.g<this.aW)&&(navigator.userAgent.indexOf('MSIE 8.0')> -1)){this.v.style.overflow='scroll';}this.U=document.createElement("div");this.U.style.height=1+"px";this.U.style.width=this.aW+"px";this.v.appendChild(this.U);this.dX();this.dI();this.H.onmousedown=this.eh.bind(this);this.k.appendChild(this.H);this.k.appendChild(this.v);this.k.appendChild(this.f);this.v.scrollLeft=this.J-this.d;this.f.scrollTop=this.C-this.c;this.bE();vuzit.Event.observe(this.f,'scroll',this.cg.bind(this),false);vuzit.Event.observe(this.v,'scroll',this.ct.bind(this),false);},cw:function(){return this.bs;},aZ:function(bs){this.bs=bs;},getPageNumber:function(){return this.aa;},getZoom:function(){return this.aJ;},setPageNumber:function(eH){var bj=eH;if(bj>this.aa){if(this.aa==this.V){bj=this.V}}else{if(this.aa==1){bj=1;}}this.C=((bj-1)*this.af)+this.c;this.bE();var bn=this.aU(this.C);var O=bn/this.w;this.f.scrollTop=Math.floor(this.f.scrollHeight*O);},eZ:function(){cG=this.H.childNodes;for(i=(cG.length-1);i>=0;i--){if(cG[i].className=="highlight"){this.H.removeChild(cG[i]);}}},destroy:function(){if(this.ci){return;}this.eZ();for(var i=0;i<this.V;++i){var I=this.dN[i];I.onselectstart=null;I.oncontextmenu=null;I.onload=null;if(I.parentNode!=null){this.H.removeChild(I);}}for(var i=0;i<this.V;++i){var av=this.fp[i];this.H.removeChild(av);}vuzit.Event.stopObserving(this.f,'scroll',this.cg,false);vuzit.Event.stopObserving(this.v,'scroll',this.ct,false);if(this.U.parentNode!=null){this.v.removeChild(this.U);}if(this.Q.parentNode!=null){this.f.removeChild(this.Q);}this.options.onPageChanged=null;this.options.gW=null;this.H.onmousedown=null;this.aa=1;this.ci=true;},dp:function(bI,url){var aB=url;if(aB.indexOf("/"+bI)!= -1){if(bI!="v"){aB=aB.substring(0,(aB.indexOf("/"+bI)+(bI.length+1)));}else{aB=aB.substring(0,(aB.lastIndexOf("/"+bI)+(bI.length+1)));}}aB=aB+"/"+parseInt(this.aa)+"?zoom="+this.aJ+"&x="+this.pageX()+"&y="+this.pageY();return aB;},bk:function(zoom,eg,ff){var eD=((ff=='height')?this.r[this.aJ]:this.Y[this.aJ]);var eG=((ff=='height')?this.r[zoom]:this.Y[zoom]);var eJ=Math.floor(parseInt(eg)/eD);return Math.floor(eJ*eG);},di:function(zoom,eg){var ac=this.bk(zoom,eg,'height');var aL=this.aR[zoom]+vuzit.dz.bG;return this.bK(zoom,ac,aL);},fM:function(){return Math.floor((this.C-this.c)/this.af)+1;},dK:function(zoom,eg){var ac=this.bk(zoom,eg,'width');if((ac+this.d)<(this.d-this.marginWidth)){ac=(this.d-this.marginWidth)-this.d;return ac;}else if((ac+this.d)>this.aF[zoom]){ac=this.aF[zoom]-this.d;return ac;}return ac;},dL:function(zoom,eg){var ac=this.bk(zoom,eg,'height');var aL=this.aR[zoom]+vuzit.dz.bG;var eF=this.bK(zoom,ac,aL);ac=ac%aL;if(ac<0){return 0;}else if(eF==this.V){if(ac>((this.aA[zoom]-this.c)%aL)){return(this.aA[zoom]-this.c)%aL;}}return ac;},bK:function(zoom,ac,aL){return Math.floor(ac/aL);},highlight:function(fV,gl,gk){this.eZ();for(i=0;i<fV.length;i++){this.ax(fV[i],gl,gk);}},moveToHit:function(fT,gl,gk){var x=this.fI(fT.h.nX,this.T,gl);var y=this.fI(fT.h.nY,this.bS,gk);var p=this.ht[parseInt(fT.h.p)];var F=(y+(this.af*p))+this.c-30;F=this.bV(F);var cz=this.topTileRow(this.C);var bU=this.topTileRow(F);var X=this.cF(x);if(cz!=bU){if(Math.abs(bU-cz)<this.bB()){this.move(X,F);}else{this.J=X;this.C=F;this.bE();}}else{this.C=F;this.J=X;this.aT();}var bn=this.aU(this.C);var ah=this.bD(this.J);this.gB(bn,ah);},pageX:function(){return parseInt(this.J-this.d);},pageY:function(){return parseInt((this.C-this.c)%this.af);},db:function(J,C){J=this.cF(J);C=this.bV(C);var bn=this.aU(C);var ah=this.bD(J);this.move(J,C);this.gB(bn,ah);},bC:function(offsetX,offsetY){this.db(this.J+offsetX,this.C+offsetY);},ax:function(fT,gl,gk){var x1=this.fI(fT.h.nX,this.T,gl);var x2=this.fI(fT.h.xX,this.T,gl);var fB=this.fI(fT.h.nY,this.bS,gk);var fA=this.fI(fT.h.xY,this.bS,gk);var p=this.ht[parseInt(fT.h.p)];var fS=document.createElement("div");fS.className="highlight";fS.style.width=parseInt(x2-x1)+"px";fS.style.height=parseInt(fA-fB)+"px";fS.style.left=x1+"px";fS.style.top=parseInt(fB+(this.af*p))+"px";this.H.appendChild(fS);},dI:function(){this.fp=new Array(this.V);for(var i=1;i<=this.V;i++){var av=document.createElement("div");av.style.width=this.T+"px";av.style.height=this.bS+"px";av.style.zIndex=0;av.style.position='absolute';this.cB(av,i-1);av.style.font=12+'px Arial, Helvetica, sans-serif;';var text=document.createTextNode(vuzit.Local.t("page_loading"));av.appendChild(text);this.H.appendChild(av);this.fp[i-1]=av;}},dX:function(){this.H=document.createElement("div");this.H.id='mainDoc';this.H.style.position="absolute";this.H.style.zIndex=0;this.H.style.height=this.w+"px";this.H.style.width=this.aW+"px";var dC=this.V;this.dN=new Array(dC);for(var y=0;y!=dC;++y){var I=document.createElement("img");I.id='vuzit_tile_'+y;I.alt='';I.unselectable="on";I.dD=false;I.onselectstart=function(){return false;};I.oncontextmenu=function(e){if(!ab){e.stopPropagation();}return false;};I.style.position="absolute";I.style.border=0;I.style.zIndex=1;this.H.appendChild(I);this.dN[y]=I;}},bi:function(ag){if((ag<this.V)&&(!this.dN[ag].dD)){this.dA(ag);}},fj:function(e){if(e==null|| !this.bs){return false;}var self=this;setTimeout(function(){self.fj();},30);var fC=(e.clientX)+this.Z.scrollLeft-this.k.offsetLeft;var bU=(e.clientY)+this.Z.scrollTop-this.k.offsetTop;var X=this.bQ+this.bu-fC;var F=this.bW+this.bp-bU;this.db(X,F);return false;},eh:function(e){if(!e){e=window.event;}if(e.button==2){return true;}this.aZ(true);this.bQ=(ab?event.clientX:e.clientX)+this.Z.scrollLeft-this.k.offsetLeft;this.bW=(ab?event.clientY:e.clientY)+this.Z.scrollTop-this.k.offsetTop;this.bu=this.J;this.bp=this.C;this.H.style.cursor=ab?vuzit.Base.ad(true)+"/images/grabbing.cur":"-moz-grabbing";document.documentElement.onmousemove=this.dF.bind(this);var self=this;document.documentElement.onmouseup=function(e){return self.dO(e);};if(ab){this.k.focus();}return false;},dO:function(e){document.documentElement.onmousemove=null;document.documentElement.onmouseup=null;this.aZ(false);this.H.style.cursor=ab?vuzit.Base.ad(true)+"/images/grab.cur":"-moz-grab";var eE=(ab?event.clientX:e.clientX)+this.Z.scrollLeft-this.k.offsetLeft;var aq=(ab?event.clientY:e.clientY)+this.Z.scrollTop-this.k.offsetTop;if(this.bQ==eE&&this.bW==aq){return;}return false;},dF:function(e){this.fj(ab?event:e);return false;},cF:function(X){if((this.H.style.left= -(X-this.d))>=this.marginWidth){X=this.bb;}else if((this.H.style.left= -(X-this.d))<= -((this.T-(this.g-vuzit.dz.A))+this.marginWidth)){X=this.aM;}return(X);},bV:function(F){if((this.H.style.top= -(F-this.c))>=0){F=this.cJ;}else if((this.H.style.top= -(F-this.c))<= -(this.w-this.j)){F=this.be;}return(F);},eI:function(fa,fi){this.bQ=0;this.bW=0;this.bu=0;this.bp=0;this.bs=false;this.J=this.d-this.marginWidth;this.C=this.c;this.bb=this.J;this.cJ=this.C;this.aM=(this.T-(this.d-this.marginWidth));if(this.g%2==0){if((this.T+(this.marginWidth*2))==(this.g-vuzit.dz.A)){this.aM=this.aM-1;}}else{if((this.T+(this.marginWidth*2))!=(this.g-vuzit.dz.A)){this.aM=this.aM+1;}}if(this.w<this.j){this.be=this.cJ;}else{this.be=this.w-this.c;}this.C=(this.af*(this.aa-1))+this.c;if(isNaN(fa)){}else{var x=parseInt(fa);if(x!=(this.d-this.marginWidth)-this.d){if((x<(this.bb-this.d))||(x>(this.aM-this.d))){}else{this.J=x+this.d;}}}if(isNaN(fi)){}else{var ag=parseInt(fi);var cl=false;if(ag<0){cl=true;}else{if(this.aa<this.V){if(ag>this.af-1){cl=true;}}else{var aq=ag+((this.aa-1)*this.af);if(aq>(this.be-this.c)){cl=true;}}}if(!cl){this.C=(ag+((this.aa-1)*this.af))+this.c;}}this.fN=this.J;this.fQ=this.C;},cU:function(M){this.aE=new Array();this.aR=new Array();this.aF=new Array();this.aA=new Array();for(var i=0;i<M.getZoomCount();++i){if(M.isProcessingSuccess()){bS=M.getHeight(i);T=M.getWidth(i);}else{bS=0;T=0;}this.aR[i]=Math.floor(bS);var ba=this.bh(this.aR[i]);this.aA[i]=ba-this.c;this.aE[i]=Math.floor(T);this.aF[i]=this.aE[i]-(this.d-this.marginWidth)-1;}},fI:function(fU,gm,gj){return Math.floor((parseInt(fU)*gm)/gj);},dh:function(M){this.r=new Array();this.Y=new Array();var cY=M.getZoomCount()-1;for(var i=0;i<M.getZoomCount();++i){if(i==cY){this.r[i]=1.0;this.Y[i]=1.0;}else{this.r[i]=M.getHeight(i)/M.getHeight(cY);this.Y[i]=M.getWidth(i)/M.getWidth(cY);}}},bD:function(eS){return(eS-this.d);},getPageTilesCount:function(){var eM=Math.ceil(this.j/this.af);if(eM<=vuzit.dz.an){return vuzit.dz.an;}else{return eM;}},aU:function(eV){return(eV-this.c);},bh:function(height){var ba= -1;ba=((height*this.V)+(vuzit.dz.bG*this.V));if(this.T>this.g){ba+=parseInt(vuzit.dz.az);}return ba;},cQ:function(ag){if(ag<this.V){ho=this.hk[ag];return(vuzit.Utilities.dB(this.id,ho,this.aJ,this.options.signature,this.options.timestamp,this.options.includedPages,this.dw,this.options.watermark));}else{return '';}},dA:function(ag){var I=this.dN[ag];var src=this.cQ(ag);this.bF(I,src,ag);I.dD=true;},cb:function(I){I.style.borderTop="none";I.style.borderBottom="none";I.style.borderLeft="none";I.style.borderRight="none";I.style.borderTop="1px solid black";I.style.borderLeft="1px solid black";I.style.borderRight="1px solid black";I.style.borderBottom="1px solid black";},bF:function(I,src,ag){if(I.src==src){return;}if(!(vuzit.Utilities.getBrowser()=="Opera")){var fc=this;if(I.parentNode!=null){this.H.removeChild(I);}I.onload=function(){fc.H.appendChild(this);};}I.src=src;this.cB(I,ag);},bE:function(){this.gY(this.topTileRow(this.C)+1);var G=this;var aq=this.C-this.c;var top;if(aq==0){top=0;}else{top=Math.floor(aq/this.af);}G.ej(top);},ej:function(top){var eQ=top+this.bB();for(var ag=top;ag<eQ;++ag){this.bi(ag);}this.aT();},move:function(X,F){var cz=this.topTileRow(this.C);this.J=X;this.C=F;var bU=this.topTileRow(this.C);this.gY(bU+1);if(cz<bU){this.cq((this.al+cz),(this.al+bU));}else if(bU<cz){this.cq(bU,cz);}this.aT();},aT:function(){var bn=this.aU(this.C);var ah=this.bD(this.J);this.H.style.left= -(ah)+"px";this.H.style.top= -(bn)+"px";},ct:function(e){if(this.cw()){return;}var aG=this.v.scrollLeft/this.v.scrollWidth;var ah=Math.floor(this.aW*aG);if(ah==0){ah=ah-this.marginWidth;}else if((ah+vuzit.dz.A+5)>=(this.aM-this.bb)){ah=ah+this.marginWidth;}this.J=ah+this.d;this.aT();},cg:function(e){if(this.cw()){return;}var O=0;if(this.f.scrollHeight>0){O=this.f.scrollTop/this.f.scrollHeight;}var bn=Math.floor(this.w*O);var F=bn+this.c;F=this.bV(F);var cz=this.topTileRow(this.C);var bU=this.topTileRow(F);if(cz!=bU){if(Math.abs(bU-cz)<this.bB()){this.move(this.J,F);}else{this.C=F;this.bE();}}else{this.C=F;this.aT();}},et:function(number,fn){var padding=0;if(number<10){padding=2;}else if(number<100){padding=1;}if(fn>3){padding+=1;}var eK='';for(var i=0;i<padding;++i){eK+='0';}return(eK+number);},gY:function(bj){var gV=this.aa;this.aa=bj;if(gV!=this.aa){if(this.options.onPageChanged!=null){this.options.onPageChanged.call();}if(this.options.gW!=null){this.options.gW.call();}}},eB:function(aq){if(aq==0){gU=1;}else{var fR=this.af-this.c;var gU=Math.floor(aq/this.af)+1;if((aq%this.af)>=fR){var incr;if(gU==this.V){incr=0;}else{incr=1;}gU=gU+incr;}}return gU;},eu:function(){var cL=this.g-this.T-vuzit.dz.A;if(cL>(vuzit.dz.cx*2)){this.marginWidth=Math.floor(cL/2);}else{this.marginWidth=vuzit.dz.cx;}if((this.options.width!=vuzit.dz.L)&&(this.g<vuzit.dz.ar)){this.g=vuzit.dz.ar;}this.d=(this.g-vuzit.dz.A)>>1;if((this.options.height!=vuzit.dz.D)&&(this.j<vuzit.dz.ao)){this.j=vuzit.dz.ao;}this.c=this.j>>1;if(this.w<this.j){this.marginHeight=Math.floor((this.j-this.w)/2);}else{this.marginHeight=0;}},gB:function(bn,ah){var O=bn/this.w;this.f.scrollTop=Math.floor(this.f.scrollHeight*O);var aG=ah/this.aW;this.v.scrollLeft=Math.floor(this.v.scrollWidth*aG);},cB:function(ey,ag){ey.style.left=0;ey.style.top=parseInt((ag*this.af)+1)+"px";this.cb(ey);},bB:function(){return(this.V<this.al)?this.V:this.al;},topTileRow:function(center){var aq=(center-this.c);gU=this.eB(aq)-1;return gU;},cq:function(hn,hm){this.cN(hn,hm);},cN:function(hn,hm){for(var ag=hn;ag!=hm;++ag){this.bi(ag);}}};vuzit.Document=vuzit.Base.createClass();vuzit.Document.prototype={getErrorMessage:function(){return this.data['errorMessage'];},getFileName:function(){return this.data['file_name'];},getFileSize:function(){return parseInt(this.data['file_size']);},getFileType:function(){return this.data['file_ext'];},getHeight:function(bM){return this.aN(bM,'height');},getHeightThumb:function(){return this.aN(this.aP(),'height');},getId:function(){return this.data['web_id'];},getImageType:function(){return this.data['image_type'];},getModifiedAt:function(){return this.data['modified_at'];},getPageCount:function(){if(this.options.includedPages!=null){return vuzit.Utilities.hi(this.options.includedPages).length;}else{return parseInt(this.data['page_count']);}},getSubject:function(){return this.data['subject'];},getSubmittedAt:function(){return this.data['submitted_at'];},getDisplayTitle:function(){return this.getTitle();},getTitle:function(){return this.data['title'];},getUrl:function(){return this.data['url'];},getUrlImage:function(ag,bM){if(ag<0||ag>=this.getPageCount()){throw 'ag is out of hj';}else if(bM!= -1&&(bM<0||bM>=this.getZoomCount())){throw 'bM is out of hj';}else{return vuzit.Utilities.dB(this.getId(),ag,bM,null,null,null,true,null);}},getUrlImageThumb:function(ag){return this.getUrlImage(ag,this.aP());},getWidth:function(bM){return this.aN(bM,'width');},getWidthThumb:function(){return this.aN(this.aP(),'width');},getZoomCount:function(){return this.data['zoom_count'];},isDownloadable:function(){return this.bR(this.data['downloadable']);},isProcessingComplete:function(){return(this.ak()>=4||this.ak()== -1);},isPrintPdf:function(){return this.bR(this.data['print_pdf']);},isProcessingSuccess:function(){return(this.ak()==4);},reprocess:function(options){this.options={onDocumentComplete:null};vuzit.extend(this.options,options||{});this.bT('reload');},initialize:function(identifier,options){this.data=[];this.at=null;this.options={onDocumentComplete:null,bt:true,includedPages:null,watermark:null,signature:null,timestamp:null};vuzit.extend(this.options,options||{});var url=this.options.fromUrl?escape(identifier):null;var id=this.options.fromUrl?null:identifier;this.cM={'url':url,'id':id,'format':'json'};},bm:function(){this.data['web_id']='';this.data['image_type']='jpg';this.data['page_count']=0;this.data['local']=1;},ei:function(cZ){},dY:function(cZ){this.bq(cZ.responseText.fD(true));},bR:function(text){return parseInt(text)==1;},getDate:function(text){var result=new Date();result.setTime(parseInt(text)*1000);return result;},getCopyable:function(){return this.bR(this.data['encrypted']);},aN:function(bM,eo){dQ=this.getZoomCount();ai=this.data['zoom'+bM];if(bM==null||bM>=dQ||ai==null){throw 'Invalid Dimension';}else{return parseInt(ai[eo]);}},eY:function(){return this.bR(this.data['encrypted']);},getErrorCode:function(){return(this.data['errorCode']==null)?0:this.data['errorCode'];},getLocal:function(){return this.bR(this.data['local']);},getPageHeight:function(){return parseInt(this.data['height']);},getPageWidth:function(){return parseInt(this.data['width']);},ak:function(){var dV=parseInt(this.data['status']);return isNaN(dV)? -1:dV;},aP:function(){return-1;},aC:function(){return(this.data['watermark']==null)?null:this.data['watermark'];},getZooms:function(){var ae=new Array();for(var i=0;i<this.getZoomCount();++i){ae.push(this.data['zoom'+i]);}return ae;},bq:function(at){this.data={};this.at=at;if(at.document){this.data=at.document;}else{this.data['errorCode']=parseInt(at['err']['code']);this.data['errorMessage']=at['err']['msg'];this.bm();}if(this.options.onDocumentComplete!=null){this.options.onDocumentComplete.call();this.options.onDocumentComplete=null;}},cd:function(){var options={method:'get',bt:this.options.bt,fL:this.ei.bind(this),onDocumentComplete:this.dY.bind(this)};var url=this.cE(this.cM);var fW=new Ajax.Request(url,options);},cE:function(cM){var result=vuzit.Base.ad(true)+'/documents';if(cM.id!=null){result+='/'+cM.id;}result+='.'+cM.format+'?key='+vuzit.Base.apiKey;if(cM.url!=null){result+='&url='+cM.url;}if(this.options.signature!=null){result+='&signature='+this.options.signature;}if(this.options.timestamp!=null){result+='&timestamp='+this.options.timestamp;}if(this.options.includedPages!=null){result+='&included_pages='+this.options.includedPages;}if(this.options.watermark!=null){result+='&watermark='+this.options.watermark;}if(this.options.setDownloadable!=null){result+='&setDownloadable=';if(this.options.setDownloadable){result+='true';}else{result+='false';}}if(this.options.setPrintPdf!=null){result+='&setPrintPdf=';if(this.options.setPrintPdf){result+='true';}else{result+='false';}}result+='&ajax=true';return result;},startDataUpdateLoop:function(){if(this.options.bt){vuzit.Utilities.bT(this.cE(this.cM),this);}else{this.cd();}}};vuzit.gp=vuzit.Base.createClass();vuzit.gp.prototype={getHit:function(i){return this.data[i];},initialize:function(id,q,includedPages,options){this.data=[];this.at=null;this.options={gg:null,bt:true,signature:null,timestamp:null};vuzit.extend(this.options,options||{});this.gM=false;this.cM={'id':id,'includedPages':includedPages,'q':q};if(this.options.bt){this.gL={gO:this.bq.bind(this)};vuzit.Utilities.bT(this.cE(this.cM),this,this.gL);}},bq:function(at){this.gM=true;this.data=new Array();if(at==null){this.data='error';}else if(at.err){this.data=at.err;}else if(at.length==0){this.data=null;}else{fV=at.length;for(i=0;i<fV;i++){this.data[i]=at[i];}}if(this.options.gg!=null){this.options.gg.call();this.options.gg=null;}},cE:function(cM){var result=vuzit.Base.ad(true)+'/documents'+'/'+cM.id+'.json';result+='?q='+cM.q;result+='&key='+vuzit.Base.apiKey;if(this.options.includedPages!=null){result+='&included_pages='+cM.includedPages;}if(this.options.watermark!=null){result+='&watermark='+this.options.watermark;}if(this.options.signature!=null&&this.options.timestamp!=null){result+='&signature='+this.options.signature;result+='&timestamp='+this.options.timestamp;}return result;}};vuzit.Track=vuzit.Base.createClass();vuzit.Track.prototype={initialize:function(bI,page,duration,gT,options){this.data=[];this.at=null;this.options={bt:true,signature:null,timestamp:null};vuzit.extend(this.options,options||{});if(this.options.bt){this.gL={gO:this.bq.bind(this)};vuzit.Utilities.bT(this.cE(bI,page,duration,gT),this,this.gL);}},bq:function(at){this.data=new Array();if(at==null){this.data='error';}else if(at.err){this.data=at.err;}else{}},cE:function(bI,page,duration,gT){var result=vuzit.Base.ad(true)+'/events.json?create=1';result+='&web_id='+bI;if(page!=null){result+='&page='+page;}if(duration!=null){result+='&duration='+duration;}if(this.options.custom!=''){result+='&custom='+this.options.custom;}result+='&event='+gT;result+='&key='+vuzit.Base.apiKey;if(this.options.includedPages!=null){result+='&included_pages='+escape(this.options.includedPages);}if(this.options.watermark!=null){result+='&watermark='+this.options.watermark;}if(this.options.signature!=null&&this.options.timestamp!=null){result+='&signature='+this.options.signature;result+='&timestamp='+this.options.timestamp;}return result;}};vuzit.hA=vuzit.Base.createClass();vuzit.hA.prototype={initialize:function(url,options){this.options={hw:null};vuzit.extend(this.options,options||{});this.data=[];this.at=null;this.gL={gO:this.bq.bind(this)};vuzit.Utilities.bT(url,this,this.gL);},bq:function(at){this.data=new Array();if(at.err){this.data=at.err;}else{this.data=at.complete;}if(this.options.hw!=null){this.options.hw.call();this.options.hw=null;}}};vuzit.Viewer=vuzit.Base.createClass();vuzit.extend(vuzit.Viewer,{fromId:function(id,fX){this.options={signature:null,timestamp:null,fromUrl:false,custom:'',trackEvents:true,includedPages:null,watermark:null};vuzit.extend(this.options,fX||{});var viewer=new vuzit.Viewer(id,this.options);return viewer;},fromUrl:function(url,fX){this.options={signature:null,timestamp:null,fromUrl:true,custom:'',setDownloadable:null,setPrintPdf:null,trackEvents:true,includedPages:null,watermark:null};vuzit.extend(this.options,fX||{});var viewer=new vuzit.Viewer(url,this.options);return viewer;}});vuzit.Viewer.prototype={initialize:function(identifier,fX){this.dk=false;this.fd=false;this.options={signature:null,timestamp:null,onComplete:null,onDocumentDisplayed:null,custom:'',setDownloadable:null,setPrintPdf:null,trackEvents:true,fromUrl:true,includedPages:null,watermark:null};if(fX.ssl!=undefined){vuzit.Base.gD(fX.ssl);delete fX.ssl}vuzit.extend(this.options,fX||{});this.gz=false;this.eb=0;this.he=null;this.hf=null;if(this.options.fromUrl){this.setUrl(identifier);}else{this.setId(identifier);}},destroy:function(){if(this.ci){return;}if(this.dk){this.bc();if(this.toolbar!=null){this.toolbar.destroy();}if(this.gr!=null){this.gr.destroy();}}this.gz=false;this.fr=null;this.options.onComplete=null;this.cc=false;this.gw=null;this.eb=0;this.ci=true;},bc:function(){this.hide();if(vuzit.Utilities.getBrowser()=="IE"){cS=vuzit.getNode(this.gr.dS);cS.parentNode.removeChild(cS);cS=vuzit.getNode(this.gr.ce);cS.parentNode.removeChild(cS);}else{vuzit.Utilities.eX(vuzit.getNode(this.gr.dS));vuzit.Utilities.eX(vuzit.getNode(this.gr.ce));}document.onkeypress=null;this.gX=null;this.he=null;this.hf=null;if(!this.options.disableShortcuts){vuzit.Event.stopObserving(document,'keydown',this.Ky,false);vuzit.Event.stopObserving(document,'keyup',this.Ky,false);vuzit.Event.stopObserving(document,'keydown',this.dJ,false);vuzit.Event.stopObserving(document,'keyup',this.eL,false);}vuzit.Event.stopObserving(document,'mousewheel',this.Ky,false);vuzit.Event.stopObserving(document,'DOMMouseScroll',this.Ky,false);vuzit.Event.stopObserving(document,'mousewheel',this.am,false);vuzit.Event.stopObserving(document,'DOMMouseScroll',this.am,false);vuzit.Event.stopObserving(window,'unload',this.hc,false);this.k.onmouseover=null;this.k.onmouseout=null;this.k.style.cursor=null;this.div.removeChild(this.k);this.k=null;if(this.G!=null){this.G.destroy();}this.fF=false;this.dk=false;},display:function(div,options){if(this.ci){return;}if(this.loadTimer){clearInterval(this.loadTimer);if(!this.fd){this.bc();}}this.fd=false;this.cv=false;this.ec(div);this.bX();this.docOptions={disableShortcuts:false,onPageChanged:null,x:0,y:0,zoom:0,signature:null,timestamp:null};vuzit.extend(this.options,options||{});vuzit.extend(this.docOptions,options||{});vuzit.extend(this.docOptions,this.options||{});this.cW();this.show();if(this.cc){this.fk();this.cv=true;this.dk=true;}else{var self=this;var current=self.fr;this.loadTimer=setInterval(function(){if((self.cc)&&(current==self.fr)){self.fk();self.cv=true;self.dk=true;clearInterval(self.loadTimer);}else if(current!=self.fr){clearInterval(self.loadTimer);self.bc();}else if(!self.cv){self.fk();self.cv=true;}},500);}},getDocument:function(){return this.M;},getPageNumber:function(){return(this.G!=null)?this.G.getPageNumber(): -1;},de:function(){var eR=vuzit.Utilities.getBrowser();switch(eR){case "Firefox":case "Firefox3":return 109;break;case "Safari":case "IE":default:return 189;break;}},dM:function(){var eR=vuzit.Utilities.getBrowser();switch(eR){case "Firefox3":return 107;case "Firefox":return 61;case "Safari":case "IE":default:return 187;}},getUrl:function(){return this.M.getUrl();},getZoom:function(){return this.docOptions.zoom;},hide:function(){vuzit.Utilities.eX(this.div);this.hb();this.ha("document_unload",null,null);},isDestroyed:function(){return this.ci;},pageNext:function(){this.setPageNumber(this.getPageNumber()+1);},pagePrevious:function(){this.setPageNumber(this.getPageNumber()-1);},searchClear:function(){this.gw=null;this.eb=0;this.G.eZ();},searchNext:function(){if((this.eb==0)||(this.eb==this.gw.data.length)){return;}this.eb++;this.fY();},searchPrevious:function(){if(this.eb<2){return;}this.eb--;this.fY();},searchSet:function(query){this.gr.searchBox.value=query;this.cC();this.gy(query);},setFullScreenUrl:function(url){this.P=url;},setSearch:function(query){this.searchSet(query);},fx:function(url){this.fl=url;},setPageNumber:function(page){if(!this.ee(page)){return;}this.G.setPageNumber(page);this.docOptions.page=page;},setSize:function(width,height){this.div.style.width=width+"px";this.div.style.height=height+"px";this.options.g=width;this.options.j=height-this.bO.offsetHeight;if(this.G!=null){this.docOptions.x=this.G.pageX();this.docOptions.page=this.G.fM()-1;this.docOptions.y=this.G.pageY();this.gr.gC();this.toolbar.hy();}if((navigator.userAgent.indexOf("MSIE 6")== -1)||(!this.cc)){this.bf(undefined,this.M.isProcessingComplete());}else{var self=this;setTimeout(function(){self.bf(undefined,self.M.isProcessingComplete());},50);}},setId:function(id){this.options.fromUrl=false;this.gA(id);},setUrl:function(url){this.options.fromUrl=true;this.gA(url);},setZoom:function(zoom){if(!this.toolbar.cX(zoom)||this.G==null||this.docOptions.zoom==zoom){return;}if(this.docOptions.zoom>zoom){this.ha("zoom_out",this.G.getPageNumber(),null);}else{this.ha("zoom_in",this.G.getPageNumber(),null);}this.docOptions.zoom=zoom;this.docOptions.page=this.G.di(zoom,this.G.C-this.G.c);this.docOptions.x=this.G.dK(zoom,this.G.J-this.G.d);this.docOptions.y=this.G.dL(zoom,this.G.C-this.G.c);this.bf(undefined,this.M.isProcessingComplete());if(this.gw!=null){this.G.highlight(this.gw.data,this.M.getPageWidth(),this.M.getPageHeight());}},show:function(){if(this.M.getId()!=undefined){this.ha("document_loaded",null,null);}vuzit.Utilities.eW(this.div);},ec:function(div){this.div=div;},bX:function(){this.id="vuzit_"+new Date().getTime()+'_';this.docOptions={};this.bO=document.createElement('div');this.bO.id=this.id+'toolbar';this.div.appendChild(this.bO);this.gu=document.createElement('div');this.gu.id='vuzit_searchbar_container';this.div.appendChild(this.gu);this.k=document.createElement('div');this.k.id=this.id+'view';this.k.className='vuzit_view';if(this.div.offsetWidth<vuzit.dz.ar){this.k.style.width=vuzit.dz.ar+'px';}else{this.k.style.width=this.div.offsetWidth+'px';}if(this.div.offsetHeight<vuzit.dz.ao){this.k.style.height=(vuzit.dz.ao-25)+'px';}else{this.k.style.height=(this.div.offsetHeight-25)+'px';}this.div.appendChild(this.k);this.P=null;this.fl=null;this.hd=document.createElement('div');this.hd.className='watermark';options={width: -1,height: -1,as:'vuzit-prod'};vuzit.extend(this.options,options||{});},gP:function(){var gQ=document.createElement("form");gQ.method="post";gQ.action=vuzit.Base.ad(true)+"/doc/file";gQ.id="vuzit_file_form";var gR=document.createElement("input");gR.type="hidden";gR.id="vuzit_download";gR.name="vuzit_download";gQ.appendChild(gR);var gS=document.createElement("input");gS.type="hidden";gS.id="vuzit_download_type";gS.name="vuzit_download_type";gQ.appendChild(gS);this.div.appendChild(gQ);},hl:function(){clearTimeout(this.gX);var self=this;this.gX=setTimeout(function(){self.hb();},1000);},dP:function(){this.searchClear();this.gr.setSearchCount(0,0);this.gz=false;vuzit.Utilities.eX(this.gr.getElement());vuzit.Utilities.eX(vuzit.getNode(this.gr.dS));vuzit.Utilities.eX(vuzit.getNode(this.gr.ce));},by:function(e){var ai=(window.event)?window.event.keyCode:e.which;return(ai!=vuzit.Event.KEY_RETURN);},Ky:function(e){var ai=(window.event)?window.event.keyCode:e.which;var dx=(window.event)?window.event:e;var eA=dx.ctrlKey;var shift=dx.shiftKey;var alt=dx.altKey;if((this.ay)&&(this.aQ(ai)&& !this.gz)&& !shift&& !eA&& !alt){if(e){vuzit.Event.stop(e);}return false;}},bL:function(){if((typeof(this.M.getUrl())=="undefined")&&(this.M.getErrorCode()==0)){return;}var isComplete=this.M.isProcessingComplete();if(!isComplete){this.bo(false);}else if(this.options.onComplete!=null){this.cc=true;this.options.onComplete.call();this.options.onComplete=null;}else{this.cc=true;}},am:function(e){if(!this.ay||this.G==null){return true;}if(e){vuzit.Event.stop(e);}else{e=window.event;}var dZ=0;if(e.wheelDelta){dZ=e.wheelDelta/120;}else if(e.detail){dZ= -e.detail/3;}var offsetY=(dZ<0)?50: -50;this.G.bC(0,offsetY);return false;},cW:function(){if(!this.options.disableShortcuts){vuzit.Event.observe(document,'keydown',this.Ky.bind(this),false);vuzit.Event.observe(document,'keyup',this.Ky.bind(this),false);vuzit.Event.observe(document,'keydown',this.dJ.bind(this),false);vuzit.Event.observe(document,'keyup',this.eL.bind(this),false);}vuzit.Event.observe(document,'mousewheel',this.Ky.bind(this),false);vuzit.Event.observe(document,'DOMMouseScroll',this.Ky.bind(this),false);vuzit.Event.observe(document,'mousewheel',this.am.bind(this),false);vuzit.Event.observe(document,'DOMMouseScroll',this.am.bind(this),false);vuzit.Event.observe(window,'unload',this.hc.bind(this),false);this.ay=false;var self=this;this.k.onmouseover=function(){self.ay=true;};this.k.onmouseout=function(e){var el=(window.event!=null)?window.event.srcElement:e.target;var id=el.getAttribute('id');if(window.event!=null){fy=window.event.toElement;}else if(e.relatedTarget!=null){fy=e.relatedTarget;}else{fy=null;}if(((id==this.id)||(id=='mainDoc')||(el.parentNode.getAttribute('id')=='mainDoc'))&&((fy!=null)&&(fy.getAttribute('id')!=undefined)&&(fy.getAttribute('id').indexOf('vuzit_tile')!= -1))){self.ay=true;}else{self.ay=false;}};},getDownloadUrl:function(pdf,hv){var result=vuzit.Base.ad(true)+'/documents/'+this.M.getId()+'.';if(hv){result+='json';}else{if(pdf){result+='pdf';}else{result+=this.M.getFileType();}}result+='?key='+vuzit.Base.apiKey;if(this.options.signature!=null){result+='&signature='+this.options.signature;}if(this.options.timestamp!=null){result+='&timestamp='+this.options.timestamp;}if(this.options.includedPages!=null){result+='&included_pages='+escape(this.options.includedPages);}if(this.options.watermark!=null){result+='&watermark='+escape(this.options.watermark);}if(hv){result+='&pdf=true';}return result},hu:function(){if(this.hB!=null){if(this.hB.data.code){if(parseInt(this.hB.data.code)==449){this.toolbar.hz(this.hB.data.msg);}else{this.toolbar.hz(this.hB.data.msg);var self=this;setTimeout(function(){var result=self.getDownloadUrl(true,true);self.hB=new vuzit.hA(result,self.options);},5000);}}else{this.toolbar.hz("Watermarking complete.");var result=this.getDownloadUrl(true,false);window.open(result);vuzit.Utilities.eX(vuzit.getNode(this.toolbar.dS));}}},aQ:function(ai){var fs=this.dM();var fq=this.de();return((ai>=vuzit.Event.KEY_PAGEUP&&ai<=vuzit.Event.KEY_DOWN)||ai==74||ai==75||ai==72||ai==76||((ai>=48&&ai<=57)||ai==78||ai==80||ai==fs||ai==fq));},dJ:function(e){if(!this.ay||this.G==null||this.gz){return true;}e=(e)?e:window.event;var ai=e.keyCode;var eA=e['ctrlKey'];var shift=e['shiftKey'];if(this.aQ(ai)&& !eA){this.G.aZ(true);this.eT(ai);return false;}return false;},eL:function(e){if(!this.ay||this.G==null||this.gz){return true;}e=(e)?e:window.event;this.G.aZ(false);var ai=e.keyCode;if(!this.aQ(ai)){return false;}return false;},eT:function(ai){var aY=40;var offsetX=0;var offsetY=0;var bJ=Math.floor(this.M.getHeight(this.docOptions.zoom)/2.0);if(ai>=48&&ai<=57){this.setZoom(ai.toString()-49);}else if(ai==vuzit.Event.KEY_HOME){this.G.setPageNumber(1);}else if(ai==vuzit.Event.KEY_END){this.G.setPageNumber(this.M.getPageCount());}else{var fs=this.dM();var fq=this.de();switch(ai){case vuzit.Event.KEY_LEFT:case 72:offsetX-=aY;break;case vuzit.Event.KEY_UP:case 75:offsetY-=aY;break;case vuzit.Event.KEY_RIGHT:case 76:offsetX+=aY;break;case vuzit.Event.KEY_DOWN:case 74:offsetY+=aY;break;case vuzit.Event.KEY_PAGEUP:offsetY-=bJ;break;case vuzit.Event.KEY_PAGEDOWN:offsetY+=bJ;break;case 78:this.pageNext();break;case 80:this.pagePrevious();break;case fs:this.setZoom(this.getZoom()+1);break;case fq:this.setZoom(this.getZoom()-1);break;}this.G.bC(offsetX,offsetY);}},cs:function(){var div=document.createElement('div');div.className='viewer_message';div.style.position='relative';div.style.top='18px';var fontSize=12;div.style.font=fontSize+'px Arial, Helvetica, sans-serif;';return vuzit.getNode(div);},fY:function(){this.gr.setSearchCount(this.eb,this.gw.data.length);this.G.moveToHit(this.gw.getHit(this.eb-1),this.M.getPageWidth(),this.M.getPageHeight());},gh:function(){vuzit.Utilities.eX(vuzit.getNode(this.gr.dS));if(this.gw!=null){if((this.gw.data=='error')||(this.gw.data==null)||(this.gw.data.code)){this.gr.setNoResults(this.gw.data);this.searchClear();this.gr.setSearchCount(0,0);vuzit.Utilities.eW(vuzit.getNode(this.gr.ce));}else{vuzit.Utilities.eX(vuzit.getNode(this.gr.ce));this.G.highlight(this.gw.data,this.M.getPageWidth(),this.M.getPageHeight());this.G.moveToHit(this.gw.getHit(0),this.M.getPageWidth(),this.M.getPageHeight());this.gr.setSearchCount(1,fV);this.eb=1;}}},bo:function(isComplete){if(!isComplete){var self=this;var current=self.fr;var fromUrl=self.options.fromUrl;setTimeout(function(){if(current==self.fr){if(fromUrl){self.setUrl(self.fr);}else{self.setId(self.fr);}}},5000);}},cj:function(){return this.options.height<vuzit.dz.ao||this.options.width<vuzit.dz.ar;},gy:function(gE){vuzit.Utilities.eX(vuzit.getNode(this.gr.ce));this.options.gg=this.gh.bind(this);vuzit.Utilities.eW(vuzit.getNode(this.gr.dS));this.gw=new vuzit.gp(this.getDocument().getId(),gE,this.options.includedPages,this.options);},gv:function(){if(this.gr!=null){this.gr.destroy();}var self=this;var cH={gc:function(){self.searchPrevious();},gb:function(){self.searchNext();},ge:function(event){var ai=(window.event)?window.event.keyCode:event.which;if(ai==vuzit.Event.KEY_RETURN){self.gy(self.gr.searchBox.value);return false;}},fZ:function(e){self.dP();}};this.gr=new vuzit.gs(this.gu,this.toolbar.gq.offsetLeft,cH);vuzit.Utilities.eX(this.gr.getElement());this.gr.getElement().style.top='2px';this.gr.gC();},hx:function(){vuzit.Utilities.eW(vuzit.getNode(this.toolbar.dS));var result=this.getDownloadUrl(true,true);this.options.hw=this.hu.bind(this);this.hB=new vuzit.hA(result,this.options);},gA:function(identifier){if(this.dk){this.bc();this.fd=true;}this.cc=false;this.ci=false;this.options.onDocumentComplete=this.bL.bind(this);this.M=new vuzit.Document(identifier,this.options);this.M.startDataUpdateLoop();this.fr=identifier;},hg:function(){this.he=this.G.getPageNumber();var hs=new Date();this.hf=hs.valueOf();},fk:function(){url=this.M.getUrl();if((!(typeof(url)=="undefined"))&&(url.substring(0,7)=='file://')){this.gP();}this.cr(this.docOptions);this.gv();this.options.g=(this.k.parentNode.offsetWidth==0)?500:(ab?this.k.parentNode.offsetWidth:this.k.parentNode.offsetWidth-2);this.options.j=(this.k.parentNode.offsetHeight==0)?400:this.k.parentNode.offsetHeight-this.bO.offsetHeight;var isComplete;if((this.M.ak()== -1)&&(this.M.getErrorCode()==0)){isComplete=false;}else{isComplete=this.M.isProcessingComplete();}this.bf(true,isComplete);},cC:function(){vuzit.Utilities.eW(this.gr.getElement());this.gz=true;},cT:function(isComplete){if(!isComplete){var p=document.createElement('p');this.k.appendChild(p);var cS=this.cs();cS.innerHTML='Document is loading.';cS.style.left='25px';p.appendChild(cS);var image=document.createElement('img');image.alt='';image.id='indicator_image';image.src=vuzit.Base.ad(true)+'/images/indicator.gif';image.style.top='12px';image.style.padding='0 5px 0 5px';p.appendChild(image);}else if(this.M.getErrorCode()!=0){var p=document.createElement('p');this.k.appendChild(p);var cS=this.cs();cS.innerHTML=this.M.getErrorMessage();p.appendChild(cS);}else{}},hc:function(e){this.hb();this.ha("document_unload",null,null);},cr:function(options){if(this.toolbar!=null){this.toolbar.destroy();}var self=this;var cH={aO:function(){self.pagePrevious();},bz:function(){self.pageNext();},bN:function(event){var ai=(window.event)?window.event.keyCode:event.which;if(ai==vuzit.Event.KEY_RETURN){self.setPageNumber(self.toolbar.getPageNumber());return false;}},bH:function(e){self.toolbar.setZoom(self.getZoom()-1,true);},ca:function(e){self.toolbar.setZoom(self.getZoom()+1,true);},cp:function(e){self.setZoom(self.toolbar.getZoom());},bg:function(){window.location.replace(self.eC());},ga:function(){url=self.M.getUrl();self.ha("download_original_click",null,null);if(!(typeof(url)=="undefined")){if(url.substring(0,7)=='file://'){if((self.options.watermark!=null)&&(self.M.getFileType()=='pdf')){self.hx();}else{vuzit.getNode('vuzit_download').value=url.substring(7);vuzit.getNode('vuzit_download_type').value=self.M.getFileType();vuzit.getNode('vuzit_file_form').submit();}}else{if((self.options.watermark!=null)&&(self.M.getFileType()=='pdf')){self.hx();}else{var result=self.getDownloadUrl(false,false);window.open(result);}}}},gd:function(){url=self.M.getUrl();self.ha("download_pdf_click",null,null);if(!(typeof(url)=="undefined")){if(url.substring(0,7)=='file://'){if(self.options.watermark!=null){self.hx();}else{vuzit.getNode('vuzit_download').value=url.substring(7)+'.pdf';vuzit.getNode('vuzit_download_type').value=1;vuzit.getNode('vuzit_file_form').submit();}}else{if(self.options.watermark!=null){self.hx();}else{var result=self.getDownloadUrl(true,false);window.open(result);}}}},gf:function(){if(self.gr.getElement().style.display=='none'){self.cC();self.gr.searchBox.focus();}else{self.dP();}},showDownload:true,showPrintPdf:true,showZooms:true,showPages:true,showFullScreen:false,showShortcuts:false};vuzit.extend(cH,options||{});if(!this.M.isDownloadable()){cH.showDownload=false;}if(!this.M.isPrintPdf()||(parseInt(this.M.getFileType())==1)){cH.showPrintPdf=false;}this.toolbar=new vuzit.dG(this.bO,this.M.getZooms().length,cH);if(cH.showFullScreen){if((this.P==null)||(this.P=="#")){if(typeof(this.M.getId())=="undefined"){this.P="#";}else{this.P=vuzit.Base.ad(true)+'/view/'+this.M.getId()+'/?oid=3&key='+vuzit.Base.apiKey;if(this.options.signature!=null){this.P=this.P+"&signature="+this.options.signature;}if(this.options.timestamp!=null){this.P=this.P+"&timestamp="+this.options.timestamp;}}}this.toolbar.cD(this.P.replace(/\$\[URL\]/,escape(this.M.getUrl())));}if(cH.showShortcuts){this.toolbar.dW('http://vuzit.com/page/keyboard_shortcuts');}this.toolbar.hy();},ha:function(gT,page,duration){if((this.M.getErrorMessage()==null)&&(this.options.trackEvents)){var gZ=new vuzit.Track(this.M.getId(),page,duration,gT,this.options);}},hb:function(){var hs=new Date();var duration=Math.round((hs.valueOf()-this.hf)/1000);if((this.he!=null)&&(duration<=1800)){this.ha("page_view",this.he,duration);}this.hg();},bf:function(fb,isComplete){this.hG=false;if(!this.cc&&typeof(fb)=="undefined"){return;}if(this.G!=null){this.G.destroy();this.hG=true;}if(this.k!=null){this.k.innerHTML='';}this.toolbar.setZoom(this.getZoom());this.toolbar.ds(this.M.getPageCount());this.docOptions.bx=this.M.getImageType();this.docOptions.height=this.options.height;this.docOptions.width=this.options.width;this.docOptions.j=this.options.j;this.docOptions.g=this.options.g;var self=this;this.docOptions.gW=function(e){if((self.G!=null)&&(!self.hG)){self.toolbar.setPageNumber(self.G.getPageNumber());self.hl();}else if((self.G!=null)&&(self.hG)){hH=setInterval(function(){if(!self.hG){self.toolbar.setPageNumber(self.G.getPageNumber());self.hl();clearInterval(hH);}},100);}};if(isComplete){this.G=new vuzit.dz(this.k,this.M,this.docOptions);this.hG=false;if((self.G.getPageNumber()!=1)&&(vuzit.Utilities.getBrowser()=="Safari")){if(this.options.gW!=null){this.options.gW.call();}if(this.options.onPageChanged!=null){this.docOptions.onPageChanged.call();}}else if((self.G.getPageNumber()!=1)&&(vuzit.Utilities.getBrowser()=="Opera")){this.G.aa=this.docOptions.page;if(this.options.gW!=null){this.options.gW.call();}if(this.options.onPageChanged!=null){this.docOptions.onPageChanged.call();}}if(typeof(fb)!="undefined"){this.ha("document_loaded",null,null);this.hg();}watermark=this.M.aC();if(watermark!=null){this.k.appendChild(this.hd);this.hd.style.top=(parseInt(this.k.style.height)-40)+'px';this.hd.style.left='10px';this.hd.innerHTML=this.M.aC();}if(this.options.onDocumentDisplayed!=null){this.options.onDocumentDisplayed.call();this.options.onDocumentDisplayed=null;}}this.k.style.cursor=ab?vuzit.Base.ad(true)+"/images/grab.cur":"-moz-grab";if(this.k.style.width.indexOf('px')!= -1){this.toolbar.dr((parseInt(this.k.style.width)+2)+'px');}else{this.toolbar.dr(this.k.style.width);}this.cT(isComplete);},ee:function(page){return(page<(this.M.getPageCount()+1)&&page>0);}};vuzit.gs=vuzit.Base.createClass();vuzit.gs.prototype={initialize:function(div,hE,options){this.options={ge:null,gc:null,gb:null};vuzit.extend(this.options,options||{});this.div=div;this.eE=hE;this.dm();},getElement:function(){return this.aj;},setNoResults:function(data){var cS=vuzit.getNode(this.ce);var text;if(data==null){cS.style.width='200px';text='Phrase not found.';}else if(data=='error'){cS.style.width='360px';text='Error occurred during search index. Please try again.';}else{cS.style.width='250px';text=data.msg;}cS.innerHTML=text;},setSearchCount:function(current,fV){var gJ=(fV>0)?(current+' of '+fV):'0 of 0';var size=30-((gJ.length-6)*2);this.searchBox.size=size;this.gK.nodeValue=gJ;},destroy:function(){this.cf(this.aj);this.div.removeChild(this.aj);},dm:function(){this.id="vuzit_"+new Date().getTime()+'_';this.aj=document.createElement("div");this.aj.id=this.id+'gr';this.aj.className='vuzit_searchbar';if(vuzit.Utilities.getBrowser()=="Safari"){this.aj.style.width='370px';}else if((vuzit.Utilities.getBrowser()=="IE")||(vuzit.Utilities.getBrowser()=="Chrome")){this.aj.style.width='310px';}else{this.aj.style.width='300px';}var gI=document.createElement("div");gI.style.position="absolute";gI.style.height=0;gI.style.width=0;this.div.appendChild(gI);var indicator=document.createElement("div");this.dS="vuzit_"+new Date().getTime()+'_searchbar_indicator';indicator.id=this.dS;indicator.className="vuzit_searchbar";indicator.style.width='100px';indicator.style.height='30px';indicator.style.display="none";var image=document.createElement('img');image.alt='';image.id='search_indicator_image';image.src=vuzit.Base.ad(true)+'/images/indicator.gif';image.style.padding='5px 5px 0 5px';indicator.appendChild(image);var cS=document.createElement('span');cS.className='viewer_message';cS.style.position='relative';var fontSize=12;cS.style.font=fontSize+'px Arial, Helvetica, sans-serif;';cS.innerHTML='Searching...';indicator.appendChild(cS);gI.appendChild(indicator);var text=document.createElement("div");this.ce="vuzit_"+new Date().getTime()+"_no_search_results";text.id=this.ce;text.className="vuzit_searchbar";text.style.display="none";text.style.height='20px';text.style.padding='5px 5px 5px 5px';var gN=document.createElement('span');gN.className='viewer_message';gN.style.position='relative';var fontSize=12;gN.style.font=fontSize+'px Arial, Helvetica, sans-serif;';text.appendChild(gN);gI.appendChild(text);var result=document.createElement("div");result.className="vuzit_toolbar_pageGroup";var form=document.createElement("form");form.id="vuzit_search_form";form.action="#";form.method="post";var p=document.createElement("p");result.appendChild(form);form.appendChild(p);var size;size='30';var input=document.createElement("input");input.id="vuzit_searchbox";input.type="text";input.size=size;input.maxLength="30";input.style.margin="2px 5px 0 0";input.onkeypress=this.options.ge;this.searchBox=input;p.appendChild(input);this.gK=document.createTextNode('0 of 0');p.appendChild(this.gK);var previous=vuzit.Utilities.aK('vuzit_toolbar_previousPage','Previous match');previous.onclick=this.options.gc;result.appendChild(previous);var next=vuzit.Utilities.aK('vuzit_toolbar_nextPage','Next match');next.onclick=this.options.gb;result.appendChild(next);var gH=vuzit.Utilities.aK('vuzit_searchbar_close','Close search');gH.onclick=this.options.fZ;result.appendChild(gH);this.aj.appendChild(result);this.div.appendChild(this.aj);},cf:function(el){var a=el.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;i+=1){n=a[i].name;if(typeof el[n]==='function'){el[n]=null;}}}a=el.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1){this.cf(el.childNodes[i]);}}},fP:function(){var left=parseInt(this.eE-parseInt(this.aj.style.width));var gG=this.aj.parentNode.parentNode.offsetLeft;if(left<gG){return gG+'px';}else{return left+'px';}},gC:function(){var ah=this.fP();this.aj.style.left=ah;vuzit.getNode(this.dS).style.left=ah;vuzit.getNode(this.dS).style.top='30px';vuzit.getNode(this.ce).style.left=ah;vuzit.getNode(this.ce).style.top='30px';}};vuzit.dG=vuzit.Base.createClass();vuzit.dG.prototype={initialize:function(div,ae,options){this.options={showFullScreen:false,showShortcuts:false,showDownload:true,showPrintPdf:true,du:false,simplePage:false,simpleZoom:false,showZooms:true,showPages:true,bN:null,aO:null,bz:null,bH:null,ca:null,cp:null,bg:null,ga:null,gd:null,gf:null};vuzit.extend(this.options,options||{});this.div=div;this.ae=ae;this.dm();},getElement:function(){return this.aj;},getPageNumber:function(){return parseInt(this.cu.value);},setPageNumber:function(page){this.cu.value=page;},getZoom:function(){for(var i=0;i<this.aH.zoomRadio.length;i++){var cR=this.aH.zoomRadio[i];if(cR.checked){return parseInt(cR.value);}}},hz:function(text){vuzit.getNode(this.hF).innerHTML=text;},dr:function(width){this.getElement().style.width=width;},setZoom:function(zoom,cO){if(!this.cX(zoom)){return;}for(var i=0;i<this.aH.zoomRadio.length;i++){var cR=this.aH.zoomRadio[i];cR.checked=(i==zoom);}if(cO!=null&&cO==true){this.aH.zoomRadio[zoom].click();}this.aH.zoomRadio[zoom].blur();},ds:function(page){if(isNaN(page)){page=0;}this.bY.nodeValue=(' / '+page);},destroy:function(){this.cf(this.aj);this.div.removeChild(this.aj);},cX:function(zoom){return(zoom>=0&&this.aH.zoomRadio!=null&&zoom<this.aH.zoomRadio.length);},au:function(group){this.aj.appendChild(this.aV());this.aj.appendChild(group);},dm:function(){this.id="vuzit_"+new Date().getTime()+'_';this.aj=document.createElement("div");this.aj.id=this.id+'toolbar';this.aj.className='vuzit_toolbar';this.div.appendChild(this.aj);this.aj.appendChild(this.logoGroup());this.aj.appendChild(this.es());if(this.options.showZooms){this.aj.appendChild(this.aV());}this.aj.appendChild(this.ek());if(this.options.du){this.au(this.dg());}if(this.options.showDownload){this.au(this.fG());}if(this.options.showPrintPdf){this.au(this.gi());}if(this.options.showFullScreen){this.au(this.da());}if(this.options.showShortcuts){this.au(this.ev());}this.au(this.gx());var gI=document.createElement("div");gI.style.position="absolute";gI.style.height=0;gI.style.width=0;this.div.appendChild(gI);var indicator=document.createElement("div");this.dS="vuzit_"+new Date().getTime()+'_watermark_indicator';indicator.id=this.dS;indicator.className="vuzit_searchbar";indicator.style.width='260px';indicator.style.height='70px';indicator.style.display="none";var image=document.createElement('img');image.alt='';image.id='watermark_indicator_image';image.src=vuzit.Base.ad(true)+'/images/indicator.gif';image.style.padding='5px 5px 0 5px';indicator.appendChild(image);var cS=document.createElement('span');this.hF="vuzit_"+new Date().getTime()+'watermark_results';cS.id=this.hF;cS.className='viewer_message';cS.innerHTML=vuzit.Local.t("watermark_request");cS.style.position='relative';var fontSize=12;cS.style.font=fontSize+'px Arial, Helvetica, sans-serif;';indicator.appendChild(cS);gI.appendChild(indicator);},fG:function(){var hD=vuzit.Utilities.cP('vuzit_toolbar_downloadGroup','Download',this.options.ga);this.hD=hD;return hD;},cf:function(el){var a=el.attributes,i,l,n;if(a){l=a.length;for(i=0;i<l;i+=1){n=a[i].name;if(typeof el[n]==='function'){el[n]=null;}}}a=el.childNodes;if(a){l=a.length;for(i=0;i<l;i+=1){this.cf(el.childNodes[i]);}}},da:function(){this.ap=document.createElement("a");return this.linkButton("vuzit_toolbar_textGroup",vuzit.Local.t("full_screen"),this.ap);},aV:function(){var newEl=document.createElement("div");newEl.className="vuzit_toolbar_separator";return newEl;},linkButton:function(className,innerHTML,a){var result=document.createElement("div");result.className=className;a.href="";a.innerHTML=innerHTML;result.appendChild(a);return result;},logoGroup:function(){var result=document.createElement('div');result.className="vuzit_toolbar_logoGroup";var link=document.createElement('a');link.href='http://vuzit.com/referer/viewer';link.title=vuzit.Local.t("logo_description");var as=vuzit.Base.ad(true)+"/images/vuzit_viewer_logo.png";var cS=vuzit.Utilities.dc(as,57,20);cS.style.border='0';cS.style.cursor='pointer';link.appendChild(cS);result.appendChild(link);return result;},es:function(){var result=document.createElement("div");result.className="vuzit_toolbar_pageGroup";var previous=vuzit.Utilities.aK('vuzit_toolbar_previousPage',vuzit.Local.t("previous_page"));previous.onclick=this.options.aO;result.appendChild(previous);var next=vuzit.Utilities.aK('vuzit_toolbar_nextPage',vuzit.Local.t("next_page"));next.onclick=this.options.bz;result.appendChild(next);var form=document.createElement("form");form.id="vuzit_page_form";form.action="#";form.method="post";if(this.options.simplePage){vuzit.Utilities.eX(form);}var p=document.createElement("p");result.appendChild(form);form.appendChild(p);var size;if((vuzit.Utilities.getBrowser()=="Safari")||(vuzit.Utilities.getBrowser()=="Opera")){size='3';}else{size='1';}var input=document.createElement("input");input.id="vuzit_pager";input.type="text";input.value="1";input.size=size;input.maxLength="3";this.cu=input;input.onkeypress=this.options.bN;p.appendChild(input);this.bY=document.createTextNode(' / 1');p.appendChild(this.bY);if(!this.options.showPages){vuzit.Utilities.eX(result);}return result;},dg:function(){return vuzit.Utilities.cP('vuzit_toolbar_linkToPageGroup','Link fy this page',this.options.bg);},gi:function(){var hC=vuzit.Utilities.cP('vuzit_toolbar_printPdfGroup',vuzit.Local.t('print_pdf'),this.options.gd);this.hC=hC;return hC;},gx:function(){gq=vuzit.Utilities.aK('vuzit_toolbar_searchGroup',vuzit.Local.t("find_text"));gq.onclick=this.options.gf;this.gq=gq;return gq;},cD:function(link){this.ap.href=link;},dW:function(link){this.bv.href=link;},hy:function(){vuzit.getNode(this.dS).style.top='30px';if(this.options.showDownload){vuzit.getNode(this.dS).style.left=this.hD.offsetLeft+'px';}else if(this.options.showPrintPdf){vuzit.getNode(this.dS).style.left=this.hC.offsetLeft+'px';}},ev:function(){this.bv=document.createElement("a");return this.linkButton("vuzit_toolbar_textGroup","Keyboard Shortcuts",this.bv);},ek:function(){var result=document.createElement("div");result.className="vuzit_toolbar_zoomGroup";var dH=vuzit.Utilities.aK('vuzit_toolbar_zoomOut',vuzit.Local.t("zoom_out"));dH.onclick=this.options.bH;result.appendChild(dH);var form=document.createElement("form");form.id="vuzit_toolbar_zoomForm";form.action="#";if(this.options.simpleZoom){vuzit.Utilities.eX(form);}this.aH=form;var p=document.createElement("p");form.appendChild(p);for(var i=0;i<this.ae;i++){var input;if(vuzit.Utilities.getBrowser()=="IE"){input=document.createElement("<input type=\"radio\" name=\"zoomRadio\">");}else{input=document.createElement("input");input.type="radio";input.name="zoomRadio";}input.value=i;input.onclick=this.options.cp;p.appendChild(input);}result.appendChild(form);var eq=vuzit.Utilities.aK('vuzit_toolbar_zoomIn',vuzit.Local.t("zoom_in"));eq.onclick=this.options.ca;result.appendChild(eq);if(!this.options.showZooms){vuzit.Utilities.eX(result);}return result;}};vuzit.ck=vuzit.Base.createClass();vuzit.extend(vuzit.ck.prototype,vuzit.Viewer.prototype);vuzit.extend(vuzit.ck.prototype,{initialize:function(options){var ea={title:'',width:vuzit.dz.L,height:vuzit.dz.D,top:100,left:100,'resizable':false,'draggable':true,'minimizable':false,'maximizable':false,'onClose':this.hide.bind(this),'mouseoutOnDrag':false,'recenterAuto':false};this.aI=new Window(ea);this.cc=false;this.ec(this.aI.getContent());this.P=null;this.dD=false;this.options={width:vuzit.dz.L,height:vuzit.dz.D,g: -1,j: -1};vuzit.extend(this.options,options||{});this.bX(this.options);this.aI.getContent().style.backgroundColor='#E0E0E0';this.k.style.border='0px';this.div.style.overflow='hidden';this.cW();},bw:function(){return this.aI;},destroyPreview:function(){if(this.isDestroyed()){return;}this.aI.destroy();this.destroy();},hide:function(){if(vuzit.Utilities.getBrowser()=="IE"){this.aI.setLocation(-1000,-1000);this.aI.show();}else{this.aI.getElement().hide();}},load:function(url,options){var cH={zoom:1,signature:null,timestamp:null};vuzit.extend(cH,options||{});this.setUrl(url,cH);},setLocation:function(top,left){this.aI.setLocation(top,left);},setSize:function(width,height){this.aI.setSize(width,height);},show:function(){this.aI.show();},bL:function(){this.cr({simplePage:true,dy:false,showDownload:false,showFullScreen:true});this.docOptions.ae=null;this.docOptions.zoom= -1;id=this.M.aP();var isComplete=this.M.isProcessingComplete();var ew=(((isComplete)&&(this.M.getWidth(id)!= -1))?this.M.getWidth(id):vuzit.dz.L);var ed=(((isComplete)&&(this.M.getHeight(id)!= -1))?this.M.getHeight(id):vuzit.dz.D);this.options.g=ew+vuzit.dz.PreviewViewerPanelWidthOffset;this.options.j=ed+vuzit.dz.PreviewViewerPanelHeightOffset;if(this.k!=null){this.bf(true,isComplete);}this.setSize(parseInt(ew+vuzit.dz.PreviewViewerWindowWidthOffset),parseInt(ed+vuzit.dz.PreviewViewerWindowHeightOffset));this.bo(isComplete);this.cc=true;}});var cA=function(source){var o=cA.options,value=o.dn[o.dR?"strict":"loose"].exec(source);for(var i=0,bd={};i<14;i++){bd[o.ai[i]]=value[i]||"";}bd[o.q.name]={};bd[o.ai[12]].replace(o.q.dn,function($0,$1,$2){if($1)bd[o.q.name][$1]=$2;});return bd;};cA.options={dR:false,ai:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",dn:/(?:^|&)([^&=]*)=?([^&]*)/g},dn:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};vuzit.cK=vuzit.Base.createClass();vuzit.cK.prototype={initialize:function(){this.eN=[];this.eP=[];this.bZ=[];this.extensions=[];this.aS=false;},cn:function(accept){this.aS=accept;},ez:function(){return this.aS;},eO:function(name){this.bZ.push(name);},dj:function(name){this.extensions.push(name);},fJ:function(name){this.eP.push(name);},fK:function(name){this.eN.push(name.toLowerCase());},find:function(){var result=new Array();var links=document.getElementsByTagName('a');var validLinks=0;for(var i=0;i<links.length;i++){links[i].vuzitUrl=this.dU(links[i].href);var bd=cA(links[i].vuzitUrl);if(!this.dT(links[i].className)){continue;}if(!this.cV(bd)){if(!this.ep(bd)){continue;}}if(!this.aS&& !this.ef(bd)){continue;}links[i].arrayIndex=validLinks;links[i].firstLoad=true;links[i].loadCalled=false;validLinks++;result.push(links[i]);}return result;},dU:function(link){var result=link;if(result.substr(0,5).toLowerCase()!='http:'){var fh=('http://'+location.host);if(result[0]!='/'){fh+='/';}result=(fh+result);}return result;},cI:function(list,ai){for(var i=0;i<list.length;i++){if(list[i]==ai){return true;}}return false;},dT:function(className){return!this.cI(this.bZ,className);},cV:function(bd){var result=false;var index=bd.file.lastIndexOf('.');if(index!= -1){var fO=bd.file.substring(index+1,bd.file.length);result=this.cI(this.extensions,fO);}return result;},ep:function(bd){return this.cI(this.eP,bd.file);},ef:function(bd){return this.cI(this.eN,bd.host);}};vuzit.PreviewLoader=vuzit.Base.createClass();vuzit.PreviewLoader.prototype={initialize:function(){this.bl=new vuzit.cK();this.previewViewers=new Array();this.links=new Array();this.curLoadLink=0;},destroy:function(){var cG=null;if(this.options["popPrompt"]=='icon'){cG=document.dE('vuzit_preview_icon');}else{cG=this.bl.find();}for(var i=0;i<cG.length;i++){this.df(this.previewViewers[i]);}this.links=null;this.curLoadLink=null;},load:function(name){this.links=this.bl.find();for(var i=0;i<this.links.length;i++){var link=vuzit.getNode(this.links[i]);var image=this.er();if(this.options['showIcon']){link.parentNode.insertBefore(image,link.nextSibling);}if(this.options['showPreview']){}if(this.options["cy"]){link.href=vuzit.Base.ad(true)+'/doc/view?url='+link.href;}}},loadViewers:function(){this.links[0].loadCalled=true;this.previewViewers[0].load(this.links[0].vuzitUrl);this.loadTimer=setInterval(function(){var self=vuzit.PreviewLoader.instance;if(self.curLoadLink<self.links.length){var link=self.links[self.curLoadLink];var viewer=self.previewViewers[self.curLoadLink];if(!link.loadCalled){link.loadCalled=true;viewer.load(link.vuzitUrl);}else{if((viewer.G!=null)&&(viewer.cc)){self.curLoadLink++;}}}else{clearInterval(self.loadTimer);}},200);},setOptions:function(options){vuzit.Base.apiKeySet(options.apiKey);this.options={showIcon:true,cy:true,showPreview:false,popDelay:1000};if(options.linkit!=null){vuzit.extend(this.options,options.linkit||{});}fo=this.bl;fo.dj('pdf');this.bl.cn(true);},df:function(aI){vuzit.Event.stopObserving(aI.bw().getElement(),'mouseover',this.bA);vuzit.Event.stopObserving(aI.bw().getElement(),'mouseout',this.previewUnloadWindow);aI.destroyPreview();},getElementWithArrayIndex:function(m){var self=vuzit.PreviewLoader.instance;if(m.arrayIndex==null){return self.getElementWithArrayIndex(m.parentNode);}else{return m;}},getOffSet:function(obj,ff,aI){var eg=0;var m=obj;do{if(ff=="left"){eg+=obj.offsetLeft;}else{eg+=obj.offsetTop;}}while(obj=obj.offsetParent);if(ff=="left"){pos=eg+m.getWidth()+15;if((pos+aI.aI.width)>=document.body.clientWidth){pos=eg-aI.aI.width;}}else{pos=eg;if((pos+aI.aI.height)>=document.body.clientHeight){pos=pos-aI.aI.height;}}return pos;},hide:function(){var self=vuzit.PreviewLoader.instance;for(var i=0;i<self.previewViewers.length;i++){self.previewViewers[i].hide();}},er:function(){var image=document.createElement('img');if(ab){image.setAttribute('className','vuzit_preview_icon');}else{image.setAttribute('class','vuzit_preview_icon');}image.setAttribute('src','http://'+vuzit.Base.R.host+':'+vuzit.Base.R.port+'/images/vuzit_tiny.gif');return image;},log:function(message){},co:function(e){if(!e){e=window.event;}var self=vuzit.PreviewLoader.instance;self.hide();var m=(e.srcElement!=null)?vuzit.getNode(e.srcElement):vuzit.getNode(this);self.setCloseRequestedFromElement(m,false);var aI=self.previewViewers[m.arrayIndex];if(m.firstLoad){if(!m.loadCalled){m.loadCalled=true;aI.load(m.vuzitUrl);}m.firstLoad=false;vuzit.Event.observe(aI.bw().getElement(),'mouseover',self.bA);vuzit.Event.observe(aI.bw().getElement(),'mouseout',self.previewUnloadWindow);aI.bw().getElement().arrayIndex=m.arrayIndex;}aI.setLocation(self.getOffSet(m,'top',aI),self.getOffSet(m,'left',aI));aI.show();},aD:function(e){var self=vuzit.PreviewLoader.instance;var m=(e.srcElement!=null)?vuzit.getNode(e.srcElement):vuzit.getNode(this);self.setCloseRequestedFromElement(m,true);self.setDelay(m,self.previewViewers[m.arrayIndex]);},previewUnloadWindow:function(e){var self=vuzit.PreviewLoader.instance;if(vuzit.Utilities.getBrowser()=="Firefox"||vuzit.Utilities.getBrowser()=="Firefox3"){m=vuzit.getNode(this);}else{m=self.getElementWithArrayIndex(e.srcElement);}var arrayIndex=self.setCloseRequestedFromArrayIndex(m,true);self.setDelay(self.links[arrayIndex],self.previewViewers[arrayIndex]);},setCloseRequestedFromElement:function(m,eg){if(m.vuzitUrl==null){m=vuzit.getNode(m.parentNode);}m.aw=eg;},setCloseRequestedFromArrayIndex:function(m,eg){var self=vuzit.PreviewLoader.instance;var arrayIndex=m.arrayIndex;self.links[arrayIndex].aw=eg;return arrayIndex;},setDelay:function(m,viewer){var self=vuzit.PreviewLoader.instance;setTimeout(function(){var self=vuzit.PreviewLoader.instance;if((m.aw)){viewer.hide();}else{};},parseInt(self.options["popDelay"]));},bA:function(e){var self=vuzit.PreviewLoader.instance;if(vuzit.Utilities.getBrowser()=="Firefox"||vuzit.Utilities.getBrowser()=="Firefox3"){m=vuzit.getNode(this);}else{m=self.getElementWithArrayIndex(e.srcElement);}self.setCloseRequestedFromArrayIndex(m,false);}};vuzit.Local=vuzit.Base.createClass();vuzit.Local={activeText:"en",text:{en:{download:"Download",find_text:"Find Text",full_screen:"Full screen",logo_description:"Get your own embedded document viewer from Vuzit fy protect, share and analyze your online documents.",next_page:"Next page",page_loading:"Page is loading...",preview_not_shown:"Pages #{start} fy #{end} are not shown in this preview.",previous_page:"Previous page",print_pdf:"Print PDF",watermark_request:"Watermarking request sent.  Please wait.",zoom_in:"Zoom in",zoom_out:"Zoom out"}},getActiveText:function(){return vuzit.Local.activeText;},setActiveText:function(type){vuzit.Local.activeText=type;},addText:function(name,values){if(vuzit.Local.text[name]!=null){alert("The local text "+name+" already exists");}vuzit.Local.text[name]=vuzit.extend(vuzit.clone(vuzit.Local.text.en),values);},t:function(ai){var text=vuzit.Local.text[vuzit.Local.activeText];if(text==null){alert("The text type "+ai+" does not exist");}return text[ai]||"{Translation not found}";}}; 