RecentItemsManager=function(a,b){this.name=a;this.theme=b;this.resultDIV=null;this.theLink=null;this.imageFileName="recentItems";this.imageId=this.imageFileName+"Img"+this.name;this.imageStates={norm:"-96px -123px",over:"-96px -150px",down:"-96px -177px"};this.button=null;this.isOpen=false;this.cachedResult=null;bindMethods(this)};RecentItemsManager.prototype.initialize=function(){this.resultDIV=getElement(this.name+"results");this.button=getElement(this.imageId);this.topSpan=getElement("recentItemsSpan"+this.name);updateNodeAttributes(this.button,{onmousedown:this.showRecentItems});updateNodeAttributes(this.button,{onmouseover:this.highlightButton});updateNodeAttributes(this.button,{onmouseout:this.unhighlightButton});addToCallStack(document,"onmousedown",this.hideRecentItems)};RecentItemsManager.prototype.highlightButton=function(){if(document.images.length!=0&&showElement){this.button.style.backgroundPosition=this.imageStates.over;showElement($("recentItemsNavButtonText"))}};RecentItemsManager.prototype.unhighlightButton=function(){if(document.images.length!=0){this.button.style.backgroundPosition=this.imageStates.norm;hideElement($("recentItemsNavButtonText"))}};RecentItemsManager.prototype.pressButton=function(){if(document.images.length!=0){this.button.style.backgroundPosition=this.imageStates.down;hideElement($("recentItemsNavButtonText"));updateNodeAttributes(this.button,{onmousedown:this.hideRecentItems});updateNodeAttributes(this.button,{onmouseover:null});updateNodeAttributes(this.button,{onmouseout:null})}};RecentItemsManager.prototype.unpressButton=function(){this.button.style.backgroundPosition=this.imageStates.norm;this.button.onmousedown=this.showRecentItems;this.button.onmouseover=this.highlightButton;this.button.onmouseout=this.unhighlightButton};RecentItemsManager.prototype.hideRecentItems=function(b){if(this.isOpen&&getEventTarget){var a=getEventTarget(b);for(;a!=null&&a!=this.button&&a!=this.topSpan;a=a.parentNode){}if(a==this.topSpan){}else{if(a==null){this.unpressButton();this.resultDIV.innerHTML="";this.isOpen=false}else{this.unpressButton();this.highlightButton();this.resultDIV.innerHTML="";this.isOpen=false}}}};RecentItemsManager.prototype.showRecentItems=function(b){if(!this.isOpen){this.pressButton();if(this.cachedResult==null){var c=opriusLoadJSONDoc("/recent/",{tg_format:"json",tg_random:(new Date()).getTime()});var a=function(f,e){if(e==undefined){return false}f.resultDIV.innerHTML=e.itemsHTML;f.resultDIV=getElement(f.name+"results");var d=createDOM("IFRAME");appendChildNodes(f.resultDIV,d);f.cachedResult=f.resultDIV.innerHTML;f.isOpen=true};c.addCallback(partial(a,this))}else{var a=function(d){d.resultDIV.innerHTML=d.cachedResult;d.isOpen=true};callLater(0.01,a,this)}}};
