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;},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'},fd:false,apiKey:'',apiKeySet:function(ai){vuzit.Base.apiKey=ai;},createClass:function(){return function(){this.initialize.apply(this,arguments);}},fM:function(fd){vuzit.Base.fd=fd},webServerSet:function(options){vuzit.extend(vuzit.Base.R,options);},ad:function(){if(vuzit.Base.fd){protocol='https';host="ssl."+vuzit.Base.R.host;port='443';}else{protocol='http';host=vuzit.Base.R.host;port=vuzit.Base.R.port;}fP=protocol+'://'+host+':'+port;return fP;},imageServerSet:function(options){vuzit.extend(vuzit.Base.aX,options);}};ab=(document.all!=undefined);vuzit.Utilities={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('Safari')> -1){return "Safari";}else if(fu.indexOf('Opera')> -1){return "Opera";}else{return "Other";}},dB:function(ft,ag,bM,signature,timestamp,fg){var result=vuzit.Base.ad();result+=(fg)?'/documents/'+ft+'/pages/'+ag+'.jpg':'/doc/image_url';var eU=(bM== -1)?'?t=thumb':'?z='+bM;eU+='&key='+vuzit.Base.apiKey;if(signature!=null&&timestamp!=null){eU+="&signature="+signature;eU+="&timestamp="+timestamp;}result+=eU;return result;},fH:function(fE){var fv=window.onload;if(typeof window.onload!='function'){window.onload=fE;}else{window.onload=function(){fv();fE();}}},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;}};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:1,x:0,y:0,zoom:1,height: -1,width: -1,j: -1,g: -1,bx:'jpg',ae:M.getZooms(),aC:null};this.ci=false;vuzit.extend(this.options,options||{});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.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";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;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;},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);},destroy:function(){if(this.ci){return;}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.aC=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);},eb: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)+1;},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);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);},bC:function(offsetX,offsetY){this.db(this.J+offsetX,this.C+offsetY);},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("Page is 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(y){if((y<this.V)&&(!this.dN[y].dD)){this.dA(y);}},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()+"/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()+"/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 y=parseInt(fi);var cl=false;if(y<0){cl=true;}else{if(this.aa<this.V){if(y>this.af-1){cl=true;}}else{var aq=y+((this.aa-1)*this.af);if(aq>(this.be-this.c)){cl=true;}}}if(!cl){this.C=(y+((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;}},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){return((ag<this.V)?vuzit.Utilities.dB(this.id,ag,this.aJ,this.options.signature,this.options.timestamp,this.dw):'');},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,y){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,y);},bE:function(){this.topTileRow(this.C);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 y=top;y<eQ;++y){this.bi(y);}this.aT();},move:function(X,F){var cz=this.topTileRow(this.C);this.J=X;this.C=F;var bU=this.topTileRow(this.C);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);},eB:function(aq){if(aq==0){this.aa=1;}else{var fG=this.af-this.c;var aa=Math.floor(aq/this.af)+1;if((aq%this.af)<fG){this.aa=aa;}else{var incr;if(aa==this.V){incr=0;}else{incr=1;}this.aa=aa+incr;}}if(this.options.aC!=null){this.options.aC.call();}},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;}},cB:function(ey,eM){ey.style.left=0;ey.style.top=parseInt((eM*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);this.eB(aq);return(this.aa-1);},cq:function(fB,fA){this.cN(fB,fA);},cN:function(fB,fA){for(var y=fB;y!=fA;++y){this.bi(y);}}};vuzit.Document=vuzit.Base.createClass();vuzit.Document.prototype={getErrorMessage:function(){return this.data['errorMessage'];},getFileSize:function(){return parseInt(this.data['file_size']);},getFileType:function(){switch(parseInt(this.data['file_type'])){case 1:return 'pdf';break;}},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.getDate(this.data['modified_at']);},getPageCount:function(){return parseInt(this.data['page_count']);},getSubject:function(){return this.data['subject'];},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 range';}else if(bM!= -1&&(bM<0||bM>=this.getZoomCount())){throw 'bM is out of range';}else{return vuzit.Utilities.dB(this.getId(),ag,bM,null,null,true);}},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'];},isProcessingComplete:function(){return(this.ak()>=4||this.ak()== -1);},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,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,'fI':'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']);},ak:function(){var dV=parseInt(this.data['status']);return isNaN(dV)? -1:dV;},aP:function(){return-1;},eZ:function(){return(parseInt(this.data['uploaded']))?true:false;},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;}},bT:function(){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=this.cE(this.cM);url+='&callback=window.'+bP;script.src=url;window[bP]=this.bq.bind(this);var dD=function(at){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.product=="Gecko"){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);}};script.onerror=error;if(typeof head=="undefined"){document.body.appendChild(script);}else{head.appendChild(script);}},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()+'/documents';if(cM.id!=null){result+='/'+cM.id;}result+='.'+cM.fI+'?key='+vuzit.Base.apiKey;if(cM.url!=null){result+='&url='+cM.url;}if(this.options.signature!=null&&this.options.timestamp!=null){result+='&signature='+this.options.signature;result+='&timestamp='+this.options.timestamp;}result+='&ajax=true';return result;},startDataUpdateLoop:function(){if(this.options.bt){this.bT();}else{this.cd();}}};vuzit.Viewer=vuzit.Base.createClass();vuzit.extend(vuzit.Viewer,{fromId:function(id,au){this.options={fromUrl:false};vuzit.extend(this.options,au||{});var viewer=new vuzit.Viewer(id,this.options);return viewer;},fromUrl:function(url,au){this.options={fromUrl:true};vuzit.extend(this.options,au||{});var viewer=new vuzit.Viewer(url,this.options);return viewer;}});vuzit.Viewer.prototype={initialize:function(identifier,au){this.dk=false;this.ax=false;this.options={signature:null,timestamp:null,onComplete:null,fromUrl:true};if(au.ssl!=undefined){vuzit.Base.fM(au.ssl);delete au.ssl}vuzit.extend(this.options,au||{});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();}}this.B=null;this.options.onComplete=null;this.cc=false;this.ci=true;},bc:function(){this.hide();document.onkeypress=null;vuzit.Event.stopObserving(document,'keypress',this.by,false);vuzit.Event.stopObserving(document,'keydown',this.Ky,false);vuzit.Event.stopObserving(document,'keyup',this.Ky,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(document,'keydown',this.dJ,false);vuzit.Event.stopObserving(document,'keyup',this.eL,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.ax){this.bc();}}this.ax=false;this.cv=false;this.ec(div);this.bX();this.cW();this.show();this.t={page:1,x:0,y:0,zoom:0,signature:null,timestamp:null};vuzit.extend(this.options,options||{});vuzit.extend(this.t,options||{});vuzit.extend(this.t,this.options||{});if(this.cc){this.fk();this.cv=true;this.dk=true;}else{var self=this;var current=self.B;this.loadTimer=setInterval(function(){if((self.cc)&&(current==self.B)){self.fk();self.cv=true;self.dk=true;clearInterval(self.loadTimer);}else if(current!=self.B){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.t.zoom;},hide:function(){vuzit.Utilities.eX(this.div);},isDestroyed:function(){return this.ci;},pageNext:function(){this.setPageNumber(this.getPageNumber()+1);},pagePrevious:function(){this.setPageNumber(this.getPageNumber()-1);},setFullScreenUrl:function(url){this.P=url;},fx:function(url){this.fl=url;},setPageNumber:function(page){if(!this.ee(page)){return;}this.G.setPageNumber(page);this.t.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.k.parentNode.firstChild.offsetHeight;if(this.G!=null){this.t.x=this.G.pageX();this.t.page=this.G.eb();this.t.y=this.G.pageY();}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.fr(id);},setUrl:function(url){this.options.fromUrl=true;this.fr(url);},setZoom:function(zoom){if(!this.toolbar.cX(zoom)||this.G==null||this.t.zoom==zoom){return;}this.t.zoom=zoom;this.t.page=this.G.di(zoom,this.G.C-this.G.c);this.t.x=this.G.dK(zoom,this.G.J-this.G.d);this.t.y=this.G.dL(zoom,this.G.C-this.G.c);this.bf(undefined,this.M.isProcessingComplete());},show:function(){vuzit.Utilities.eW(this.div);},ec:function(div){this.div=div;},bX:function(){this.id="vuzit_"+new Date().getTime()+'_';this.t={};this.bO=document.createElement('div');this.bO.id=this.id+'toolbar';this.div.appendChild(this.bO);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;options={width: -1,height: -1,as:'vuzit-prod'};vuzit.extend(this.options,options||{});},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))&& !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(){document.onkeypress=this.by;vuzit.Event.observe(document,'keydown',this.Ky.bind(this),false);vuzit.Event.observe(document,'keyup',this.Ky.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(document,'keydown',this.dJ.bind(this),false);vuzit.Event.observe(document,'keyup',this.eL.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;}};},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){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;}},eL:function(e){if(!this.ay||this.G==null){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.t.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);},bo:function(isComplete){if(!isComplete){var self=this;var current=self.B;var fromUrl=self.options.fromUrl;setTimeout(function(){if(current==self.B){if(fromUrl){self.setUrl(self.B);}else{self.setId(self.B);}}},5000);}},cj:function(){return this.options.height<vuzit.dz.ao||this.options.width<vuzit.dz.ar;},fr:function(identifier){if(this.dk){this.bc();this.ax=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.B=identifier;},fk:function(){this.cr(this.t);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.k.parentNode.firstChild.offsetHeight;var isComplete;if((this.M.ak()== -1)&&(this.M.getErrorCode()==0)){isComplete=false;}else{isComplete=this.M.isProcessingComplete();}this.bf(true,isComplete);},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()+'/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{}},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());}},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());},ce:function(){url=self.M.getUrl();if(!(typeof(url)=="undefined")){if(url.substring(0,7)=='file://'){document.getElementById('download').value=url.substring(7);document.getElementById('file_form').submit();}else{window.open(url);}}},showDownload:true,showZooms:true,showPages:true,showFullScreen:false,showShortcuts:false};vuzit.extend(cH,options||{});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()+'/view/'+this.M.getId()+'/?z=2';}}this.toolbar.cD(this.P.replace(/\$\[URL\]/,escape(this.M.getUrl())));}if(cH.showShortcuts){this.toolbar.dW('http://vuzit.com/help/documents#shortcuts');}},bf:function(fb,isComplete){if(!this.cc&&typeof(fb)=="undefined"){return;}if(this.G!=null){this.G.destroy();}if(this.k!=null){this.k.innerHTML='';}this.toolbar.setZoom(this.getZoom());this.toolbar.ds(this.M.getPageCount());this.t.bx=this.M.getImageType();this.t.height=this.options.height;this.t.width=this.options.width;this.t.j=this.options.j;this.t.g=this.options.g;var self=this;this.t.aC=function(e){if(self.G!=null){self.toolbar.setPageNumber(self.G.getPageNumber());}};if(isComplete){this.G=new vuzit.dz(this.k,this.M,this.t);if((self.G.getPageNumber()!=1)&&(vuzit.Utilities.getBrowser()=="Safari")){this.t.aC.call();}else if((self.G.getPageNumber()!=1)&&(vuzit.Utilities.getBrowser()=="Opera")){this.G.aa=this.t.page;this.t.aC.call();}}this.k.style.cursor=ab?vuzit.Base.ad()+"/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.dG=vuzit.Base.createClass();vuzit.dG.prototype={initialize:function(div,ae,options){this.options={showFullScreen:false,showShortcuts:false,showDownload:true,du:false,cC:false,dS:false,showZooms:true,showPages:true,bN:null,aO:null,bz:null,bH:null,ca:null,cp:null,bg:null,ce: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);}}},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=(' of '+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);},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.en());this.aj.appendChild(this.es());if(this.options.showZooms){this.aj.appendChild(this.aV());}this.aj.appendChild(this.ek());if(this.options.du){this.aj.appendChild(this.aV());this.aj.appendChild(this.dg());}if(this.options.showDownload){this.aj.appendChild(this.aV());this.aj.appendChild(this.dP());}if(this.options.showFullScreen){this.aj.appendChild(this.aV());this.aj.appendChild(this.da());}if(this.options.showShortcuts){this.aj.appendChild(this.aV());this.aj.appendChild(this.ev());}},aK:function(className,title){var newEl=document.createElement("div");newEl.className="vuzit_toolbar_button "+className;newEl.title=title;return newEl;},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","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;},en: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="Get a free Vuzit viewer!";var as=vuzit.Base.ad()+"/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=this.aK('vuzit_toolbar_previousPage','Previous page');previous.onclick=this.options.aO;result.appendChild(previous);var form=document.createElement("form");form.id="vuzit_page_form";form.action="#";form.method="post";if(this.options.cC){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(' of 1');p.appendChild(this.bY);var next=this.aK('vuzit_toolbar_nextPage','Next page');next.onclick=this.options.bz;result.appendChild(next);if(!this.options.showPages){vuzit.Utilities.eX(result);}return result;},dg:function(){return this.cP('vuzit_toolbar_linkToPageGroup','Link fy this page',this.options.bg);},dP:function(){return this.cP('vuzit_toolbar_printGroup','Download',this.options.ce);},cD:function(link){this.ap.href=link;},dW:function(link){this.bv.href=link;},ev:function(){this.bv=document.createElement("a");return this.linkButton("vuzit_toolbar_textGroup","Keyboard Shortcuts",this.bv);},cP:function(className,title,dv){var result=document.createElement("div");result.className="vuzit_toolbar_textButton "+className;result.title=title;result.innerHTML=title;result.onclick=dv;return result;},ek:function(){var result=document.createElement("div");result.className="vuzit_toolbar_zoomGroup";var dH=this.aK('vuzit_toolbar_zoomOut','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.dS){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=this.aK('vuzit_toolbar_zoomIn','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({cC:true,dy:false,showDownload:false,showFullScreen:true});this.t.ae=null;this.t.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()+'/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);}}; 
