CropLayer=function(a){this.layer=new OpenLayers.Layer.Boxes(a.name,{displayInLayerSwitcher:false});this.page=1;this.annobox=null;this.boxes=[];this.boxlonlat=0;this.attachAnno=new YAHOO.util.CustomEvent("attachAnno");this.exitCrop=new YAHOO.util.CustomEvent("exitcrop");this.cropReady=new YAHOO.util.CustomEvent("cropready");this.stopCropListen=new YAHOO.util.CustomEvent("stopCropListen");this.mousePos=a.mouse;this.doc=a.doc;};CropLayer.prototype={createCropBox:function(d,a){obj=a.obj;layer=a.layer;var c=YAHOO.util.Event.getPageX(d);var b=YAHOO.util.Event.getPageY(d)-20;obj.boxlonlat=obj.layer.getLonLatFromViewPortPx(obj.mousePos.lastXy);var f=new CropLayerBox(obj.boxlonlat,layer,obj.mousePos);f.removeBox.subscribe(obj.destroy,obj);f.cropSaved.subscribe(function(j,h,g){g.cropReady.fire(h[0].obj);},obj);obj.layer.addMarker(f.box);obj.exitCrop.fire();obj.stopCropListen.fire();},exitCropMode:function(){this.exitCrop.fire();},terminate:function(){if(this.layer.markers.length>0){for(i=0;i<this.layer.markers.length;i++){this.layer.removeMarker(this.layer.markers[i]);}}},destroy:function(d,c,a){var b=c[0];a.layer.removeMarker(b);}};