var Persistence=Class.create();Persistence.prototype={initialize:function(a,b){this.skyMapsId=a;this.firstTime=true;this.persistence=false;this.dataDictionary={};this.setOptions(b)},setOptions:function(a){this.options={indicatorId:"persistence-value"};Object.extend(this.options,a||{})},isFirstTime:function(){return this.firstTime},thereIsPersistence:function(){return this.persistence},getFrameChildren:function(){return window.frames[0]},updateIndicator:function(){if(this.thereIsPersistence()){this.getFrameChildren().$(this.options.indicatorId).innerHTML="on"}else{this.getFrameChildren().$(this.options.indicatorId).innerHTML="off"}},switchPersistence:function(){if(this.thereIsPersistence()){this.setPersistence(false)}else{this.setPersistence(true)}},setPersistence:function(a){this.persistence=a;this.updateIndicator()},initializePersistence:function(){this.firstTime=false;this.setPersistence(true);this.update()},resetSkyMapsValues:function(){skyMaps=this.getFrameChildren().$(this.skyMapsId);skyMaps.variables.zoomLevel=this.zoomLevel;skyMaps.variables.x=this.corner.x;skyMaps.variables.y=this.corner.y;skyMaps.start=this.start;skyMaps.mouse=this.mouse;skyMaps.flags.flagsLength=this.flagsLength;skyMaps.flags.flags=this.flags;skyMaps.flags.flags.values().each(function(a){this.getFrameChildren().$(skyMaps.flags.flagsId).appendChild(a.image);skyMaps.flags.createFlagOption(a.image.id,a.lon+180,a.lat,a.time)}.bind(this));skyMaps.dwfs.options.DWFVisible=this.DWFVisible;if(this.DWFVisible){this.getFrameChildren().$("checkbox_"+skyMaps.dwfs.dwfsId).setAttribute("checked","checked")}else{this.getFrameChildren().$("checkbox_"+skyMaps.dwfs.dwfsId).removeAttribute("checked")}skyMaps.maps.values().each(function(a){if(a.isArchive()){skyMaps.search.updateValues(a.getArchiveId(),false)}}.bind(this));this.archiveSelected.each(function(a){skyMaps.search.updateValues(a,true)}.bind(this))},update:function(){this.updatePosition();this.updateFlags();this.updateDWFs();this.updateArchivesSelected()},updatePosition:function(){skyMaps=this.getFrameChildren().$(this.skyMapsId);this.tileSize=skyMaps.options.tileSize;this.zoomLevel=skyMaps.variables.zoomLevel;this.width=skyMaps.options.width;this.height=skyMaps.options.height;this.offsetWidth=skyMaps.offsetWidth;this.offsetHeight=skyMaps.offsetHeight;this.corner={x:skyMaps.variables.x,y:skyMaps.variables.y};this.start=skyMaps.start;this.mouse=skyMaps.mouse},updateFlags:function(){flags=this.getFrameChildren().$(this.skyMapsId).flags;this.flagsLength=flags.flagsLength;this.flags=$H(flags.flags)},updateDWFs:function(){dwfs=this.getFrameChildren().$(this.skyMapsId).dwfs;this.DWFVisible=dwfs.options.DWFVisible},updateArchivesSelected:function(){skyMaps=this.getFrameChildren().$(this.skyMapsId);this.archiveSelected=new Array();skyMaps.maps.values().each(function(a){if(a.isArchive()&&a.isVisible()){this.archiveSelected.push(a.getArchiveId())}}.bind(this))},setSelectedArchives:function(a){this.archiveSelected=new Array();$A(a).each(function(b){this.archiveSelected.push(b)}.bind(this))},createArchivesNameList:function(){skyMaps=this.getFrameChildren().$(this.skyMapsId);this.archiveNameList=new Array();skyMaps.maps.values().each(function(a){if(a.isArchive()&&a.isVisible()){this.archiveNameList.push(a.getArchiveName())}}.bind(this))},setValue:function(a,b){this.dataDictionary[a]=b},getValue:function(a){return this.dataDictionary[a]}};