var _EMS_SFL_=true;
EMS=new Object();
EMS.Control=new Object();
EMS.Handler=new Object();
EMS._scriptName=(typeof (_EMS_SFL_)=="undefined"?"lib/EMS.js":"EMS.js");
EMS._getScriptLocation=function(){
var _57545=this._searchForEmsLibraryLocation(document.getElementsByTagName("head")[0].childNodes);
if(_57545==null){
_57545=this._searchForEmsLibraryLocation(document.getElementsByTagName("script"));
}
return _57545==null?"":_57545;
};
EMS._searchForEmsLibraryLocation=function(_57546){
var _57547=null;
var _57548=EMS._scriptName;
for(var i=0;i<_57546.length;i++){
if(_57546[i].tagName=="SCRIPT"){
var src=_57546[i].getAttribute("src");
if(src!=null){
if(src.indexOf("?")>-1){
src=src.substring(0,src.indexOf("?"));
}
if(src){
var index=src.lastIndexOf(_57548);
if((index>-1)&&(index+_57548.length==src.length)){
_57547=src.slice(0,-_57548.length);
break;
}
}
}
}
}
return _57547;
};
if(typeof (_EMS_SFL_)=="undefined"){
(function(){
var _57549=new Array("ems/EMSUtils.js","ems/Ajax.js","ems/HoverIcon.js","ems/EMSServices.js","ems/EMSGeometry.js","ems/EMSZoomBar.js","ems/EMSPopup.js","ems/EMSPanButton.js","ems/HighlightFeature.js","ems/MouseDefaults.js","ems/OverviewMap.js","ems/NorthArrow.js","ems/Copyright.js","ems/Button.js","ems/Scale.js","ems/Shadow.js","ems/MultiPopup.js","ems/MarkerProximityCombiner.js","ems/MarkerGroup.js","ems/CombinerCalculator.js","ems/IndexedLayer.js","ems/ContextMenu.js","ems/RightClick.js","ems/ContextPopup.js","ems/TabbedPopup.js","ems/RoutePopup.js","ems/DraggingControl.js","ems/DragMarkerHandler.js");
var _57550="";
var host=EMS._getScriptLocation()+"lib/";
for(var i=0;i<_57549.length;i++){
if(/MSIE/.test(navigator.userAgent)||/Safari/.test(navigator.userAgent)){
var _57551="<script src='"+host+_57549[i]+"'></script>";
_57550+=_57551;
}else{
var s=document.createElement("script");
s.src=host+_57549[i];
var h=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;
h.appendChild(s);
}
}
if(_57550){
document.write(_57550);
}
})();
}
EMS.Ajax=new Object();
EMS.Ajax.cancelableRequests=[];
EMS.Ajax.groupedRequests={};
EMS.Ajax.maxCrossDomainURLLength=1800;
EMS.Ajax.crossDomainTimeout=10000;
EMS.Ajax.jsessionId=null;
if(typeof EMS.Services=="undefined"){
EMS.Services=new Object();
}
EMS.Services._jsonBaseUrl=EMS._getScriptLocation()+"../..";
EMS.Ajax.json=function(url,_57552,_57553){
url=EMS.Services._jsonBaseUrl+url;
_57553=_57553?_57553:{};
_57553.parameters=_57553.parameters?_57553.parameters:{};
_57553.parameters.domain=EMS.Util.getDomain();
if(!_57553.parameters.token){
_57553.parameters.token=EMS.token;
}
if(_57553.parameters&&typeof _57553.parameters!="string"){
_57553.parameters=EMS.Util.getParameterString(_57553.parameters);
}
var _57554=_57553.onException?_57553.onException:EMS.Services._onException;
var _57555=_57553.communicationMode||EMS.Services.communicationMode;
var _57556=function(){
};
isJsonResponseOK=function(_57557){
if(_57557.stat&&(_57557.stat=="fail")){
var _57558="["+_57557.code+"] "+_57557.error;
if(_57557.stackTrace){
_57558+="\n\n"+_57557.stackTrace;
}
_57554(_57556,_57558);
return false;
}
return true;
};
try{
if(EMS.Ajax.jsessionId!=null){
var jsess=EMS.Ajax.jsessionId;
}else{
if(window.opener!=null&&window.opener.EMS!=null&&window.opener.EMS.Ajax.jsessionId!=null){
var jsess=window.opener.EMS.Ajax.jsessionId;
}else{
jsess=null;
}
}
}
catch(e){
}
if(jsess!=null){
var _57559="jsessionid";
if(_57555=="XMLHttpRequest"){
_57559="ems.jsessionid";
}
url+=";"+_57559+"="+jsess;
}
if(_57555=="XMLHttpRequest"){
var _57560;
var _57561;
var _57562=OpenLayers.Function.bind(function(_57556,json,_57563){
var result=eval("("+_57556.responseText+")");
EMS.Ajax.Responders.dispatch("onComplete",_57560,_57556,result);
if(_57563&&_57563.options&&_57563.options.group&&_57563.options.requestTime<EMS.Ajax.groupedRequests[_57563.options.group]){
return;
}
if(isJsonResponseOK(result)){
_57552(result.message);
}
},this);
_57561=OpenLayers.Util.extend(_57553,{onComplete:_57562,onException:_57554});
_57560=new OpenLayers.Ajax.Request(url,_57561);
EMS.Ajax.Responders.dispatch("onCreate",_57560,_57560.transport,null);
}else{
if(_57555=="CrossDomain"){
var _57564=function(){
};
var _57565=_57553.parameters.length;
var parts=new Array();
if(_57565>EMS.Ajax.maxCrossDomainURLLength){
var parts=new Array();
var _57566=0;
var _57567=true;
var start=0;
while(_57567){
var end=_57553.parameters.lastIndexOf("%22",start+EMS.Ajax.maxCrossDomainURLLength);
if(end==start){
parts[_57566]=_57553.parameters.substring(start);
_57566++;
_57567=false;
}else{
parts[_57566]=_57553.parameters.substring(start,end);
}
start=end;
_57566++;
}
}else{
parts[0]=_57553.parameters;
}
var _57568={"transport":_57564,"options":_57553};
if(typeof handlerFunctions=="undefined"){
handlerFunctions={};
}
if(typeof handler=="undefined"){
handler=0;
}else{
handler++;
}
handlerFunctions["ajaxHandler"+handler]=OpenLayers.Function.bind(function(group,_57569,ajax){
if(group&&_57569<EMS.Ajax.groupedRequests[group]){
return;
}
if(isJsonResponseOK(ajax)){
if(ajax.chunked){
}else{
try{
EMS.Ajax.Responders.dispatch("onComplete",_57568,_57564,ajax);
_57552(ajax.message);
}
catch(e){
alert("exception "+e);
}
}
}
},this,_57553.group,new Date().getTime());
EMS.Ajax.Responders.dispatch("onCreate",_57568,_57564,null);
for(var i=0;i<parts.length;i++){
var dtRf=new Date();
oScript=document.createElement("script");
var _57570=parts[i].replace(/=/g,"%3D%3D").replace(/&/g,"%26%26");
var _57571=url+"?cb=ajaxHandler"+handler+"&rf="+dtRf.getTime()+"&nop="+parts.length+"&pn="+(i+1)+"&part="+_57570;
oScript.setAttribute("src",_57571);
oScript.setAttribute("id","emsajaxscript"+handler);
var head=document.getElementsByTagName("head").item(0);
head.appendChild(oScript);
}
setTimeout(OpenLayers.Function.bind(function(_57572){
window["ajaxHandler"+_57572]=null;
var id="emsajaxscript"+_57572;
var _57573=document.getElementById(id);
var head=document.getElementsByTagName("head").item(0);
if(_57573){
head.removeChild(_57573);
}
},this),EMS.Ajax.crossDomainTimeout);
}else{
alert("Invalid communication mode. Expected XMLHttpRequest or CrossDomain");
}
}
};
EMS.Services._json=EMS.Ajax.json;
EMS.Ajax.callInProgress=function(_57574){
switch(_57574.readyState){
case 1:
case 2:
case 3:
return true;
default:
return false;
}
};
EMS.Ajax.cancelAll=function(){
for(var i=0;i<EMS.Ajax.cancelableRequests.length;i++){
if(EMS.Ajax.callInProgress(EMS.Ajax.cancelableRequests[i].transport)){
EMS.Ajax.cancelableRequests[i].options.onException=function(){
};
EMS.Ajax.cancelableRequests[i].transport.abort();
}
}
EMS.Ajax.cancelableRequests=[];
};
EMS.Ajax.requestCreate=function(_57575){
_57575.options.requestTime=new Date().getTime();
if(!_57575.options.uninterruptable){
EMS.Ajax.cancelableRequests.push(_57575);
}
};
EMS.Ajax.requestComplete=function(_57576){
var i=-1;
var found=false;
for(i=0;i<EMS.Ajax.cancelableRequests.length;i++){
if(EMS.Ajax.cancelableRequests[i].options.requestTime==_57576.options.requestTime){
found=true;
break;
}
}
if(found){
EMS.Ajax.cancelableRequests.splice(i,1);
}
if(_57576.options.group){
if(!EMS.Ajax.groupedRequests[_57576.options.group]){
EMS.Ajax.groupedRequests[_57576.options.group]=_57576.options.requestTime;
}else{
if(_57576.options.requestTime<EMS.Ajax.groupedRequests[_57576.options.group]){
_57576.options.staleRequest=true;
}else{
EMS.Ajax.groupedRequests[_57576.options.group]=_57576.options.requestTime;
}
}
}
};
EMS.Ajax.Responders={responders:[],register:function(_57577){
for(var i=0;i<this.responders.length;i++){
if(_57577==this.responders[i]){
return;
}
}
this.responders.push(_57577);
},dispatch:function(_57578,_57579,_57580,json){
for(var i=0;i<this.responders.length;i++){
var _57581=this.responders[i];
if(_57581[_57578]&&typeof _57581[_57578]=="function"){
try{
_57581[_57578].apply(_57581,[_57579,_57580,json]);
}
catch(e){
}
}
}
}};
EMS.Ajax.Responders.register({onCreate:EMS.Ajax.requestCreate,onComplete:EMS.Ajax.requestComplete});
EMS.Ajax.requestCompleteExtractJsessionId=function(_57582,_57583,json){
if(json.jsessionid){
EMS.Ajax.jsessionId=json.jsessionid;
}
};
EMS.Ajax.Responders.register({onComplete:EMS.Ajax.requestCompleteExtractJsessionId});
EMS.Util=new Object();
EMS.Util.convertY=[0,10,20.154266,30.796044,42.343049,55.397122,70.95436,90.95436,120.192404,177.780109];
EMS.Util.latToSGP4=function(lat){
var ilat=Math.ceil(lat/10);
var _57584=EMS.Util.convertY;
if(ilat>=9){
ilat=8;
}
if(lat>=0){
return _57584[ilat]+((lat-10*ilat)/10)*(_57584[ilat+1]-_57584[ilat]);
}else{
lat=-lat;
ilat=-ilat;
return -(_57584[ilat]+((lat-10*ilat)/10)*(_57584[ilat+1]-_57584[ilat]));
}
};
EMS.Util.sgp4ToLat=function(lat_){
var _57585=EMS.Util.convertY;
var i;
if(lat_>=0){
for(i=0;i<10;i++){
if(lat_<_57585[i]){
return ((i-1)*10)+10*(lat_-_57585[i-1])/(_57585[i]-_57585[i-1]);
}
}
i=9;
return ((i-1)*10)+10*(lat_-_57585[i-1])/(_57585[i]-_57585[i-1]);
}else{
lat_=-lat_;
for(i=0;i<10;i++){
if(lat_<_57585[i]){
return -(((i-1)*10)+10*(lat_-_57585[i-1])/(_57585[i]-_57585[i-1]));
}
}
i=9;
return -(((i-1)*10)+10*(lat_-_57585[i-1])/(_57585[i]-_57585[i-1]));
}
};
EMS.Util.isIE8=function(){
if(OpenLayers.Util.getBrowserName()=="msie"){
if(typeof XDomainRequest!="undefined"){
return true;
}
}
return false;
};
EMS.Util.isIE6=function(){
if(window.ActiveXObject){
if(!window.XMLHttpRequest){
return true;
}
}
return false;
};
EMS.Util.isGecko=function(){
return document.getBoxObjectFor!=null||window.mozInnerScreenX!=null;
};
EMS.Util.$type=function(obj){
if(obj===null||obj===undefined){
return false;
}
var type=typeof obj;
if(type=="object"){
if(obj.htmlElement){
return "element";
}
if(obj.push){
return "array";
}
if(obj.nodeName){
switch(obj.nodeType){
case 1:
return "element";
case 3:
return obj.nodeValue.test(/\S/)?"textnode":"whitespace";
}
}
}
return type;
};
EMS.Util.Json={toString:function(obj){
switch(EMS.Util.$type(obj)){
case "string":
return "\""+obj.replace(new RegExp("([\"\\\\])","g"),"\\$1")+"\"";
case "array":
return "["+this._map(obj,function(ar){
return EMS.Util.Json.toString(ar);
}).join(",")+"]";
case "object":
var string=[];
for(var _57586 in obj){
if(EMS.Util.$type(obj[_57586])!="function"){
string.push("\""+_57586+"\":"+EMS.Util.Json.toString(obj[_57586]));
}
}
return "{"+string.join(",")+"}";
case "function":
return null;
}
return String(obj);
},evaluate:function(str){
return eval("("+str+")");
},_map:function(array,func){
var result=[];
for(var i=0;i<array.length;i++){
result.push(func(array[i]));
}
return result;
}};
EMS.Util.getParameterString=function(params){
var _57587=new Array();
for(var key in params){
var value=params[key];
if((value!=null)&&(typeof value!="function")){
var _57588;
if(typeof value=="object"){
_57588=encodeURIComponent(EMS.Util.Json.toString(value));
}else{
_57588=encodeURIComponent(value);
}
_57587.push(encodeURIComponent(key)+"="+_57588);
}
}
return _57587.join("&");
};
EMS.Event={pointerX:function(event){
return event.pageX||(event.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));
},pointerY:function(event){
return event.pageY||(event.clientY+(document.documentElement.scrollTop||document.body.scrollTop));
}};
OpenLayers.Util.onImageLoadError=function(){
this._attempts=(this._attempts)?(this._attempts+1):1;
if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){
this.src=this.src;
}else{
if(this.src.indexOf("LAYERS=street")>=0){
this.src=EMS.Util.getImagesLocation()+"no_data_map.png";
}else{
this.src=EMS.Util.getImagesLocation()+"no_data.png";
}
}
this.style.display="";
};
EMS.ImgPath="";
EMS.Util.getImagesLocation=function(){
return EMS.ImgPath||(EMS._getScriptLocation()+"img/");
};
EMS.Util.getDomain=function(){
var regexS=".*//([^:/]*)";
var regex=new RegExp(regexS);
var tmpURL=window.location.href;
var _57589=regex.exec(tmpURL);
return _57589[1];
};
EMS.Util.toAbsoluteUrl=function(url){
if(url.startsWith("/")){
return window.location.href.match(/http:\/\/.*?\//)[0]+url.substring(1);
}else{
return (url.indexOf("http://")>=0?"":window.location.href.match(/.*\//)[0])+url;
}
};
EMS.Util.dump=function(arr,level){
var _57590="";
if(!level){
level=0;
}
var _57591="";
for(var j=0;j<level+1;j++){
_57591+="    ";
}
if(typeof (arr)=="object"){
for(var item in arr){
var value=arr[item];
if(typeof (value)=="object"){
_57590+=_57591+"'"+item+"' ...\n";
_57590+=dump(value,level+1);
}else{
_57590+=_57591+"'"+item+"' => \""+value+"\"\n";
}
}
}else{
_57590="===>"+arr+"<===("+typeof (arr)+")";
}
return _57590;
};
EMS.Util.defaultResolutions=[0.1,0.05,0.025,0.0125,0.00625,0.003125,0.0015625,0.00078125,0.000390625,0.0001953125,0.00009765625,0.000048828125,0.0000244140625,0.00001220703125,0.000006103515625,0.0000030517578125,0.00000152587890625];
EMS.Util.ZoomCalculator=OpenLayers.Class({initialize:function(_57592,_57593){
this.resolutions=_57592;
var _57594=OpenLayers.Element.getDimensions(_57593);
if((_57594.width==undefined)||(_57594.height==undefined)||_57594.width==0||_57594.height==0){
this.width=parseInt($(_57593).style.width);
this.height=parseInt($(_57593).style.height);
}else{
this.width=_57594.width;
this.height=_57594.height;
}
},getZoomForExtent:function(extent){
var _57595=new OpenLayers.Size(this.width,this.height);
var _57596=Math.max(extent.getWidth()/_57595.w,extent.getHeight()/_57595.h);
return this.getZoomForResolution(_57596);
},getZoomForResolution:function(_57597){
for(var i=1;i<this.resolutions.length;i++){
if(this.resolutions[i]<_57597){
break;
}
}
return (i-1);
}});
OpenLayers.Event.isLeftClick=function(event){
return (((event.which)&&(event.which==1))||((typeof event.button!="undefined")&&(event.button<2)));
};
OpenLayers.Util.alphaHack=function(){
if(navigator.appVersion.indexOf("MSIE")!=-1){
var _57598=navigator.appVersion.split("MSIE");
var _57599=parseFloat(_57598[1]);
var filter=false;
try{
filter=document.body.filters;
}
catch(e){
}
return (filter&&(_57599>=5.5)&&(_57599<7)&&!window.XMLHttpRequest);
}
return false;
};
OpenLayers.LonLat.prototype.asWGS84=function(){
return {lon:this.lon,lat:EMS.Util.sgp4ToLat(this.lat)};
};
EMS.LonLat=OpenLayers.Class(OpenLayers.LonLat,{initialize:function(lon,lat){
OpenLayers.LonLat.prototype.initialize.apply(this,[lon,EMS.Util.latToSGP4(lat)]);
}});
OpenLayers.Bounds.prototype.asWGS84=function(){
return new OpenLayers.Bounds(this.left,EMS.Util.sgp4ToLat(this.bottom),this.right,EMS.Util.sgp4ToLat(this.top));
};
EMS.Bounds=OpenLayers.Class(OpenLayers.Bounds,{initialize:function(left,bottom,right,top){
OpenLayers.Bounds.prototype.initialize.apply(this,[left,EMS.Util.latToSGP4(bottom),right,EMS.Util.latToSGP4(top)]);
}});
EMS.HoverIcon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,alphaImageDiv:null,imageDiv:null,px:null,stickyState:null,initialize:function(url,size,offset,_57600,_57601){
this.stickyState=null;
this.numberOfStates=_57601||2;
this.url=url;
this.size=(size)?size:new OpenLayers.Size(20,20);
this.offset=offset?offset:new OpenLayers.Pixel(-(this.size.w/this.numberOfStates),-(this.size.h/this.numberOfStates));
this.calculateOffset=_57600;
var id=OpenLayers.Util.createUniqueID("OL_Icon_");
this.alphaImageDiv=OpenLayers.Util.createAlphaImageDiv(id,null,new OpenLayers.Size(size.w,size.h*this.numberOfStates));
this.imageDiv=OpenLayers.Util.createDiv(null,null,size,null,null,null,"hidden");
this.imageDiv.appendChild(this.alphaImageDiv);
},destroy:function(){
OpenLayers.Event.stopObservingElement(this.alphaImageDiv.firstChild);
OpenLayers.Event.stopObservingElement(this.alphaImageDiv);
OpenLayers.Util.removeNode(this.alphaImageDiv);
OpenLayers.Util.removeNode(this.imageDiv);
this.alphaImageDiv=null;
this.imageDiv=null;
},clone:function(){
return new EMS.HoverIcon(this.url,this.size,this.offset,this.calculateOffset,this.numberOfStates);
},setSize:function(size){
if(size!=null){
this.size=size;
}
this.draw();
},draw:function(px){
OpenLayers.Util.modifyAlphaImageDiv(this.alphaImageDiv,null,null,new OpenLayers.Size(this.size.w,this.size.h),this.url,"absolute");
OpenLayers.Util.modifyDOMElement(this.imageDiv,null,null,new OpenLayers.Size(this.size.w,this.size.h));
this.imageDiv.style.position="absolute";
this.imageDiv.style.overflow="hidden";
var img=this.alphaImageDiv.childNodes[0];
img.style.height=(this.size.h*this.numberOfStates)+"px";
this.alphaImageDiv.style.height=this.size.h+"px";
this.alphaImageDiv.style.position="relative";
if(this.alphaImageDiv.firstChild.src.match("north")!=null){
this.alphaImageDiv.firstChild.alt="Pan north";
}else{
if(this.alphaImageDiv.firstChild.src.match("south")!=null){
this.alphaImageDiv.firstChild.alt="Pan south";
}else{
if(this.alphaImageDiv.firstChild.src.match("west")!=null){
this.alphaImageDiv.firstChild.alt="Pan west";
}else{
if(this.alphaImageDiv.firstChild.src.match("east")!=null){
this.alphaImageDiv.firstChild.alt="Pan east";
}
}
}
}
OpenLayers.Event.observe(this.alphaImageDiv,"mouseover",function(e){
var div=this.alphaImageDiv;
var offset;
if(this.stickyState){
offset=(-this.size.h*this.stickyState)+"px";
}else{
offset=(-this.size.h)+"px";
}
if(document.all){
div.style.marginTop=offset;
}else{
div.style.top=offset;
}
}.bindAsEventListener(this));
OpenLayers.Event.observe(this.alphaImageDiv,"mouseout",function(e){
var div=this.alphaImageDiv;
var offset;
if(this.stickyState){
offset=(-this.size.h*this.stickyState)+"px";
}else{
offset="0px";
}
if(document.all){
div.style.marginTop=offset;
}else{
div.style.top=offset;
}
}.bindAsEventListener(this));
this.setStickyState(this.stickyState);
this.moveTo(px);
return this.imageDiv;
},setOpacity:function(_57602){
OpenLayers.Util.modifyAlphaImageDiv(this.alphaImageDiv,null,null,null,null,null,null,null,_57602);
},moveTo:function(px){
if(px!=null){
this.px=px;
}
if(this.alphaImageDiv!=null){
if(this.px==null){
this.display(false);
}else{
if(this.calculateOffset){
this.offset=this.calculateOffset(this.size);
}
var _57603=this.px.offset(this.offset);
OpenLayers.Util.modifyDOMElement(this.imageDiv,null,_57603);
}
}
},display:function(_57604){
this.imageDiv.style.display=(_57604)?"":"none";
},setStickyState:function(state){
if(state==null){
state=0;
}
this.stickyState=state;
var offset=(-this.size.h*this.stickyState)+"px";
if(document.all){
this.alphaImageDiv.style.marginTop=offset;
}else{
this.alphaImageDiv.style.top=offset;
}
},CLASS_NAME:"EMS.HoverIcon"});
EMS.Control.PanButton=OpenLayers.Class(OpenLayers.Control,{id:"PanButton",type:null,map:null,element:null,offset:0,smallPanButton:false,initialize:function(type,icon,_57605){
OpenLayers.Control.prototype.initialize.apply(this,[_57605]);
this.type=type;
if(!icon){
if(this.smallPanButton){
if(type=="n"){
icon=new EMS.HoverIcon(EMS.Util.getImagesLocation()+"pan_north_sml.png",new OpenLayers.Size(20,16));
}else{
if(type=="s"){
icon=new EMS.HoverIcon(EMS.Util.getImagesLocation()+"pan_south_sml.png",new OpenLayers.Size(20,16));
}else{
if(type=="e"){
icon=new EMS.HoverIcon(EMS.Util.getImagesLocation()+"pan_east_sml.png",new OpenLayers.Size(16,20));
}else{
if(type=="w"){
icon=new EMS.HoverIcon(EMS.Util.getImagesLocation()+"pan_west_sml.png",new OpenLayers.Size(16,20));
}
}
}
}
}else{
if(type=="n"){
icon=new EMS.HoverIcon(EMS.Util.getImagesLocation()+"pan_north.png",new OpenLayers.Size(25,20));
}else{
if(type=="s"){
icon=new EMS.HoverIcon(EMS.Util.getImagesLocation()+"pan_south.png",new OpenLayers.Size(25,20));
}else{
if(type=="e"){
icon=new EMS.HoverIcon(EMS.Util.getImagesLocation()+"pan_east.png",new OpenLayers.Size(20,25));
}else{
if(type=="w"){
icon=new EMS.HoverIcon(EMS.Util.getImagesLocation()+"pan_west.png",new OpenLayers.Size(20,25));
}
}
}
}
}
}
this.icon=icon;
this.displayClass=this.CLASS_NAME.replace("EMS.","ems").replace(".","")+"-"+type;
},setMap:function(map){
OpenLayers.Control.prototype.setMap.apply(this,arguments);
var _57606=OpenLayers.Function.bind(this.updateSize);
var _57607=map.updateSize;
map.onMapResize=function(){
_57607();
_57606();
};
if(navigator.appName.contains("Microsoft")){
map.events.register("resize",this,this.updateSize);
}else{
OpenLayers.Event.observe(window,"resize",this.updateSizeCallback=this.updateSize.bindAsEventListener(this));
}
},updateSize:function(){
var wMax=this.icon.size.w;
var hMax=this.icon.size.h;
var _57608;
if(this.type=="n"){
_57608=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,(0+this.offset));
}else{
if(this.type=="s"){
_57608=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,this.map.getSize().h-(hMax+this.offset));
}else{
if(this.type=="e"){
_57608=new OpenLayers.Pixel(this.map.getSize().w-(wMax+this.offset),this.map.getSize().h/2-hMax/2);
}else{
if(this.type=="w"){
_57608=new OpenLayers.Pixel((0+this.offset),this.map.getSize().h/2-hMax/2);
}
}
}
}
OpenLayers.Util.modifyDOMElement(this.div,null,_57608);
},destroy:function(){
OpenLayers.Event.stopObservingElement(this.div);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
this.div.style.overflow="hidden";
this.div.style.height=this.icon.size.h+"px";
var wMax=this.icon.size.w;
var hMax=this.icon.size.h;
var wMin=this.icon.size.w;
var hMin=this.icon.size.h;
var _57609;
if(this.type=="n"){
_57609=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,(0+this.offset));
}else{
if(this.type=="s"){
_57609=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,this.map.getSize().h-(hMax+this.offset));
}else{
if(this.type=="e"){
_57609=new OpenLayers.Pixel(this.map.getSize().w-(wMax+this.offset),this.map.getSize().h/2-hMax/2);
}else{
if(this.type=="w"){
_57609=new OpenLayers.Pixel((0+this.offset),this.map.getSize().h/2-hMax/2);
}
}
}
}
this.icon.draw();
this.icon.display(true);
OpenLayers.Event.observe(this.div,"click",this.pan.bindAsEventListener(this));
OpenLayers.Event.observe(this.div,"mousedown",this._eatThisEvent);
OpenLayers.Event.observe(this.div,"mouseup",this._eatThisEvent);
OpenLayers.Event.observe(this.div,"dblclick",this._eatThisEvent);
this.div.appendChild(this.icon.imageDiv);
OpenLayers.Util.modifyDOMElement(this.div,null,_57609);
OpenLayers.Util.modifyDOMElement(this.icon.imageDiv,null,null,null,"static");
return this.div;
},pan:function(e){
var _57610=this.map.getCenter().clone();
if(this.type=="n"){
_57610.lat+=this.map.getExtent().getHeight()/2;
}else{
if(this.type=="s"){
_57610.lat-=this.map.getExtent().getHeight()/2;
}else{
if(this.type=="w"){
_57610.lon-=this.map.getExtent().getWidth()/2;
}else{
if(this.type=="e"){
_57610.lon+=this.map.getExtent().getWidth()/2;
}
}
}
}
this.map.setCenter(_57610);
OpenLayers.Event.stop(e);
return false;
},_eatThisEvent:function(e){
OpenLayers.Event.stop(e);
return false;
},CLASS_NAME:"EMS.Control.PanButton"});
EMS.Popup=OpenLayers.Class({EVENT_TYPES:["shown","hidden"],events:null,id:"",lonlat:null,div:null,size:null,contentHTML:"",backgroundColor:"",opacity:1,border:"",contentDiv:null,groupDiv:null,padding:5,calloutSize:new OpenLayers.Size(14,22),map:null,initialize:function(id,lonlat,size,_57611,anchor,_57612){
if(id==null){
id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");
}
this.id=id;
this.lonlat=lonlat;
this.size=(size!=null)?size:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);
if(_57611!=null){
this.contentHTML=_57611;
}
this.anchor=anchor;
this.backgroundColor=OpenLayers.Popup.COLOR;
this.opacity=OpenLayers.Popup.OPACITY;
this.border=OpenLayers.Popup.BORDER;
this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"visible");
this.div.className="emsPopup";
this.div.style.backgroundColor="transparent";
this.calloutDiv=OpenLayers.Util.createAlphaImageDiv(this.div.getAttribute("id")+"-callout",null,this.calloutSize,null,"absolute",null,null,1);
this.calloutDiv.style.backgroundColor="transparent";
this.div.appendChild(this.calloutDiv);
this.groupDiv=OpenLayers.Util.createDiv(null,null,null,null,"absolute",null,"hidden");
this.groupDiv.className="emsPopupGroup";
this.shadow1Div=OpenLayers.Util.createDiv(null,null,null,null,"absolute",null,"hidden",0.15);
this.shadow1Div.style.marginLeft="4px";
this.shadow1Div.style.marginTop="4px";
this.shadow1Div.style.backgroundColor="black";
this.shadow2Div=OpenLayers.Util.createDiv(null,null,null,null,"absolute",null,"hidden",0.15);
this.shadow2Div.style.marginTop="8px";
this.shadow2Div.style.marginLeft="8px";
this.shadow2Div.style.backgroundColor="black";
var id=this.div.id+"_contentDiv";
this.contentDiv=OpenLayers.Util.createDiv(id,null,this.size.clone(),null,"relative",null,"hidden");
this.contentDiv.className="emsPopupContent";
this.groupDiv.appendChild(this.contentDiv);
this.div.appendChild(this.shadow1Div);
this.div.appendChild(this.shadow2Div);
this.div.appendChild(this.groupDiv);
if(_57612){
var _57613=new OpenLayers.Size(12,12);
var img=EMS.Util.getImagesLocation()+"close_off.gif";
var _57614=OpenLayers.Util.createAlphaImageDiv(this.id+"_close",null,_57613,img);
_57614.style.right=this.padding+"px";
_57614.style.top=this.padding+"px";
this.groupDiv.appendChild(_57614);
var _57615=function(e){
this.hide();
OpenLayers.Event.stop(e);
};
OpenLayers.Event.observe(_57614,"click",_57615.bindAsEventListener(this));
}
this.registerEvents();
},destroy:function(){
if(this.map!=null){
this.map.removePopup(this);
this.map=null;
}
this.events.destroy();
this.events=null;
this.div=null;
},draw:function(px){
if(px==null){
if((this.lonlat!=null)&&(this.map!=null)){
px=this.map.getLayerPxFromLonLat(this.lonlat);
}
}
this.setSize();
this.setBackgroundColor();
this.setOpacity();
this.setBorder();
this.setContentHTML();
this.moveTo(px);
return this.div;
},updatePosition:function(){
if((this.lonlat)&&(this.map)){
var px=this.map.getLayerPxFromLonLat(this.lonlat);
this.moveTo(px);
}
},moveTo:function(px){
if((px!=null)&&(this.div!=null)){
var _57616=this.direction(px);
var _57617=px;
var _57618=(this.anchor==undefined?0:this.anchor.size.h);
var _57619=(this.anchor==undefined?0:this.anchor.size.w);
if(this.anchor!=undefined){
if(this.anchor.offset!=undefined&&(_57618/2)==(this.anchor.offset.y/-1)){
_57618=0;
}
px=px.add(_57616*_57619/2,-_57618/2);
}
if(_57616==-1){
px=px.add(-this.size.w,0);
px=px.add(_57616*this.calloutSize.w,0);
}
px=px.add(0,-this.size.h/2);
if(this.map.getExtent().containsLonLat(this.map.getLonLatFromLayerPx(_57617))){
if(this.map.getViewPortPxFromLayerPx(px).y<0){
px=px.add(0,-(this.map.getViewPortPxFromLayerPx(px).y));
}else{
if(this.map.getViewPortPxFromLayerPx(px).y+this.size.h>this.map.getSize().h){
px=px.add(0,-(this.map.getViewPortPxFromLayerPx(px).y+this.size.h-this.map.getSize().h));
}
}
}
this.shadow1Div.style.marginTop="4px";
this.shadow2Div.style.marginTop="8px";
if(_57616>0){
this.shadow1Div.style.marginLeft=(this.calloutSize.w+4)+"px";
this.shadow2Div.style.marginLeft=(this.calloutSize.w+8)+"px";
this.groupDiv.style.marginLeft=this.calloutSize.w+"px";
this.groupDiv.style.marginRight="0px";
this.shadow1Div.style.marginRight="0px";
this.shadow2Div.style.marginRight="0px";
}else{
this.shadow1Div.style.marginLeft="0px";
this.shadow2Div.style.marginLeft="0px";
this.groupDiv.style.marginLeft="0px";
this.shadow1Div.style.marginLeft=(4)+"px";
this.shadow2Div.style.marginLeft=(8)+"px";
this.groupDiv.style.marginRight=this.calloutSize.w+"px";
}
if(_57616>0){
this.calloutDiv.style.left="2px";
this.calloutDiv.style.right="";
}else{
this.calloutDiv.style.right="2px";
this.calloutDiv.style.left="";
}
this.calloutDiv.style.top=(_57617.y-px.y-this.calloutSize.h/2-_57618/2)+"px";
this.calloutDiv.style.zIndex=this.div.style.zIndex+1;
if(_57616>0){
OpenLayers.Util.modifyAlphaImageDiv(this.calloutDiv,null,null,null,EMS.Util.getImagesLocation()+"calloutleft.png");
}else{
OpenLayers.Util.modifyAlphaImageDiv(this.calloutDiv,null,null,null,EMS.Util.getImagesLocation()+"calloutright.png");
}
this.div.style.left=px.x+"px";
this.div.style.top=px.y+"px";
}
},direction:function(px){
var lonlat=this.map.getLonLatFromLayerPx(px);
var extent=this.map.getExtent();
var _57620=extent.determineQuadrant(lonlat);
if(_57620.charAt(1)=="l"){
return 1;
}else{
return -1;
}
},visible:function(){
return OpenLayers.Element.visible(this.div);
},toggle:function(){
OpenLayers.Element.toggle(this.div);
if(this.visible()){
this.events.triggerEvent("shown");
}else{
this.events.triggerEvent("hidden");
}
},show:function(){
OpenLayers.Element.show(this.div);
this.events.triggerEvent("shown");
},hide:function(){
OpenLayers.Element.hide(this.div);
this.events.triggerEvent("hidden");
},setSize:function(size){
if(size!=undefined){
this.size=size;
}
if(this.div!=null){
this.div.style.width=(this.size.w+this.calloutSize.w)+"px";
this.div.style.height=this.size.h+"px";
}
var _57621=this.size.w-4;
var _57622=this.size.h-4;
if(this.groupDiv!=null){
this.groupDiv.style.width=_57621+"px";
this.groupDiv.style.height=_57622+"px";
}
if(this.shadow1Div!=null&&this.shadow2Div!=null){
this.shadow1Div.style.width=(_57621+4)+"px";
this.shadow1Div.style.height=(_57622+4)+"px";
this.shadow2Div.style.width=(_57621+4)+"px";
this.shadow2Div.style.height=(_57622+4)+"px";
}
if(this.contentDiv!=null){
this.contentDiv.style.width=_57621+"px";
this.contentDiv.style.height=_57622+"px";
}
},setBackgroundColor:function(color){
if(color!=undefined){
this.backgroundColor=color;
}
if(this.div!=null){
this.groupDiv.style.backgroundColor=this.backgroundColor;
}
},setOpacity:function(_57623){
if(_57623!=undefined){
this.opacity=_57623;
}
if(this.div!=null){
if(this.opacity==1){
this.div.style.opacity=null;
this.div.style.filter=null;
}else{
this.div.style.opacity=this.opacity;
this.div.style.filter="alpha(opacity="+this.opacity*100+")";
}
}
},setBorder:function(border){
if(border!=undefined){
this.border=border;
}
if(this.div!=null){
this.div.style.border=this.border;
}
},setContentHTML:function(_57624){
if(_57624!=null){
this.contentHTML=_57624;
}
if(this.contentDiv!=null){
this.contentDiv.innerHTML=this.contentHTML;
}
},registerEvents:function(){
this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,true);
this.events.register("mousedown",this,this.onmousedown);
this.events.register("mousemove",this,this.onmousemove);
this.events.register("mouseup",this,this.onmouseup);
this.events.register("click",this,this.onclick);
this.events.register("mouseout",this,this.onmouseout);
this.events.register("dblclick",this,this.ondblclick);
},onmousedown:function(evt){
this.mousedown=true;
OpenLayers.Event.stop(evt,true);
},onmousemove:function(evt){
if(this.mousedown){
OpenLayers.Event.stop(evt,true);
}
},onmouseup:function(evt){
if(this.mousedown){
this.mousedown=false;
OpenLayers.Event.stop(evt,true);
}
},onclick:function(evt){
OpenLayers.Event.stop(evt,true);
},onmouseout:function(evt){
this.mousedown=false;
},ondblclick:function(evt){
OpenLayers.Event.stop(evt,true);
},CLASS_NAME:"EMS.Popup"});
EMS.Button=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["click"],events:null,isDown:false,initialize:function(upIcon,_57625,_57626,isDown,_57627){
OpenLayers.Control.prototype.initialize.apply(this,[_57627]);
this.upIcon=upIcon;
this.downIcon=_57625;
this.hoverIcon=_57626;
this.isDown=isDown;
this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,false);
},destroy:function(){
OpenLayers.Event.stopObservingElement(this.imageDiv);
},redraw:function(){
if(this.div!=null){
this.div.innerHTML="";
}
this.draw();
},draw:function(px){
OpenLayers.Control.prototype.draw.apply(this,arguments);
this.imageDiv=OpenLayers.Util.createDiv(null,px,this.size(),this.url(),"absolute");
this.imageDiv.className=this.displayClass;
this.div.appendChild(this.imageDiv);
this.contentDiv=OpenLayers.Util.createDiv(null,null,this.size(),null,"absolute");
this.contentDiv.className="contentDiv";
this.imageDiv.appendChild(this.contentDiv);
if(!this.isDown){
OpenLayers.Event.observe(this.imageDiv,"mouseover",this.mouseOver.bindAsEventListener(this));
OpenLayers.Event.observe(this.imageDiv,"mouseout",this.mouseOut.bindAsEventListener(this));
}
OpenLayers.Event.observe(this.imageDiv,"mouseDown",function(){
});
OpenLayers.Event.observe(this.imageDiv,"click",this.click.bindAsEventListener(this));
},size:function(){
if(this.isDown){
return this.downIcon.size;
}else{
return this.upIcon.size;
}
},url:function(){
if(this.isDown){
return this.downIcon.url;
}else{
return this.upIcon.url;
}
},mouseOver:function(){
this.imageDiv.style.backgroundImage="url(\""+this.hoverIcon.url+"\")";
},mouseOut:function(){
this.imageDiv.style.backgroundImage="url(\""+this.upIcon.url+"\")";
},click:function(e){
this.events.triggerEvent("click",e);
OpenLayers.Event.stop(e);
},CLASS_NAME:"EMS.Control.Button"});
EMS.Control.ZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{buttons:null,showHybridInPhotoView:true,sliderSize:new OpenLayers.Size(40,161),handleSize:new OpenLayers.Size(23,18),fullZoomBar:true,showMapPhotoButtons:true,initialize:function(_57628,_57629,_57630,_57631,_57632){
OpenLayers.Control.PanZoom.prototype.initialize.apply(this,[]);
this.streetLayer=_57628;
this.photoLayer=_57629;
this.hybridLayer=_57630;
if(_57631!=undefined){
this.fullZoomBar=_57631;
}
if(_57632!=undefined){
this.showMapPhotoButtons=_57632;
}
this.position=new OpenLayers.Pixel(EMS.Control.ZoomBar.X,EMS.Control.ZoomBar.Y);
},destroy:function(){
OpenLayers.Event.stopObservingElement(this.markersDiv);
if(this.fullZoomBar){
this.scale.events.destroy();
for(var i=0;i<this.markers.length;i++){
this.markers[i].events.destroy();
OpenLayers.Event.stopObservingElement(this.markers[i].image);
OpenLayers.Util.removeNode(this.div);
}
}
OpenLayers.Event.stopObservingElement(this.zoominButton);
OpenLayers.Event.stopObservingElement(this.zoomoutButton);
if(this.fullZoomBar){
this.map.events.unregister("mousemove",this,this._showHideMarkers);
}
this.map=null;
},setMap:function(map){
OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);
this.map.events.register("changebaselayer",this,this.redraw);
},redraw:function(){
if(this.div!=null){
this.div.innerHTML="";
}
this.draw();
},draw:function(px){
OpenLayers.Control.prototype.draw.apply(this,arguments);
zoomPx=this.position.clone();
layerPx=this.position.clone();
this.buttons=new Array();
if(this.showMapPhotoButtons){
this.layersDiv=OpenLayers.Util.createDiv(this.div.id+"_LayersButtons",layerPx,new OpenLayers.Size(75,22),null,"absolute");
this.layersDiv.className="LayersButtons";
this.streetButton=this._addStreetButton(layerPx);
this.photoButton=this._addPhotoButton(layerPx.add(38,0));
this.layersDiv.style.left="27px";
this.layersDiv.style.top="2px";
if(this.photoButton.isDown){
var _57633="button_bg_lrg.png";
var bgSize=209;
}else{
var _57633="button_bg_sml.png";
var bgSize=108;
}
this.layerBackground=OpenLayers.Util.createAlphaImageDiv(null,this.position.clone(),new OpenLayers.Size(bgSize,25),EMS.Util.getImagesLocation()+_57633);
this.div.appendChild(this.layerBackground);
this.div.appendChild(this.layersDiv);
}
this.northArrow=OpenLayers.Util.createAlphaImageDiv(null,this.position.clone().add(7,2),new OpenLayers.Size(13,20),EMS.Util.getImagesLocation()+"north_arrow.png");
this.northArrow.style.position="absolute";
this.northArrow.firstChild.alt="Magnetic North";
this.div.appendChild(this.northArrow);
if(this.showMapPhotoButtons){
zoomPx=zoomPx.add(29,34);
}else{
zoomPx=zoomPx.add(8,30);
}
this.zoomoutButton=this._addButton("zoomout","sdr-zoomout.png",zoomPx,new OpenLayers.Size(21,26));
zoomPx=zoomPx.add(0,26);
if(this.fullZoomBar){
this._addScale(this.div.id+"EMSZoomBar_Scale","sdr-scale.png",zoomPx,new OpenLayers.Size(21,169));
this.scale.className="EMSZoombarScale";
this.markersDiv=OpenLayers.Util.createDiv(this.div.id+"_Markers",zoomPx.add(16,0),new OpenLayers.Size(0,169),null,"absolute");
this.markersDiv.className="EMSZoombarMarkers";
this.map.events.register("mousemove",this,this._showHideMarkers);
this.div.appendChild(this.markersDiv);
this.markers=new Array();
this._addMarker("country-marker","country-marker.png",new OpenLayers.Pixel(0,1),new OpenLayers.Size(46,15));
this._addMarker("state-marker","state-marker.png",new OpenLayers.Pixel(0,30),new OpenLayers.Size(46,15));
this._addMarker("suburb-marker","suburb-marker.png",new OpenLayers.Pixel(0,97),new OpenLayers.Size(46,15));
this._addMarker("street-marker","street-marker.png",new OpenLayers.Pixel(0,125),new OpenLayers.Size(46,15));
this._addZoomBar(zoomPx.add(0,6));
zoomPx=zoomPx.add(0,169);
this.moveZoomBar();
}
this.zoominButton=this._addButton("zoomin","sdr-zoomin.png",zoomPx,new OpenLayers.Size(21,26));
return this.div;
},_showHideMarkers:function(e){
var pos=OpenLayers.Util.docPosition(this.map.div);
var x=EMS.Event.pointerX(e);
var y=EMS.Event.pointerY(e);
x-=pos[0];
y-=pos[1];
if(this.markersVisible){
if(!(x>28&&x<90&&y>34&&y<256)){
if(this.slider.childNodes[0].style.marginTop!="-18px"){
this.hideMarkers();
}
}
}else{
if(x>28&&x<53&&y>34&&y<256){
this.showMarkers();
}
}
},ignoreEvent:function(evt){
OpenLayers.Event.stop(evt);
},_addScale:function(id,img,px,sz){
var _57634=EMS.Util.getImagesLocation()+img;
this.scale=OpenLayers.Util.createAlphaImageDiv(id,px,sz,_57634,"absolute",null,null);
this.scale.events=new OpenLayers.Events(this,this.scale,null,true);
this.scale.events.register("mousedown",this,this.divClick);
this.scale.events.register("mousemove",this,this.passEventToSlider);
this.scale.events.register("mouseup",this,this.passEventToSlider);
this.scale.events.register("dblclick",this,this.doubleClick);
this.scale.events.register("click",this,this.doubleClick);
this.div.appendChild(this.scale);
return this.scale;
},_addMarker:function(id,img,xy,sz){
var _57635=EMS.Util.getImagesLocation()+img;
var image=OpenLayers.Util.createAlphaImageDiv(id+"-image",null,new OpenLayers.Size(sz.w,sz.h*2),_57635);
OpenLayers.Event.observe(image,"mouseover",(function(){
this.style.marginTop="-15px";
}).bindAsEventListener(image));
OpenLayers.Event.observe(image,"mouseout",(function(){
if(!this.parentNode.selected){
this.style.marginTop="0px";
}
}).bindAsEventListener(image));
var marker=OpenLayers.Util.createDiv(id,xy,sz,null,"absolute",null,"hidden");
marker.appendChild(image);
marker.image=image;
marker.value=xy.y;
marker.events=new OpenLayers.Events(this,marker,null,true);
marker.events.register("mousedown",this,this.markerClick);
marker.events.register("mouseover",marker,function(){
this.style.cursor="pointer";
});
this.markers.push(marker);
marker.style.visibility="hidden";
this.markersDiv.appendChild(marker);
return this.marker;
},_addButton:function(id,img,xy,sz){
var _57636=EMS.Util.getImagesLocation()+img;
var image=OpenLayers.Util.createAlphaImageDiv(id+"-image",null,new OpenLayers.Size(sz.w,sz.h*2),_57636);
OpenLayers.Event.observe(image,"mouseover",(function(){
this.style.marginTop="-26px";
}).bindAsEventListener(image));
OpenLayers.Event.observe(image,"mouseout",(function(){
this.style.marginTop="0px";
}).bindAsEventListener(image));
if(id=="zoomin"){
image.firstChild.alt="Zoom In";
}else{
if(id=="zoomout"){
image.firstChild.alt="Zoom Out";
}
}
var button=OpenLayers.Util.createDiv(id,xy,sz,null,"absolute",null,"hidden");
button.appendChild(image);
this.div.appendChild(button);
button.events=new OpenLayers.Events(this,button,null,true);
button.events.register("mousedown",button,this.buttonDown);
button.events.register("dblclick",button,this.doubleClick);
button.events.register("click",button,this.doubleClick);
button.events.register("mouseover",button,function(){
this.style.cursor="pointer";
});
if(this.fullZoomBar){
button.events.register("mousemove",this,this.passEventToSlider);
button.events.register("mouseup",this,this.passEventToSlider);
button.events.register("mouseover",this,this.showMarkers);
button.events.register("mouseout",this,this.hideMarkers);
}
button.action=id;
button.map=this.map;
button.slideFactor=this.slideFactor;
this.buttons.push(button);
return button;
},_addZoomBar:function(_57637){
var _57638=EMS.Util.getImagesLocation();
var sz=this.sliderSize.clone();
var _57639=this.handleSize;
var id="EMS_Control_ZoomBar_Slider"+this.map.id;
var _57640=this.map.getNumZoomLevels()-1-this.map.getZoom();
var image=OpenLayers.Util.createAlphaImageDiv(id+"-image",null,new OpenLayers.Size(this.handleSize.w,this.handleSize.h*2),_57638+"sdr-pointer.png");
OpenLayers.Event.observe(image,"mouseover",(function(){
this.style.marginTop="-18px";
}).bindAsEventListener(image));
OpenLayers.Event.observe(image,"mouseout",(function(){
this.style.marginTop="0px";
}).bindAsEventListener(image));
this.slider=OpenLayers.Util.createDiv(id,_57637.add(-_57639.w/2+4,sz.h-_57639.h/2),this.handleSize,null,"absolute",null,"hidden");
this.slider.appendChild(image);
this.slider.events=new OpenLayers.Events(this,this.slider,null,true);
this.slider.events.register("mousedown",this,this.zoomBarDown);
this.slider.events.register("mousemove",this,this.zoomBarDrag);
this.slider.events.register("mouseup",this,this.zoomBarUp);
this.slider.events.register("dblclick",this,this.doubleClick);
this.slider.events.register("click",this,this.doubleClick);
this.slider.events.register("mouseover",this,this.showMarkers);
this.slider.className="ZoomBar_Slider";
this.div.appendChild(this.slider);
this.map.events.register("zoomend",this,this.moveZoomBar);
_57637=_57637.add(0,sz.h);
return _57637;
},_addPhotoButton:function(px){
var upIcon=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Photo_off.gif",new OpenLayers.Size(36,21),new OpenLayers.Size(0,0));
var _57641=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Photo_on_extended.gif",new OpenLayers.Size(137,21),new OpenLayers.Size(0,0));
var _57642=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Photo_on.gif",new OpenLayers.Size(36,21),new OpenLayers.Size(0,0));
var _57643=this.photoLayer.getVisibility();
var button=new EMS.Button(upIcon,_57641,_57642,_57643,{div:this.layersDiv,displayClass:"photoLayerSelector"});
button.draw(px);
button.contentDiv.innerHTML="Photo";
button.events.register("click",this,function(e){
this.streetButton.isDown=false;
this.photoButton.isDown=true;
this.map.setBaseLayer(this.photoLayer,false);
this.hybridLayer.setVisibility(this.showHybridInPhotoView);
this.photoButton.contentDiv.innerHTML="";
var _57644=this._photoContents(this.streetButton.isDown,this.photoButton.isDown,this.hybridLayer.getVisibility());
this.photoButton.contentDiv.appendChild(_57644);
OpenLayers.Event.stop(e);
});
return button;
},displayPhotoLayer:function(hybrid){
this.map.setBaseLayer(this.photoLayer,false);
this.hybridLayer.setVisibility(hybrid);
if(this.showMapPhotoButtons){
this.streetButton.isDown=false;
this.photoButton.isDown=true;
this.photoButton.contentDiv.innerHTML="";
var _57645=this._photoContents(this.streetButton.isDown,this.photoButton.isDown,this.hybridLayer.getVisibility());
this.photoButton.contentDiv.appendChild(_57645);
}
},_addStreetButton:function(px){
var upIcon=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Map_off.gif",new OpenLayers.Size(38,21),new OpenLayers.Size(0,0));
var _57646=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Map_on.gif",new OpenLayers.Size(38,21),new OpenLayers.Size(0,0));
var _57647=_57646.clone();
var _57648=this.streetLayer.getVisibility();
var button=new EMS.Button(upIcon,_57646,_57647,_57648,{div:this.layersDiv,displayClass:"streetLayerSelector"});
button.draw(px);
button.contentDiv.innerHTML=_57648?"<b>Map</b>":"Map";
button.events.register("click",this,function(e){
this.streetButton.isDown=true;
this.photoButton.isDown=false;
this.photoButton.contentDiv.innerHTML="";
var _57649=this._photoContents(this.streetButton.isDown,this.photoButton.isDown,this.hybridLayer.getVisibility());
this.photoButton.contentDiv.appendChild(_57649);
this.map.setBaseLayer(this.streetLayer,false);
OpenLayers.Event.stop(e);
});
this.hybridLayer.setVisibility(false);
return button;
},_photoContents:function(_57650,_57651,_57652){
var div=OpenLayers.Util.createDiv();
var photo=document.createTextNode("Photo ");
if(_57651){
var bold=document.createElement("b");
bold.appendChild(photo);
photo=bold;
}
div.appendChild(photo);
if(_57651){
var _57653=document.createElement("img");
_57653.src=EMS.Util.getImagesLocation()+"divider.gif";
div.appendChild(_57653);
var space=document.createTextNode(" ");
div.appendChild(space);
var _57654=document.createElement("span");
var anchor=document.createElement("a");
anchor.href="#";
OpenLayers.Event.observe(anchor,"click",this._toggleHybrid.bindAsEventListener(this));
var text;
if(_57652){
text=document.createTextNode("Hide street labels");
}else{
text=document.createTextNode("Show street labels");
}
anchor.appendChild(text);
_57654.appendChild(anchor);
div.appendChild(_57654);
}
return div;
},_toggleHybrid:function(){
this.hybridLayer.setVisibility(!this.hybridLayer.getVisibility(),false);
this.showHybridInPhotoView=this.hybridLayer.getVisibility();
},_addHover:function(button){
OpenLayers.Event.observe(button,"mouseover",function(){
button.style.backgroundImage=button.onImgLocation;
});
},passEventToSlider:function(evt){
this.slider.events.handleBrowserEvent(evt);
},divClick:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
var y=evt.xy.y-this.handleSize.h/2;
var _57655=(y/this.sliderSize.h);
var level=Math.ceil(_57655*this.map.getNumZoomLevels());
this.map.zoomTo(level);
this.updateMarkers();
OpenLayers.Event.stop(evt);
},markerClick:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
evt.xy.y=evt.element.value;
this.divClick(evt);
},updateMarkers:function(){
var top=OpenLayers.Util.pagePosition(this.slider)[1];
for(var i=0;i<this.markers.length;i++){
var marker=this.markers[i];
var _57656=OpenLayers.Util.pagePosition(marker)[1];
var _57657=marker.clientHeight+_57656;
var _57658=_57657-top;
if(_57658<this.handleSize.h*2&&_57658>=0){
marker.selected=true;
marker.image.style.marginTop="-15px";
}else{
marker.selected=false;
marker.image.style.marginTop="0px";
}
}
},showMarkers:function(){
this.updateMarkers();
this.markersVisible=true;
for(var i=0;i<this.markers.length;i++){
this.markers[i].style.visibility="visible";
}
},hideMarkers:function(){
this.markersVisible=false;
if(this.mouseDragStart!=null){
return;
}
for(var i=0;i<this.markers.length;i++){
this.markers[i].style.visibility="hidden";
}
},zoomBarDown:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
document.onselectstart=function(){
return false;
};
document.onmouseup=function(){
document.onselectstart=null;
};
this.map.events.unregister("zoomend",this,this.moveZoomBar);
this.map.events.register("mousemove",this,this.passEventToSlider);
this.map.events.register("mouseup",this,this.passEventToSlider);
this.mouseDragStart=evt.xy.clone();
this.zoomStart=evt.xy.clone();
this.slider.style.cursor="url('"+EMS.Util.getImagesLocation()+"grabbing.cur'), move";
this.div.style.cursor="url('"+EMS.Util.getImagesLocation()+"grabbing.cur'), move";
OpenLayers.Event.stop(evt);
},zoomBarDrag:function(evt){
if(this.mouseDragStart!=null){
var _57659=OpenLayers.Util.docPosition(this.scale);
var pos=EMS.Event.pointerY(evt)-_57659[1];
var _57660=parseInt(this.scale.style.top);
var _57661=parseInt(this.scale.style.height);
var _57662=parseInt(this.slider.style.height);
var newTop=(_57660+pos-_57662/2);
var _57663=pos-_57662/2<0;
if(_57663){
newTop=_57660;
}
var _57664=pos-_57662/2>_57661-_57662;
if(_57664){
newTop=_57660+_57661-_57662;
}
var oldTop=parseInt(this.slider.style.top);
this.slider.style.top=newTop+"px";
this.updateMarkers();
this.mouseDragStart=evt.xy.clone();
var _57665=oldTop!=newTop;
if(_57665&&(_57663||_57664)){
this.zoomBarUp(evt);
}else{
OpenLayers.Event.stop(evt);
}
}
},zoomBarUp:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
if(this.zoomStart){
this.slider.style.cursor="url('"+EMS.Util.getImagesLocation()+"grab.cur'), move";
this.div.style.cursor="url('"+EMS.Util.getImagesLocation()+"grab.cur'), move";
this.map.events.unregister("mouseup",this,this.passEventToSlider);
this.map.events.unregister("mousemove",this,this.passEventToSlider);
var y=this.slider.offsetTop-this.scale.offsetTop;
var _57666=(y/this.sliderSize.h);
var level=Math.floor(_57666*this.map.getNumZoomLevels());
this.map.zoomTo(level);
this.mouseDragStart=null;
OpenLayers.Event.stop(evt);
this.map.events.register("zoomend",this,this.moveZoomBar);
this.moveZoomBar();
if(!this.markersVisible){
this.hideMarkers();
}
this.zoomStart=null;
}
},moveZoomBar:function(){
var _57667=(this.map.getZoom()/this.map.getNumZoomLevels());
var newTop=_57667*this.sliderSize.h;
newTop+=parseInt(this.scale.style.top);
this.slider.style.top=newTop+"px";
this.updateMarkers();
},CLASS_NAME:"EMS.Control.ZoomBar"});
EMS.Control.ZoomBar.X=0;
EMS.Control.ZoomBar.Y=0;
EMS.IndexedLayer=OpenLayers.Class(OpenLayers.Layer.WMS,{DEFAULT_PARAMS:{service:"EMS",version:"1.1.1"},initialize:function(name,url,params,_57668){
OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);
},getURL:function(bounds){
var _57669=this.getImageSize();
var x=(bounds.left-this.map.getMaxExtent().left)/(_57669.w*this.map.getResolution());
var y=(bounds.bottom-this.map.getMaxExtent().bottom)/(_57669.h*this.map.getResolution());
var z=this.map.getNumZoomLevels()-this.map.getZoom();
return this.getFullRequestString({X:Math.round(x),Y:Math.round(y),Z:z});
},CLASS_NAME:"EMS.IndexedLayer"});
if(typeof EMS.Services=="undefined"){
EMS.Services=new Object();
}
OpenLayers.Map.TILE_WIDTH=400;
OpenLayers.Map.TILE_HEIGHT=400;
EMS.Services.communicationMode="XMLHttpRequest";
EMS.Services._onException=function(req,_57670){
if(typeof OpenLayers.Console!="undefined"&&OpenLayers.Console){
OpenLayers.Console.debug(_57670);
}
if(_57670.message){
alert("Problem: "+_57670.message);
}else{
alert("Problem: "+_57670);
}
};
EMS.Services.Map=OpenLayers.Class(OpenLayers.Map,{buffer:0,tilePath:null,pingPeriod:1000*60*5,EVENT_TYPES:["addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer","inactiveclick"],initialize:function(div,_57671){
this.active=true;
this.tilePath=EMS.tilePath;
_57671=_57671?_57671:{};
_57671=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(100,-50,170,-3),maxResolution:0.1,numZoomLevels:17,miniControls:false,showMapPhotoButtons:true,showMaxExtent:true},_57671);
var _57672=false;
if(_57671.controls==null){
_57671.controls=[];
_57672=true;
}
OpenLayers.Map.prototype.initialize.apply(this,[div,_57671]);
var _57673;
if(EMS.tilePath instanceof Array){
_57673=new Array(EMS.tilePath.length);
for(var i=0;i<EMS.tilePath.length;i++){
_57673[i]=EMS.tilePath[i]+"/tile?";
}
}else{
_57673=EMS.tilePath+"/tile?";
}
if(_57671.layers==null){
this.whereis_street_wms=new EMS.IndexedLayer("Whereis Street",_57673,{layers:"street",format:"image/gif",CACHE:"TRUE",VERSION:"1.0.3"},{displayOutsideMaxExtent:true,visible:true});
this.whereis_street_wms.setVisibility(true);
this.whereis_photo_wms=new EMS.IndexedLayer("Whereis Photo",_57673,{layers:"photo",format:"image/jpg",CACHE:"TRUE",VERSION:"1.0.3"},{displayOutsideMaxExtent:true,visible:false});
this.whereis_photo_wms.setVisibility(false);
this.whereis_hybrid_wms=new EMS.IndexedLayer("Whereis Hybrid",_57673,{layers:"hybrid",format:"image/gif",TRANSPARENT:true,CACHE:"TRUE",VERSION:"1.0.3"},{displayOutsideMaxExtent:true,transparent:true});
this.whereis_hybrid_wms.setVisibility(false);
if(OpenLayers.Renderer.SVG.prototype.supported()||OpenLayers.Renderer.VML.prototype.supported()){
this.vlayer=new EMS.Layer.Vector("Route");
}
this.markersLayer=new OpenLayers.Layer.Markers("Markers");
if(OpenLayers.Renderer.SVG.prototype.supported()||OpenLayers.Renderer.VML.prototype.supported()){
this.addLayers([this.whereis_street_wms,this.whereis_photo_wms,this.whereis_hybrid_wms,this.vlayer,this.markersLayer]);
}else{
this.addLayers([this.whereis_street_wms,this.whereis_photo_wms,this.whereis_hybrid_wms,this.markersLayer]);
}
}
if(_57672){
this.addControl(this.zoombar=new EMS.Control.ZoomBar(this.whereis_street_wms,this.whereis_photo_wms,this.whereis_hybrid_wms,!_57671.miniControls,_57671.showMapPhotoButtons));
this.addControl(this.mouseDefaults=new EMS.Control.MouseDefaults());
this.addControl(this.panNorth=new EMS.Control.PanButton("n"));
this.addControl(this.panSouth=new EMS.Control.PanButton("s"));
this.addControl(this.panEast=new EMS.Control.PanButton("e"));
this.addControl(this.panWest=new EMS.Control.PanButton("w"));
this.addControl(this.copyRight=new EMS.Control.Copyright({smallCopyright:_57671.miniControls}));
this.addControl(this.scalebar=new EMS.Control.Scale());
var _57674=new EMS.IndexedLayer("Street",_57673,{layers:"street",format:"image/gif",cache:"TRUE",version:"1.0.3"},{displayOutsideMaxExtent:true,visible:true});
_57674.buffer=0;
this.addControl(this.overviewmap=new EMS.Control.OverviewMap({layers:[_57674],mapOptions:{maxResolution:1.6,numZoomLevels:21,maxExtent:new OpenLayers.Bounds(100,-50,170,-3)}}));
}
if(this.center==undefined&&_57671.showMaxExtent){
this.zoomToMaxExtent();
}
var _57675=OpenLayers.Function.bind(function(_57676){
if(_57676.authorized){
if(!_57671.noping){
this.timeoutVar=setTimeout(OpenLayers.Function.bind(this.ping,this),this.pingPeriod);
}
if(_57671.onInit){
_57671.onInit(this);
}
}else{
EMS.token=null;
this.destroy();
alert("Authentication problem");
}
},this);
var domain=EMS.Util.getDomain();
EMS.Ajax.json("/json/auth/init",_57675,{parameters:{token:EMS.token,domain:domain}});
},ping:function(){
var empty=function(){
};
EMS.Services._json("/json/ping/ping",empty,{parameters:{},onException:empty});
this.timeoutVar=setTimeout(OpenLayers.Function.bind(this.ping,this),this.pingPeriod);
},destroy:function(){
OpenLayers.Map.prototype.destroy.apply(this);
if(this.timeoutVar){
clearTimeout(this.timeoutVar);
}
},deactivate:function(){
if(!this.active){
return;
}
var _57677=document.createElement("div");
_57677.style.left="0px";
_57677.style.top="0px";
_57677.style.width="100%";
_57677.style.height="100%";
_57677.id=this.div.id+"glassPane";
_57677.style.position="relative";
_57677.style.backgroundImage="url('+ "+EMS.Util.getImagesLocation()+"blank.gif')";
_57677.style.zIndex="4000";
var _57678=this.div.childNodes[0];
var _57679=function(e){
OpenLayers.Event.stop(e);
this.events.triggerEvent("inactiveclick");
}.bindAsEventListener(this);
var _57680=function(e){
OpenLayers.Event.stop(e);
}.bindAsEventListener(this);
OpenLayers.Event.observe(_57677,"click",_57679);
OpenLayers.Event.observe(_57677,"mousedown",_57679);
OpenLayers.Event.observe(_57677,"mouseup",_57679);
OpenLayers.Event.observe(_57677,"dblclick",_57679);
OpenLayers.Event.observe(_57677,"mousemove",_57680);
OpenLayers.Event.observe(_57677,"mouseover",_57680);
OpenLayers.Event.observe(_57677,"mouseout",_57680);
_57678.appendChild(_57677);
this.glassPane=_57677;
this.active=false;
},activate:function(){
if(this.active){
return;
}
OpenLayers.Event.stopObservingElement(this.glassPane);
var _57681=this.div.childNodes[0];
_57681.removeChild(this.glassPane);
this.active=true;
},print:function(_57682,_57683){
var _57684={layers:OpenLayers.Function.bind(function(){
var layers=[];
if(this.whereis_street_wms.getVisibility()){
layers.push("street");
}
if(this.whereis_photo_wms.getVisibility()){
layers.push("photo");
}
if(this.whereis_hybrid_wms.getVisibility()){
layers.push("hybrid");
}
return layers;
},this)(),vector:this._externalizeVectorLayer(this.vlayer),markers:this._remoteMarkers(this.markersLayer),mapWidth:this.getSize().w,mapHeight:this.getSize().h,boundingBox:{left:this.getExtent().left,bottom:this.getExtent().bottom,right:this.getExtent().right,top:this.getExtent().top}};
_57683=OpenLayers.Util.extend({parameters:{request:_57684}},_57683);
EMS.Services._json("/json/print/custom",_57682,_57683);
},print2:function(_57685,_57686,_57687){
var _57688={layers:OpenLayers.Function.bind(function(){
var layers=[];
if(this.whereis_street_wms.getVisibility()){
layers.push("street");
}
if(this.whereis_photo_wms.getVisibility()){
layers.push("photo");
}
if(this.whereis_hybrid_wms.getVisibility()){
layers.push("hybrid");
}
return layers;
},this)(),routeHandle:_57685,markers:this._remoteMarkers(this.markersLayer),mapWidth:_57687.width?_57687.width:this.getSize().w,mapHeight:_57687.height?_57687.height:this.getSize().h,boundingBox:{left:this.getExtent().left,bottom:this.getExtent().bottom,right:this.getExtent().right,top:this.getExtent().top}};
_57687=OpenLayers.Util.extend({parameters:{request:_57688}},_57687);
EMS.Services._json("/json/print/simple",_57686,_57687);
},_remoteGrid:function(layer){
if(layer.getVisibility()){
var _57689=[];
for(var x=0;x<layer.grid.length;x++){
_57689[x]=[];
for(var y=0;y<layer.grid[x].length;y++){
var tile=layer.grid[x][y];
_57689[x][y]={bounds:{left:tile.bounds.left,right:tile.bounds.right,top:tile.bounds.top,bottom:tile.bounds.bottom},url:tile.url,position:{x:tile.position.x+this.layerContainerDiv.offsetLeft,y:tile.position.y+this.layerContainerDiv.offsetTop}};
}
}
return _57689;
}else{
return null;
}
},_remoteMarkers:function(_57690){
var _57691=[];
for(var i=0;i<_57690.markers.length;i++){
var m=_57690.markers[i];
if((m.visible==undefined)||m.visible){
_57691.push({lonlat:{lat:m.lonlat.lat,lon:m.lonlat.lon},icon:{px:{x:m.icon.px.x,y:m.icon.px.y},sz:{w:m.icon.size.w,h:m.icon.size.h},url:EMS.Util.toAbsoluteUrl(m.icon.url),offset:{x:m.icon.offset.x,y:m.icon.offset.y}}});
}
}
return _57691;
},_remoteFeatures:function(_57692){
var _57693=new Array();
for(var _57694=0;_57694<_57692.features.length;_57694++){
var _57695=_57692.features[_57694];
for(var _57696=0;_57696<_57695.geometry.components.length;_57696++){
var line=_57695.geometry.components[_57696];
_57693.push(line.toString());
}
}
return _57693;
},_externalizeVectorLayer:function(_57697){
var filter=new EMS.Geometry.PolylineBoundsFilter(this.getExtent());
var _57698=new EMS.Geometry.SimpleLineReducer(this.getResolution());
return _57697.externalize(new EMS.Geometry.JsonFormatter(filter,_57698));
}});
EMS.Services.Geocoder=OpenLayers.Class({initialize:function(){
},findAddress:function(street,suburb,state,_57699,_57700){
var _57701={};
_57701.street=street;
_57701.suburb=suburb;
_57701.state=state;
var _57702={address:_57701};
if(_57700&&_57700.feature){
_57702=OpenLayers.Util.extend({feature:_57700.feature},_57702);
}
_57700=OpenLayers.Util.extend({parameters:_57702},_57700);
this._json("/json/fastGeocode/simple",_57699,_57700);
},findGeocodedAddress:function(query,_57703,_57704){
var _57705=query.address;
var _57706={address:_57705};
if(_57704&&_57704.feature){
_57706=OpenLayers.Util.extend({feature:_57704.feature},_57706);
}
_57704=OpenLayers.Util.extend({parameters:_57706},_57704);
this._json("/json/fastGeocode/findGeocodedAddress",_57703,_57704);
},reverseGeocode:function(lon,lat,_57707,_57708){
var params={longitude:lon,latitude:lat};
if(_57708&&_57708.feature){
params=OpenLayers.Util.extend({feature:_57708.feature},params);
}
_57708=OpenLayers.Util.extend({parameters:params},_57708);
this._json("/json/fastGeocode/reverseGeocode",_57707,_57708);
},reverseGeocodePoi:function(query,_57709,_57710){
var lon=query.lon;
var lat=query.lat;
var _57711=query.keyword;
var source=query.source;
_57710=OpenLayers.Util.extend({parameters:{longitude:lon,latitude:lat,keyword:_57711,source:source}},_57710);
this._json("/json/fastGeocode/reverseGeocodePoi",_57709,_57710);
},findLocalityByPrefix:function(query,_57712,_57713){
var _57714=query.address;
var id=query.id;
_57713=OpenLayers.Util.extend({parameters:{address:_57714,id:id}},_57713);
this._json("/json/fastGeocode/findLocalityByPrefix",_57712,_57713);
},findStreetByPrefix:function(street,_57715,_57716){
_57716=OpenLayers.Util.extend({parameters:{street:street}},_57716);
this._json("/json/fastGeocode/findStreetByPrefix",_57715,_57716);
},poiSearch:function(query,_57717,_57718){
var _57719=query.address;
var bounds=query.bounds;
var _57720=query.keyword;
var offset=query.offset;
var size=query.size;
var source=query.source;
var id=query.id;
var poiId=query.poiId;
_57718=OpenLayers.Util.extend({parameters:{address:_57719,bounds:bounds,keyword:_57720,offset:offset,size:size,source:source,id:id,poiId:poiId}},_57718);
this._json("/json/fastGeocode/poiSearch",_57717,_57718);
},combinedSearch:function(query,_57721,_57722){
var _57723=query.address;
var _57724=query.keyword;
var offset=query.offset;
var size=query.size;
var source=query.source;
var id=query.id;
var bounds=query.bounds;
var poiId=query.poiId;
_57722=OpenLayers.Util.extend({parameters:{address:_57723,keyword:_57724,bounds:bounds,offset:offset,size:size,source:source,id:id,poiId:poiId}},_57722);
this._json("/json/fastGeocode/combinedSearch",_57721,_57722);
},locationPoiSearch:function(query,_57725,_57726){
var _57727=query.address;
var _57728=query.keyword;
var offset=query.offset;
var size=query.size;
var source=query.source;
var id=query.id;
var xy=query.xy;
var poiId=query.poiId;
var bounds=query.bounds;
var _57729=query.feature;
_57726=OpenLayers.Util.extend({parameters:{address:_57727,bounds:bounds,keyword:_57728,xy:xy,offset:offset,size:size,source:source,id:id,poiId:poiId,feature:_57729}},_57726);
this._json("/json/fastGeocode/locationPoiSearch",_57725,_57726);
},geocodeIntersection:function(query,_57730,_57731){
var _57732=query.primaryStreet;
var _57733=query.intersectingStreet;
var suburb=query.suburb;
var state=query.state;
_57731=OpenLayers.Util.extend({parameters:{primaryStreet:_57732,intersectingStreet:_57733,suburb:suburb,state:state}},_57731);
this._json("/json/geocode/geocodeIntersection",_57730,_57731);
},reverseGeocodeIntersection:function(lon,lat,_57734,_57735){
_57735=OpenLayers.Util.extend({parameters:{longitude:lon,latitude:lat}},_57735);
this._json("/json/geocode/reverseGeocodeIntersection",_57734,_57735);
},_json:EMS.Services._json,_onException:EMS.Services._onException,CLASS_NAME:"EMS.Services.Geocoder"});
EMS.Services.Itin=OpenLayers.Class({initialize:function(){
},splitRoute:function(_57736,_57737,tolls,_57738,_57739,_57740,_57741){
_57741=OpenLayers.Util.extend({parameters:this._getRouteParams(_57736,_57737,tolls,_57738,_57739)},_57741);
this._json("/json/itin/splitRoute",_57740,_57741);
},combinedRoute:function(_57742,_57743,tolls,_57744,_57745,_57746,_57747){
_57747=OpenLayers.Util.extend({parameters:this._getRouteParams(_57742,_57743,tolls,_57744,_57745,_57747.landmarks)},_57747);
this._json("/json/itin/combinedRoute",_57746,_57747);
},_getRouteParams:function(_57748,_57749,tolls,_57750,_57751,_57752){
var params={};
if(_57748[0].street){
params.wpAddresses=_57748;
}else{
for(var i=0;i<_57748.length;i++){
params["wp"+(i+1)]=_57748[i];
}
}
params.fastest=_57749;
params.tolls=tolls;
params.tt=_57750;
params.handleOnly=_57751;
params.landmarks=_57752;
return params;
},getRoutePart:function(handle,_57753,extent,_57754,_57755){
var params={handle:handle,resolution:_57753,left:extent.left,top:extent.top,right:extent.right,bottom:extent.bottom};
_57755=OpenLayers.Util.extend({parameters:params},_57755);
this._json("/json/itin/getRoutePart",_57754,_57755);
},rankPoints:function(_57756,points,tolls,mode,_57757,_57758){
var params={lon:_57756.lon,lat:_57756.lat,tolls:tolls,mode:mode,points:points};
_57758=OpenLayers.Util.extend({parameters:params},_57758);
this._json("/json/itin/rankPoints",_57757,_57758);
},releaseRouteHandle:function(handle,_57759){
_57759=OpenLayers.Util.extend({parameters:{handle:handle}},_57759);
this._json("/json/itin/releaseRouteHandle",function(){
},_57759);
},_json:EMS.Services._json,_onException:EMS.Services._onException,CLASS_NAME:"EMS.Services.Itin"});
EMS.Services.Itin2=OpenLayers.Class(EMS.Services.Itin,{combinedRoute:function(_57760,_57761,_57762){
_57762=OpenLayers.Util.extend({parameters:{json:_57760}},_57762);
this._json("/json/route/route",_57761,_57762);
},getRoutePart:function(handle,_57763,extent,_57764,_57765){
var params={handle:handle,resolution:_57763,left:extent.left,top:extent.top,right:extent.right,bottom:extent.bottom};
_57765=OpenLayers.Util.extend({parameters:params},_57765);
this._json("/json/route/getRoutePart",_57764,_57765);
}});
OpenLayers.Map.prototype.getLayerByName=function(_57766){
for(var i=0;i<this.layers.length;i++){
if(this.layers[i].name==_57766){
return this.layers[i];
}
}
};
EMS.Services.StandardIconGeometry={colours:{purple:{start:"4D1448",end:"AB489B"},green:{start:"1D4242",end:"71C9C1"},brown:{start:"522C10",end:"AD8852"}},poi:{size:new OpenLayers.Size(27,32),offset:new OpenLayers.Pixel(-14,-32),url:function(_57767,_57768,text,_57769,_57770,_57771){
var _57772="/marker?type=poi&width=27&height=96&colour1="+encodeURIComponent(_57767)+"&colour2="+encodeURIComponent(_57768)+"&text1="+encodeURIComponent(text);
if(_57769!=null){
_57772+="&textColour="+encodeURIComponent(_57769);
}
if(_57770!=null){
_57772+="&hoverColour1="+encodeURIComponent(_57770);
}
if(_57771!=null){
_57772+="&hoverColour2="+encodeURIComponent(_57771);
}
return _57772;
}},multipoi:{size:new OpenLayers.Size(36,43),offset:new OpenLayers.Pixel(-14,-43),url:function(_57773,_57774,text,_57775,_57776,_57777){
var query="/marker?type=multipoi&width=36&height=129&colour1="+encodeURIComponent(_57773)+"&colour2="+encodeURIComponent(_57774)+"&text2=&text1="+encodeURIComponent(text);
if(_57775!=null){
query+="&textColour="+encodeURIComponent(_57775);
}
if(_57776!=null){
query+="&hoverColour1="+encodeURIComponent(_57776);
}
if(_57777!=null){
query+="&hoverColour2="+encodeURIComponent(_57777);
}
return query;
}},babushka:{size:new OpenLayers.Size(36,43),offset:new OpenLayers.Pixel(-14,-43),url:function(text,_57778,_57779,_57780,_57781,_57782){
var query="/marker?type=babushka&width=36&height=129&text1="+encodeURIComponent(text);
if(_57778!=null){
query+="&colour1="+encodeURIComponent(_57778);
}else{
query+="&colour1=213367";
}
if(_57778!=null){
query+="&colour2="+encodeURIComponent(_57779);
}else{
query+="&colour2=2B89C9";
}
if(_57780!=null){
query+="&textColour="+encodeURIComponent(_57780);
}
if(_57781!=null){
query+="&hoverColour1="+encodeURIComponent(_57781);
}
if(_57782!=null){
query+="&hoverColour2="+encodeURIComponent(_57782);
}
return query;
}}};
EMS.Services.StandardIcons={crossHair:function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"cross_hair.png",new OpenLayers.Size(28,30),new OpenLayers.Pixel(-14,-15));
},crossHairAGD:function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"cross_hair3.png",new OpenLayers.Size(28,30),new OpenLayers.Pixel(-14,-15));
},crossHairGDA:function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"cross_hair2.png",new OpenLayers.Size(28,30),new OpenLayers.Pixel(-14,-15));
},start:function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"start.png",new OpenLayers.Size(43,30),new OpenLayers.Pixel(-20,-29));
},end:function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"end.png",new OpenLayers.Size(34,30),new OpenLayers.Pixel(-20,-29));
},vias:[function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"via1.png",new OpenLayers.Size(42,30),new OpenLayers.Pixel(-20,-29));
},function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"via2.png",new OpenLayers.Size(42,30),new OpenLayers.Pixel(-20,-29));
},function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"via3.png",new OpenLayers.Size(42,30),new OpenLayers.Pixel(-20,-29));
},function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"via4.png",new OpenLayers.Size(42,30),new OpenLayers.Pixel(-20,-29));
},function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"via5.png",new OpenLayers.Size(42,30),new OpenLayers.Pixel(-20,-29));
}],redNumber:function(_57783,text){
return new OpenLayers.Icon(_57783+"/marker?type=number&width=20&height=20&colour1=000000&colour2=000000&text1="+text,new OpenLayers.Size(20,20),new OpenLayers.Pixel(-10,-10));
},poi:function(_57784,_57785,_57786,text,_57787,_57788,_57789){
return new EMS.HoverIcon(_57784+EMS.Services.StandardIconGeometry.poi.url(_57785,_57786,text,_57787,_57788,_57789),EMS.Services.StandardIconGeometry.poi.size,EMS.Services.StandardIconGeometry.poi.offset,null,3);
},purplePoi:function(_57790,text){
return EMS.Services.StandardIcons.poi(_57790,EMS.Services.StandardIconGeometry.colours.purple.start,EMS.Services.StandardIconGeometry.colours.purple.end,text);
},greenPoi:function(_57791,text){
return EMS.Services.StandardIcons.poi(_57791,EMS.Services.StandardIconGeometry.colours.green.start,EMS.Services.StandardIconGeometry.colours.green.end,text);
},brownPoi:function(_57792,text){
return EMS.Services.StandardIcons.poi(_57792,EMS.Services.StandardIconGeometry.colours.brown.start,EMS.Services.StandardIconGeometry.colours.brown.end,text);
},multipoi:function(_57793,_57794,_57795,text,_57796,_57797,_57798){
return new EMS.HoverIcon(_57793+EMS.Services.StandardIconGeometry.multipoi.url(_57794,_57795,text,_57796,_57797,_57798),EMS.Services.StandardIconGeometry.multipoi.size,EMS.Services.StandardIconGeometry.multipoi.offset,null,3);
},purpleMultipoi:function(_57799,text){
return new EMS.Services.StandardIcons.multipoi(_57799,EMS.Services.StandardIconGeometry.colours.purple.start,EMS.Services.StandardIconGeometry.colours.purple.end,text);
},greenMultipoi:function(_57800,text){
return new EMS.Services.StandardIcons.multipoi(_57800,EMS.Services.StandardIconGeometry.colours.green.start,EMS.Services.StandardIconGeometry.colours.green.end,text);
},brownMultipoi:function(_57801,text){
return new EMS.Services.StandardIcons.multipoi(_57801,EMS.Services.StandardIconGeometry.colours.brown.start,EMS.Services.StandardIconGeometry.colours.brown.end,text);
},babushka:function(_57802,text,_57803,_57804,_57805,_57806,_57807){
return new EMS.HoverIcon(_57802+EMS.Services.StandardIconGeometry.babushka.url(text,_57803,_57804,_57805,_57806,_57807),EMS.Services.StandardIconGeometry.babushka.size,EMS.Services.StandardIconGeometry.babushka.offset,null,3);
},circlePoi:function(){
return new EMS.HoverIcon(EMS.Util.getImagesLocation()+"circle_poi.png",new OpenLayers.Size(16,16),new OpenLayers.Pixel(-8,-8),null,2);
}};
EMS.Services.LineFeatureStyle={fillColor:"#3366ff",fillOpacity:0.7,hoverFillColor:"red",hoverFillOpacity:1,strokeColor:"#3366ff",strokeOpacity:0.7,strokeWidth:7,hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:6,pointRadius:6,hoverPointRadius:6,hoverPointUnit:"%",pointerEvents:"visiblePainted"};
EMS.Services.RouteManager=OpenLayers.Class({EVENT_TYPES:["routeretrieved","invalidroute","routeerror"],events:null,mode:null,initialize:function(map){
this.map=map;
this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);
this.show=true;
this.vectors=[];
},route:function(_57808,_57809,tolls,_57810,_57811,_57812){
if(!this.itin){
this.itin=new EMS.Services.Itin();
}
this.mode="route1";
this.options=_57812;
this.routeVectorLayer=_57811;
this.itin.combinedRoute(_57808,_57809,tolls,_57810,true,OpenLayers.Function.bind(this._setupMapRoute,this),_57812);
},toggleRoute:function(show){
this.show=show;
if(this.routeVectorLayer){
this.routeVectorLayer.setVisibility(show);
}
},clearRoute:function(){
if(this.routeVectorLayer){
this.routeVectorLayer.setVisibility(false);
}
if(this.rHandle){
this.itin.releaseRouteHandle(this.rHandle);
}
this._clearVectorFeatures();
this.map.events.unregister("moveend",this,this._moveHandler);
this.rHandle=null;
this.routeVectorLayer=null;
this.routeDetails=null;
},_clearVectorFeatures:function(){
if(this.routeVectorLayer&&this.vectors){
this.routeVectorLayer.removeFeatures(this.vectors);
this.vectors=[];
}
},_setupMapRoute:function(route){
if(route.error){
this.events.triggerEvent("routeerror",route);
return;
}
this.rHandle=route.routeHandle;
this.routeDetails=route;
this.map.events.register("moveend",this,this._moveHandler);
this.events.triggerEvent("routeretrieved");
this._moveHandler();
if(this.options&&this.options.onComplete){
this.options.onComplete(route);
}
},_moveHandler:function(){
if(this.show){
var extent=this.map.getExtent();
extent.top=EMS.Util.sgp4ToLat(extent.top);
extent.bottom=EMS.Util.sgp4ToLat(extent.bottom);
if(navigator.appName.contains("Microsoft")){
this._clearVectorFeatures();
}else{
if(EMS.Util.isGecko()){
var x=(this.map.getCenter().lon/this.map.getResolution()+this.routeVectorLayer.renderer.left);
var y=(this.map.getCenter().lat/this.map.getResolution()-this.routeVectorLayer.renderer.top);
if(x<-14000||x>14000){
this.routeVectorLayer.renderer.localResolution=null;
}
if(y<-14000||y>14000){
this.routeVectorLayer.renderer.localResolution=null;
}
}
}
var _57813={group:"routePart"};
this.itin.getRoutePart(this.rHandle,this.map.getResolution(),extent,OpenLayers.Function.bind(this._plotRouteLine,this),_57813);
}
},_plotRouteLine:function(_57814){
if(!this.routeVectorLayer){
return;
}
var _57815=[];
if(_57814.invalidRoute){
this.events.triggerEvent("invalidroute");
this.clearRoute();
return;
}
this.routeVectorLayer.setVisibility(false);
for(var _57816=0;_57816<_57814.routes.length;_57816++){
var route=_57814.routes[_57816];
var _57817=[];
for(i=0;i<route.routeGeometry.length;i++){
var _57818=[];
for(var j=0;j<route.routeGeometry[i].length;j++){
var lon=route.routeGeometry[i][j][0];
var lat=EMS.Util.latToSGP4(route.routeGeometry[i][j][1]);
var point=new OpenLayers.Geometry.Point(lon,lat);
_57818.push(point);
}
if(_57818.length>0){
var _57819=new OpenLayers.Geometry.LineString(_57818);
_57817.push(_57819);
}
}
if(_57817.length>0){
var _57820=new OpenLayers.Geometry.MultiLineString(_57817);
var vector=new EMS.Feature.Vector(_57820);
vector.routeNumber=_57816;
vector.routeHandle=_57814.routeHandle;
vector.style=EMS.Services.LineFeatureStyle;
_57815.push(vector);
}
}
this._clearVectorFeatures();
if(_57815.length>0){
this.routeVectorLayer.addFeatures(_57815);
for(var i=0;i<_57815.length;i++){
this.vectors.push(_57815[i]);
}
}
this.routeVectorLayer.setVisibility(true);
},CLASS_NAME:"EMS.Services.RouteManager"});
EMS.Services.RouteManager2=OpenLayers.Class(EMS.Services.RouteManager,{route:function(_57821,_57822,_57823){
if(!this.itin){
this.itin=new EMS.Services.Itin2();
}
if(!_57821.preferences.contains("ROUTE_HANDLE_ONLY")){
_57821.preferences.push("ROUTE_HANDLE_ONLY");
}
this.mode="route2";
this.options=_57823;
this.routeVectorLayer=_57822;
this.itin.combinedRoute(_57821,OpenLayers.Function.bind(this._setupMapRoute,this),_57823);
},_plotRouteLine:function(_57824){
if(!this.routeVectorLayer){
return;
}
var _57825=[];
if(_57824.invalidRoute){
this.events.triggerEvent("invalidroute");
this.clearRoute();
return;
}
this.routeVectorLayer.setVisibility(false);
var _57826=[];
var _57827=_57824.polylines;
for(i=0;i<_57827.length;i++){
var _57828=[];
for(var j=0;j<_57827[i].length;j++){
var lon=_57827[i][j][0];
var lat=EMS.Util.latToSGP4(_57827[i][j][1]);
var point=new OpenLayers.Geometry.Point(lon,lat);
_57828.push(point);
}
if(_57828.length>0){
var _57829=new OpenLayers.Geometry.LineString(_57828);
_57826.push(_57829);
}
}
if(_57826.length>0){
var _57830=new OpenLayers.Geometry.MultiLineString(_57826);
var vector=new EMS.Feature.Vector(_57830);
vector.style=EMS.Services.LineFeatureStyle;
vector.routeHandle=_57824.routeHandle;
_57825.push(vector);
}
this._clearVectorFeatures();
if(_57825.length>0){
this.routeVectorLayer.addFeatures(_57825);
for(var i=0;i<_57825.length;i++){
this.vectors.push(_57825[i]);
}
}
this.routeVectorLayer.setVisibility(true);
},CLASS_NAME:"EMS.Services.RouteManager2"});
OpenLayers.Geometry.prototype.externalize=function(_57831){
throw "EMS Unsupported Geometry Type: "+this.CLASS_NAME;
};
OpenLayers.Geometry.LineString.prototype.externalize=function(_57832){
return _57832.formatPolyline(this);
};
OpenLayers.Geometry.LinearRing.prototype.externalize=function(_57833){
return _57833.formatClosedPolyline(this);
};
OpenLayers.Geometry.MultiLineString.prototype.externalize=function(_57834){
return _57834.formatGeometryContainer(this);
};
OpenLayers.Geometry.Polygon.prototype.externalize=function(_57835){
return _57835.formatGeometryContainer(this);
};
OpenLayers.Geometry.Point.prototype.externalize=function(_57836){
return _57836.formatPoint(this);
};
OpenLayers.Feature.Vector.prototype.externalize=function(_57837){
return _57837.formatFeature(this);
};
EMS.Layer=new Object();
EMS.Layer.Vector=OpenLayers.Class(OpenLayers.Layer.Vector,{initialize:function(name,_57838){
OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments);
},externalize:function(_57839){
return _57839.formatVector(this);
}});
EMS.Feature=new Object();
EMS.Feature.Vector=OpenLayers.Class(OpenLayers.Feature.Vector,{routeHandle:null,initialize:function(_57840,_57841,style){
OpenLayers.Feature.Vector.prototype.initialize.apply(this,arguments);
},getRouteHandle:function(){
return routeHandle;
}});
EMS.Geometry=new Object();
EMS.Geometry.JsonFormatter=OpenLayers.Class({defaultColor:"none",defaultOpacity:0,defaultWidth:1,defaultLinecap:null,filter:null,lineReducer:null,initialize:function(filter,_57842){
this.filter=filter;
this.lineReducer=_57842;
},formatVector:function(vector){
return {features:this._formatComponents(vector.features)};
},formatFeature:function(_57843){
return {routeHandle:_57843.routeHandle?_57843.routeHandle:null,style:this.formatStyle(_57843.style),geometry:_57843.routeHandle?null:_57843.geometry.externalize(this)};
},formatGeometryContainer:function(_57844){
return {type:_57844.CLASS_NAME,components:this._formatComponents(_57844.components)};
},formatPolyline:function(line){
var _57845=this._filterPolyline(line.components);
var _57846=[];
for(var i=0;i<_57845.length;i++){
_57846.push(this._formatComponents(this._reducePolyline(_57845[i])));
}
return {type:line.CLASS_NAME,segments:_57846};
},formatClosedPolyline:function(line){
var _57847=[];
_57847.push(this._formatComponents(this._reducePolyline(line.components)));
return {type:line.CLASS_NAME,segments:_57847};
},formatStyle:function(style){
return {fillColor:style.fillColor?style.fillColor:this.defaultColor,fillOpacity:style.fillOpacity?style.fillOpacity:this.defaultOpacity,strokeColor:style.strokeColor?style.strokeColor:this.defaultColor,strokeOpacity:style.strokeOpacity?style.strokeOpacity:this.defaultOpacity,strokeWidth:style.strokeWidth?style.strokeWidth:this.defaultWidth,strokeLinecap:style.strokeLinecap?style.strokeLinecap:this.defaultLinecap};
},_formatComponents:function(_57848){
var _57849=[];
for(var i=0;i<_57848.length;i++){
_57849.push(_57848[i].externalize(this));
}
return _57849;
},_reducePolyline:function(_57850){
if(this.lineReducer){
return this.lineReducer.reduce(_57850);
}
return _57850;
},_filterPolyline:function(_57851){
if(this.filter){
return this.filter.filter(_57851);
}
return [_57851];
},formatPoint:function(point){
return {x:point.x,y:EMS.Util.sgp4ToLat(point.y)};
},CLASS_NAME:"EMS.Geometry.JsonFormatter"});
EMS.Geometry.SimpleLineReducer=OpenLayers.Class({factor:5,minDistance:null,initialize:function(_57852){
this.minDistance=_57852*this.factor;
},reduce:function(_57853){
var _57854=[];
var _57855=_57853[0];
_57854.push(_57855);
if(_57853.length>1){
var _57856=_57853.length-1;
for(var i=1;i<_57856;i++){
var _57857=_57853[i];
if(this.includePoint(_57855,_57857)){
_57854.push(_57857);
_57855=_57857;
}
}
_57854.push(_57853[_57856]);
}
return _57854;
},includePoint:function(_57858,_57859){
return (Math.abs(_57858.x-_57859.x)>this.minDistance)||(Math.abs(_57858.y-_57859.y)>this.minDistance);
},CLASS_NAME:"EMS.Geometry.SimpleLineReducer"});
EMS.Geometry.PolylineBoundsFilter=OpenLayers.Class({bounds:null,initialize:function(_57860){
this.bounds=_57860;
},filter:function(_57861){
var _57862=[];
if(_57861.length>1){
var _57863=[];
var _57864=_57861.length-1;
for(var i=0;i<_57864;i++){
var _57865=new OpenLayers.Bounds(_57861[i].x,_57861[i].y,_57861[i].x,_57861[i].y);
_57865.extend(_57861[i+1]);
if(this.bounds.intersectsBounds(_57865)){
if(_57863.length==0){
_57863.push(_57861[i]);
}
_57863.push(_57861[i+1]);
}else{
if(_57863.length>0){
_57862.push(_57863);
_57863=[];
}
}
}
if(_57863.length>1){
_57862.push(_57863);
}
}
return _57862;
},CLASS_NAME:"EMS.Geometry.PolylineBoundsFilter"});
EMS.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:false,wheelObserver:null,initialize:function(){
this.active=true;
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},destroy:function(){
if(this.handler){
this.handler.destroy();
}
this.handler=null;
this.map.events.unregister("click",this,this.defaultClick);
this.map.events.unregister("dblclick",this,this.defaultDblClick);
this.map.events.unregister("mousedown",this,this.defaultMouseDown);
this.map.events.unregister("mouseup",this,this.defaultMouseUp);
this.map.events.unregister("mousemove",this,this.defaultMouseMove);
this.map.events.unregister("mouseout",this,this.defaultMouseOut);
OpenLayers.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);
OpenLayers.Event.stopObserving(window,"mousewheel",this.wheelObserver);
OpenLayers.Event.stopObserving(document,"mousewheel",this.wheelObserver);
this.wheelObserver=null;
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
this.map.events.register("click",this,this.defaultClick);
this.map.events.register("dblclick",this,this.defaultDblClick);
this.map.events.register("mousedown",this,this.defaultMouseDown);
this.map.events.register("mouseup",this,this.defaultMouseUp);
this.map.events.register("mousemove",this,this.defaultMouseMove);
this.map.events.register("mouseout",this,this.defaultMouseOut);
this.registerWheelEvents();
this.map.viewPortDiv.style.cursor="url('"+EMS.Util.getImagesLocation()+"grab.cur'), move";
},registerWheelEvents:function(){
this.wheelObserver=this.onWheelEvent.bindAsEventListener(this);
OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserver);
OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);
OpenLayers.Event.observe(document,"mousewheel",this.wheelObserver);
},defaultMouseDown:function(evt){
if(!this.active){
return;
}
this.mouseDownStart=evt.xy.clone();
this.mouseDownStartTime=new Date().valueOf();
this.doubleClickCalled=false;
this.clickCalled=false;
this.map.viewPortDiv.style.cursor="url('"+EMS.Util.getImagesLocation()+"grabbing.cur'), move";
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
this.mouseDragStart=evt.xy.clone();
this.performedDrag=false;
if(evt.shiftKey){
this.map.div.style.cursor="crosshair";
this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");
this.zoomBox.style.backgroundColor="white";
this.zoomBox.style.filter="alpha(opacity=50)";
this.zoomBox.style.opacity="0.50";
this.zoomBox.style.fontSize="1px";
this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE["Popup"]-1;
this.map.viewPortDiv.appendChild(this.zoomBox);
}
document.onselectstart=function(){
return false;
};
OpenLayers.Event.stop(evt);
},defaultClick:function(evt){
if(!this.active){
return;
}
this.clickCalled=true;
var result=OpenLayers.Control.MouseDefaults.prototype.defaultClick.apply(this,arguments);
if(!OpenLayers.Event.isLeftClick(evt)){
return result;
}
this.mouseDownStart=null;
return result;
},defaultMouseMove:function(evt){
if(!this.active){
return;
}
this.mousePosition=evt.xy.clone();
if(this.mouseDragStart!=null){
if(this.zoomBox){
var deltaX=Math.abs(this.mouseDragStart.x-evt.xy.x);
var deltaY=Math.abs(this.mouseDragStart.y-evt.xy.y);
this.zoomBox.style.width=Math.max(1,deltaX)+"px";
this.zoomBox.style.height=Math.max(1,deltaY)+"px";
if(evt.xy.x<this.mouseDragStart.x){
this.zoomBox.style.left=evt.xy.x+"px";
}
if(evt.xy.y<this.mouseDragStart.y){
this.zoomBox.style.top=evt.xy.y+"px";
}
}else{
var deltaX=this.mouseDragStart.x-evt.xy.x;
var deltaY=this.mouseDragStart.y-evt.xy.y;
if(!this.performedDrag&&(Math.abs(deltaX)<7&&Math.abs(deltaY)<7)){
return;
}
var size=this.map.getSize();
var newXY=new OpenLayers.Pixel(size.w/2+deltaX,size.h/2+deltaY);
var _57866=this.map.getLonLatFromViewPortPx(newXY);
this.map.setCenter(_57866,null,true);
this.mouseDragStart=evt.xy.clone();
this.map.div.style.cursor="move";
this.performedDrag=true;
}
}
},defaultMouseOut:function(evt){
if(!this.active){
return;
}
if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(evt,this.map.div)){
if(this.zoomBox){
this.removeZoomBox();
}
this.mouseDragStart=null;
}
},cancelRecenter:function(){
this.doubleClickCalled=true;
},defaultWheelUp:function(evt){
if(!this.active){
return;
}
var mouse=this.map.getLonLatFromPixel(evt.xy);
var center=this.map.getCenter();
var _57867=this.map.getResolution();
var _57868=new OpenLayers.Pixel((mouse.lon-center.lon)/_57867,(mouse.lat-center.lat)/_57867);
if(this.map.baseLayer!=null){
var _57869=this.map.baseLayer.resolutions[this.map.getZoom()+1];
}else{
var _57869=this.map.getResolution();
}
this.map.setCenter(new OpenLayers.LonLat(center.lon+(_57868.x*_57869),center.lat+(_57868.y*_57869)),this.map.getZoom()+1);
},defaultWheelDown:function(evt){
if(!this.active){
return;
}
if(this.map.getZoom()>0){
var mouse=this.map.getLonLatFromPixel(evt.xy);
var center=this.map.getCenter();
var _57870=this.map.getResolution();
var _57871=new OpenLayers.Pixel((mouse.lon-center.lon)/_57870,(mouse.lat-center.lat)/_57870);
if(this.map.baseLayer!=null){
var _57872=this.map.baseLayer.resolutions[this.map.getZoom()-1];
}else{
var _57872=this.map.getResolution();
}
this.map.setCenter(new OpenLayers.LonLat(mouse.lon-(_57871.x*_57872),mouse.lat-(_57871.y*_57872)),this.map.getZoom()-1);
}
},defaultMouseUp:function(evt){
if(!this.active){
return;
}
this.map.viewPortDiv.style.cursor="url('"+EMS.Util.getImagesLocation()+"grab.cur'), move";
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
if(this.zoomBox){
this.zoomBoxEnd(evt);
}else{
if(this.performedDrag){
this.map.setCenter(this.map.center);
}
}
document.onselectstart=null;
this.mouseDragStart=null;
this.map.div.style.cursor="";
this.performedDrag=false;
},zoomBoxEnd:function(evt){
if(this.mouseDragStart!=null){
if(Math.abs(this.mouseDragStart.x-evt.xy.x)>5||Math.abs(this.mouseDragStart.y-evt.xy.y)>5){
var start=this.map.getLonLatFromViewPortPx(this.mouseDragStart);
var end=this.map.getLonLatFromViewPortPx(evt.xy);
var top=Math.max(start.lat,end.lat);
var bottom=Math.min(start.lat,end.lat);
var left=Math.min(start.lon,end.lon);
var right=Math.max(start.lon,end.lon);
var bounds=new OpenLayers.Bounds(left,bottom,right,top);
this.map.zoomToExtent(bounds);
}else{
var end=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(new OpenLayers.LonLat((end.lon),(end.lat)),this.map.getZoom()+1);
}
this.removeZoomBox();
}
},removeZoomBox:function(){
this.map.viewPortDiv.removeChild(this.zoomBox);
this.zoomBox=null;
},defaultDblClick:function(evt){
if(!this.active){
return;
}
this.doubleClickCalled=true;
var _57873=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_57873,this.map.zoom+1);
OpenLayers.Event.stop(evt);
return false;
},onWheelEvent:function(e){
var inMap=false;
var elem=OpenLayers.Event.element(e);
while(elem!=null){
if(this.map&&elem==this.map.div){
inMap=true;
break;
}
elem=elem.parentNode;
}
if(inMap){
var delta=0;
if(!e){
e=window.event;
}
if(e.wheelDelta){
delta=e.wheelDelta/120;
if(window.opera){
delta=-delta;
}
}else{
if(e.detail){
delta=-e.detail/3;
}
}
if(delta){
e.xy=this.mousePosition;
if(delta<0){
this.defaultWheelDown(e);
}else{
this.defaultWheelUp(e);
}
}
OpenLayers.Event.stop(e);
}
},CLASS_NAME:"EMS.Control.MouseDefaults"});
EMS.HighlightFeature=OpenLayers.Class(OpenLayers.Control,{callbacks:null,onSelect:function(){
},onUnselect:function(){
},initialize:function(layer,_57874){
OpenLayers.Control.prototype.initialize.apply(this,[_57874]);
this.callbacks=OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.callbacks);
this.layer=layer;
this.handler=new OpenLayers.Handler.Feature(this,layer,this.callbacks);
this.selectStyle=_57874.hoverStyle;
this.handler.activate=function(){
if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){
this.layerIndex=this.layer.div.style.zIndex;
return true;
}else{
return false;
}
};
},overFeature:function(_57875){
if(!(OpenLayers.Util.indexOf(this.layer.selectedFeatures,_57875)>-1)){
this.select(_57875);
}
},outFeature:function(_57876){
this.unselect(_57876);
},select:function(_57877){
if(_57877.originalStyle==null){
_57877.originalStyle=_57877.style;
}
this.layer.selectedFeatures.push(_57877);
this.layer.drawFeature(_57877,this.selectStyle);
this.onSelect(_57877);
},unselect:function(_57878){
if(_57878.originalStyle==null){
_57878.originalStyle=_57878.style;
}
this.layer.drawFeature(_57878,_57878.originalStyle);
OpenLayers.Util.removeItem(this.layer.selectedFeatures,_57878);
this.onUnselect(_57878);
},setMap:function(map){
this.handler.setMap(map);
OpenLayers.Control.prototype.setMap.apply(this,arguments);
},CLASS_NAME:"EMS.HighlightFeature"});
EMS.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["minimize","maximize"],id:"OverviewMap",element:null,events:null,ovmap:null,size:new OpenLayers.Size(145,93),layers:null,minRatio:9,maxRatio:9,mapOptions:null,initialize:function(_57879){
this.layers=_57879.layers;
OpenLayers.Control.prototype.initialize.apply(this,[_57879]);
this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);
},destroy:function(){
if(!this.mapDiv){
return;
}
this.mapDiv.removeChild(this.extentRectangle);
this.extentRectangle=null;
this.rectEvents.destroy();
this.rectEvents=null;
this.ovmap=null;
this.element.removeChild(this.mapDiv);
this.mapDiv=null;
this.mapDivEvents.destroy();
this.mapDivEvents=null;
this.div.removeChild(this.element);
this.element=null;
this.elementEvents.destroy();
this.elementEvents=null;
if(this.maximizeDiv){
OpenLayers.Event.stopObservingElement(this.maximizeDiv);
this.div.removeChild(this.maximizeDiv);
this.maximizeDiv=null;
}
if(this.minimizeDiv){
OpenLayers.Event.stopObservingElement(this.minimizeDiv);
this.div.removeChild(this.minimizeDiv);
this.minimizeDiv=null;
}
this.map.events.unregister("moveend",this,this.update);
this.map.events.unregister("changebaselayer",this,this.baseLayerDraw);
this.events.destroy();
OpenLayers.Control.prototype.destroy.apply(this,arguments);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!(this.layers.length>0)){
if(this.map.baseLayer){
var layer=this.map.baseLayer.clone();
this.layers=[layer];
}else{
this.map.events.register("changebaselayer",this,this.baseLayerDraw);
return this.div;
}
}
this.element=document.createElement("div");
this.element.className=this.displayClass+"Element";
this.element.style.display="none";
this.element.style.bottom="0px";
this.element.style.right="145px";
this.cornersDivTop=this.createCorner("Top",145,4,0,0,"frame-top.gif");
this.cornersDivBottom=this.createCorner("Bottom",145,4,89,0,"frame-bottom.gif");
this.cornersDivLeft=this.createCorner("Left",4,85,4,0,"frame-left.gif");
this.cornersDivRight=this.createCorner("Right",1,93,0,145,"frame-right.gif");
this.australiaDiv=document.createElement("div");
this.australiaDiv.style.width=this.size.w+"px";
this.australiaDiv.style.height=this.size.h+"px";
this.australiaDiv.style.left="0px";
this.australiaDiv.style.top="0px";
this.australiaDiv.style.position="absolute";
this.australiaDiv.style.overflow="hidden";
this.australiaDiv.style.backgroundImage="url('"+EMS.Util.getImagesLocation()+"australia.gif')";
this.australiaDiv.id=OpenLayers.Util.createUniqueID("australiaOverview");
this.australiaDiv.style.display="none";
this.mapDiv=document.createElement("div");
this.mapDiv.style.width=this.size.w+"px";
this.mapDiv.style.height=this.size.h+"px";
this.mapDiv.style.position="relative";
this.mapDiv.style.overflow="hidden";
this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap");
this.extentRectangle=document.createElement("div");
this.extentRectangle.style.position="absolute";
this.extentRectangle.style.zIndex=1000;
this.extentRectangle.style.overflow="hidden";
this.extentRectangle.className=this.displayClass+"ExtentRectangle";
this.mapDiv.appendChild(this.extentRectangle);
this.element.appendChild(this.mapDiv);
this.element.appendChild(this.australiaDiv);
this.element.appendChild(this.cornersDivTop);
this.element.appendChild(this.cornersDivBottom);
this.element.appendChild(this.cornersDivLeft);
this.element.appendChild(this.cornersDivRight);
this.div.appendChild(this.element);
this.elementEvents=new OpenLayers.Events(this,this.element);
this.elementEvents.register("mousedown",this,function(e){
OpenLayers.Event.stop(e);
});
this.elementEvents.register("click",this,function(e){
OpenLayers.Event.stop(e);
});
this.elementEvents.register("dblclick",this,function(e){
OpenLayers.Event.stop(e);
});
this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true);
this.rectEvents.register("mouseover",this,this.rectMouseOver);
this.rectEvents.register("mouseout",this,this.rectMouseOut);
this.rectEvents.register("mousedown",this,this.rectMouseDown);
this.rectEvents.register("mousemove",this,this.rectMouseMove);
this.rectEvents.register("mouseup",this,this.rectMouseUp);
this.rectEvents.register("click",this,function(e){
OpenLayers.Event.stop(e);
});
this.rectEvents.register("dblclick",this,this.rectDblClick);
this.mapDivEvents=new OpenLayers.Events(this,this.mapDiv);
this.mapDivEvents.register("click",this,this.mapDivClick);
if(!this.outsideViewport){
this.div.className=this.displayClass+"Container";
var _57880=EMS.Util.getImagesLocation();
var img=_57880+"tab_out.gif";
this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(15,38),img,"absolute");
this.maximizeDiv.style.display="none";
this.maximizeDiv.className=this.displayClass+"MaximizeButton";
OpenLayers.Event.observe(this.maximizeDiv,"click",this.maximizeControl.bindAsEventListener(this));
OpenLayers.Event.observe(this.maximizeDiv,"dblclick",function(e){
OpenLayers.Event.stop(e);
});
this.div.appendChild(this.maximizeDiv);
this.addHover(this.maximizeDiv,"tab_out_over.gif","tab_out.gif");
var img=_57880+"tab_in.gif";
this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(15,38),img,"absolute");
this.minimizeDiv.style.zIndex="3000";
this.minimizeDiv.style.display="none";
this.minimizeDiv.className=this.displayClass+"MinimizeButton";
OpenLayers.Event.observe(this.minimizeDiv,"click",this.minimizeControl.bindAsEventListener(this));
OpenLayers.Event.observe(this.minimizeDiv,"dblclick",function(e){
OpenLayers.Event.stop(e);
});
this.div.appendChild(this.minimizeDiv);
this.addHover(this.minimizeDiv,"tab_in_over.gif","tab_in.gif");
this.minimizeControl();
}else{
this.element.style.display="";
}
if(this.map.getExtent()){
this.update();
}
this.map.events.register("moveend",this,this.update);
return this.div;
},addHover:function(_57881,_57882,_57883){
var _57884=_57881.childNodes[0];
var _57885=function(_57886,_57887){
while(_57886){
if(_57886==_57887){
return true;
}
_57886=_57886.parentNode;
}
return false;
};
OpenLayers.Event.observe(_57881,"mouseover",function(){
if(!_57881.isOver){
if((navigator.appVersion.indexOf("MSIE 6.")!=-1)){
_57881.appendChild(OpenLayers.Util.createImage(null,null,null,EMS.Util.getImagesLocation()+_57882));
_57881.childNodes[1].style.top="0px";
_57881.childNodes[1].style.left="0px";
_57881.childNodes[1].style.position="absolute";
_57881.childNodes[1].style.marginLeft="0px";
_57881.childNodes[1].style.marginTop="0px";
}else{
_57881.childNodes[0].src=EMS.Util.getImagesLocation()+_57882;
}
_57881.isOver=true;
}
});
OpenLayers.Event.observe(_57881,"mouseout",function(e){
if(e.relatedTarget==this||_57885(e.relatedTarget,_57881)){
return;
}
if((navigator.appVersion.indexOf("MSIE 6.")!=-1)){
_57881.removeChild(_57881.childNodes[1]);
}else{
_57881.childNodes[0].src=EMS.Util.getImagesLocation()+_57883;
}
_57881.isOver=false;
});
},createCorner:function(type,width,height,top,left,_57888){
var div;
div=document.createElement("div");
div.id=OpenLayers.Util.createUniqueID("cornersOverview"+type);
div.style.width=width+"px";
div.style.height=height+"px";
div.style.left=left+"px";
div.style.top=top+"px";
div.style.position="absolute";
div.style.overflow="hidden";
div.style.backgroundImage="url('"+EMS.Util.getImagesLocation()+_57888+"')";
div.style.zIndex=1000;
return div;
},baseLayerDraw:function(){
this.draw();
this.map.events.unregister("changebaselayer",this,this.baseLayerDraw);
},rectMouseOver:function(evt){
},rectMouseOut:function(evt){
if(this.rectDragStart!=null){
if(this.performedRectDrag){
this.rectMouseMove(evt);
var _57889=this.getRectPxBounds();
if((_57889.top<=0)||(_57889.left<=0)||(_57889.bottom>=this.size.h-this.hComp)||(_57889.right>=this.size.w-this.wComp)){
this.updateMapToRect();
}else{
return;
}
}
this.rectDragStart=null;
}
},rectMouseDown:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
this.rectDragStart=evt.xy.clone();
this.performedRectDrag=false;
document.onselectstart=function(){
return false;
};
OpenLayers.Event.stop(evt);
},rectMouseMove:function(evt){
if(this.rectDragStart!=null){
var deltaX=this.rectDragStart.x-evt.xy.x;
var deltaY=this.rectDragStart.y-evt.xy.y;
var _57890=this.getRectPxBounds();
var _57891=_57890.top;
var _57892=_57890.left;
var _57893=Math.abs(_57890.getHeight());
var _57894=_57890.getWidth();
var newTop=Math.max(0,(_57891-deltaY));
newTop=Math.min(newTop,this.ovmap.size.h-this.hComp-_57893);
var _57895=Math.max(0,(_57892-deltaX));
_57895=Math.min(_57895,this.ovmap.size.w-this.wComp-_57894);
this.setRectPxBounds(new OpenLayers.Bounds(_57895,newTop+_57893,_57895+_57894,newTop));
this.rectDragStart=evt.xy.clone();
this.performedRectDrag=true;
OpenLayers.Event.stop(evt);
this.extentRectangle.style.cursor="url('"+EMS.Util.getImagesLocation()+"grabbing.cur'), move";
}else{
this.extentRectangle.style.cursor="url('"+EMS.Util.getImagesLocation()+"grab.cur'), move";
}
},rectMouseUp:function(evt){
if(!OpenLayers.Event.isLeftClick(evt)){
return;
}
if(this.performedRectDrag){
this.updateMapToRect();
OpenLayers.Event.stop(evt);
}
document.onselectstart=null;
this.rectDragStart=null;
},rectDblClick:function(evt){
this.performedRectDrag=false;
OpenLayers.Event.stop(evt);
this.updateOverview();
},mapDivClick:function(evt){
var _57896=this.getRectPxBounds();
var _57897=_57896.getCenterPixel();
var deltaX=evt.xy.x-_57897.x;
var deltaY=evt.xy.y-_57897.y;
var top=_57896.top;
var left=_57896.left;
var height=Math.abs(_57896.getHeight());
var width=_57896.getWidth();
var newTop=Math.max(0,(top+deltaY));
newTop=Math.min(newTop,this.ovmap.size.h-height);
var _57898=Math.max(0,(left+deltaX));
_57898=Math.min(_57898,this.ovmap.size.w-width);
this.setRectPxBounds(new OpenLayers.Bounds(_57898,newTop+height,_57898+width,newTop));
this.updateMapToRect();
OpenLayers.Event.stop(evt);
},maximizeControl:function(e){
this.element.style.display="";
this.showToggle(false);
if(e!=null){
OpenLayers.Event.stop(e);
}
this.events.triggerEvent("maximize");
},minimizeControl:function(e){
this.element.style.display="none";
this.showToggle(true);
if(e!=null){
OpenLayers.Event.stop(e);
}
this.events.triggerEvent("minimize");
},showToggle:function(_57899){
this.maximizeDiv.style.display=_57899?"":"none";
this.minimizeDiv.style.display=_57899?"none":"";
},update:function(){
if(this.ovmap==null){
this.createMap();
}
this.updateOverview();
this.updateRectToMap();
},isSuitableOverview:function(){
var _57900=this.map.getExtent();
var _57901=this.map.maxExtent;
var _57902=new OpenLayers.Bounds(Math.max(_57900.left,_57901.left),Math.max(_57900.bottom,_57901.bottom),Math.min(_57900.right,_57901.right),Math.min(_57900.top,_57901.top));
var _57903=this.ovmap.getResolution()/this.map.getResolution();
return ((_57903>this.minRatio)&&(_57903<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(_57902)));
},updateOverview:function(){
if(this.map.getResolution()>0.0125){
}else{
this.australiaDiv.style.display="none";
this.mapDiv.style.display="block";
}
var mapRes=this.map.getResolution();
var _57904=this.ovmap.getResolution();
var _57905=_57904/mapRes;
if(_57905>this.maxRatio){
_57904=this.minRatio*mapRes;
}else{
if(_57905<=this.minRatio){
_57904=this.maxRatio*mapRes;
}
}
var _57906=this.ovmap.getZoomForResolution(_57904);
if(_57906<1){
_57906=1;
}
this.ovmap.setCenter(this.map.center,_57906);
this.updateRectToMap();
},createMap:function(){
var _57907=OpenLayers.Util.extend({controls:[],buffer:0},this.mapOptions);
this.ovmap=new OpenLayers.Map(this.mapDiv,_57907);
this.ovmap.addLayers(this.layers);
this.ovmap.zoomToMaxExtent();
this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));
this.wComp=(this.wComp)?this.wComp:2;
this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));
this.hComp=(this.hComp)?this.hComp:2;
},updateRectToMap:function(){
if(this.map.units!="degrees"){
if(this.ovmap.getProjection()&&(this.map.getProjection()!=this.ovmap.getProjection())){
alert("The overview map only works when it is in the same projection as the main map");
}
}
var _57908=this.getRectBoundsFromMapBounds(this.map.getExtent());
if(_57908){
this.setRectPxBounds(_57908);
}
},updateMapToRect:function(){
var _57909=this.getRectPxBounds();
var _57910=this.getMapBoundsFromRectBounds(_57909);
this.map.setCenter(_57910.getCenterLonLat(),this.map.zoom);
},getRectPxBounds:function(){
var top=parseInt(this.extentRectangle.style.top);
var left=parseInt(this.extentRectangle.style.left);
var height=parseInt(this.extentRectangle.style.height);
var width=parseInt(this.extentRectangle.style.width);
return new OpenLayers.Bounds(left,top+height,left+width,top);
},setRectPxBounds:function(_57911){
var top=Math.max(_57911.top,0);
var left=Math.max(_57911.left,0);
var bottom=Math.min(_57911.top+Math.abs(_57911.getHeight()),this.ovmap.size.h-this.hComp);
var right=Math.min(_57911.left+_57911.getWidth(),this.ovmap.size.w-this.wComp);
this.extentRectangle.style.top=parseInt(top)+"px";
this.extentRectangle.style.left=parseInt(left)+"px";
this.extentRectangle.style.height=parseInt(Math.max(bottom-top,0))+"px";
this.extentRectangle.style.width=parseInt(Math.max(right-left,0))+"px";
},getRectBoundsFromMapBounds:function(_57912){
var _57913=new OpenLayers.LonLat(_57912.left,_57912.bottom);
var _57914=new OpenLayers.LonLat(_57912.right,_57912.top);
var _57915=this.getOverviewPxFromLonLat(_57913);
var _57916=this.getOverviewPxFromLonLat(_57914);
var bounds=null;
if(_57915&&_57916){
bounds=new OpenLayers.Bounds(_57915.x,_57915.y,_57916.x,_57916.y);
}
return bounds;
},getMapBoundsFromRectBounds:function(_57917){
var _57918=new OpenLayers.Pixel(_57917.left,_57917.bottom);
var _57919=new OpenLayers.Pixel(_57917.right,_57917.top);
var _57920=this.getLonLatFromOverviewPx(_57918);
var _57921=this.getLonLatFromOverviewPx(_57919);
return new OpenLayers.Bounds(_57920.lon,_57920.lat,_57921.lon,_57921.lat);
},getLonLatFromOverviewPx:function(_57922){
var size=this.ovmap.size;
var res=this.ovmap.getResolution();
var center=this.ovmap.getExtent().getCenterLonLat();
var _57923=_57922.x-(size.w/2);
var _57924=_57922.y-(size.h/2);
return new OpenLayers.LonLat(center.lon+_57923*res,center.lat-_57924*res);
},getOverviewPxFromLonLat:function(lonlat){
var res=this.ovmap.getResolution();
var extent=this.ovmap.getExtent();
var px=null;
if(extent){
px=new OpenLayers.Pixel(Math.round(1/res*(lonlat.lon-extent.left)),Math.round(1/res*(extent.top-lonlat.lat)));
}
return px;
},CLASS_NAME:"EMS.Control.OverviewMap"});
EMS.Control.NorthArrow=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(_57925){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.element){
this.div.left="";
this.div.top="";
this.div.className=this.displayClass;
var image=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(11,18),EMS.Util.getImagesLocation()+"north_arrow.png");
image.style.position="relative";
this.element=this.div;
this.element.appendChild(image);
}
return this.div;
},CLASS_NAME:"EMS.Control.NorthArrow"});
EMS.Control.Copyright=OpenLayers.Class(OpenLayers.Control,{element:null,smallCopyright:false,initialize:function(_57926){
OpenLayers.Control.prototype.initialize.apply(this,arguments);
},destroy:function(){
OpenLayers.Control.prototype.destroy.apply(this,arguments);
OpenLayers.Event.stopObservingElement(this.div);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.element){
this.div.left="";
this.div.top="";
this.div.className=this.displayClass;
var _57927=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(70,22),EMS.Util.getImagesLocation()+"whereis-footprint.png");
_57927.style.position="relative";
var _57928=function(e){
var _57929=new OpenLayers.LonLat(this.map.center.lon,this.map.center.lat).asWGS84();
window.open("http://www.whereis.com/?y="+_57929.lat+"&x="+_57929.lon+"&z="+this.map.zoom,"_blank");
OpenLayers.Event.stop(e);
};
OpenLayers.Event.observe(_57927,"click",_57928.bindAsEventListener(this));
OpenLayers.Event.observe(_57927,"mouseover",function(){
_57927.style.cursor="pointer";
});
if(this.smallCopyright){
var _57930=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(46,22),EMS.Util.getImagesLocation()+"legals_sml.png");
}else{
var _57930=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(80,22),EMS.Util.getImagesLocation()+"legals.png");
}
_57930.style.position="absolute";
_57930.style.top="0px";
_57930.style.left="70px";
OpenLayers.Event.observe(_57930,"click",function(e){
window.open("http://www.whereis.com/products/terms-of-use/index.html","_blank");
OpenLayers.Event.stop(e);
});
OpenLayers.Event.observe(_57930,"mouseover",function(){
_57930.style.cursor="pointer";
});
this.element=this.div;
this.element.appendChild(_57927);
this.element.appendChild(_57930);
}
return this.div;
},CLASS_NAME:"EMS.Control.Copyright"});
EMS.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,bottom:null,initialize:function(_57931,_57932){
OpenLayers.Control.prototype.initialize.apply(this,[_57932]);
this.element=OpenLayers.Util.getElement(_57931);
},draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.element){
this.element=document.createElement("div");
this.div.className=this.displayClass;
if(this.bottom!=undefined){
this.div.style.bottom=this.bottom;
}
this.element.style.fontSize="smaller";
this.div.appendChild(this.element);
}
this.map.events.register("moveend",this,this.updateScale);
this.updateScale();
return this.div;
},updateScale:function(){
if(!this.map){
return;
}
if(!this.map.getExtent()){
return;
}
var _57933=Math.cos(EMS.Util.sgp4ToLat(((this.map.getExtent().bottom+this.map.getExtent().top)/2))*Math.PI/180);
var scale=_57933*6378137*Math.PI*this.map.getExtent().getWidth()/180;
if(!scale){
return;
}
function log10(x){
return Math.log(x)/Math.LN10;
}
function magnitude(x){
return Math.pow(10,Math.floor(log10(x)+1e-7));
}
var _57934=scale/4;
var _57935=this.map.getSize().w/4;
var _57936=this.map.getSize().w/scale;
var _57937=Math.round(_57934/magnitude(_57934))*magnitude(_57934);
var _57938=_57937*_57936;
if(_57937<1000){
_57937="&nbsp;"+_57937+"m";
}else{
_57937="&nbsp;"+(_57937/1000)+"km";
}
var _57939;
if(this.map.whereis_street_wms.getVisibility()){
_57939="black";
}else{
_57939="white";
}
this.element.innerHTML="<div class='"+this.displayClass+"Text' style='width: "+_57938+"px ; color:"+_57939+"'>"+_57937+"</div>";
},CLASS_NAME:"EMS.Control.Scale"});
EMS.MultiPopup=OpenLayers.Class(EMS.Popup,{events:null,EVENT_TYPES:["markerclick","hidden","shown"],history:[],initialize:function(id,lonlat,size,anchor,_57940,_57941,_57942,_57943){
this.mapId=OpenLayers.Util.createUniqueID(this.CLASS_NAME.replace(/\./g,"")+"_map");
EMS.Popup.prototype.initialize.apply(this,[id,lonlat,size,"",anchor,_57940]);
this.locatables=_57941;
this.locatableRenderer=_57942;
OpenLayers.Util.extend(this,_57943||{});
this.history=[];
this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES,true);
},markerCreator:function(_57944){
var icon,lonlat;
if(_57944.length==1){
icon=EMS.Services.StandardIcons.greenPoi(this.map.tilePath,"");
lonlat=_57944[0].lonlat.clone();
}else{
icon=EMS.Services.StandardIcons.greenMultipoi(this.map.tilePath,_57944.length);
var bounds=new OpenLayers.Bounds(_57944[0].lonlat.lon,_57944[0].lonlat.lat,_57944[0].lonlat.lon,_57944[0].lonlat.lat);
for(var i=1;i<_57944.length;i++){
bounds.extend(_57944[i].lonlat);
}
lonlat=bounds.getCenterLonLat();
}
return new OpenLayers.Marker(lonlat,icon);
},markerReleaser:function(marker){
marker.destroy();
},draw:function(px){
var div=EMS.Popup.prototype.draw.apply(this,arguments);
this.countDiv=OpenLayers.Util.createDiv(null);
this.countDiv.className="ems-multipoi-count";
this.contentDiv.appendChild(this.countDiv);
this.mapTab=this.createMapTab();
this.listTab=this.createListTab();
this.tabs=new EMS.MultiPopupTabs([this.mapTab,this.listTab]);
if(this.showListFirst==true){
this.tabs.showTab(this.listTab);
}else{
this.tabs.showTab(this.mapTab);
}
return div;
},createMapTab:function(){
var _57945=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(5,32),new OpenLayers.Size(this.size.w-15,this.size.h-70),null,"absolute");
this.tab1ContentsDiv=_57945;
_57945.style.borderTop="1px solid #58a2d1";
var tab1On=this.createImageDiv("multi-tab.gif",0,0,45,32,90,96,140,1);
var _57946=this.createImageDiv("multi-tab.gif",0,32,45,32,90,96,140,1);
var _57947=this.createImageDiv("multi-tab.gif",0,64,45,32,90,96,140,1);
var mapTab=new EMS.MultiPopupTab(tab1On,_57946,_57947,_57945);
this.contentDiv.appendChild(_57945);
this.contentDiv.appendChild(tab1On);
this.contentDiv.appendChild(_57946);
this.contentDiv.appendChild(_57947);
this.mapDiv=OpenLayers.Util.createDiv(this.mapId,null,null);
this.mapDiv.style.width=(this.size.w-15)+"px";
this.mapDiv.style.height=(this.size.h-70)+"px";
this.tab1ContentsDiv.appendChild(this.mapDiv);
var extent=this.getExtent(this.locatables,this.mapDiv);
var _57948=EMS.Util.defaultResolutions;
var _57949=new EMS.Util.ZoomCalculator(_57948,this.mapDiv);
var zoom=_57949.getZoomForExtent(extent);
this.multimap=new EMS.Services.Map(this.mapDiv,{onInit:OpenLayers.Function.bind(this.mapInit,this),controls:[],layers:[],noping:true,zoom:zoom,center:extent.getCenterLonLat()});
this.historyDiv=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(0,this.size.h-30));
this.historyDiv.className="ems-history";
var _57950=document.createElement("a");
_57950.className="ems-top-back";
_57950.href="#";
this.historyDiv.appendChild(_57950);
this.historyDiv.appendChild(document.createTextNode("  "));
var _57951=document.createElement("a");
_57951.href="#";
_57951.className="ems-back";
_57951.appendChild(document.createTextNode("Back"));
this.historyDiv.appendChild(_57951);
this.historyDiv.style.top=(this.size.h-65)+"px";
this.tab1ContentsDiv.appendChild(this.historyDiv);
OpenLayers.Event.observe(_57951,"click",OpenLayers.Function.bind(this.backInHistory,this));
OpenLayers.Event.observe(_57950,"click",OpenLayers.Function.bind(this.backInHistoryToTop,this));
return mapTab;
},createListTab:function(){
var _57952=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(5,32),new OpenLayers.Size(this.size.w-15,this.size.h-47),null,"absolute");
this.tab2ContentsDiv=_57952;
this.tab2ContentsDiv.style.overflow="auto";
_57952.style.borderTop="1px solid #58a2d1";
var tab2On=this.createImageDiv("multi-tab.gif",45,0,45,32,90,96,186,1);
var _57953=this.createImageDiv("multi-tab.gif",45,32,45,32,90,96,186,1);
var _57954=this.createImageDiv("multi-tab.gif",45,64,45,32,90,96,186,1);
var _57955=new EMS.MultiPopupTab(tab2On,_57953,_57954,_57952);
this.contentDiv.appendChild(_57952);
this.contentDiv.appendChild(tab2On);
this.contentDiv.appendChild(_57953);
this.contentDiv.appendChild(_57954);
return _57955;
},createImageDiv:function(_57956,_57957,_57958,_57959,_57960,_57961,_57962,left,top){
var _57963=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(left,top),new OpenLayers.Size(_57959,_57960),null,"absolute");
_57963.style.overflow="hidden";
var image=OpenLayers.Util.createImage(null,new OpenLayers.Pixel(-_57957,-_57958),new OpenLayers.Size(_57961,_57962),EMS.Util.getImagesLocation()+_57956);
_57963.appendChild(image);
return _57963;
},mapInit:function(map){
this.map=map;
var _57964=new OpenLayers.Layer.Markers("Markers");
var _57965=new EMS.IndexedLayer("Whereis Street",this.map.tilePath+"/tile?",{layers:"street",format:"image/gif",cache:"TRUE",version:"1.0.2"},{displayOutsideMaxExtent:true,visible:true});
map.markersLayer=_57964;
map.whereis_street_wms=_57965;
map.addLayer(map.whereis_street_wms);
map.addLayer(map.markersLayer);
var _57966=new EMS.CombinerCalculator(map.getResolution(),this.locatables);
this.history.push(this.locatables);
this.updateHistoryLinks();
var points=_57966.calculateCombined();
var i;
for(i=0;i<points.length;i++){
var point=points[i];
var marker=this.markerCreator(point.combined);
marker.lonlat.lon=point.lonlat.lon;
marker.lonlat.lat=point.lonlat.lat;
map.markersLayer.addMarker(marker);
if(point.combined.length>1){
marker.events.register("click",this,OpenLayers.Function.bind(this.zoomMarker,this,point.combined,map));
}else{
marker.events.register("click",this,OpenLayers.Function.bind(this.zoomToMarker,this,point.combined));
}
}
for(i=0;i<this.locatables.length;i++){
this.tab2ContentsDiv.appendChild(this.locatableRenderer(this.locatables[i]));
}
var _57967=EMS.Services.StandardIcons.redNumber(this.map.tilePath,this.locatables.length);
this.countDiv.innerHTML="<img src='"+_57967.url+"'/><span style='display: block; margin-left: 2em; margin-top: -1.7em;'> place"+(this.locatables.length==1?"":"s")+"</span>";
},zoomMarker:function(_57968,map){
var extent=this.getExtent(_57968,this.mapDiv);
var zoom=map.getZoomForExtent(extent);
var _57969=true;
for(var i=0;i<_57968.length;i++){
if(i==0){
var _57970=_57968[0].lonlat;
}else{
if(!_57970.equals(_57968[i].lonlat)){
_57969=false;
}
}
}
if(map.getZoom()==zoom||_57969){
this.tabs.showTab(this.listTab);
}
map.setCenter(extent.getCenterLonLat(),zoom);
var _57971=this.history.length==0?-1:this.history[this.history.length-1].length;
if(map.getZoom()!=zoom||_57971!=_57968.length){
this.history.push(_57968);
this.tab2ContentsDiv.innerHTML="";
var _57972=new EMS.CombinerCalculator(map.getResolution(),_57968);
var points=_57972.calculateCombined();
this.destroyMarkersOnMap(map);
var i;
for(i=0;i<points.length;i++){
var marker=this.markerCreator(points[i].combined);
marker.lonlat.lon=points[i].lonlat.lon;
marker.lonlat.lat=points[i].lonlat.lat;
map.markersLayer.addMarker(marker);
if(points[i].combined.length>1){
marker.events.register("click",this,OpenLayers.Function.bind(this.zoomMarker,this,points[i].combined,map));
}else{
marker.events.register("click",this,OpenLayers.Function.bind(this.zoomToMarker,this,marker));
}
}
for(i=0;i<_57968.length;i++){
this.tab2ContentsDiv.appendChild(this.locatableRenderer(_57968[i]));
}
this.updateHistoryLinks();
var _57973=EMS.Services.StandardIcons.redNumber(this.map.tilePath,_57968.length);
this.countDiv.innerHTML="<img src='"+_57973.url+"'/><span style='display: block; margin-left: 2em; margin-top: -1.7em;'> place"+(_57968.length==1?"":"s")+"</span>";
}
},backInHistory:function(){
var _57974=this.history.pop();
_57974=this.history.pop();
console.assert(_57974,"Locatables present");
this.zoomMarker(_57974,this.multimap);
},backInHistoryToTop:function(){
var _57975=this.history[0];
this.history=[];
console.assert(_57975,"Locatables present");
this.zoomMarker(_57975,this.multimap);
},updateHistoryLinks:function(){
this.historyDiv.style.display=this.history.length>1?"block":"none";
},destroyMarkersOnMap:function(map){
var _57976=map.markersLayer.markers;
while(_57976.length>0){
var marker=_57976[0];
map.markersLayer.removeMarker(marker);
this.markerReleaser(marker);
}
},zoomToMarker:function(marker){
console.assert(marker,"marker present");
this.events.triggerEvent("markerclick",{marker:marker,popup:this});
},destroy:function(){
this.destroyMarkersOnMap();
this.events.destroy();
if(this.multimap){
this.multimap.destroy();
this.multimap=null;
}
},getExtent:function(_57977,mapDiv){
var _57978=EMS.Util.defaultResolutions;
var _57979=new EMS.Util.ZoomCalculator(_57978,mapDiv);
var bounds;
for(var i=0;i<_57977.length;i++){
if(i==0){
bounds=new OpenLayers.Bounds(_57977[i].lonlat.lon,_57977[i].lonlat.lat,_57977[i].lonlat.lon,_57977[i].lonlat.lat);
}else{
bounds.extend(new OpenLayers.LonLat(_57977[i].lonlat.lon,_57977[i].lonlat.lat));
}
}
var zoom=_57979.getZoomForExtent(bounds);
var _57980=_57978[zoom];
bounds.extend(new OpenLayers.LonLat(bounds.left,bounds.top+_57980*66));
bounds.extend(new OpenLayers.LonLat(bounds.left-_57980*15,bounds.top));
bounds.extend(new OpenLayers.LonLat(bounds.right+_57980*15,bounds.top));
return bounds;
},CLASS_NAME:"EMS.MultiPopup"});
EMS.MultiPopupTabs=OpenLayers.Class({initialize:function(tabs){
this.tabs=tabs;
for(var i=0;i<tabs.length;i++){
OpenLayers.Event.observe(tabs[i].tabOffDiv,"click",OpenLayers.Function.bind(this.showTab,this,tabs[i]));
OpenLayers.Event.observe(tabs[i].tabHoverDiv,"click",OpenLayers.Function.bind(this.showTab,this,tabs[i]));
}
},addTab:function(tab){
this.tabs.push(tab);
OpenLayers.Event.observe(tab.tabOffDiv,"click",OpenLayers.Function.bind(this.showTab,this,tab));
OpenLayers.Event.observe(tab.tabHoverDiv,"click",OpenLayers.Function.bind(this.showTab,this,tab));
},showTab:function(tab){
if(this.activeTab){
this.activeTab.hide();
}
tab.show();
this.activeTab=tab;
}});
EMS.MultiPopupTab=OpenLayers.Class({initialize:function(_57981,_57982,_57983,_57984){
this.tabOnDiv=_57981;
this.tabOffDiv=_57982;
this.tabHoverDiv=_57983;
this.contentDiv=_57984;
OpenLayers.Event.observe(this.tabOffDiv,"mouseover",function(){
OpenLayers.Element.hide(_57982);
OpenLayers.Element.show(_57983);
});
OpenLayers.Event.observe(this.tabHoverDiv,"mouseout",function(){
if(OpenLayers.Element.visible(_57981)){
OpenLayers.Element.hide(_57982);
}else{
OpenLayers.Element.show(_57982);
}
OpenLayers.Element.hide(_57983);
});
this.hide();
},show:function(){
OpenLayers.Element.show(this.tabOnDiv);
OpenLayers.Element.hide(this.tabOffDiv);
OpenLayers.Element.hide(this.tabHoverDiv);
OpenLayers.Element.show(this.contentDiv);
},hide:function(){
OpenLayers.Element.hide(this.tabOnDiv);
OpenLayers.Element.show(this.tabOffDiv);
OpenLayers.Element.hide(this.tabHoverDiv);
OpenLayers.Element.hide(this.contentDiv);
}});
EMS.CombinerCalculator=OpenLayers.Class({combinePixels:40,initialize:function(_57985,_57986,_57987){
this.resolution=_57985;
this.locatableObjects=[].concat(_57986);
this.locatableObjects.sort(function(a,b){
return b.lonlat.lon-a.lonlat.lon;
});
_57987=_57987||{};
OpenLayers.Util.extend(this,_57987);
},calculateCombined:function(){
var _57988=[];
for(var i=0;i<this.locatableObjects.length;i++){
var _57989=this.locatableObjects[i];
if(!_57989.combined){
var bounds=new OpenLayers.Bounds(_57989.lonlat.lon,_57989.lonlat.lat,_57989.lonlat.lon,_57989.lonlat.lat);
var _57990=[_57989];
_57989.combined=true;
var _57991,j;
for(j=i+1;j<this.locatableObjects.length;j++){
_57991=this.testForCloseness(_57989,this.locatableObjects[j],bounds);
if(_57991=="combine"){
bounds.extend(this.locatableObjects[j].lonlat);
this.locatableObjects[j].combined=true;
_57990.push(this.locatableObjects[j]);
}else{
if(_57991=="break"){
break;
}
}
}
for(j=i-1;j>=0;j--){
_57991=this.testForCloseness(_57989,this.locatableObjects[j],bounds);
if(_57991=="combine"){
bounds.extend(this.locatableObjects[j].lonlat);
this.locatableObjects[j].combined=true;
_57990.push(this.locatableObjects[j]);
}else{
if(_57991=="break"){
break;
}
}
}
_57988.push({lonlat:bounds.getCenterLonLat(),combined:_57990});
}
}
for(var i=0;i<this.locatableObjects.length;i++){
delete this.locatableObjects[i].combined;
}
return _57988;
},testForCloseness:function(_57992,_57993,bounds){
if(Math.abs((_57993.lonlat.lon-_57992.lonlat.lon)/this.resolution)>this.combinePixels){
return "break";
}
if(_57992!=_57993&&!_57993.combined){
var diffX=Math.abs(bounds.getCenterLonLat().lon-_57993.lonlat.lon)/this.resolution;
var diffY=Math.abs(bounds.getCenterLonLat().lat-_57993.lonlat.lat)/this.resolution;
if(diffX<this.combinePixels&&diffY<this.combinePixels){
return "combine";
}
}
return "nomatch";
}});
EMS.MarkerGroup=OpenLayers.Class({markers:null,name:"",iconFactory:null,initialize:function(name,_57994){
this.name=name;
this.iconFactory=_57994;
this.markers=[];
},addMarker:function(marker){
marker.group=this;
this.markers.push(marker);
}});
EMS.MarkerProximityCombiner=OpenLayers.Class({combinePixels:40,groups:null,multigroupIconFactory:function(_57995){
return EMS.Services.StandardIcons.babushka(this.map.tilePath,_57995.length);
},initialize:function(map,groups,_57996){
this.map=map;
this.groups=groups;
_57996=_57996||{};
OpenLayers.Util.extend(this,_57996);
var iter=this._markerIterator();
var marker=null;
while(marker=iter()){
marker.combined=null;
}
},getMarkers:function(){
if(!this.markers){
this._calculateMarkers();
}
return this.markers;
},destroy:function(){
this.map=null;
this.groups=null;
},_calculateMarkers:function(){
this.markers=[];
var _57997=new Array();
for(var i=0;i<this.groups.length;i++){
_57997=_57997.concat(this.groups[i].markers);
}
_57997.sort(function(a,b){
return b.lonlat.lon-a.lonlat.lon;
});
var marker,candidateMarker;
var count=0;
var _57998=0,markerIdx1=0;
for(i=0;i<_57997.length;i++){
marker=_57997[i];
if(!this._markerVisible(marker)){
continue;
}
if(!marker.combined){
var _57999=marker;
var _58000=[this._copyMarker(_57999)];
var bounds=new OpenLayers.Bounds(marker.lonlat.lon,marker.lonlat.lat,marker.lonlat.lon,marker.lonlat.lat);
function testMarker(_58001){
if(!this._markerVisible(_58001)){
return true;
}
if(Math.abs((_58001.lonlat.lon-marker.lonlat.lon)/this.map.getResolution())>this.combinePixels){
return false;
}
if(_57999!=_58001&&!_58001.combined){
var diffX=Math.abs(bounds.getCenterLonLat().lon-_58001.lonlat.lon)/this.map.getResolution();
var diffY=Math.abs(bounds.getCenterLonLat().lat-_58001.lonlat.lat)/this.map.getResolution();
if(diffX<this.combinePixels&&diffY<this.combinePixels){
_58000.push(this._copyMarker(_58001));
_58001.combined=true;
bounds.extend(_58001.lonlat);
}
}
return true;
}
for(var j=i+1;j<_57997.length;j++){
candidateMarker=_57997[j];
if(!OpenLayers.Function.bind(testMarker,this)(candidateMarker)){
break;
}
}
for(j=i-1;j>=0;j--){
candidateMarker=_57997[j];
if(!OpenLayers.Function.bind(testMarker,this)(candidateMarker)){
break;
}
}
_57999.combined=true;
if(_58000.length==1){
this.markers.push(this._copyMarker(_57999));
}else{
this.markers.push(this._makeCombinedMarker(_58000,bounds));
}
}
count++;
}
},_makeCombinedMarker:function(_58002,bounds){
var _58003=null;
var _58004=false;
for(var i=0;i<_58002.length;i++){
if(_58003!=null&&_58002[i].group.name!=_58003){
_58004=true;
}
_58003=_58002[i].group.name;
}
var icon;
if(_58004){
icon=this.multigroupIconFactory(_58002);
}else{
icon=_58002[0].group.iconFactory(_58002);
}
var lonlat=bounds.getCenterLonLat();
var marker=new OpenLayers.Marker(lonlat,icon);
marker.combinedMarkers=_58002;
marker.combinedBounds=bounds;
return marker;
},_copyMarker:function(marker){
var _58005=new OpenLayers.Marker(marker.lonlat.clone(),marker.icon.clone());
_58005.group=marker.group;
return _58005;
},_markerVisible:function(marker){
if(marker.icon.div){
if(OpenLayers.Element.visible(marker.icon.div)){
return true;
}
}else{
if(marker.icon.imageDiv){
if(OpenLayers.Element.visible(marker.icon.imageDiv)){
return true;
}
}
}
return false;
},_markerIterator:function(){
var _58006=0;
var _58007=0;
var groups=this.groups;
return function(){
while(true){
if(_58006<groups.length){
var group=groups[_58006];
var marker=group.markers[_58007++];
if(marker){
if(marker.icon.div){
if(OpenLayers.Element.visible(marker.icon.div)){
return marker;
}
}else{
if(marker.icon.imageDiv){
if(OpenLayers.Element.visible(marker.icon.imageDiv)){
return marker;
}
}
}
}else{
_58006++;
_58007=0;
}
}else{
return null;
}
}
};
}});
EMS.Control.ContextMenu=OpenLayers.Class.create();
EMS.Control.ContextMenu.prototype=OpenLayers.Class.inherit(OpenLayers.Control,{EVENT_TYPES:["showMenu","hideMenu"],menuDisplayOwner:null,menuDisplayCallbacks:null,initialize:function(_58008,_58009,_58010){
OpenLayers.Control.prototype.initialize.apply(this,[_58010]);
var _58011=OpenLayers.Util.extend({show:this.showMenu,hide:this.hideMenu},_58011);
this.handler=new EMS.Handler.RightClick(this,_58011,{});
this.menuDisplayOwner=_58008;
this.menuDisplayCallbacks=_58009;
},callback:function(name,args){
if(this.menuDisplayCallbacks[name]){
this.menuDisplayCallbacks[name].apply(this.control,args);
}
},showMenu:function(evt){
this.callback("showMenu",[this.map.getLonLatFromPixel(evt.xy)]);
},hideMenu:function(evt){
this.callback("hideMenu",[]);
},activate:function(){
if(this.active){
return false;
}
if(this.handler){
this.handler.activate();
}
this.map.div.oncontextmenu=function noContextMenu(e){
return false;
};
this.map.events.register("zoomend",this,this.hideMenu);
this.active=true;
return true;
},deactivate:function(){
if(this.active){
if(this.handler){
this.handler.deactivate();
}
this.map.events.unregister("zoomend",this,this.hideMenu);
this.active=false;
return true;
}
return false;
},CLASS_NAME:"EMS.Control.ContextMenu"});
EMS.Handler.RightClick=OpenLayers.Class.create();
EMS.Handler.RightClick.prototype=OpenLayers.Class.inherit(OpenLayers.Handler,{initialize:function(_58012,_58013,_58014){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
},activate:function(){
if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){
return false;
}
var _58015={};
return true;
},deactivate:function(){
if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){
return false;
}
if(this.showingMenu){
this.hideMenu();
}
return true;
},mousedown:function(evt){
if((((evt.which)&&(evt.which==2))||((evt.button)&&(evt.button==2)))){
this.hideMenu(evt);
this.displayMenu(evt);
}else{
this.hideMenu(evt);
}
},hideMenu:function(evt){
this.callback("hide",[evt]);
},displayMenu:function(evt){
this.callback("show",[evt]);
},CLASS_NAME:"EMS.Handler.RightClick"});
EMS.Control.Shadow=OpenLayers.Class(OpenLayers.Control,{shadowSize:7,shadowColor:"#000",shadowMaxOpacity:0.5,element:null,draw:function(){
OpenLayers.Control.prototype.draw.apply(this,arguments);
if(!this.element){
this.div.left="";
this.div.top="";
this.div.style.width="100%";
this.div.style.height=this.shadowSize+"px";
this.element=this.div;
for(var i=0;i<this.shadowSize;i++){
var pix=new OpenLayers.Pixel(0,i);
var _58016=(this.shadowMaxOpacity*(this.shadowSize-i))/this.shadowSize;
var obj=OpenLayers.Util.createDiv(this.div.id+"_"+i,pix,null,null,"absolute",null,null,_58016);
obj.style.width="100%";
obj.style.height="1px";
obj.style.backgroundColor=this.shadowColor;
obj.style.overflow="hidden";
this.element.appendChild(obj);
}
}
return this.div;
},CLASS_NAME:"EMS.Control.Shadow"});
EMS.ContextPopup=OpenLayers.Class(OpenLayers.Popup.Anchored,{anchor:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)},address:null,menuOptions:null,initialize:function(id,size,lonlat,_58017,_58018){
OpenLayers.Popup.Anchored.prototype.initialize.apply(this,[id,lonlat,size,"",this.anchor,false]);
this.address=_58017;
this.setBackgroundColor("#FFFFFF");
this.setBorder("2px solid #999999");
this.menuOptions=_58018;
},draw:function(px){
OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);
var height=this.size.h;
this.element=$(this.contentDiv);
this.element.addClass("emsPopupContent");
if(this.menuOptions){
this.menu=OpenLayers.Util.createDiv(null);
this.menu.className="emsPopupMenu";
if(this.address){
var _58019="";
_58019+=this.address.streetNumber;
_58019+=" "+this.address.street.fullName;
_58019+=" "+this.address.suburb;
_58019+=" "+this.address.state;
_58019+="<BR/><BR/>";
this.menu.innerHTML=_58019;
}
for(var x=0;x<this.menuOptions.length;x++){
this.subMenu=OpenLayers.Util.createDiv(null);
this.subMenu.className="emsPopupMenuOption";
OpenLayers.Event.observe(this.subMenu,"mouseover",OpenLayers.Function.bind(this.mouseOverMenu,this));
OpenLayers.Event.observe(this.subMenu,"mouseout",OpenLayers.Function.bind(this.mouseOutMenu,this));
OpenLayers.Event.observe(this.subMenu,"click",OpenLayers.Function.bind(this.menuOptions[x][1],this,this.address));
this.subMenu.innerHTML=this.menuOptions[x][0];
height+=30;
this.menu.appendChild(this.subMenu);
}
this.setSize(new OpenLayers.Size(150,height));
this.element.appendChild(this.menu);
}
return this.div;
},mouseOverMenu:function(e){
if(!e){
var e=window.event;
}
var tg=(window.event)?e.srcElement:e.target;
tg.setStyle("background","grey");
},mouseOutMenu:function(e){
if(!e){
var e=window.event;
}
var tg=(window.event)?e.srcElement:e.target;
tg.setStyle("background","lightgrey");
},CLASS_NAME:"EMS.ContextPopup"});
EMS.TabbedPopup=OpenLayers.Class(EMS.Popup,{EVENT_TYPES:["shown","hidden"],tabs:null,logoDiv:null,initialize:function(id,lonlat,size,_58020,anchor,_58021,_58022,tabs){
EMS.Popup.prototype.initialize.apply(this,[id,lonlat,size?size:new OpenLayers.Size(304,286),_58020,anchor,_58021]);
this.logoDiv=_58022;
this.tabs=tabs;
},createTab:function(tab){
var pos=this.currentPx.clone();
var tabOn=OpenLayers.Util.createDiv(null,pos,tab.headingWidth,null,"absolute");
tabOn.className="emsPopupTabOn";
tabOn.style.borderBottom="1px solid white";
tabOn.style.zIndex=2000;
tabOn.innerHTML=tab.heading;
var _58023=OpenLayers.Util.createAlphaImageDiv(tabOn.id+"_left",new OpenLayers.Pixel(0,0),new OpenLayers.Size(1,33),EMS.Util.getImagesLocation()+"tab_end.gif");
var _58024=OpenLayers.Util.createAlphaImageDiv(tabOn.id+"_right",new OpenLayers.Pixel(tab.headingWidth.w-1,0),new OpenLayers.Size(1,33),EMS.Util.getImagesLocation()+"tab_end.gif");
tabOn.appendChild(_58023);
tabOn.appendChild(_58024);
var tabOff=OpenLayers.Util.createDiv(null,pos,tab.headingWidth,null,"absolute");
tabOff.className="emsPopupTabOff";
tabOff.innerHTML=tab.heading;
var _58025=OpenLayers.Util.createDiv(null,pos,tab.headingWidth,null,"absolute");
_58025.className="emsPopupTabHover";
_58025.innerHTML=tab.heading;
this.currentPx=this.currentPx.add(tab.headingWidth.w,0);
this.contentDiv.appendChild(tabOn);
this.contentDiv.appendChild(tabOff);
this.contentDiv.appendChild(_58025);
this.contentDiv.appendChild(tab.contentDiv);
var aTab=new EMS.MultiPopupTab(tabOn,tabOff,_58025,tab.contentDiv);
return aTab;
},draw:function(px){
var div=EMS.Popup.prototype.draw.apply(this,arguments);
if(this.tabs!=undefined){
if(this.logoDiv!=undefined){
this.contentDiv.appendChild(this.logoDiv);
this.currentPx=new OpenLayers.Pixel(this.logoDiv.style.width,2);
}else{
this.currentPx=new OpenLayers.Pixel(50,2);
}
this.tab1=this.createTab(this.tabs[0]);
this.multiTabs=new EMS.MultiPopupTabs([this.tab1]);
if(this.tabs.length>1){
this.tab2=this.createTab(this.tabs[1]);
this.multiTabs.addTab(this.tab2);
}
if(this.tabs.length>2){
this.tab3=this.createTab(this.tabs[2]);
this.multiTabs.addTab(this.tab3);
}
if(this.tabs.length>3){
this.tab4=this.createTab(this.tabs[3]);
this.multiTabs.addTab(this.tab4);
}
this.multiTabs.showTab(this.tab1);
}
return div;
},createImageDiv:function(_58026,_58027,_58028,_58029,_58030,_58031,_58032,left,top){
var _58033=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(left,top),new OpenLayers.Size(_58029,_58030),null,"absolute");
_58033.style.overflow="hidden";
var image=OpenLayers.Util.createImage(null,new OpenLayers.Pixel(-_58027,-_58028),new OpenLayers.Size(_58031,_58032),EMS.Util.getImagesLocation()+_58026);
_58033.appendChild(image);
return _58033;
}});
EMS.CustomTab=OpenLayers.Class({initialize:function(_58034,_58035,_58036){
this.heading=_58034;
this.contentDiv=_58035;
if(_58036==undefined){
this.headingWidth=new OpenLayers.Size(45,32);
}else{
this.headingWidth=new OpenLayers.Size(_58036,32);
}
}});
EMS.RoutePopup=OpenLayers.Class(EMS.Popup,{EVENT_TYPES:["shown","hidden","next","previous"],routeDetail:null,routeMap:null,currentRoute:0,currentSegment:0,mapZoomLevel:13,zoomToLevel:13,showRouteMarkers:true,initialize:function(_58037,_58038,_58039,_58040){
if(_58038){
this.currentRoute=_58038;
}
if(_58039){
this.currentSegment=_58039;
}
if(_58040){
this.showRouteMarkers=_58040;
}
this.routeDetail=_58037;
EMS.Popup.prototype.initialize.apply(this,["emsRoutePopup",this.getSegmentLonLat(),new OpenLayers.Size(250,260)," ",null,true]);
},getCurrentSegment:function(){
return this.getCurrentRoute().routeSegments[this.currentSegment];
},getCurrentRoute:function(){
return this.routeDetail.routes[this.currentRoute];
},draw:function(px){
var div=EMS.Popup.prototype.draw.apply(this,arguments);
this.instructionsDiv=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(15,10),new OpenLayers.Size(215,42),null,"absolute");
this.instructionsDiv.innerHTML=this.getSegmentInstructions();
this.instructionsDiv.className="emsRouteInstructions";
this.contentDiv.appendChild(this.instructionsDiv);
this.nextPreviousLinks=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(15,52),new OpenLayers.Size(220,30),null,"absolute");
this.nextPreviousLinks.className="emsRouteLinks";
this.previous=document.createElement("a");
this.previous.href="#";
if(this.hasPrevious()){
this.previous.className="emsPreviousLink";
}else{
this.previous.className="emsPreviousLink emsDisabled";
}
this.previous.appendChild(document.createTextNode("<< Previous"));
this.nextPreviousLinks.appendChild(this.previous);
OpenLayers.Event.observe(this.previous,"mouseover",function(){
this.className=this.className+" emsHover";
});
OpenLayers.Event.observe(this.previous,"mouseout",function(){
this.className=this.className.replace("emsHover","");
});
OpenLayers.Event.observe(this.previous,"click",OpenLayers.Function.bind(this.goPrevious,this));
this.next=document.createElement("a");
this.next.href="#";
if(this.hasNext()){
this.next.className="emsNextLink";
}else{
this.next.className="emsNextLink emsDisabled";
}
this.next.appendChild(document.createTextNode("Next >>"));
this.nextPreviousLinks.appendChild(this.next);
OpenLayers.Event.observe(this.next,"mouseover",function(){
this.className=this.className+" emsHover";
});
OpenLayers.Event.observe(this.next,"mouseout",function(){
this.className=this.className.replace("emsHover","");
});
OpenLayers.Event.observe(this.next,"click",OpenLayers.Function.bind(this.goNext,this));
this.contentDiv.appendChild(this.nextPreviousLinks);
this.mapDiv=OpenLayers.Util.createDiv("mapDiv",new OpenLayers.Pixel(5,67),new OpenLayers.Size(234,160),null,"absolute");
this.mapDiv.className="emsRouteMap";
this.contentDiv.appendChild(this.mapDiv);
this.routeMap=new EMS.Services.Map(this.mapDiv,{onInit:OpenLayers.Function.bind(this.mapInit,this),controls:[],layers:[],noping:true,zoom:this.mapZoomLevel,center:this.lonlat});
this.zoomToLink=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(15,235),new OpenLayers.Size(220,20),null,"absolute");
this.zoomToLink.className="emsRouteLinks";
this.zoomTo=document.createElement("a");
this.zoomTo.href="#";
if(this.map.getZoom()<this.zoomToLevel){
this.zoomTo.className="emsZoomToLink";
}else{
this.zoomTo.className="emsZoomToLink emsDisabled";
}
this.zoomTo.appendChild(document.createTextNode("Zoom to"));
this.zoomToLink.appendChild(this.zoomTo);
OpenLayers.Event.observe(this.zoomTo,"mouseover",function(){
this.className=this.className+" emsHover";
});
OpenLayers.Event.observe(this.zoomTo,"mouseout",function(){
this.className=this.className.replace("emsHover","");
});
OpenLayers.Event.observe(this.zoomTo,"click",OpenLayers.Function.bind(this.goZoomTo,this));
this.contentDiv.appendChild(this.zoomToLink);
return div;
},updateSegment:function(event){
this.instructionsDiv.innerHTML=this.getSegmentInstructions();
this.routeMap.setCenter(this.lonlat,this.mapZoomLevel);
if((this.lonlat)&&(this.map)){
if(!(this.map.getExtent().containsLonLat(this.lonlat))){
this.map.setCenter(this.lonlat);
}
var px=this.map.getLayerPxFromLonLat(this.lonlat);
this.moveTo(px);
}
if(this.hasPrevious()){
this.previous.className="emsPreviousLink";
}else{
this.previous.className="emsPreviousLink emsDisabled";
}
if(this.hasNext()){
this.next.className="emsNextLink";
}else{
this.next.className="emsNextLink emsDisabled";
}
if(this.map.getZoom()<this.zoomToLevel){
this.zoomTo.className="emsZoomToLink";
}else{
this.zoomTo.className="emsZoomToLink emsDisabled";
}
},goZoomTo:function(event){
if(this.map.getZoom()<this.zoomToLevel){
this.map.setCenter(this.lonlat,this.zoomToLevel);
this.map.removePopup(this);
this.events.triggerEvent("hidden");
}
},goNext:function(event){
if(this.currentSegment+1==this.getCurrentRoute().routeSegments.length){
if(this.currentRoute+1!=this.routeDetail.routes.length){
this.currentRoute++;
this.currentSegment=0;
}else{
return;
}
}else{
this.currentSegment++;
}
this.lonlat=this.getSegmentLonLat();
this.updateSegment();
this.events.triggerEvent("next");
},goPrevious:function(event){
if(this.currentSegment==0){
if(this.currentRoute!=0){
this.currentRoute--;
this.currentSegment=this.getCurrentRoute().routeSegments.length-1;
}else{
return;
}
}else{
this.currentSegment--;
}
this.lonlat=this.getSegmentLonLat();
this.updateSegment();
this.events.triggerEvent("previous");
},hasNext:function(){
if(this.currentRoute==(this.routeDetail.routes.length-1)&&this.currentSegment==(this.getCurrentRoute().routeSegments.length-1)){
return false;
}
return true;
},hasPrevious:function(){
if(this.currentSegment==0&&this.currentRoute==0){
return false;
}
return true;
},mapInit:function(map){
var _58041=new OpenLayers.Layer.Markers("Route Markers");
var _58042=new EMS.IndexedLayer("Whereis Route Popup",this.map.tilePath+"/tile?",{layers:"street",format:"image/gif",cache:"TRUE",version:"1.0.2"},{displayOutsideMaxExtent:true,visible:true});
this.routeMap.markersLayer=_58041;
this.routeMap.whereis_street_wms=_58042;
this.routeMap.addLayer(_58042);
if(OpenLayers.Renderer.SVG.prototype.supported()||OpenLayers.Renderer.VML.prototype.supported()){
this.routeVectorLayer=new OpenLayers.Layer.Vector("Route");
this.routeMap.addLayer(this.routeVectorLayer);
}
this.routeMap.addLayer(_58041);
if(this.showRouteMarkers){
for(var i=0;i<this.routeDetail.routes.length;i++){
for(var j=0;j<this.routeDetail.routes[i].routeSegments.length;j++){
if(i==0&&j==0){
seg=this.routeDetail.routes[i].routeSegments[j];
var marker=new OpenLayers.Marker(new EMS.LonLat(seg.centre.longitude,seg.centre.latitude).clone(),EMS.Services.StandardIcons.start());
_58041.addMarker(marker);
}
if(i!=0&&j==0){
seg=this.routeDetail.routes[i].routeSegments[j];
var marker=new OpenLayers.Marker(new EMS.LonLat(seg.centre.longitude,seg.centre.latitude).clone(),EMS.Services.StandardIcons.vias[i-1]());
_58041.addMarker(marker);
}
if((i+1==this.routeDetail.routes.length)&&(j+1==this.routeDetail.routes[i].routeSegments.length)){
seg=this.routeDetail.routes[i].routeSegments[j];
var marker=new OpenLayers.Marker(new EMS.LonLat(seg.centre.longitude,seg.centre.latitude).clone(),EMS.Services.StandardIcons.end());
_58041.addMarker(marker);
}
}
}
}
this.routeManager=new EMS.Services.RouteManager(this.routeMap);
this.routeManager.routeVectorLayer=this.routeVectorLayer;
this.routeManager.itin=new EMS.Services.Itin();
this.routeManager._setupMapRoute(this.routeDetail);
},getSegmentLonLat:function(){
return new EMS.LonLat(this.getCurrentSegment().centre.longitude,this.getCurrentSegment().centre.latitude);
},getSegmentInstructions:function(){
var _58043="<span>"+(this.currentSegment+1)+". "+this.getCurrentSegment().textualInstruction+"</span>";
_58043=_58043.replace("ROUNDABOUT","roundabout");
_58043=_58043.replace("Start at","Continue on");
_58043=_58043.replace("Stop at","Arrive at");
while(true){
_58043=_58043.replace("_","<strong>");
_58043=_58043.replace("_","</strong>");
if(_58043.indexOf("_")==-1){
break;
}
}
if(this.getCurrentSegment().travelTime!=0){
_58043=_58043+"<br /><span>Travel "+this.formatLength(this.getCurrentSegment().metres);
_58043=_58043+" ("+this.formatTime(this.getCurrentSegment().travelTime)+")</span>";
}
return _58043;
},formatLength:function(metres){
var value=Math.round((metres/1000)*10)/10;
if(value<0.1){
value=Math.round(metres);
value+="m";
}else{
value+="km";
}
return value;
},formatTime:function(_58044){
var value=Math.round((_58044/60)*10)/10;
if(value<1){
value=Math.round(_58044);
value+="sec";
}else{
if(value>60){
value=Math.floor(value/60)+"hr "+Math.round(value%60)+"min";
}else{
value=Math.round(_58044/60);
value+="min";
}
}
return value;
},destroy:function(){
if(this.map!=null){
this.map.removePopup(this);
this.routeMap.destroy();
this.routeMap=null;
}
this.routeManager.clearRoute();
this.routeDetail=null;
this.events.destroy();
this.events=null;
this.div=null;
}});
EMS.Control.DraggingControl=OpenLayers.Class.create();
EMS.Control.DraggingControl.prototype=OpenLayers.Class.inherit(OpenLayers.Control.DragFeature,{startPixel:null,performedDrag:false,oldCallback:null,initialize:function(layer,_58045){
OpenLayers.Control.prototype.initialize.apply(this,[_58045]);
this.oldCallback=_58045.markerDropped;
this.layer=layer;
this.dragCallbacks=OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks);
this.dragHandler=new OpenLayers.Handler.Drag(this,this.dragCallbacks);
this.featureCallbacks=OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.featureCallbacks);
var _58046={geometryTypes:this.geometryTypes};
this.featureHandler=new EMS.Handler.DragMarkerHandler(this,this.layer,this.featureCallbacks,_58046);
},moveFeature:function(pixel){
if(!this.active){
return;
}
if(this.startPixel!=null){
if(this.preformedDrag){
var px=this.feature.icon.px.add(pixel.x-this.lastPixel.x,pixel.y-this.lastPixel.y);
this.feature.moveTo(px);
this.lastPixel=pixel;
this.onDrag(this.feature,pixel);
}else{
var deltaX=Math.abs(this.startPixel.x-pixel.x);
var deltaY=Math.abs(this.startPixel.y-pixel.y);
if((Math.abs(deltaX)<7&&Math.abs(deltaY)<7)){
return;
}
this.preformedDrag=true;
this.onStart(this.feature,pixel);
}
}
},upFeature:function(pixel){
if(!this.active){
return;
}
if(!this.over){
this.dragHandler.deactivate();
this.map.div.style.cursor="default";
}
},downFeature:function(pixel){
if(!this.active){
return;
}
this.preformedDrag=false;
this.startPixel=pixel;
this.lastPixel=pixel;
},doneDragging:function(pixel){
if(!this.active){
return;
}
if(this.preformedDrag){
if(this.feature){
this.feature.preformedDrag=true;
}
if(this.oldCallback){
this.oldCallback(this.feature,pixel);
}else{
this.onComplete(this.feature,pixel);
}
}else{
this.cancel();
}
if(!this.over){
this.feature=null;
}
this.preformedDrag=false;
this.startPixel=null;
this.lastPixel=null;
},cancel:function(){
this.dragHandler.deactivate();
this.over=false;
this.preformedDrag=false;
this.startPixel=null;
this.lastPixel=null;
},CLASS_NAME:"EMS.Control.DraggingControl"});
EMS.Handler.DragMarkerHandler=OpenLayers.Class.create();
EMS.Handler.DragMarkerHandler.prototype=OpenLayers.Class.inherit(OpenLayers.Handler.Feature,{select:function(type,evt){
var node=OpenLayers.Event.element(evt);
var _58047=null;
for(var i=0;i<this.layer.markers.length;i++){
if(node.id.match("Icon")){
if(node.id.match("innerImage")){
if(this.layer.markers[i].icon.alphaImageDiv.firstChild==node){
_58047=this.layer.markers[i];
break;
}
}else{
if(this.layer.markers[i].icon.alphaImageDiv.id==node.id){
_58047=this.layer.markers[i];
break;
}
}
}
}
var _58048=false;
if(_58047){
if(this.geometryTypes==null||(_58047.geometry!=null&&(OpenLayers.Util.indexOf(this.geometryTypes,_58047.geometry.CLASS_NAME)>-1))||(_58047.type!=null&&(OpenLayers.Util.indexOf(this.geometryTypes,_58047.type)>-1))){
if(!this.feature){
this.callback("over",[_58047]);
}else{
if(this.feature!=_58047){
this.callback("out",[this.feature]);
this.callback("over",[_58047]);
}
}
this.feature=_58047;
this.callback(type,[_58047]);
_58048=true;
}else{
if(this.feature&&(this.feature!=_58047)){
this.callback("out",[this.feature]);
this.feature=null;
}
_58048=false;
}
}else{
if(this.feature){
this.callback("out",[this.feature]);
this.feature=null;
}
_58048=false;
}
return _58048;
},CLASS_NAME:"EMS.Handler.DragMarkerHandler"});

EMS.tilePath = 'http://tiles.whereis.com:80/remapper';
EMS.token = '1817575197047251020';
EMS.VERSION_NUMBER = '1.12.4.1';

