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 _203968=this._searchForEmsLibraryLocation(document.getElementsByTagName("head")[0].childNodes);
if(_203968==null){
_203968=this._searchForEmsLibraryLocation(document.getElementsByTagName("script"));
}
return _203968==null?"":_203968;
};
EMS._searchForEmsLibraryLocation=function(scripts){
var _203969=null;
var _203970=EMS._scriptName;
for(var i=0;i<scripts.length;i++){
if(scripts[i].tagName=="SCRIPT"){
var src=scripts[i].getAttribute("src");
if(src!=null){
if(src.indexOf("?")>-1){
src=src.substring(0,src.indexOf("?"));
}
if(src){
var index=src.lastIndexOf(_203970);
if((index>-1)&&(index+_203970.length==src.length)){
_203969=src.slice(0,-_203970.length);
break;
}
}
}
}
}
return _203969;
};
if(typeof (_EMS_SFL_)=="undefined"){
(function(){
var jsfiles=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 _203971="";
var host=EMS._getScriptLocation()+"lib/";
for(var i=0;i<jsfiles.length;i++){
if(/MSIE/.test(navigator.userAgent)||/Safari/.test(navigator.userAgent)){
var _203972="<script src='"+host+jsfiles[i]+"'></script>";
_203971+=_203972;
}else{
var s=document.createElement("script");
s.src=host+jsfiles[i];
var h=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;
h.appendChild(s);
}
}
if(_203971){
document.write(_203971);
}
})();
}
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,_203973,options){
url=EMS.Services._jsonBaseUrl+url;
options=options?options:{};
options.parameters=options.parameters?options.parameters:{};
options.parameters.domain=EMS.Util.getDomain();
if(!options.parameters.token){
options.parameters.token=EMS.token;
}
if(options.parameters&&typeof options.parameters!="string"){
options.parameters=EMS.Util.getParameterString(options.parameters);
}
var _203974=options.onException?options.onException:EMS.Services._onException;
var _203975=options.communicationMode||EMS.Services.communicationMode;
var _203976=function(){
};
isJsonResponseOK=function(_203977){
if(_203977.stat&&(_203977.stat=="fail")){
var _203978="["+_203977.code+"] "+_203977.error;
if(_203977.stackTrace){
_203978+="\n\n"+_203977.stackTrace;
}
_203974(_203976,_203978);
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 _203979="jsessionid";
if(_203975=="XMLHttpRequest"){
_203979="ems.jsessionid";
}
url+=";"+_203979+"="+jsess;
}
if(_203975=="XMLHttpRequest"){
var ajaxReq;
var _203980;
var _203981=OpenLayers.Function.bind(function(_203976,json,request){
var result=eval("("+_203976.responseText+")");
EMS.Ajax.Responders.dispatch("onComplete",ajaxReq,_203976,result);
if(request&&request.options&&request.options.group&&request.options.requestTime<EMS.Ajax.groupedRequests[request.options.group]){
return;
}
if(isJsonResponseOK(result)){
_203973(result.message);
}
},this);
_203980=OpenLayers.Util.extend(options,{onComplete:_203981,onException:_203974});
ajaxReq=new OpenLayers.Ajax.Request(url,_203980);
EMS.Ajax.Responders.dispatch("onCreate",ajaxReq,ajaxReq.transport,null);
}else{
if(_203975=="CrossDomain"){
var _203982=function(){
};
var _203983=options.parameters.length;
var parts=new Array();
if(_203983>EMS.Ajax.maxCrossDomainURLLength){
var parts=new Array();
var _203984=0;
var _203985=true;
var start=0;
while(_203985){
var end=options.parameters.lastIndexOf("%22",start+EMS.Ajax.maxCrossDomainURLLength);
if(end==start){
parts[_203984]=options.parameters.substring(start);
_203984++;
_203985=false;
}else{
parts[_203984]=options.parameters.substring(start,end);
}
start=end;
_203984++;
}
}else{
parts[0]=options.parameters;
}
var request={"transport":_203982,"options":options};
if(typeof handlerFunctions=="undefined"){
handlerFunctions={};
}
if(typeof handler=="undefined"){
handler=0;
}else{
handler++;
}
handlerFunctions["ajaxHandler"+handler]=OpenLayers.Function.bind(function(group,_203986,ajax){
if(group&&_203986<EMS.Ajax.groupedRequests[group]){
return;
}
if(isJsonResponseOK(ajax)){
if(ajax.chunked){
}else{
try{
EMS.Ajax.Responders.dispatch("onComplete",request,_203982,ajax);
_203973(ajax.message);
}
catch(e){
alert("exception "+e);
}
}
}
},this,options.group,new Date().getTime());
EMS.Ajax.Responders.dispatch("onCreate",request,_203982,null);
for(var i=0;i<parts.length;i++){
var dtRf=new Date();
oScript=document.createElement("script");
var _203987=parts[i].replace(/=/g,"%3D%3D").replace(/&/g,"%26%26");
var _203988=url+"?cb=ajaxHandler"+handler+"&rf="+dtRf.getTime()+"&nop="+parts.length+"&pn="+(i+1)+"&part="+_203987;
oScript.setAttribute("src",_203988);
oScript.setAttribute("id","emsajaxscript"+handler);
var head=document.getElementsByTagName("head").item(0);
head.appendChild(oScript);
}
setTimeout(OpenLayers.Function.bind(function(handler){
window["ajaxHandler"+handler]=null;
var id="emsajaxscript"+handler;
var oScript=document.getElementById(id);
var head=document.getElementsByTagName("head").item(0);
if(oScript){
head.removeChild(oScript);
}
},this),EMS.Ajax.crossDomainTimeout);
}else{
alert("Invalid communication mode. Expected XMLHttpRequest or CrossDomain");
}
}
};
EMS.Services._json=EMS.Ajax.json;
EMS.Ajax.callInProgress=function(xmlhttp){
switch(xmlhttp.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(request){
request.options.requestTime=new Date().getTime();
if(!request.options.uninterruptable){
EMS.Ajax.cancelableRequests.push(request);
}
};
EMS.Ajax.requestComplete=function(request){
var i=-1;
var found=false;
for(i=0;i<EMS.Ajax.cancelableRequests.length;i++){
if(EMS.Ajax.cancelableRequests[i].options.requestTime==request.options.requestTime){
found=true;
break;
}
}
if(found){
EMS.Ajax.cancelableRequests.splice(i,1);
}
if(request.options.group){
if(!EMS.Ajax.groupedRequests[request.options.group]){
EMS.Ajax.groupedRequests[request.options.group]=request.options.requestTime;
}else{
if(request.options.requestTime<EMS.Ajax.groupedRequests[request.options.group]){
request.options.staleRequest=true;
}else{
EMS.Ajax.groupedRequests[request.options.group]=request.options.requestTime;
}
}
}
};
EMS.Ajax.Responders={responders:[],register:function(_203989){
for(var i=0;i<this.responders.length;i++){
if(_203989==this.responders[i]){
return;
}
}
this.responders.push(_203989);
},dispatch:function(_203990,request,_203991,json){
for(var i=0;i<this.responders.length;i++){
var _203992=this.responders[i];
if(_203992[_203990]&&typeof _203992[_203990]=="function"){
try{
_203992[_203990].apply(_203992,[request,_203991,json]);
}
catch(e){
}
}
}
}};
EMS.Ajax.Responders.register({onCreate:EMS.Ajax.requestCreate,onComplete:EMS.Ajax.requestComplete});
EMS.Ajax.requestCompleteExtractJsessionId=function(request,_203993,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 _203994=EMS.Util.convertY;
if(ilat>=9){
ilat=8;
}
if(lat>=0){
return _203994[ilat]+((lat-10*ilat)/10)*(_203994[ilat+1]-_203994[ilat]);
}else{
lat=-lat;
ilat=-ilat;
return -(_203994[ilat]+((lat-10*ilat)/10)*(_203994[ilat+1]-_203994[ilat]));
}
};
EMS.Util.sgp4ToLat=function(lat_){
var _203995=EMS.Util.convertY;
var i;
if(lat_>=0){
for(i=0;i<10;i++){
if(lat_<_203995[i]){
return ((i-1)*10)+10*(lat_-_203995[i-1])/(_203995[i]-_203995[i-1]);
}
}
i=9;
return ((i-1)*10)+10*(lat_-_203995[i-1])/(_203995[i]-_203995[i-1]);
}else{
lat_=-lat_;
for(i=0;i<10;i++){
if(lat_<_203995[i]){
return -(((i-1)*10)+10*(lat_-_203995[i-1])/(_203995[i]-_203995[i-1]));
}
}
i=9;
return -(((i-1)*10)+10*(lat_-_203995[i-1])/(_203995[i]-_203995[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 _203996 in obj){
if(EMS.Util.$type(obj[_203996])!="function"){
string.push("\""+_203996+"\":"+EMS.Util.Json.toString(obj[_203996]));
}
}
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 _203997=new Array();
for(var key in params){
var value=params[key];
if((value!=null)&&(typeof value!="function")){
var _203998;
if(typeof value=="object"){
_203998=encodeURIComponent(EMS.Util.Json.toString(value));
}else{
_203998=encodeURIComponent(value);
}
_203997.push(encodeURIComponent(key)+"="+_203998);
}
}
return _203997.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 results=regex.exec(tmpURL);
return results[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 _203999="";
if(!level){
level=0;
}
var _204000="";
for(var j=0;j<level+1;j++){
_204000+="    ";
}
if(typeof (arr)=="object"){
for(var item in arr){
var value=arr[item];
if(typeof (value)=="object"){
_203999+=_204000+"'"+item+"' ...\n";
_203999+=dump(value,level+1);
}else{
_203999+=_204000+"'"+item+"' => \""+value+"\"\n";
}
}
}else{
_203999="===>"+arr+"<===("+typeof (arr)+")";
}
return _203999;
};
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(_204001,element){
this.resolutions=_204001;
var _204002=OpenLayers.Element.getDimensions(element);
if((_204002.width==undefined)||(_204002.height==undefined)||_204002.width==0||_204002.height==0){
this.width=parseInt($(element).style.width);
this.height=parseInt($(element).style.height);
}else{
this.width=_204002.width;
this.height=_204002.height;
}
},getZoomForExtent:function(extent){
var _204003=new OpenLayers.Size(this.width,this.height);
var _204004=Math.max(extent.getWidth()/_204003.w,extent.getHeight()/_204003.h);
return this.getZoomForResolution(_204004);
},getZoomForResolution:function(_204005){
for(var i=1;i<this.resolutions.length;i++){
if(this.resolutions[i]<_204005){
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 _204006=navigator.appVersion.split("MSIE");
var version=parseFloat(_204006[1]);
var filter=false;
try{
filter=document.body.filters;
}
catch(e){
}
return (filter&&(version>=5.5)&&(version<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,_204007,_204008){
this.stickyState=null;
this.numberOfStates=_204008||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=_204007;
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(opacity){
OpenLayers.Util.modifyAlphaImageDiv(this.alphaImageDiv,null,null,null,null,null,null,null,opacity);
},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 _204009=this.px.offset(this.offset);
OpenLayers.Util.modifyDOMElement(this.imageDiv,null,_204009);
}
}
},display:function(display){
this.imageDiv.style.display=(display)?"":"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,options){
OpenLayers.Control.prototype.initialize.apply(this,[options]);
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 _204010=OpenLayers.Function.bind(this.updateSize);
var _204011=map.updateSize;
map.onMapResize=function(){
_204011();
_204010();
};
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 _204012;
if(this.type=="n"){
_204012=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,(0+this.offset));
}else{
if(this.type=="s"){
_204012=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,this.map.getSize().h-(hMax+this.offset));
}else{
if(this.type=="e"){
_204012=new OpenLayers.Pixel(this.map.getSize().w-(wMax+this.offset),this.map.getSize().h/2-hMax/2);
}else{
if(this.type=="w"){
_204012=new OpenLayers.Pixel((0+this.offset),this.map.getSize().h/2-hMax/2);
}
}
}
}
OpenLayers.Util.modifyDOMElement(this.div,null,_204012);
},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 _204013;
if(this.type=="n"){
_204013=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,(0+this.offset));
}else{
if(this.type=="s"){
_204013=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,this.map.getSize().h-(hMax+this.offset));
}else{
if(this.type=="e"){
_204013=new OpenLayers.Pixel(this.map.getSize().w-(wMax+this.offset),this.map.getSize().h/2-hMax/2);
}else{
if(this.type=="w"){
_204013=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,_204013);
OpenLayers.Util.modifyDOMElement(this.icon.imageDiv,null,null,null,"static");
return this.div;
},pan:function(e){
var _204014=this.map.getCenter().clone();
if(this.type=="n"){
_204014.lat+=this.map.getExtent().getHeight()/2;
}else{
if(this.type=="s"){
_204014.lat-=this.map.getExtent().getHeight()/2;
}else{
if(this.type=="w"){
_204014.lon-=this.map.getExtent().getWidth()/2;
}else{
if(this.type=="e"){
_204014.lon+=this.map.getExtent().getWidth()/2;
}
}
}
}
this.map.setCenter(_204014);
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,_204015,anchor,_204016){
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(_204015!=null){
this.contentHTML=_204015;
}
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(_204016){
var _204017=new OpenLayers.Size(12,12);
var img=EMS.Util.getImagesLocation()+"close_off.gif";
var _204018=OpenLayers.Util.createAlphaImageDiv(this.id+"_close",null,_204017,img);
_204018.style.right=this.padding+"px";
_204018.style.top=this.padding+"px";
this.groupDiv.appendChild(_204018);
var _204019=function(e){
this.hide();
OpenLayers.Event.stop(e);
};
OpenLayers.Event.observe(_204018,"click",_204019.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 _204020=this.direction(px);
var _204021=px;
var _204022=(this.anchor==undefined?0:this.anchor.size.h);
var _204023=(this.anchor==undefined?0:this.anchor.size.w);
if(this.anchor!=undefined){
if(this.anchor.offset!=undefined&&(_204022/2)==(this.anchor.offset.y/-1)){
_204022=0;
}
px=px.add(_204020*_204023/2,-_204022/2);
}
if(_204020==-1){
px=px.add(-this.size.w,0);
px=px.add(_204020*this.calloutSize.w,0);
}
px=px.add(0,-this.size.h/2);
if(this.map.getExtent().containsLonLat(this.map.getLonLatFromLayerPx(_204021))){
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(_204020>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(_204020>0){
this.calloutDiv.style.left="2px";
this.calloutDiv.style.right="";
}else{
this.calloutDiv.style.right="2px";
this.calloutDiv.style.left="";
}
this.calloutDiv.style.top=(_204021.y-px.y-this.calloutSize.h/2-_204022/2)+"px";
this.calloutDiv.style.zIndex=this.div.style.zIndex+1;
if(_204020>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 _204024=extent.determineQuadrant(lonlat);
if(_204024.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 _204025=this.size.w-4;
var _204026=this.size.h-4;
if(this.groupDiv!=null){
this.groupDiv.style.width=_204025+"px";
this.groupDiv.style.height=_204026+"px";
}
if(this.shadow1Div!=null&&this.shadow2Div!=null){
this.shadow1Div.style.width=(_204025+4)+"px";
this.shadow1Div.style.height=(_204026+4)+"px";
this.shadow2Div.style.width=(_204025+4)+"px";
this.shadow2Div.style.height=(_204026+4)+"px";
}
if(this.contentDiv!=null){
this.contentDiv.style.width=_204025+"px";
this.contentDiv.style.height=_204026+"px";
}
},setBackgroundColor:function(color){
if(color!=undefined){
this.backgroundColor=color;
}
if(this.div!=null){
this.groupDiv.style.backgroundColor=this.backgroundColor;
}
},setOpacity:function(opacity){
if(opacity!=undefined){
this.opacity=opacity;
}
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(_204027){
if(_204027!=null){
this.contentHTML=_204027;
}
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,_204028,_204029,isDown,options){
OpenLayers.Control.prototype.initialize.apply(this,[options]);
this.upIcon=upIcon;
this.downIcon=_204028;
this.hoverIcon=_204029;
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(_204030,_204031,_204032,_204033,_204034){
OpenLayers.Control.PanZoom.prototype.initialize.apply(this,[]);
this.streetLayer=_204030;
this.photoLayer=_204031;
this.hybridLayer=_204032;
if(_204033!=undefined){
this.fullZoomBar=_204033;
}
if(_204034!=undefined){
this.showMapPhotoButtons=_204034;
}
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 bgImage="button_bg_lrg.png";
var bgSize=209;
}else{
var bgImage="button_bg_sml.png";
var bgSize=108;
}
this.layerBackground=OpenLayers.Util.createAlphaImageDiv(null,this.position.clone(),new OpenLayers.Size(bgSize,25),EMS.Util.getImagesLocation()+bgImage);
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 _204035=EMS.Util.getImagesLocation()+img;
this.scale=OpenLayers.Util.createAlphaImageDiv(id,px,sz,_204035,"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 _204036=EMS.Util.getImagesLocation()+img;
var image=OpenLayers.Util.createAlphaImageDiv(id+"-image",null,new OpenLayers.Size(sz.w,sz.h*2),_204036);
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 _204037=EMS.Util.getImagesLocation()+img;
var image=OpenLayers.Util.createAlphaImageDiv(id+"-image",null,new OpenLayers.Size(sz.w,sz.h*2),_204037);
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(_204038){
var _204039=EMS.Util.getImagesLocation();
var sz=this.sliderSize.clone();
var _204040=this.handleSize;
var id="EMS_Control_ZoomBar_Slider"+this.map.id;
var _204041=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),_204039+"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,_204038.add(-_204040.w/2+4,sz.h-_204040.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);
_204038=_204038.add(0,sz.h);
return _204038;
},_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 _204042=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Photo_on_extended.gif",new OpenLayers.Size(137,21),new OpenLayers.Size(0,0));
var _204043=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Photo_on.gif",new OpenLayers.Size(36,21),new OpenLayers.Size(0,0));
var _204044=this.photoLayer.getVisibility();
var button=new EMS.Button(upIcon,_204042,_204043,_204044,{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 _204045=this._photoContents(this.streetButton.isDown,this.photoButton.isDown,this.hybridLayer.getVisibility());
this.photoButton.contentDiv.appendChild(_204045);
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 _204046=this._photoContents(this.streetButton.isDown,this.photoButton.isDown,this.hybridLayer.getVisibility());
this.photoButton.contentDiv.appendChild(_204046);
}
},_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 _204047=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Map_on.gif",new OpenLayers.Size(38,21),new OpenLayers.Size(0,0));
var _204048=_204047.clone();
var _204049=this.streetLayer.getVisibility();
var button=new EMS.Button(upIcon,_204047,_204048,_204049,{div:this.layersDiv,displayClass:"streetLayerSelector"});
button.draw(px);
button.contentDiv.innerHTML=_204049?"<b>Map</b>":"Map";
button.events.register("click",this,function(e){
this.streetButton.isDown=true;
this.photoButton.isDown=false;
this.photoButton.contentDiv.innerHTML="";
var _204050=this._photoContents(this.streetButton.isDown,this.photoButton.isDown,this.hybridLayer.getVisibility());
this.photoButton.contentDiv.appendChild(_204050);
this.map.setBaseLayer(this.streetLayer,false);
OpenLayers.Event.stop(e);
});
this.hybridLayer.setVisibility(false);
return button;
},_photoContents:function(_204051,_204052,_204053){
var div=OpenLayers.Util.createDiv();
var photo=document.createTextNode("Photo ");
if(_204052){
var bold=document.createElement("b");
bold.appendChild(photo);
photo=bold;
}
div.appendChild(photo);
if(_204052){
var divider=document.createElement("img");
divider.src=EMS.Util.getImagesLocation()+"divider.gif";
div.appendChild(divider);
var space=document.createTextNode(" ");
div.appendChild(space);
var _204054=document.createElement("span");
var anchor=document.createElement("a");
anchor.href="#";
OpenLayers.Event.observe(anchor,"click",this._toggleHybrid.bindAsEventListener(this));
var text;
if(_204053){
text=document.createTextNode("Hide street labels");
}else{
text=document.createTextNode("Show street labels");
}
anchor.appendChild(text);
_204054.appendChild(anchor);
div.appendChild(_204054);
}
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 zoomage=(y/this.sliderSize.h);
var level=Math.ceil(zoomage*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 _204055=OpenLayers.Util.pagePosition(marker)[1];
var _204056=marker.clientHeight+_204055;
var overlap=_204056-top;
if(overlap<this.handleSize.h*2&&overlap>=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 _204057=OpenLayers.Util.docPosition(this.scale);
var pos=EMS.Event.pointerY(evt)-_204057[1];
var _204058=parseInt(this.scale.style.top);
var _204059=parseInt(this.scale.style.height);
var _204060=parseInt(this.slider.style.height);
var newTop=(_204058+pos-_204060/2);
var _204061=pos-_204060/2<0;
if(_204061){
newTop=_204058;
}
var _204062=pos-_204060/2>_204059-_204060;
if(_204062){
newTop=_204058+_204059-_204060;
}
var oldTop=parseInt(this.slider.style.top);
this.slider.style.top=newTop+"px";
this.updateMarkers();
this.mouseDragStart=evt.xy.clone();
var _204063=oldTop!=newTop;
if(_204063&&(_204061||_204062)){
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 zoomage=(y/this.sliderSize.h);
var level=Math.floor(zoomage*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 zoomage=(this.map.getZoom()/this.map.getNumZoomLevels());
var newTop=zoomage*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,options){
OpenLayers.Layer.WMS.prototype.initialize.apply(this,arguments);
},getURL:function(bounds){
var _204064=this.getImageSize();
var x=(bounds.left-this.map.getMaxExtent().left)/(_204064.w*this.map.getResolution());
var y=(bounds.bottom-this.map.getMaxExtent().bottom)/(_204064.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,_204065){
if(typeof OpenLayers.Console!="undefined"&&OpenLayers.Console){
OpenLayers.Console.debug(_204065);
}
if(_204065.message){
alert("Problem: "+_204065.message);
}else{
alert("Problem: "+_204065);
}
};
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,options){
this.active=true;
this.tilePath=EMS.tilePath;
options=options?options:{};
options=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(100,-50,170,-3),maxResolution:0.1,numZoomLevels:17,miniControls:false,showMapPhotoButtons:true,showMaxExtent:true},options);
var _204066=false;
if(options.controls==null){
options.controls=[];
_204066=true;
}
OpenLayers.Map.prototype.initialize.apply(this,[div,options]);
var _204067;
if(EMS.tilePath instanceof Array){
_204067=new Array(EMS.tilePath.length);
for(var i=0;i<EMS.tilePath.length;i++){
_204067[i]=EMS.tilePath[i]+"/tile?";
}
}else{
_204067=EMS.tilePath+"/tile?";
}
if(options.layers==null){
this.whereis_street_wms=new EMS.IndexedLayer("Whereis Street",_204067,{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",_204067,{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",_204067,{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(_204066){
this.addControl(this.zoombar=new EMS.Control.ZoomBar(this.whereis_street_wms,this.whereis_photo_wms,this.whereis_hybrid_wms,!options.miniControls,options.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:options.miniControls}));
this.addControl(this.scalebar=new EMS.Control.Scale());
var ovLayer=new EMS.IndexedLayer("Street",_204067,{layers:"street",format:"image/gif",cache:"TRUE",version:"1.0.3"},{displayOutsideMaxExtent:true,visible:true});
ovLayer.buffer=0;
this.addControl(this.overviewmap=new EMS.Control.OverviewMap({layers:[ovLayer],mapOptions:{maxResolution:1.6,numZoomLevels:21,maxExtent:new OpenLayers.Bounds(100,-50,170,-3)}}));
}
if(this.center==undefined&&options.showMaxExtent){
this.zoomToMaxExtent();
}
var _204068=OpenLayers.Function.bind(function(results){
if(results.authorized){
if(!options.noping){
this.timeoutVar=setTimeout(OpenLayers.Function.bind(this.ping,this),this.pingPeriod);
}
if(options.onInit){
options.onInit(this);
}
}else{
EMS.token=null;
this.destroy();
alert("Authentication problem");
}
},this);
var domain=EMS.Util.getDomain();
EMS.Ajax.json("/json/auth/init",_204068,{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 _204069=document.createElement("div");
_204069.style.left="0px";
_204069.style.top="0px";
_204069.style.width="100%";
_204069.style.height="100%";
_204069.id=this.div.id+"glassPane";
_204069.style.position="relative";
_204069.style.backgroundImage="url('+ "+EMS.Util.getImagesLocation()+"blank.gif')";
_204069.style.zIndex="4000";
var _204070=this.div.childNodes[0];
var _204071=function(e){
OpenLayers.Event.stop(e);
this.events.triggerEvent("inactiveclick");
}.bindAsEventListener(this);
var _204072=function(e){
OpenLayers.Event.stop(e);
}.bindAsEventListener(this);
OpenLayers.Event.observe(_204069,"click",_204071);
OpenLayers.Event.observe(_204069,"mousedown",_204071);
OpenLayers.Event.observe(_204069,"mouseup",_204071);
OpenLayers.Event.observe(_204069,"dblclick",_204071);
OpenLayers.Event.observe(_204069,"mousemove",_204072);
OpenLayers.Event.observe(_204069,"mouseover",_204072);
OpenLayers.Event.observe(_204069,"mouseout",_204072);
_204070.appendChild(_204069);
this.glassPane=_204069;
this.active=false;
},activate:function(){
if(this.active){
return;
}
OpenLayers.Event.stopObservingElement(this.glassPane);
var _204073=this.div.childNodes[0];
_204073.removeChild(this.glassPane);
this.active=true;
},print:function(_204074,options){
var request={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}};
options=OpenLayers.Util.extend({parameters:{request:request}},options);
EMS.Services._json("/json/print/custom",_204074,options);
},print2:function(rHandle,_204075,options){
var request={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:rHandle,markers:this._remoteMarkers(this.markersLayer),mapWidth:options.width?options.width:this.getSize().w,mapHeight:options.height?options.height:this.getSize().h,boundingBox:{left:this.getExtent().left,bottom:this.getExtent().bottom,right:this.getExtent().right,top:this.getExtent().top}};
options=OpenLayers.Util.extend({parameters:{request:request}},options);
EMS.Services._json("/json/print/simple",_204075,options);
},_remoteGrid:function(layer){
if(layer.getVisibility()){
var _204076=[];
for(var x=0;x<layer.grid.length;x++){
_204076[x]=[];
for(var y=0;y<layer.grid[x].length;y++){
var tile=layer.grid[x][y];
_204076[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 _204076;
}else{
return null;
}
},_remoteMarkers:function(_204077){
var _204078=[];
for(var i=0;i<_204077.markers.length;i++){
var m=_204077.markers[i];
if((m.visible==undefined)||m.visible){
_204078.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 _204078;
},_remoteFeatures:function(_204079){
var _204080=new Array();
for(var _204081=0;_204081<_204079.features.length;_204081++){
var feature=_204079.features[_204081];
for(var lineIdx=0;lineIdx<feature.geometry.components.length;lineIdx++){
var line=feature.geometry.components[lineIdx];
_204080.push(line.toString());
}
}
return _204080;
},_externalizeVectorLayer:function(_204082){
var filter=new EMS.Geometry.PolylineBoundsFilter(this.getExtent());
var _204083=new EMS.Geometry.SimpleLineReducer(this.getResolution());
return _204082.externalize(new EMS.Geometry.JsonFormatter(filter,_204083));
}});
EMS.Services.Geocoder=OpenLayers.Class({initialize:function(){
},findAddress:function(street,suburb,state,_204084,options){
var address={};
address.street=street;
address.suburb=suburb;
address.state=state;
var _204085={address:address};
if(options&&options.feature){
_204085=OpenLayers.Util.extend({feature:options.feature},_204085);
}
options=OpenLayers.Util.extend({parameters:_204085},options);
this._json("/json/fastGeocode/simple",_204084,options);
},findGeocodedAddress:function(query,_204086,options){
var address=query.address;
var _204087={address:address};
if(options&&options.feature){
_204087=OpenLayers.Util.extend({feature:options.feature},_204087);
}
options=OpenLayers.Util.extend({parameters:_204087},options);
this._json("/json/fastGeocode/findGeocodedAddress",_204086,options);
},reverseGeocode:function(lon,lat,_204088,options){
var params={longitude:lon,latitude:lat};
if(options&&options.feature){
params=OpenLayers.Util.extend({feature:options.feature},params);
}
options=OpenLayers.Util.extend({parameters:params},options);
this._json("/json/fastGeocode/reverseGeocode",_204088,options);
},reverseGeocodePoi:function(query,_204089,options){
var lon=query.lon;
var lat=query.lat;
var keyword=query.keyword;
var source=query.source;
options=OpenLayers.Util.extend({parameters:{longitude:lon,latitude:lat,keyword:keyword,source:source}},options);
this._json("/json/fastGeocode/reverseGeocodePoi",_204089,options);
},findLocalityByPrefix:function(query,_204090,options){
var address=query.address;
var id=query.id;
options=OpenLayers.Util.extend({parameters:{address:address,id:id}},options);
this._json("/json/fastGeocode/findLocalityByPrefix",_204090,options);
},findStreetByPrefix:function(street,_204091,options){
options=OpenLayers.Util.extend({parameters:{street:street}},options);
this._json("/json/fastGeocode/findStreetByPrefix",_204091,options);
},poiSearch:function(query,_204092,options){
var address=query.address;
var bounds=query.bounds;
var keyword=query.keyword;
var offset=query.offset;
var size=query.size;
var source=query.source;
var id=query.id;
var poiId=query.poiId;
options=OpenLayers.Util.extend({parameters:{address:address,bounds:bounds,keyword:keyword,offset:offset,size:size,source:source,id:id,poiId:poiId}},options);
this._json("/json/fastGeocode/poiSearch",_204092,options);
},combinedSearch:function(query,_204093,options){
var address=query.address;
var keyword=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;
options=OpenLayers.Util.extend({parameters:{address:address,keyword:keyword,bounds:bounds,offset:offset,size:size,source:source,id:id,poiId:poiId}},options);
this._json("/json/fastGeocode/combinedSearch",_204093,options);
},locationPoiSearch:function(query,_204094,options){
var address=query.address;
var keyword=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 feature=query.feature;
options=OpenLayers.Util.extend({parameters:{address:address,bounds:bounds,keyword:keyword,xy:xy,offset:offset,size:size,source:source,id:id,poiId:poiId,feature:feature}},options);
this._json("/json/fastGeocode/locationPoiSearch",_204094,options);
},geocodeIntersection:function(query,_204095,options){
var _204096=query.primaryStreet;
var _204097=query.intersectingStreet;
var suburb=query.suburb;
var state=query.state;
options=OpenLayers.Util.extend({parameters:{primaryStreet:_204096,intersectingStreet:_204097,suburb:suburb,state:state}},options);
this._json("/json/geocode/geocodeIntersection",_204095,options);
},reverseGeocodeIntersection:function(lon,lat,_204098,options){
options=OpenLayers.Util.extend({parameters:{longitude:lon,latitude:lat}},options);
this._json("/json/geocode/reverseGeocodeIntersection",_204098,options);
},_json:EMS.Services._json,_onException:EMS.Services._onException,CLASS_NAME:"EMS.Services.Geocoder"});
EMS.Services.Itin=OpenLayers.Class({initialize:function(){
},splitRoute:function(_204099,fastest,tolls,_204100,_204101,_204102,options){
options=OpenLayers.Util.extend({parameters:this._getRouteParams(_204099,fastest,tolls,_204100,_204101)},options);
this._json("/json/itin/splitRoute",_204102,options);
},combinedRoute:function(_204103,fastest,tolls,_204104,_204105,_204106,options){
options=OpenLayers.Util.extend({parameters:this._getRouteParams(_204103,fastest,tolls,_204104,_204105,options.landmarks)},options);
this._json("/json/itin/combinedRoute",_204106,options);
},_getRouteParams:function(_204107,fastest,tolls,_204108,_204109,_204110){
var params={};
if(_204107[0].street){
params.wpAddresses=_204107;
}else{
for(var i=0;i<_204107.length;i++){
params["wp"+(i+1)]=_204107[i];
}
}
params.fastest=fastest;
params.tolls=tolls;
params.tt=_204108;
params.handleOnly=_204109;
params.landmarks=_204110;
return params;
},getRoutePart:function(handle,_204111,extent,_204112,options){
var params={handle:handle,resolution:_204111,left:extent.left,top:extent.top,right:extent.right,bottom:extent.bottom};
options=OpenLayers.Util.extend({parameters:params},options);
this._json("/json/itin/getRoutePart",_204112,options);
},rankPoints:function(_204113,points,tolls,mode,_204114,options){
var params={lon:_204113.lon,lat:_204113.lat,tolls:tolls,mode:mode,points:points};
options=OpenLayers.Util.extend({parameters:params},options);
this._json("/json/itin/rankPoints",_204114,options);
},releaseRouteHandle:function(handle,options){
options=OpenLayers.Util.extend({parameters:{handle:handle}},options);
this._json("/json/itin/releaseRouteHandle",function(){
},options);
},_json:EMS.Services._json,_onException:EMS.Services._onException,CLASS_NAME:"EMS.Services.Itin"});
EMS.Services.Itin2=OpenLayers.Class(EMS.Services.Itin,{combinedRoute:function(_204115,_204116,options){
options=OpenLayers.Util.extend({parameters:{json:_204115}},options);
this._json("/json/route/route",_204116,options);
},getRoutePart:function(handle,_204117,extent,_204118,options){
var params={handle:handle,resolution:_204117,left:extent.left,top:extent.top,right:extent.right,bottom:extent.bottom};
options=OpenLayers.Util.extend({parameters:params},options);
this._json("/json/route/getRoutePart",_204118,options);
}});
OpenLayers.Map.prototype.getLayerByName=function(_204119){
for(var i=0;i<this.layers.length;i++){
if(this.layers[i].name==_204119){
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(colour1,colour2,text,_204120,_204121,_204122){
var _204123="/marker?type=poi&width=27&height=96&colour1="+encodeURIComponent(colour1)+"&colour2="+encodeURIComponent(colour2)+"&text1="+encodeURIComponent(text);
if(_204120!=null){
_204123+="&textColour="+encodeURIComponent(_204120);
}
if(_204121!=null){
_204123+="&hoverColour1="+encodeURIComponent(_204121);
}
if(_204122!=null){
_204123+="&hoverColour2="+encodeURIComponent(_204122);
}
return _204123;
}},multipoi:{size:new OpenLayers.Size(36,43),offset:new OpenLayers.Pixel(-14,-43),url:function(colour1,colour2,text,_204124,_204125,_204126){
var query="/marker?type=multipoi&width=36&height=129&colour1="+encodeURIComponent(colour1)+"&colour2="+encodeURIComponent(colour2)+"&text2=&text1="+encodeURIComponent(text);
if(_204124!=null){
query+="&textColour="+encodeURIComponent(_204124);
}
if(_204125!=null){
query+="&hoverColour1="+encodeURIComponent(_204125);
}
if(_204126!=null){
query+="&hoverColour2="+encodeURIComponent(_204126);
}
return query;
}},babushka:{size:new OpenLayers.Size(36,43),offset:new OpenLayers.Pixel(-14,-43),url:function(text,colour1,colour2,_204127,_204128,_204129){
var query="/marker?type=babushka&width=36&height=129&text1="+encodeURIComponent(text);
if(colour1!=null){
query+="&colour1="+encodeURIComponent(colour1);
}else{
query+="&colour1=213367";
}
if(colour1!=null){
query+="&colour2="+encodeURIComponent(colour2);
}else{
query+="&colour2=2B89C9";
}
if(_204127!=null){
query+="&textColour="+encodeURIComponent(_204127);
}
if(_204128!=null){
query+="&hoverColour1="+encodeURIComponent(_204128);
}
if(_204129!=null){
query+="&hoverColour2="+encodeURIComponent(_204129);
}
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(_204130,text){
return new OpenLayers.Icon(_204130+"/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(_204131,colour1,colour2,text,_204132,_204133,_204134){
return new EMS.HoverIcon(_204131+EMS.Services.StandardIconGeometry.poi.url(colour1,colour2,text,_204132,_204133,_204134),EMS.Services.StandardIconGeometry.poi.size,EMS.Services.StandardIconGeometry.poi.offset,null,3);
},purplePoi:function(_204135,text){
return EMS.Services.StandardIcons.poi(_204135,EMS.Services.StandardIconGeometry.colours.purple.start,EMS.Services.StandardIconGeometry.colours.purple.end,text);
},greenPoi:function(_204136,text){
return EMS.Services.StandardIcons.poi(_204136,EMS.Services.StandardIconGeometry.colours.green.start,EMS.Services.StandardIconGeometry.colours.green.end,text);
},brownPoi:function(_204137,text){
return EMS.Services.StandardIcons.poi(_204137,EMS.Services.StandardIconGeometry.colours.brown.start,EMS.Services.StandardIconGeometry.colours.brown.end,text);
},multipoi:function(_204138,colour1,colour2,text,_204139,_204140,_204141){
return new EMS.HoverIcon(_204138+EMS.Services.StandardIconGeometry.multipoi.url(colour1,colour2,text,_204139,_204140,_204141),EMS.Services.StandardIconGeometry.multipoi.size,EMS.Services.StandardIconGeometry.multipoi.offset,null,3);
},purpleMultipoi:function(_204142,text){
return new EMS.Services.StandardIcons.multipoi(_204142,EMS.Services.StandardIconGeometry.colours.purple.start,EMS.Services.StandardIconGeometry.colours.purple.end,text);
},greenMultipoi:function(_204143,text){
return new EMS.Services.StandardIcons.multipoi(_204143,EMS.Services.StandardIconGeometry.colours.green.start,EMS.Services.StandardIconGeometry.colours.green.end,text);
},brownMultipoi:function(_204144,text){
return new EMS.Services.StandardIcons.multipoi(_204144,EMS.Services.StandardIconGeometry.colours.brown.start,EMS.Services.StandardIconGeometry.colours.brown.end,text);
},babushka:function(_204145,text,colour1,colour2,_204146,_204147,_204148){
return new EMS.HoverIcon(_204145+EMS.Services.StandardIconGeometry.babushka.url(text,colour1,colour2,_204146,_204147,_204148),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(_204149,fastest,tolls,_204150,_204151,options){
if(!this.itin){
this.itin=new EMS.Services.Itin();
}
this.mode="route1";
this.options=options;
this.routeVectorLayer=_204151;
this.itin.combinedRoute(_204149,fastest,tolls,_204150,true,OpenLayers.Function.bind(this._setupMapRoute,this),options);
},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 options={group:"routePart"};
this.itin.getRoutePart(this.rHandle,this.map.getResolution(),extent,OpenLayers.Function.bind(this._plotRouteLine,this),options);
}
},_plotRouteLine:function(_204152){
if(!this.routeVectorLayer){
return;
}
var _204153=[];
if(_204152.invalidRoute){
this.events.triggerEvent("invalidroute");
this.clearRoute();
return;
}
this.routeVectorLayer.setVisibility(false);
for(var _204154=0;_204154<_204152.routes.length;_204154++){
var route=_204152.routes[_204154];
var _204155=[];
for(i=0;i<route.routeGeometry.length;i++){
var _204156=[];
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);
_204156.push(point);
}
if(_204156.length>0){
var _204157=new OpenLayers.Geometry.LineString(_204156);
_204155.push(_204157);
}
}
if(_204155.length>0){
var _204158=new OpenLayers.Geometry.MultiLineString(_204155);
var vector=new EMS.Feature.Vector(_204158);
vector.routeNumber=_204154;
vector.routeHandle=_204152.routeHandle;
vector.style=EMS.Services.LineFeatureStyle;
_204153.push(vector);
}
}
this._clearVectorFeatures();
if(_204153.length>0){
this.routeVectorLayer.addFeatures(_204153);
for(var i=0;i<_204153.length;i++){
this.vectors.push(_204153[i]);
}
}
this.routeVectorLayer.setVisibility(true);
},CLASS_NAME:"EMS.Services.RouteManager"});
EMS.Services.RouteManager2=OpenLayers.Class(EMS.Services.RouteManager,{route:function(_204159,_204160,options){
if(!this.itin){
this.itin=new EMS.Services.Itin2();
}
if(!_204159.preferences.contains("ROUTE_HANDLE_ONLY")){
_204159.preferences.push("ROUTE_HANDLE_ONLY");
}
this.mode="route2";
this.options=options;
this.routeVectorLayer=_204160;
this.itin.combinedRoute(_204159,OpenLayers.Function.bind(this._setupMapRoute,this),options);
},_plotRouteLine:function(_204161){
if(!this.routeVectorLayer){
return;
}
var _204162=[];
if(_204161.invalidRoute){
this.events.triggerEvent("invalidroute");
this.clearRoute();
return;
}
this.routeVectorLayer.setVisibility(false);
var _204163=[];
var _204164=_204161.polylines;
for(i=0;i<_204164.length;i++){
var _204165=[];
for(var j=0;j<_204164[i].length;j++){
var lon=_204164[i][j][0];
var lat=EMS.Util.latToSGP4(_204164[i][j][1]);
var point=new OpenLayers.Geometry.Point(lon,lat);
_204165.push(point);
}
if(_204165.length>0){
var _204166=new OpenLayers.Geometry.LineString(_204165);
_204163.push(_204166);
}
}
if(_204163.length>0){
var _204167=new OpenLayers.Geometry.MultiLineString(_204163);
var vector=new EMS.Feature.Vector(_204167);
vector.style=EMS.Services.LineFeatureStyle;
vector.routeHandle=_204161.routeHandle;
_204162.push(vector);
}
this._clearVectorFeatures();
if(_204162.length>0){
this.routeVectorLayer.addFeatures(_204162);
for(var i=0;i<_204162.length;i++){
this.vectors.push(_204162[i]);
}
}
this.routeVectorLayer.setVisibility(true);
},CLASS_NAME:"EMS.Services.RouteManager2"});
OpenLayers.Geometry.prototype.externalize=function(_204168){
throw "EMS Unsupported Geometry Type: "+this.CLASS_NAME;
};
OpenLayers.Geometry.LineString.prototype.externalize=function(_204169){
return _204169.formatPolyline(this);
};
OpenLayers.Geometry.LinearRing.prototype.externalize=function(_204170){
return _204170.formatClosedPolyline(this);
};
OpenLayers.Geometry.MultiLineString.prototype.externalize=function(_204171){
return _204171.formatGeometryContainer(this);
};
OpenLayers.Geometry.Polygon.prototype.externalize=function(_204172){
return _204172.formatGeometryContainer(this);
};
OpenLayers.Geometry.Point.prototype.externalize=function(_204173){
return _204173.formatPoint(this);
};
OpenLayers.Feature.Vector.prototype.externalize=function(_204174){
return _204174.formatFeature(this);
};
EMS.Layer=new Object();
EMS.Layer.Vector=OpenLayers.Class(OpenLayers.Layer.Vector,{initialize:function(name,options){
OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments);
},externalize:function(_204175){
return _204175.formatVector(this);
}});
EMS.Feature=new Object();
EMS.Feature.Vector=OpenLayers.Class(OpenLayers.Feature.Vector,{routeHandle:null,initialize:function(_204176,_204177,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,_204178){
this.filter=filter;
this.lineReducer=_204178;
},formatVector:function(vector){
return {features:this._formatComponents(vector.features)};
},formatFeature:function(feature){
return {routeHandle:feature.routeHandle?feature.routeHandle:null,style:this.formatStyle(feature.style),geometry:feature.routeHandle?null:feature.geometry.externalize(this)};
},formatGeometryContainer:function(_204179){
return {type:_204179.CLASS_NAME,components:this._formatComponents(_204179.components)};
},formatPolyline:function(line){
var _204180=this._filterPolyline(line.components);
var _204181=[];
for(var i=0;i<_204180.length;i++){
_204181.push(this._formatComponents(this._reducePolyline(_204180[i])));
}
return {type:line.CLASS_NAME,segments:_204181};
},formatClosedPolyline:function(line){
var _204182=[];
_204182.push(this._formatComponents(this._reducePolyline(line.components)));
return {type:line.CLASS_NAME,segments:_204182};
},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(_204183){
var _204184=[];
for(var i=0;i<_204183.length;i++){
_204184.push(_204183[i].externalize(this));
}
return _204184;
},_reducePolyline:function(_204185){
if(this.lineReducer){
return this.lineReducer.reduce(_204185);
}
return _204185;
},_filterPolyline:function(_204186){
if(this.filter){
return this.filter.filter(_204186);
}
return [_204186];
},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(_204187){
this.minDistance=_204187*this.factor;
},reduce:function(_204188){
var _204189=[];
var _204190=_204188[0];
_204189.push(_204190);
if(_204188.length>1){
var _204191=_204188.length-1;
for(var i=1;i<_204191;i++){
var _204192=_204188[i];
if(this.includePoint(_204190,_204192)){
_204189.push(_204192);
_204190=_204192;
}
}
_204189.push(_204188[_204191]);
}
return _204189;
},includePoint:function(_204193,_204194){
return (Math.abs(_204193.x-_204194.x)>this.minDistance)||(Math.abs(_204193.y-_204194.y)>this.minDistance);
},CLASS_NAME:"EMS.Geometry.SimpleLineReducer"});
EMS.Geometry.PolylineBoundsFilter=OpenLayers.Class({bounds:null,initialize:function(_204195){
this.bounds=_204195;
},filter:function(_204196){
var _204197=[];
if(_204196.length>1){
var _204198=[];
var _204199=_204196.length-1;
for(var i=0;i<_204199;i++){
var _204200=new OpenLayers.Bounds(_204196[i].x,_204196[i].y,_204196[i].x,_204196[i].y);
_204200.extend(_204196[i+1]);
if(this.bounds.intersectsBounds(_204200)){
if(_204198.length==0){
_204198.push(_204196[i]);
}
_204198.push(_204196[i+1]);
}else{
if(_204198.length>0){
_204197.push(_204198);
_204198=[];
}
}
}
if(_204198.length>1){
_204197.push(_204198);
}
}
return _204197;
},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 _204201=this.map.getLonLatFromViewPortPx(newXY);
this.map.setCenter(_204201,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 _204202=this.map.getResolution();
var _204203=new OpenLayers.Pixel((mouse.lon-center.lon)/_204202,(mouse.lat-center.lat)/_204202);
if(this.map.baseLayer!=null){
var _204204=this.map.baseLayer.resolutions[this.map.getZoom()+1];
}else{
var _204204=this.map.getResolution();
}
this.map.setCenter(new OpenLayers.LonLat(center.lon+(_204203.x*_204204),center.lat+(_204203.y*_204204)),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 _204205=this.map.getResolution();
var _204206=new OpenLayers.Pixel((mouse.lon-center.lon)/_204205,(mouse.lat-center.lat)/_204205);
if(this.map.baseLayer!=null){
var _204207=this.map.baseLayer.resolutions[this.map.getZoom()-1];
}else{
var _204207=this.map.getResolution();
}
this.map.setCenter(new OpenLayers.LonLat(mouse.lon-(_204206.x*_204207),mouse.lat-(_204206.y*_204207)),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 _204208=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_204208,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,options){
OpenLayers.Control.prototype.initialize.apply(this,[options]);
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=options.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(feature){
if(!(OpenLayers.Util.indexOf(this.layer.selectedFeatures,feature)>-1)){
this.select(feature);
}
},outFeature:function(feature){
this.unselect(feature);
},select:function(feature){
if(feature.originalStyle==null){
feature.originalStyle=feature.style;
}
this.layer.selectedFeatures.push(feature);
this.layer.drawFeature(feature,this.selectStyle);
this.onSelect(feature);
},unselect:function(feature){
if(feature.originalStyle==null){
feature.originalStyle=feature.style;
}
this.layer.drawFeature(feature,feature.originalStyle);
OpenLayers.Util.removeItem(this.layer.selectedFeatures,feature);
this.onUnselect(feature);
},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(options){
this.layers=options.layers;
OpenLayers.Control.prototype.initialize.apply(this,[options]);
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 _204209=EMS.Util.getImagesLocation();
var img=_204209+"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=_204209+"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(element,_204210,_204211){
var _204212=element.childNodes[0];
var isChild=function(_204213,_204214){
while(_204213){
if(_204213==_204214){
return true;
}
_204213=_204213.parentNode;
}
return false;
};
OpenLayers.Event.observe(element,"mouseover",function(){
if(!element.isOver){
if((navigator.appVersion.indexOf("MSIE 6.")!=-1)){
element.appendChild(OpenLayers.Util.createImage(null,null,null,EMS.Util.getImagesLocation()+_204210));
element.childNodes[1].style.top="0px";
element.childNodes[1].style.left="0px";
element.childNodes[1].style.position="absolute";
element.childNodes[1].style.marginLeft="0px";
element.childNodes[1].style.marginTop="0px";
}else{
element.childNodes[0].src=EMS.Util.getImagesLocation()+_204210;
}
element.isOver=true;
}
});
OpenLayers.Event.observe(element,"mouseout",function(e){
if(e.relatedTarget==this||isChild(e.relatedTarget,element)){
return;
}
if((navigator.appVersion.indexOf("MSIE 6.")!=-1)){
element.removeChild(element.childNodes[1]);
}else{
element.childNodes[0].src=EMS.Util.getImagesLocation()+_204211;
}
element.isOver=false;
});
},createCorner:function(type,width,height,top,left,_204215){
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()+_204215+"')";
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 _204216=this.getRectPxBounds();
if((_204216.top<=0)||(_204216.left<=0)||(_204216.bottom>=this.size.h-this.hComp)||(_204216.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 _204217=this.getRectPxBounds();
var rectTop=_204217.top;
var _204218=_204217.left;
var _204219=Math.abs(_204217.getHeight());
var _204220=_204217.getWidth();
var newTop=Math.max(0,(rectTop-deltaY));
newTop=Math.min(newTop,this.ovmap.size.h-this.hComp-_204219);
var newLeft=Math.max(0,(_204218-deltaX));
newLeft=Math.min(newLeft,this.ovmap.size.w-this.wComp-_204220);
this.setRectPxBounds(new OpenLayers.Bounds(newLeft,newTop+_204219,newLeft+_204220,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 _204221=this.getRectPxBounds();
var _204222=_204221.getCenterPixel();
var deltaX=evt.xy.x-_204222.x;
var deltaY=evt.xy.y-_204222.y;
var top=_204221.top;
var left=_204221.left;
var height=Math.abs(_204221.getHeight());
var width=_204221.getWidth();
var newTop=Math.max(0,(top+deltaY));
newTop=Math.min(newTop,this.ovmap.size.h-height);
var newLeft=Math.max(0,(left+deltaX));
newLeft=Math.min(newLeft,this.ovmap.size.w-width);
this.setRectPxBounds(new OpenLayers.Bounds(newLeft,newTop+height,newLeft+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(_204223){
this.maximizeDiv.style.display=_204223?"":"none";
this.minimizeDiv.style.display=_204223?"none":"";
},update:function(){
if(this.ovmap==null){
this.createMap();
}
this.updateOverview();
this.updateRectToMap();
},isSuitableOverview:function(){
var _204224=this.map.getExtent();
var _204225=this.map.maxExtent;
var _204226=new OpenLayers.Bounds(Math.max(_204224.left,_204225.left),Math.max(_204224.bottom,_204225.bottom),Math.min(_204224.right,_204225.right),Math.min(_204224.top,_204225.top));
var _204227=this.ovmap.getResolution()/this.map.getResolution();
return ((_204227>this.minRatio)&&(_204227<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(_204226)));
},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 _204228=this.ovmap.getResolution();
var _204229=_204228/mapRes;
if(_204229>this.maxRatio){
_204228=this.minRatio*mapRes;
}else{
if(_204229<=this.minRatio){
_204228=this.maxRatio*mapRes;
}
}
var newZoom=this.ovmap.getZoomForResolution(_204228);
if(newZoom<1){
newZoom=1;
}
this.ovmap.setCenter(this.map.center,newZoom);
this.updateRectToMap();
},createMap:function(){
var options=OpenLayers.Util.extend({controls:[],buffer:0},this.mapOptions);
this.ovmap=new OpenLayers.Map(this.mapDiv,options);
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 _204230=this.getRectBoundsFromMapBounds(this.map.getExtent());
if(_204230){
this.setRectPxBounds(_204230);
}
},updateMapToRect:function(){
var _204231=this.getRectPxBounds();
var _204232=this.getMapBoundsFromRectBounds(_204231);
this.map.setCenter(_204232.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(_204233){
var top=Math.max(_204233.top,0);
var left=Math.max(_204233.left,0);
var bottom=Math.min(_204233.top+Math.abs(_204233.getHeight()),this.ovmap.size.h-this.hComp);
var right=Math.min(_204233.left+_204233.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(_204234){
var _204235=new OpenLayers.LonLat(_204234.left,_204234.bottom);
var _204236=new OpenLayers.LonLat(_204234.right,_204234.top);
var _204237=this.getOverviewPxFromLonLat(_204235);
var _204238=this.getOverviewPxFromLonLat(_204236);
var bounds=null;
if(_204237&&_204238){
bounds=new OpenLayers.Bounds(_204237.x,_204237.y,_204238.x,_204238.y);
}
return bounds;
},getMapBoundsFromRectBounds:function(_204239){
var _204240=new OpenLayers.Pixel(_204239.left,_204239.bottom);
var _204241=new OpenLayers.Pixel(_204239.right,_204239.top);
var _204242=this.getLonLatFromOverviewPx(_204240);
var _204243=this.getLonLatFromOverviewPx(_204241);
return new OpenLayers.Bounds(_204242.lon,_204242.lat,_204243.lon,_204243.lat);
},getLonLatFromOverviewPx:function(_204244){
var size=this.ovmap.size;
var res=this.ovmap.getResolution();
var center=this.ovmap.getExtent().getCenterLonLat();
var delta_x=_204244.x-(size.w/2);
var delta_y=_204244.y-(size.h/2);
return new OpenLayers.LonLat(center.lon+delta_x*res,center.lat-delta_y*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(options){
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(options){
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 _204245=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(70,22),EMS.Util.getImagesLocation()+"whereis-footprint.png");
_204245.style.position="relative";
var _204246=function(e){
var _204247=new OpenLayers.LonLat(this.map.center.lon,this.map.center.lat).asWGS84();
window.open("http://www.whereis.com/?y="+_204247.lat+"&x="+_204247.lon+"&z="+this.map.zoom,"_blank");
OpenLayers.Event.stop(e);
};
OpenLayers.Event.observe(_204245,"click",_204246.bindAsEventListener(this));
OpenLayers.Event.observe(_204245,"mouseover",function(){
_204245.style.cursor="pointer";
});
if(this.smallCopyright){
var _204248=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(46,22),EMS.Util.getImagesLocation()+"legals_sml.png");
}else{
var _204248=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(80,22),EMS.Util.getImagesLocation()+"legals.png");
}
_204248.style.position="absolute";
_204248.style.top="0px";
_204248.style.left="70px";
OpenLayers.Event.observe(_204248,"click",function(e){
window.open("http://www.whereis.com/products/terms-of-use/index.html","_blank");
OpenLayers.Event.stop(e);
});
OpenLayers.Event.observe(_204248,"mouseover",function(){
_204248.style.cursor="pointer";
});
this.element=this.div;
this.element.appendChild(_204245);
this.element.appendChild(_204248);
}
return this.div;
},CLASS_NAME:"EMS.Control.Copyright"});
EMS.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,bottom:null,initialize:function(element,options){
OpenLayers.Control.prototype.initialize.apply(this,[options]);
this.element=OpenLayers.Util.getElement(element);
},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 _204249=Math.cos(EMS.Util.sgp4ToLat(((this.map.getExtent().bottom+this.map.getExtent().top)/2))*Math.PI/180);
var scale=_204249*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 _204250=scale/4;
var _204251=this.map.getSize().w/4;
var _204252=this.map.getSize().w/scale;
var _204253=Math.round(_204250/magnitude(_204250))*magnitude(_204250);
var _204254=_204253*_204252;
if(_204253<1000){
_204253="&nbsp;"+_204253+"m";
}else{
_204253="&nbsp;"+(_204253/1000)+"km";
}
var _204255;
if(this.map.whereis_street_wms.getVisibility()){
_204255="black";
}else{
_204255="white";
}
this.element.innerHTML="<div class='"+this.displayClass+"Text' style='width: "+_204254+"px ; color:"+_204255+"'>"+_204253+"</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,_204256,_204257,_204258,options){
this.mapId=OpenLayers.Util.createUniqueID(this.CLASS_NAME.replace(/\./g,"")+"_map");
EMS.Popup.prototype.initialize.apply(this,[id,lonlat,size,"",anchor,_204256]);
this.locatables=_204257;
this.locatableRenderer=_204258;
OpenLayers.Util.extend(this,options||{});
this.history=[];
this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES,true);
},markerCreator:function(_204259){
var icon,lonlat;
if(_204259.length==1){
icon=EMS.Services.StandardIcons.greenPoi(this.map.tilePath,"");
lonlat=_204259[0].lonlat.clone();
}else{
icon=EMS.Services.StandardIcons.greenMultipoi(this.map.tilePath,_204259.length);
var bounds=new OpenLayers.Bounds(_204259[0].lonlat.lon,_204259[0].lonlat.lat,_204259[0].lonlat.lon,_204259[0].lonlat.lat);
for(var i=1;i<_204259.length;i++){
bounds.extend(_204259[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 _204260=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(5,32),new OpenLayers.Size(this.size.w-15,this.size.h-70),null,"absolute");
this.tab1ContentsDiv=_204260;
_204260.style.borderTop="1px solid #58a2d1";
var tab1On=this.createImageDiv("multi-tab.gif",0,0,45,32,90,96,140,1);
var tab1Off=this.createImageDiv("multi-tab.gif",0,32,45,32,90,96,140,1);
var _204261=this.createImageDiv("multi-tab.gif",0,64,45,32,90,96,140,1);
var mapTab=new EMS.MultiPopupTab(tab1On,tab1Off,_204261,_204260);
this.contentDiv.appendChild(_204260);
this.contentDiv.appendChild(tab1On);
this.contentDiv.appendChild(tab1Off);
this.contentDiv.appendChild(_204261);
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 _204262=EMS.Util.defaultResolutions;
var _204263=new EMS.Util.ZoomCalculator(_204262,this.mapDiv);
var zoom=_204263.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 _204264=document.createElement("a");
_204264.className="ems-top-back";
_204264.href="#";
this.historyDiv.appendChild(_204264);
this.historyDiv.appendChild(document.createTextNode("  "));
var _204265=document.createElement("a");
_204265.href="#";
_204265.className="ems-back";
_204265.appendChild(document.createTextNode("Back"));
this.historyDiv.appendChild(_204265);
this.historyDiv.style.top=(this.size.h-65)+"px";
this.tab1ContentsDiv.appendChild(this.historyDiv);
OpenLayers.Event.observe(_204265,"click",OpenLayers.Function.bind(this.backInHistory,this));
OpenLayers.Event.observe(_204264,"click",OpenLayers.Function.bind(this.backInHistoryToTop,this));
return mapTab;
},createListTab:function(){
var _204266=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(5,32),new OpenLayers.Size(this.size.w-15,this.size.h-47),null,"absolute");
this.tab2ContentsDiv=_204266;
this.tab2ContentsDiv.style.overflow="auto";
_204266.style.borderTop="1px solid #58a2d1";
var tab2On=this.createImageDiv("multi-tab.gif",45,0,45,32,90,96,186,1);
var tab2Off=this.createImageDiv("multi-tab.gif",45,32,45,32,90,96,186,1);
var _204267=this.createImageDiv("multi-tab.gif",45,64,45,32,90,96,186,1);
var listTab=new EMS.MultiPopupTab(tab2On,tab2Off,_204267,_204266);
this.contentDiv.appendChild(_204266);
this.contentDiv.appendChild(tab2On);
this.contentDiv.appendChild(tab2Off);
this.contentDiv.appendChild(_204267);
return listTab;
},createImageDiv:function(_204268,_204269,_204270,_204271,_204272,_204273,_204274,left,top){
var _204275=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(left,top),new OpenLayers.Size(_204271,_204272),null,"absolute");
_204275.style.overflow="hidden";
var image=OpenLayers.Util.createImage(null,new OpenLayers.Pixel(-_204269,-_204270),new OpenLayers.Size(_204273,_204274),EMS.Util.getImagesLocation()+_204268);
_204275.appendChild(image);
return _204275;
},mapInit:function(map){
this.map=map;
var _204276=new OpenLayers.Layer.Markers("Markers");
var _204277=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=_204276;
map.whereis_street_wms=_204277;
map.addLayer(map.whereis_street_wms);
map.addLayer(map.markersLayer);
var _204278=new EMS.CombinerCalculator(map.getResolution(),this.locatables);
this.history.push(this.locatables);
this.updateHistoryLinks();
var points=_204278.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 redIcon=EMS.Services.StandardIcons.redNumber(this.map.tilePath,this.locatables.length);
this.countDiv.innerHTML="<img src='"+redIcon.url+"'/><span style='display: block; margin-left: 2em; margin-top: -1.7em;'> place"+(this.locatables.length==1?"":"s")+"</span>";
},zoomMarker:function(_204279,map){
var extent=this.getExtent(_204279,this.mapDiv);
var zoom=map.getZoomForExtent(extent);
var _204280=true;
for(var i=0;i<_204279.length;i++){
if(i==0){
var _204281=_204279[0].lonlat;
}else{
if(!_204281.equals(_204279[i].lonlat)){
_204280=false;
}
}
}
if(map.getZoom()==zoom||_204280){
this.tabs.showTab(this.listTab);
}
map.setCenter(extent.getCenterLonLat(),zoom);
var _204282=this.history.length==0?-1:this.history[this.history.length-1].length;
if(map.getZoom()!=zoom||_204282!=_204279.length){
this.history.push(_204279);
this.tab2ContentsDiv.innerHTML="";
var _204283=new EMS.CombinerCalculator(map.getResolution(),_204279);
var points=_204283.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<_204279.length;i++){
this.tab2ContentsDiv.appendChild(this.locatableRenderer(_204279[i]));
}
this.updateHistoryLinks();
var redIcon=EMS.Services.StandardIcons.redNumber(this.map.tilePath,_204279.length);
this.countDiv.innerHTML="<img src='"+redIcon.url+"'/><span style='display: block; margin-left: 2em; margin-top: -1.7em;'> place"+(_204279.length==1?"":"s")+"</span>";
}
},backInHistory:function(){
var _204284=this.history.pop();
_204284=this.history.pop();
console.assert(_204284,"Locatables present");
this.zoomMarker(_204284,this.multimap);
},backInHistoryToTop:function(){
var _204285=this.history[0];
this.history=[];
console.assert(_204285,"Locatables present");
this.zoomMarker(_204285,this.multimap);
},updateHistoryLinks:function(){
this.historyDiv.style.display=this.history.length>1?"block":"none";
},destroyMarkersOnMap:function(map){
var markers=map.markersLayer.markers;
while(markers.length>0){
var marker=markers[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(_204286,mapDiv){
var _204287=EMS.Util.defaultResolutions;
var _204288=new EMS.Util.ZoomCalculator(_204287,mapDiv);
var bounds;
for(var i=0;i<_204286.length;i++){
if(i==0){
bounds=new OpenLayers.Bounds(_204286[i].lonlat.lon,_204286[i].lonlat.lat,_204286[i].lonlat.lon,_204286[i].lonlat.lat);
}else{
bounds.extend(new OpenLayers.LonLat(_204286[i].lonlat.lon,_204286[i].lonlat.lat));
}
}
var zoom=_204288.getZoomForExtent(bounds);
var _204289=_204287[zoom];
bounds.extend(new OpenLayers.LonLat(bounds.left,bounds.top+_204289*66));
bounds.extend(new OpenLayers.LonLat(bounds.left-_204289*15,bounds.top));
bounds.extend(new OpenLayers.LonLat(bounds.right+_204289*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(_204290,_204291,_204292,_204293){
this.tabOnDiv=_204290;
this.tabOffDiv=_204291;
this.tabHoverDiv=_204292;
this.contentDiv=_204293;
OpenLayers.Event.observe(this.tabOffDiv,"mouseover",function(){
OpenLayers.Element.hide(_204291);
OpenLayers.Element.show(_204292);
});
OpenLayers.Event.observe(this.tabHoverDiv,"mouseout",function(){
if(OpenLayers.Element.visible(_204290)){
OpenLayers.Element.hide(_204291);
}else{
OpenLayers.Element.show(_204291);
}
OpenLayers.Element.hide(_204292);
});
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(_204294,_204295,options){
this.resolution=_204294;
this.locatableObjects=[].concat(_204295);
this.locatableObjects.sort(function(a,b){
return b.lonlat.lon-a.lonlat.lon;
});
options=options||{};
OpenLayers.Util.extend(this,options);
},calculateCombined:function(){
var results=[];
for(var i=0;i<this.locatableObjects.length;i++){
var _204296=this.locatableObjects[i];
if(!_204296.combined){
var bounds=new OpenLayers.Bounds(_204296.lonlat.lon,_204296.lonlat.lat,_204296.lonlat.lon,_204296.lonlat.lat);
var _204297=[_204296];
_204296.combined=true;
var _204298,j;
for(j=i+1;j<this.locatableObjects.length;j++){
_204298=this.testForCloseness(_204296,this.locatableObjects[j],bounds);
if(_204298=="combine"){
bounds.extend(this.locatableObjects[j].lonlat);
this.locatableObjects[j].combined=true;
_204297.push(this.locatableObjects[j]);
}else{
if(_204298=="break"){
break;
}
}
}
for(j=i-1;j>=0;j--){
_204298=this.testForCloseness(_204296,this.locatableObjects[j],bounds);
if(_204298=="combine"){
bounds.extend(this.locatableObjects[j].lonlat);
this.locatableObjects[j].combined=true;
_204297.push(this.locatableObjects[j]);
}else{
if(_204298=="break"){
break;
}
}
}
results.push({lonlat:bounds.getCenterLonLat(),combined:_204297});
}
}
for(var i=0;i<this.locatableObjects.length;i++){
delete this.locatableObjects[i].combined;
}
return results;
},testForCloseness:function(_204299,_204300,bounds){
if(Math.abs((_204300.lonlat.lon-_204299.lonlat.lon)/this.resolution)>this.combinePixels){
return "break";
}
if(_204299!=_204300&&!_204300.combined){
var diffX=Math.abs(bounds.getCenterLonLat().lon-_204300.lonlat.lon)/this.resolution;
var diffY=Math.abs(bounds.getCenterLonLat().lat-_204300.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,_204301){
this.name=name;
this.iconFactory=_204301;
this.markers=[];
},addMarker:function(marker){
marker.group=this;
this.markers.push(marker);
}});
EMS.MarkerProximityCombiner=OpenLayers.Class({combinePixels:40,groups:null,multigroupIconFactory:function(markers){
return EMS.Services.StandardIcons.babushka(this.map.tilePath,markers.length);
},initialize:function(map,groups,options){
this.map=map;
this.groups=groups;
options=options||{};
OpenLayers.Util.extend(this,options);
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 _204302=new Array();
for(var i=0;i<this.groups.length;i++){
_204302=_204302.concat(this.groups[i].markers);
}
_204302.sort(function(a,b){
return b.lonlat.lon-a.lonlat.lon;
});
var marker,candidateMarker;
var count=0;
var _204303=0,markerIdx1=0;
for(i=0;i<_204302.length;i++){
marker=_204302[i];
if(!this._markerVisible(marker)){
continue;
}
if(!marker.combined){
var _204304=marker;
var _204305=[this._copyMarker(_204304)];
var bounds=new OpenLayers.Bounds(marker.lonlat.lon,marker.lonlat.lat,marker.lonlat.lon,marker.lonlat.lat);
function testMarker(_204306){
if(!this._markerVisible(_204306)){
return true;
}
if(Math.abs((_204306.lonlat.lon-marker.lonlat.lon)/this.map.getResolution())>this.combinePixels){
return false;
}
if(_204304!=_204306&&!_204306.combined){
var diffX=Math.abs(bounds.getCenterLonLat().lon-_204306.lonlat.lon)/this.map.getResolution();
var diffY=Math.abs(bounds.getCenterLonLat().lat-_204306.lonlat.lat)/this.map.getResolution();
if(diffX<this.combinePixels&&diffY<this.combinePixels){
_204305.push(this._copyMarker(_204306));
_204306.combined=true;
bounds.extend(_204306.lonlat);
}
}
return true;
}
for(var j=i+1;j<_204302.length;j++){
candidateMarker=_204302[j];
if(!OpenLayers.Function.bind(testMarker,this)(candidateMarker)){
break;
}
}
for(j=i-1;j>=0;j--){
candidateMarker=_204302[j];
if(!OpenLayers.Function.bind(testMarker,this)(candidateMarker)){
break;
}
}
_204304.combined=true;
if(_204305.length==1){
this.markers.push(this._copyMarker(_204304));
}else{
this.markers.push(this._makeCombinedMarker(_204305,bounds));
}
}
count++;
}
},_makeCombinedMarker:function(_204307,bounds){
var _204308=null;
var _204309=false;
for(var i=0;i<_204307.length;i++){
if(_204308!=null&&_204307[i].group.name!=_204308){
_204309=true;
}
_204308=_204307[i].group.name;
}
var icon;
if(_204309){
icon=this.multigroupIconFactory(_204307);
}else{
icon=_204307[0].group.iconFactory(_204307);
}
var lonlat=bounds.getCenterLonLat();
var marker=new OpenLayers.Marker(lonlat,icon);
marker.combinedMarkers=_204307;
marker.combinedBounds=bounds;
return marker;
},_copyMarker:function(marker){
var _204310=new OpenLayers.Marker(marker.lonlat.clone(),marker.icon.clone());
_204310.group=marker.group;
return _204310;
},_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 _204311=0;
var _204312=0;
var groups=this.groups;
return function(){
while(true){
if(_204311<groups.length){
var group=groups[_204311];
var marker=group.markers[_204312++];
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{
_204311++;
_204312=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(_204313,_204314,options){
OpenLayers.Control.prototype.initialize.apply(this,[options]);
var _204315=OpenLayers.Util.extend({show:this.showMenu,hide:this.hideMenu},_204315);
this.handler=new EMS.Handler.RightClick(this,_204315,{});
this.menuDisplayOwner=_204313;
this.menuDisplayCallbacks=_204314;
},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(control,_204316,options){
OpenLayers.Handler.prototype.initialize.apply(this,arguments);
},activate:function(){
if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){
return false;
}
var options={};
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 opacity=(this.shadowMaxOpacity*(this.shadowSize-i))/this.shadowSize;
var obj=OpenLayers.Util.createDiv(this.div.id+"_"+i,pix,null,null,"absolute",null,null,opacity);
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,address,_204317){
OpenLayers.Popup.Anchored.prototype.initialize.apply(this,[id,lonlat,size,"",this.anchor,false]);
this.address=address;
this.setBackgroundColor("#FFFFFF");
this.setBorder("2px solid #999999");
this.menuOptions=_204317;
},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 _204318="";
_204318+=this.address.streetNumber;
_204318+=" "+this.address.street.fullName;
_204318+=" "+this.address.suburb;
_204318+=" "+this.address.state;
_204318+="<BR/><BR/>";
this.menu.innerHTML=_204318;
}
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,_204319,anchor,_204320,logoDiv,tabs){
EMS.Popup.prototype.initialize.apply(this,[id,lonlat,size?size:new OpenLayers.Size(304,286),_204319,anchor,_204320]);
this.logoDiv=logoDiv;
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 _204321=OpenLayers.Util.createAlphaImageDiv(tabOn.id+"_left",new OpenLayers.Pixel(0,0),new OpenLayers.Size(1,33),EMS.Util.getImagesLocation()+"tab_end.gif");
var _204322=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(_204321);
tabOn.appendChild(_204322);
var tabOff=OpenLayers.Util.createDiv(null,pos,tab.headingWidth,null,"absolute");
tabOff.className="emsPopupTabOff";
tabOff.innerHTML=tab.heading;
var _204323=OpenLayers.Util.createDiv(null,pos,tab.headingWidth,null,"absolute");
_204323.className="emsPopupTabHover";
_204323.innerHTML=tab.heading;
this.currentPx=this.currentPx.add(tab.headingWidth.w,0);
this.contentDiv.appendChild(tabOn);
this.contentDiv.appendChild(tabOff);
this.contentDiv.appendChild(_204323);
this.contentDiv.appendChild(tab.contentDiv);
var aTab=new EMS.MultiPopupTab(tabOn,tabOff,_204323,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(_204324,_204325,_204326,_204327,_204328,_204329,_204330,left,top){
var _204331=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(left,top),new OpenLayers.Size(_204327,_204328),null,"absolute");
_204331.style.overflow="hidden";
var image=OpenLayers.Util.createImage(null,new OpenLayers.Pixel(-_204325,-_204326),new OpenLayers.Size(_204329,_204330),EMS.Util.getImagesLocation()+_204324);
_204331.appendChild(image);
return _204331;
}});
EMS.CustomTab=OpenLayers.Class({initialize:function(heading,_204332,_204333){
this.heading=heading;
this.contentDiv=_204332;
if(_204333==undefined){
this.headingWidth=new OpenLayers.Size(45,32);
}else{
this.headingWidth=new OpenLayers.Size(_204333,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(_204334,_204335,_204336,_204337){
if(_204335){
this.currentRoute=_204335;
}
if(_204336){
this.currentSegment=_204336;
}
if(_204337){
this.showRouteMarkers=_204337;
}
this.routeDetail=_204334;
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 _204338=new OpenLayers.Layer.Markers("Route Markers");
var _204339=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=_204338;
this.routeMap.whereis_street_wms=_204339;
this.routeMap.addLayer(_204339);
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(_204338);
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());
_204338.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]());
_204338.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());
_204338.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 _204340="<span>"+(this.currentSegment+1)+". "+this.getCurrentSegment().textualInstruction+"</span>";
_204340=_204340.replace("ROUNDABOUT","roundabout");
_204340=_204340.replace("Start at","Continue on");
_204340=_204340.replace("Stop at","Arrive at");
while(true){
_204340=_204340.replace("_","<strong>");
_204340=_204340.replace("_","</strong>");
if(_204340.indexOf("_")==-1){
break;
}
}
if(this.getCurrentSegment().travelTime!=0){
_204340=_204340+"<br /><span>Travel "+this.formatLength(this.getCurrentSegment().metres);
_204340=_204340+" ("+this.formatTime(this.getCurrentSegment().travelTime)+")</span>";
}
return _204340;
},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(seconds){
var value=Math.round((seconds/60)*10)/10;
if(value<1){
value=Math.round(seconds);
value+="sec";
}else{
if(value>60){
value=Math.floor(value/60)+"hr "+Math.round(value%60)+"min";
}else{
value=Math.round(seconds/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,options){
OpenLayers.Control.prototype.initialize.apply(this,[options]);
this.oldCallback=options.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 _204341={geometryTypes:this.geometryTypes};
this.featureHandler=new EMS.Handler.DragMarkerHandler(this,this.layer,this.featureCallbacks,_204341);
},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 feature=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){
feature=this.layer.markers[i];
break;
}
}else{
if(this.layer.markers[i].icon.alphaImageDiv.id==node.id){
feature=this.layer.markers[i];
break;
}
}
}
}
var _204342=false;
if(feature){
if(this.geometryTypes==null||(feature.geometry!=null&&(OpenLayers.Util.indexOf(this.geometryTypes,feature.geometry.CLASS_NAME)>-1))||(feature.type!=null&&(OpenLayers.Util.indexOf(this.geometryTypes,feature.type)>-1))){
if(!this.feature){
this.callback("over",[feature]);
}else{
if(this.feature!=feature){
this.callback("out",[this.feature]);
this.callback("over",[feature]);
}
}
this.feature=feature;
this.callback(type,[feature]);
_204342=true;
}else{
if(this.feature&&(this.feature!=feature)){
this.callback("out",[this.feature]);
this.feature=null;
}
_204342=false;
}
}else{
if(this.feature){
this.callback("out",[this.feature]);
this.feature=null;
}
_204342=false;
}
return _204342;
},CLASS_NAME:"EMS.Handler.DragMarkerHandler"});

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

