var MapMarkers=Class.create();MapMarkers.prototype={df:null,jw:null,pF:null,mA:null,initialize:function(xw){this.df=new Hash();this.pF=xw;this.jw=this.addEventType("onmarkerschanged");this.yb=this.addEventType("ondraw");},mf:false,gB:null,begin:function(bj,cO){if(!$defined(bj)||bj==null||bj==""){throw{message:"Invalid or undefined argument 'collectionId'."};}try{this.gB=bj;if(this.df.get(bj)==null){this.df.set(bj,{upperLevel:cO,collection:[]});}}catch(e){alert("MapMarker.begin exception: "+e.message);}this.mf=true;},getCollectionSize:function(bj){var rR=this.df.get(bj);if(rR==null){return 0;}else{return rR.collection.length;}},end:function(){this.mf=false;this.jw.fire(this.gB,this.df.get(this.gB).collection.length);this.gB=null;},add:function(dN,bf,dQ,ef,aS,aW,aG,fL,gv,fo,fv){if(this.gB==null){throw{message:"Function begin not called to initiate collection."};}var gM=this.df.get(this.gB);gM.collection.push({id:dN,icon:bf,northing:dQ,easting:ef,title:aS,description:aW,callback:aG,lowerbound:fL,upperbound:gM.upperLevel,iconXOffset:fo,iconYOffset:fv});if(!this.mf){this.jw.fire(this.df.get(this.gB).collection.length);}},clear:function(bj,lI){if(lI&&bj){if(this.df.get(bj)!=null){var rv=new Array();var xP=function(gM){rv.push(gM.id);};this.df.get(bj).collection.each(xP);var i,ao=lI.length;for(i=0;i<ao;i++){lI[i](bj,rv);}this.jw.fire(this.mA,this.df.get(bj).collection.length);this.mA=null;this.df.unset(bj);}}},draw:function(bj,lG){if(bj&&lG){if(this.df.get(bj)!=null&&this.df.get(bj).collection.length>0){var jo=this.df.get(bj);var cb=jo.collection;try{var j,l2=lG.length;for(j=0;j<l2;j++){var func=lG[j];if(typeof func=="function"){var i,ao=(cb!=null)?cb.length:0;for(i=0;i<ao;i++){var curr=cb[i];func(bj,cb[i].id,this.pF,curr.icon,curr.northing,curr.easting,curr.title,curr.description,curr.callback,curr.lowerbound,jo.upperLevel,curr.iconXOffset,curr.iconYOffset);}}else{throw{message:"Invalid argument func. Must be function pointer"};}}}catch(e){throw{message:"Argument function threw exception upon invokation. '"+e.message+"'"};}this.yb.fire(this.mA,cb.length);}}}};Object.extend(MapMarkers.prototype,new AbstractEventTrigger());