if(typeof(obips.Map)=="undefined"){obips.Map=function(){}}obips.Map.Factory=function(){this.controllers=new Object();this.currentMapID=null;this.myQueue=new Object();globalRegister.addObject(obips.Map.Factory.SINGLETON_NAME,this)};obips.Map.Factory.prototype.getRecentMapID=function(){return this.currentMapID};obips.Map.Factory.prototype.getController=function(a){return this.controllers[a]};obips.Map.Factory.prototype.doGarbageCollection=function(){for(var b in this.controllers){var a=document.getElementById(b+"_mapContainer");if(a==null){try{this.controllers[b].destroy()}catch(c){}delete this.controllers[b]}}};obips.Map.Factory.prototype.addToQueue=function(a,b){this.myQueue[a]=b};obips.Map.Factory.prototype.paintQueue=function(){var c=this.myQueue;for(var a in c){try{obips.Map.Factory.startPaint(a,c[a]);delete c[a]}catch(b){alert(b)}}};obips.Map.Factory.prototype.registerController=function(b,a){this.doGarbageCollection();this.currentMapID=b;this.controllers[b]=a};obips.Map.Factory.verifyOMVJS=function(a){var b=document.getElementById(a+"_configError");if(typeof(MVMapView)=="undefined"){if(b){b.style.display="";return false}}else{if(b){b.parentNode.removeChild(b)}return true}return false};obips.Map.Factory.paintMap=function(b,c){if(obips.Map.isEditorMode()){var a=obips.Map.Factory.getSingleton();a.addToQueue(b,c)}else{obips.Map.Factory.startPaint(b,c)}};obips.Map.Factory.startPaint=function(a,b){try{var i=obips.Map.Factory.verifyOMVJS(a);if(!i){return}var k=document.getElementById(a+"Splitter");var j=document.getElementById(a+"_mapDiv");var g=false;if(k){g=(k.offsetWidth>0)&&(k.offsetHeight>0)}obips.Map.setUseMobile(k==undefined);if((obips.Map.useMobile()||g)&&(j.offsetWidth>0)&&(j.offsetHeight>0)){var f=new obips.Map.Model();f.initFromJSON(a,b);var d=new obips.Map.Viewer(a,f)}else{var c=obips.Map.Factory.getSingleton();c.addToQueue(a,b)}}catch(h){alert("obips.Map.Factory.paintMap: "+h)}};obips.Map.Factory.getSingleton=function(){var a=obips.getSingleton(obips.Map.Factory.SINGLETON_NAME);if(!a){a=new obips.Map.Factory()}return a};obips.Map.Factory.SINGLETON_NAME=obips.Map.k_sFactoryName;obips.Map.Factory.queueHandler=function(){var a=obips.Map.Factory.getSingleton();a.paintQueue()};obips.Map.Factory.gcHandler=function(){var a=obips.Map.Factory.getSingleton();a.doGarbageCollection()};obips.Map.Factory.queueHandler=function(){var a=obips.Map.Factory.getSingleton();a.paintQueue()};saw.addEventListener(window,"load",obips.Map.Factory.queueHandler);saw.addEventListener(window,"unload",obips.Map.Factory.gcHandler);