obips.AnalysisHistory=function(c,a){if(obips.history){var b=XUIPanel.getEditor("idPage");if(b&&b.getActiveTab){obips.history.initialize({reportXML:c,activeTab:b.getActiveTab()},{hashGenerator:obips.AnalysisHistory.historyHashGenerator});obips.history.addListener(new obips.Callback(this,this.onHistoryStateChange));this.ah_init=true}else{this.ah_init=false}}};obips.AnalysisHistory.getOrCreateInstance=function(c,a){var b=obips.AnalysisHistory.getInstance();if(!b){b=new obips.AnalysisHistory(c,a);if(b.ah_init){globalRegister.addObject("obips.AnalysisHistory",b)}}return b};obips.AnalysisHistory.getInstance=function(){return globalRegister.getObject("obips.AnalysisHistory")};obips.AnalysisHistory.historyHashGenerator=function(b){var a=XUIPanel.getEditor("idPage");if(a&&a.getActiveTab){return ReportPageEditor.historyHashGenerator(b)}else{return"obips.AnalysisHistory"+obips.history.UniqueNumberHashGenerator()}};obips.AnalysisHistory.prototype.onHistoryStateChange=function(b,e){if(!e){return}var d=XUIPanel.getEditor("idPage");if(d&&d.getActiveTab){return}else{if(e.reportXML&&e.reportStatePath){var g=obips.Analysis.getReport(e.reportStatePath);var c=g.getXML();var f=saw.getFirstChildElement(saw.parseXML(e.reportXML));c.parentNode.replaceChild(f,c);var a=new obips.CommonAnalysisEvents.HistoryUpdatedEvent(false,e.viewID);obips.AnalysisEventManager.raiseEvent(a)}}};obips.AnalysisHistory.add=function(c,d,a){var b=XUIPanel.getEditor("idPage");if(b&&b.getActiveTab&&b.addToHistory){b.addToHistory({activeTab:b.getActiveTab(),reportXML:c})}};