var KAMAP_ADDQUERY=gnLastEventId++;function addQuery(B){kaTool.apply(this,[B]);this.name="addQuery";this.cursorNormal=["crosshair","crosshair","crosshair","crosshair"];this.cursorDrag=["url('images/grabbing.cur'),move","grabbing","-moz-grabbing","move"];this.cursor=this.cursorNormal;this.activeImage=this.kaMap.server+"images/button_pan_3.png";this.disabledImage=this.kaMap.server+"images/button_pan_2.png";this.lastx=null;this.lasty=null;this.bMouseDown=false;for(var A in kaTool.prototype){if(!addQuery.prototype[A]){addQuery.prototype[A]=kaTool.prototype[A]}}}addQuery.prototype.onmouseout=function(A){A=(A)?A:((event)?event:null);if(!A.target){A.target=A.srcElement}if(A.target.id==this.kaMap.domObj.id){this.bMouseDown=false;return kaTool.prototype.onmouseout.apply(this,[A])}};addQuery.prototype.onmousemove=function(C){C=(C)?C:((event)?event:null);if(!this.bMouseDown){return false}if(!this.kaMap.layersHidden){this.kaMap.hideLayers()}var A=safeParseInt(this.kaMap.theInsideLayer.style.top);var B=safeParseInt(this.kaMap.theInsideLayer.style.left);A=A-this.lasty+C.clientY;B=B-this.lastx+C.clientX;this.kaMap.theInsideLayer.style.top=A+"px";this.kaMap.theInsideLayer.style.left=B+"px";this.kaMap.checkWrap.apply(this.kaMap,[]);this.lastx=C.clientX;this.lasty=C.clientY;return false};addQuery.prototype.onmousedown=function(A){A=(A)?A:((event)?event:null);if(A.button==2){return this.cancelEvent(A)}else{this.cursor=this.cursorDrag;this.kaMap.setCursor(this.cursorDrag);if(this.kaMap.isIE4){document.onkeydown=kaTool_redirect_onkeypress}document.onkeypress=kaTool_redirect_onkeypress;this.bMouseDown=true;this.lastx=A.clientX;this.lasty=A.clientY;A.cancelBubble=true;A.returnValue=false;if(A.stopPropogation){A.stopPropogation()}if(A.preventDefault){A.preventDefault()}return false}};addQuery.prototype.onmouseup=function(A){this.cursor=this.cursorNormal;this.kaMap.setCursor(this.cursorNormal);A=(A)?A:((event)?event:null);this.bMouseDown=false;this.kaMap.showLayers();this.kaMap.triggerEvent(KAMAP_EXTENTS_CHANGED,this.kaMap.getGeoExtents());return false};addQuery.prototype.ondblclick=function(C){C=(C)?C:((event)?event:null);var B=this.adjustPixPosition(C.clientX,C.clientY);var A=this.kaMap.pixToGeo(B[0],B[1]);this.kaMap.triggerEvent(KAMAP_ADDQUERY,A);return false};