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 _203218=this._searchForEmsLibraryLocation(document.getElementsByTagName("head")[0].childNodes);
if(_203218==null){
_203218=this._searchForEmsLibraryLocation(document.getElementsByTagName("script"));
}
return _203218==null?"":_203218;
};
EMS._searchForEmsLibraryLocation=function(scripts){
var _203219=null;
var _203220=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(_203220);
if((index>-1)&&(index+_203220.length==src.length)){
_203219=src.slice(0,-_203220.length);
break;
}
}
}
}
}
return _203219;
};
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 _203221="";
var host=EMS._getScriptLocation()+"lib/";
for(var i=0;i<jsfiles.length;i++){
if(/MSIE/.test(navigator.userAgent)||/Safari/.test(navigator.userAgent)){
var _203222="<script src='"+host+jsfiles[i]+"'></script>";
_203221+=_203222;
}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(_203221){
document.write(_203221);
}
})();
}
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,_203223,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 _203224=options.onException?options.onException:EMS.Services._onException;
var _203225=options.communicationMode||EMS.Services.communicationMode;
var _203226=function(){
};
isJsonResponseOK=function(_203227){
if(_203227.stat&&(_203227.stat=="fail")){
var _203228="["+_203227.code+"] "+_203227.error;
if(_203227.stackTrace){
_203228+="\n\n"+_203227.stackTrace;
}
_203224(_203226,_203228);
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 _203229="jsessionid";
if(_203225=="XMLHttpRequest"){
_203229="ems.jsessionid";
}
url+=";"+_203229+"="+jsess;
}
if(_203225=="XMLHttpRequest"){
var ajaxReq;
var _203230;
var _203231=OpenLayers.Function.bind(function(_203226,json,request){
var result=eval("("+_203226.responseText+")");
EMS.Ajax.Responders.dispatch("onComplete",ajaxReq,_203226,result);
if(request&&request.options&&request.options.group&&request.options.requestTime<EMS.Ajax.groupedRequests[request.options.group]){
return;
}
if(isJsonResponseOK(result)){
_203223(result.message);
}
},this);
_203230=OpenLayers.Util.extend(options,{onComplete:_203231,onException:_203224});
ajaxReq=new OpenLayers.Ajax.Request(url,_203230);
EMS.Ajax.Responders.dispatch("onCreate",ajaxReq,ajaxReq.transport,null);
}else{
if(_203225=="CrossDomain"){
var _203232=function(){
};
var _203233=options.parameters.length;
var parts=new Array();
if(_203233>EMS.Ajax.maxCrossDomainURLLength){
var parts=new Array();
var _203234=0;
var _203235=true;
var start=0;
while(_203235){
var end=options.parameters.lastIndexOf("%22",start+EMS.Ajax.maxCrossDomainURLLength);
if(end==start){
parts[_203234]=options.parameters.substring(start);
_203234++;
_203235=false;
}else{
parts[_203234]=options.parameters.substring(start,end);
}
start=end;
_203234++;
}
}else{
parts[0]=options.parameters;
}
var request={"transport":_203232,"options":options};
if(typeof handlerFunctions=="undefined"){
handlerFunctions={};
}
if(typeof handler=="undefined"){
handler=0;
}else{
handler++;
}
handlerFunctions["ajaxHandler"+handler]=OpenLayers.Function.bind(function(group,_203236,ajax){
if(group&&_203236<EMS.Ajax.groupedRequests[group]){
return;
}
if(isJsonResponseOK(ajax)){
if(ajax.chunked){
}else{
try{
EMS.Ajax.Responders.dispatch("onComplete",request,_203232,ajax);
_203223(ajax.message);
}
catch(e){
alert("exception "+e);
}
}
}
},this,options.group,new Date().getTime());
EMS.Ajax.Responders.dispatch("onCreate",request,_203232,null);
for(var i=0;i<parts.length;i++){
var dtRf=new Date();
oScript=document.createElement("script");
var _203237=parts[i].replace(/=/g,"%3D%3D").replace(/&/g,"%26%26");
var _203238=url+"?cb=ajaxHandler"+handler+"&rf="+dtRf.getTime()+"&nop="+parts.length+"&pn="+(i+1)+"&part="+_203237;
oScript.setAttribute("src",_203238);
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(_203239){
for(var i=0;i<this.responders.length;i++){
if(_203239==this.responders[i]){
return;
}
}
this.responders.push(_203239);
},dispatch:function(_203240,request,_203241,json){
for(var i=0;i<this.responders.length;i++){
var _203242=this.responders[i];
if(_203242[_203240]&&typeof _203242[_203240]=="function"){
try{
_203242[_203240].apply(_203242,[request,_203241,json]);
}
catch(e){
}
}
}
}};
EMS.Ajax.Responders.register({onCreate:EMS.Ajax.requestCreate,onComplete:EMS.Ajax.requestComplete});
EMS.Ajax.requestCompleteExtractJsessionId=function(request,_203243,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 _203244=EMS.Util.convertY;
if(ilat>=9){
ilat=8;
}
if(lat>=0){
return _203244[ilat]+((lat-10*ilat)/10)*(_203244[ilat+1]-_203244[ilat]);
}else{
lat=-lat;
ilat=-ilat;
return -(_203244[ilat]+((lat-10*ilat)/10)*(_203244[ilat+1]-_203244[ilat]));
}
};
EMS.Util.sgp4ToLat=function(lat_){
var _203245=EMS.Util.convertY;
var i;
if(lat_>=0){
for(i=0;i<10;i++){
if(lat_<_203245[i]){
return ((i-1)*10)+10*(lat_-_203245[i-1])/(_203245[i]-_203245[i-1]);
}
}
i=9;
return ((i-1)*10)+10*(lat_-_203245[i-1])/(_203245[i]-_203245[i-1]);
}else{
lat_=-lat_;
for(i=0;i<10;i++){
if(lat_<_203245[i]){
return -(((i-1)*10)+10*(lat_-_203245[i-1])/(_203245[i]-_203245[i-1]));
}
}
i=9;
return -(((i-1)*10)+10*(lat_-_203245[i-1])/(_203245[i]-_203245[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 _203246 in obj){
if(EMS.Util.$type(obj[_203246])!="function"){
string.push("\""+_203246+"\":"+EMS.Util.Json.toString(obj[_203246]));
}
}
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 _203247=new Array();
for(var key in params){
var value=params[key];
if((value!=null)&&(typeof value!="function")){
var _203248;
if(typeof value=="object"){
_203248=encodeURIComponent(EMS.Util.Json.toString(value));
}else{
_203248=encodeURIComponent(value);
}
_203247.push(encodeURIComponent(key)+"="+_203248);
}
}
return _203247.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 _203249="";
if(!level){
level=0;
}
var _203250="";
for(var j=0;j<level+1;j++){
_203250+="    ";
}
if(typeof (arr)=="object"){
for(var item in arr){
var value=arr[item];
if(typeof (value)=="object"){
_203249+=_203250+"'"+item+"' ...\n";
_203249+=dump(value,level+1);
}else{
_203249+=_203250+"'"+item+"' => \""+value+"\"\n";
}
}
}else{
_203249="===>"+arr+"<===("+typeof (arr)+")";
}
return _203249;
};
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(_203251,element){
this.resolutions=_203251;
var _203252=OpenLayers.Element.getDimensions(element);
if((_203252.width==undefined)||(_203252.height==undefined)||_203252.width==0||_203252.height==0){
this.width=parseInt($(element).style.width);
this.height=parseInt($(element).style.height);
}else{
this.width=_203252.width;
this.height=_203252.height;
}
},getZoomForExtent:function(extent){
var _203253=new OpenLayers.Size(this.width,this.height);
var _203254=Math.max(extent.getWidth()/_203253.w,extent.getHeight()/_203253.h);
return this.getZoomForResolution(_203254);
},getZoomForResolution:function(_203255){
for(var i=1;i<this.resolutions.length;i++){
if(this.resolutions[i]<_203255){
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 _203256=navigator.appVersion.split("MSIE");
var version=parseFloat(_203256[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,_203257,_203258){
this.stickyState=null;
this.numberOfStates=_203258||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=_203257;
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 _203259=this.px.offset(this.offset);
OpenLayers.Util.modifyDOMElement(this.imageDiv,null,_203259);
}
}
},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 _203260=OpenLayers.Function.bind(this.updateSize);
var _203261=map.updateSize;
map.onMapResize=function(){
_203261();
_203260();
};
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 _203262;
if(this.type=="n"){
_203262=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,(0+this.offset));
}else{
if(this.type=="s"){
_203262=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,this.map.getSize().h-(hMax+this.offset));
}else{
if(this.type=="e"){
_203262=new OpenLayers.Pixel(this.map.getSize().w-(wMax+this.offset),this.map.getSize().h/2-hMax/2);
}else{
if(this.type=="w"){
_203262=new OpenLayers.Pixel((0+this.offset),this.map.getSize().h/2-hMax/2);
}
}
}
}
OpenLayers.Util.modifyDOMElement(this.div,null,_203262);
},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 _203263;
if(this.type=="n"){
_203263=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,(0+this.offset));
}else{
if(this.type=="s"){
_203263=new OpenLayers.Pixel(this.map.getSize().w/2-wMax/2,this.map.getSize().h-(hMax+this.offset));
}else{
if(this.type=="e"){
_203263=new OpenLayers.Pixel(this.map.getSize().w-(wMax+this.offset),this.map.getSize().h/2-hMax/2);
}else{
if(this.type=="w"){
_203263=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,_203263);
OpenLayers.Util.modifyDOMElement(this.icon.imageDiv,null,null,null,"static");
return this.div;
},pan:function(e){
var _203264=this.map.getCenter().clone();
if(this.type=="n"){
_203264.lat+=this.map.getExtent().getHeight()/2;
}else{
if(this.type=="s"){
_203264.lat-=this.map.getExtent().getHeight()/2;
}else{
if(this.type=="w"){
_203264.lon-=this.map.getExtent().getWidth()/2;
}else{
if(this.type=="e"){
_203264.lon+=this.map.getExtent().getWidth()/2;
}
}
}
}
this.map.setCenter(_203264);
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,_203265,anchor,_203266){
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(_203265!=null){
this.contentHTML=_203265;
}
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(_203266){
var _203267=new OpenLayers.Size(12,12);
var img=EMS.Util.getImagesLocation()+"close_off.gif";
var _203268=OpenLayers.Util.createAlphaImageDiv(this.id+"_close",null,_203267,img);
_203268.style.right=this.padding+"px";
_203268.style.top=this.padding+"px";
this.groupDiv.appendChild(_203268);
var _203269=function(e){
this.hide();
OpenLayers.Event.stop(e);
};
OpenLayers.Event.observe(_203268,"click",_203269.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 _203270=this.direction(px);
var _203271=px;
var _203272=(this.anchor==undefined?0:this.anchor.size.h);
var _203273=(this.anchor==undefined?0:this.anchor.size.w);
if(this.anchor!=undefined){
if(this.anchor.offset!=undefined&&(_203272/2)==(this.anchor.offset.y/-1)){
_203272=0;
}
px=px.add(_203270*_203273/2,-_203272/2);
}
if(_203270==-1){
px=px.add(-this.size.w,0);
px=px.add(_203270*this.calloutSize.w,0);
}
px=px.add(0,-this.size.h/2);
if(this.map.getExtent().containsLonLat(this.map.getLonLatFromLayerPx(_203271))){
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(_203270>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(_203270>0){
this.calloutDiv.style.left="2px";
this.calloutDiv.style.right="";
}else{
this.calloutDiv.style.right="2px";
this.calloutDiv.style.left="";
}
this.calloutDiv.style.top=(_203271.y-px.y-this.calloutSize.h/2-_203272/2)+"px";
this.calloutDiv.style.zIndex=this.div.style.zIndex+1;
if(_203270>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 _203274=extent.determineQuadrant(lonlat);
if(_203274.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 _203275=this.size.w-4;
var _203276=this.size.h-4;
if(this.groupDiv!=null){
this.groupDiv.style.width=_203275+"px";
this.groupDiv.style.height=_203276+"px";
}
if(this.shadow1Div!=null&&this.shadow2Div!=null){
this.shadow1Div.style.width=(_203275+4)+"px";
this.shadow1Div.style.height=(_203276+4)+"px";
this.shadow2Div.style.width=(_203275+4)+"px";
this.shadow2Div.style.height=(_203276+4)+"px";
}
if(this.contentDiv!=null){
this.contentDiv.style.width=_203275+"px";
this.contentDiv.style.height=_203276+"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(_203277){
if(_203277!=null){
this.contentHTML=_203277;
}
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,_203278,_203279,isDown,options){
OpenLayers.Control.prototype.initialize.apply(this,[options]);
this.upIcon=upIcon;
this.downIcon=_203278;
this.hoverIcon=_203279;
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(_203280,_203281,_203282,_203283,_203284){
OpenLayers.Control.PanZoom.prototype.initialize.apply(this,[]);
this.streetLayer=_203280;
this.photoLayer=_203281;
this.hybridLayer=_203282;
if(_203283!=undefined){
this.fullZoomBar=_203283;
}
if(_203284!=undefined){
this.showMapPhotoButtons=_203284;
}
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 _203285=EMS.Util.getImagesLocation()+img;
this.scale=OpenLayers.Util.createAlphaImageDiv(id,px,sz,_203285,"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 _203286=EMS.Util.getImagesLocation()+img;
var image=OpenLayers.Util.createAlphaImageDiv(id+"-image",null,new OpenLayers.Size(sz.w,sz.h*2),_203286);
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 _203287=EMS.Util.getImagesLocation()+img;
var image=OpenLayers.Util.createAlphaImageDiv(id+"-image",null,new OpenLayers.Size(sz.w,sz.h*2),_203287);
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(_203288){
var _203289=EMS.Util.getImagesLocation();
var sz=this.sliderSize.clone();
var _203290=this.handleSize;
var id="EMS_Control_ZoomBar_Slider"+this.map.id;
var _203291=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),_203289+"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,_203288.add(-_203290.w/2+4,sz.h-_203290.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);
_203288=_203288.add(0,sz.h);
return _203288;
},_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 _203292=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Photo_on_extended.gif",new OpenLayers.Size(137,21),new OpenLayers.Size(0,0));
var _203293=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Photo_on.gif",new OpenLayers.Size(36,21),new OpenLayers.Size(0,0));
var _203294=this.photoLayer.getVisibility();
var button=new EMS.Button(upIcon,_203292,_203293,_203294,{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 _203295=this._photoContents(this.streetButton.isDown,this.photoButton.isDown,this.hybridLayer.getVisibility());
this.photoButton.contentDiv.appendChild(_203295);
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 _203296=this._photoContents(this.streetButton.isDown,this.photoButton.isDown,this.hybridLayer.getVisibility());
this.photoButton.contentDiv.appendChild(_203296);
}
},_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 _203297=new OpenLayers.Icon(EMS.Util.getImagesLocation()+"Map_on.gif",new OpenLayers.Size(38,21),new OpenLayers.Size(0,0));
var _203298=_203297.clone();
var _203299=this.streetLayer.getVisibility();
var button=new EMS.Button(upIcon,_203297,_203298,_203299,{div:this.layersDiv,displayClass:"streetLayerSelector"});
button.draw(px);
button.contentDiv.innerHTML=_203299?"<b>Map</b>":"Map";
button.events.register("click",this,function(e){
this.streetButton.isDown=true;
this.photoButton.isDown=false;
this.photoButton.contentDiv.innerHTML="";
var _203300=this._photoContents(this.streetButton.isDown,this.photoButton.isDown,this.hybridLayer.getVisibility());
this.photoButton.contentDiv.appendChild(_203300);
this.map.setBaseLayer(this.streetLayer,false);
OpenLayers.Event.stop(e);
});
this.hybridLayer.setVisibility(false);
return button;
},_photoContents:function(_203301,_203302,_203303){
var div=OpenLayers.Util.createDiv();
var photo=document.createTextNode("Photo ");
if(_203302){
var bold=document.createElement("b");
bold.appendChild(photo);
photo=bold;
}
div.appendChild(photo);
if(_203302){
var divider=document.createElement("img");
divider.src=EMS.Util.getImagesLocation()+"divider.gif";
div.appendChild(divider);
var space=document.createTextNode(" ");
div.appendChild(space);
var _203304=document.createElement("span");
var anchor=document.createElement("a");
anchor.href="#";
OpenLayers.Event.observe(anchor,"click",this._toggleHybrid.bindAsEventListener(this));
var text;
if(_203303){
text=document.createTextNode("Hide street labels");
}else{
text=document.createTextNode("Show street labels");
}
anchor.appendChild(text);
_203304.appendChild(anchor);
div.appendChild(_203304);
}
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 _203305=OpenLayers.Util.pagePosition(marker)[1];
var _203306=marker.clientHeight+_203305;
var overlap=_203306-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 _203307=OpenLayers.Util.docPosition(this.scale);
var pos=EMS.Event.pointerY(evt)-_203307[1];
var _203308=parseInt(this.scale.style.top);
var _203309=parseInt(this.scale.style.height);
var _203310=parseInt(this.slider.style.height);
var newTop=(_203308+pos-_203310/2);
var _203311=pos-_203310/2<0;
if(_203311){
newTop=_203308;
}
var _203312=pos-_203310/2>_203309-_203310;
if(_203312){
newTop=_203308+_203309-_203310;
}
var oldTop=parseInt(this.slider.style.top);
this.slider.style.top=newTop+"px";
this.updateMarkers();
this.mouseDragStart=evt.xy.clone();
var _203313=oldTop!=newTop;
if(_203313&&(_203311||_203312)){
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 _203314=this.getImageSize();
var x=(bounds.left-this.map.getMaxExtent().left)/(_203314.w*this.map.getResolution());
var y=(bounds.bottom-this.map.getMaxExtent().bottom)/(_203314.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,_203315){
if(typeof OpenLayers.Console!="undefined"&&OpenLayers.Console){
OpenLayers.Console.debug(_203315);
}
if(_203315.message){
alert("Problem: "+_203315.message);
}else{
alert("Problem: "+_203315);
}
};
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 _203316=false;
if(options.controls==null){
options.controls=[];
_203316=true;
}
OpenLayers.Map.prototype.initialize.apply(this,[div,options]);
var _203317;
if(EMS.tilePath instanceof Array){
_203317=new Array(EMS.tilePath.length);
for(var i=0;i<EMS.tilePath.length;i++){
_203317[i]=EMS.tilePath[i]+"/tile?";
}
}else{
_203317=EMS.tilePath+"/tile?";
}
if(options.layers==null){
this.whereis_street_wms=new EMS.IndexedLayer("Whereis Street",_203317,{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",_203317,{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",_203317,{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(_203316){
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",_203317,{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 _203318=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",_203318,{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 _203319=document.createElement("div");
_203319.style.left="0px";
_203319.style.top="0px";
_203319.style.width="100%";
_203319.style.height="100%";
_203319.id=this.div.id+"glassPane";
_203319.style.position="relative";
_203319.style.backgroundImage="url('+ "+EMS.Util.getImagesLocation()+"blank.gif')";
_203319.style.zIndex="4000";
var _203320=this.div.childNodes[0];
var _203321=function(e){
OpenLayers.Event.stop(e);
this.events.triggerEvent("inactiveclick");
}.bindAsEventListener(this);
var _203322=function(e){
OpenLayers.Event.stop(e);
}.bindAsEventListener(this);
OpenLayers.Event.observe(_203319,"click",_203321);
OpenLayers.Event.observe(_203319,"mousedown",_203321);
OpenLayers.Event.observe(_203319,"mouseup",_203321);
OpenLayers.Event.observe(_203319,"dblclick",_203321);
OpenLayers.Event.observe(_203319,"mousemove",_203322);
OpenLayers.Event.observe(_203319,"mouseover",_203322);
OpenLayers.Event.observe(_203319,"mouseout",_203322);
_203320.appendChild(_203319);
this.glassPane=_203319;
this.active=false;
},activate:function(){
if(this.active){
return;
}
OpenLayers.Event.stopObservingElement(this.glassPane);
var _203323=this.div.childNodes[0];
_203323.removeChild(this.glassPane);
this.active=true;
},print:function(_203324,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",_203324,options);
},print2:function(rHandle,_203325,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",_203325,options);
},_remoteGrid:function(layer){
if(layer.getVisibility()){
var _203326=[];
for(var x=0;x<layer.grid.length;x++){
_203326[x]=[];
for(var y=0;y<layer.grid[x].length;y++){
var tile=layer.grid[x][y];
_203326[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 _203326;
}else{
return null;
}
},_remoteMarkers:function(_203327){
var _203328=[];
for(var i=0;i<_203327.markers.length;i++){
var m=_203327.markers[i];
if((m.visible==undefined)||m.visible){
_203328.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 _203328;
},_remoteFeatures:function(_203329){
var _203330=new Array();
for(var _203331=0;_203331<_203329.features.length;_203331++){
var feature=_203329.features[_203331];
for(var lineIdx=0;lineIdx<feature.geometry.components.length;lineIdx++){
var line=feature.geometry.components[lineIdx];
_203330.push(line.toString());
}
}
return _203330;
},_externalizeVectorLayer:function(_203332){
var filter=new EMS.Geometry.PolylineBoundsFilter(this.getExtent());
var _203333=new EMS.Geometry.SimpleLineReducer(this.getResolution());
return _203332.externalize(new EMS.Geometry.JsonFormatter(filter,_203333));
}});
EMS.Services.Geocoder=OpenLayers.Class({initialize:function(){
},findAddress:function(street,suburb,state,_203334,options){
var address={};
address.street=street;
address.suburb=suburb;
address.state=state;
var _203335={address:address};
if(options&&options.feature){
_203335=OpenLayers.Util.extend({feature:options.feature},_203335);
}
options=OpenLayers.Util.extend({parameters:_203335},options);
this._json("/json/fastGeocode/simple",_203334,options);
},findGeocodedAddress:function(query,_203336,options){
var address=query.address;
var _203337={address:address};
if(options&&options.feature){
_203337=OpenLayers.Util.extend({feature:options.feature},_203337);
}
options=OpenLayers.Util.extend({parameters:_203337},options);
this._json("/json/fastGeocode/findGeocodedAddress",_203336,options);
},reverseGeocode:function(lon,lat,_203338,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",_203338,options);
},reverseGeocodePoi:function(query,_203339,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",_203339,options);
},findLocalityByPrefix:function(query,_203340,options){
var address=query.address;
var id=query.id;
options=OpenLayers.Util.extend({parameters:{address:address,id:id}},options);
this._json("/json/fastGeocode/findLocalityByPrefix",_203340,options);
},findStreetByPrefix:function(street,_203341,options){
options=OpenLayers.Util.extend({parameters:{street:street}},options);
this._json("/json/fastGeocode/findStreetByPrefix",_203341,options);
},poiSearch:function(query,_203342,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",_203342,options);
},combinedSearch:function(query,_203343,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",_203343,options);
},locationPoiSearch:function(query,_203344,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",_203344,options);
},geocodeIntersection:function(query,_203345,options){
var _203346=query.primaryStreet;
var _203347=query.intersectingStreet;
var suburb=query.suburb;
var state=query.state;
options=OpenLayers.Util.extend({parameters:{primaryStreet:_203346,intersectingStreet:_203347,suburb:suburb,state:state}},options);
this._json("/json/geocode/geocodeIntersection",_203345,options);
},reverseGeocodeIntersection:function(lon,lat,_203348,options){
options=OpenLayers.Util.extend({parameters:{longitude:lon,latitude:lat}},options);
this._json("/json/geocode/reverseGeocodeIntersection",_203348,options);
},_json:EMS.Services._json,_onException:EMS.Services._onException,CLASS_NAME:"EMS.Services.Geocoder"});
EMS.Services.Itin=OpenLayers.Class({initialize:function(){
},splitRoute:function(_203349,fastest,tolls,_203350,_203351,_203352,options){
options=OpenLayers.Util.extend({parameters:this._getRouteParams(_203349,fastest,tolls,_203350,_203351)},options);
this._json("/json/itin/splitRoute",_203352,options);
},combinedRoute:function(_203353,fastest,tolls,_203354,_203355,_203356,options){
options=OpenLayers.Util.extend({parameters:this._getRouteParams(_203353,fastest,tolls,_203354,_203355,options.landmarks)},options);
this._json("/json/itin/combinedRoute",_203356,options);
},_getRouteParams:function(_203357,fastest,tolls,_203358,_203359,_203360){
var params={};
if(_203357[0].street){
params.wpAddresses=_203357;
}else{
for(var i=0;i<_203357.length;i++){
params["wp"+(i+1)]=_203357[i];
}
}
params.fastest=fastest;
params.tolls=tolls;
params.tt=_203358;
params.handleOnly=_203359;
params.landmarks=_203360;
return params;
},getRoutePart:function(handle,_203361,extent,_203362,options){
var params={handle:handle,resolution:_203361,left:extent.left,top:extent.top,right:extent.right,bottom:extent.bottom};
options=OpenLayers.Util.extend({parameters:params},options);
this._json("/json/itin/getRoutePart",_203362,options);
},rankPoints:function(_203363,points,tolls,mode,_203364,options){
var params={lon:_203363.lon,lat:_203363.lat,tolls:tolls,mode:mode,points:points};
options=OpenLayers.Util.extend({parameters:params},options);
this._json("/json/itin/rankPoints",_203364,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(_203365,_203366,options){
options=OpenLayers.Util.extend({parameters:{json:_203365}},options);
this._json("/json/route/route",_203366,options);
},getRoutePart:function(handle,_203367,extent,_203368,options){
var params={handle:handle,resolution:_203367,left:extent.left,top:extent.top,right:extent.right,bottom:extent.bottom};
options=OpenLayers.Util.extend({parameters:params},options);
this._json("/json/route/getRoutePart",_203368,options);
}});
OpenLayers.Map.prototype.getLayerByName=function(_203369){
for(var i=0;i<this.layers.length;i++){
if(this.layers[i].name==_203369){
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,_203370,_203371,_203372){
var _203373="/marker?type=poi&width=27&height=96&colour1="+encodeURIComponent(colour1)+"&colour2="+encodeURIComponent(colour2)+"&text1="+encodeURIComponent(text);
if(_203370!=null){
_203373+="&textColour="+encodeURIComponent(_203370);
}
if(_203371!=null){
_203373+="&hoverColour1="+encodeURIComponent(_203371);
}
if(_203372!=null){
_203373+="&hoverColour2="+encodeURIComponent(_203372);
}
return _203373;
}},multipoi:{size:new OpenLayers.Size(36,43),offset:new OpenLayers.Pixel(-14,-43),url:function(colour1,colour2,text,_203374,_203375,_203376){
var query="/marker?type=multipoi&width=36&height=129&colour1="+encodeURIComponent(colour1)+"&colour2="+encodeURIComponent(colour2)+"&text2=&text1="+encodeURIComponent(text);
if(_203374!=null){
query+="&textColour="+encodeURIComponent(_203374);
}
if(_203375!=null){
query+="&hoverColour1="+encodeURIComponent(_203375);
}
if(_203376!=null){
query+="&hoverColour2="+encodeURIComponent(_203376);
}
return query;
}},babushka:{size:new OpenLayers.Size(36,43),offset:new OpenLayers.Pixel(-14,-43),url:function(text,colour1,colour2,_203377,_203378,_203379){
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(_203377!=null){
query+="&textColour="+encodeURIComponent(_203377);
}
if(_203378!=null){
query+="&hoverColour1="+encodeURIComponent(_203378);
}
if(_203379!=null){
query+="&hoverColour2="+encodeURIComponent(_203379);
}
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(_203380,text){
return new OpenLayers.Icon(_203380+"/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(_203381,colour1,colour2,text,_203382,_203383,_203384){
return new EMS.HoverIcon(_203381+EMS.Services.StandardIconGeometry.poi.url(colour1,colour2,text,_203382,_203383,_203384),EMS.Services.StandardIconGeometry.poi.size,EMS.Services.StandardIconGeometry.poi.offset,null,3);
},purplePoi:function(_203385,text){
return EMS.Services.StandardIcons.poi(_203385,EMS.Services.StandardIconGeometry.colours.purple.start,EMS.Services.StandardIconGeometry.colours.purple.end,text);
},greenPoi:function(_203386,text){
return EMS.Services.StandardIcons.poi(_203386,EMS.Services.StandardIconGeometry.colours.green.start,EMS.Services.StandardIconGeometry.colours.green.end,text);
},brownPoi:function(_203387,text){
return EMS.Services.StandardIcons.poi(_203387,EMS.Services.StandardIconGeometry.colours.brown.start,EMS.Services.StandardIconGeometry.colours.brown.end,text);
},multipoi:function(_203388,colour1,colour2,text,_203389,_203390,_203391){
return new EMS.HoverIcon(_203388+EMS.Services.StandardIconGeometry.multipoi.url(colour1,colour2,text,_203389,_203390,_203391),EMS.Services.StandardIconGeometry.multipoi.size,EMS.Services.StandardIconGeometry.multipoi.offset,null,3);
},purpleMultipoi:function(_203392,text){
return new EMS.Services.StandardIcons.multipoi(_203392,EMS.Services.StandardIconGeometry.colours.purple.start,EMS.Services.StandardIconGeometry.colours.purple.end,text);
},greenMultipoi:function(_203393,text){
return new EMS.Services.StandardIcons.multipoi(_203393,EMS.Services.StandardIconGeometry.colours.green.start,EMS.Services.StandardIconGeometry.colours.green.end,text);
},brownMultipoi:function(_203394,text){
return new EMS.Services.StandardIcons.multipoi(_203394,EMS.Services.StandardIconGeometry.colours.brown.start,EMS.Services.StandardIconGeometry.colours.brown.end,text);
},babushka:function(_203395,text,colour1,colour2,_203396,_203397,_203398){
return new EMS.HoverIcon(_203395+EMS.Services.StandardIconGeometry.babushka.url(text,colour1,colour2,_203396,_203397,_203398),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(_203399,fastest,tolls,_203400,_203401,options){
if(!this.itin){
this.itin=new EMS.Services.Itin();
}
this.mode="route1";
this.options=options;
this.routeVectorLayer=_203401;
this.itin.combinedRoute(_203399,fastest,tolls,_203400,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(_203402){
if(!this.routeVectorLayer){
return;
}
var _203403=[];
if(_203402.invalidRoute){
this.events.triggerEvent("invalidroute");
this.clearRoute();
return;
}
this.routeVectorLayer.setVisibility(false);
for(var _203404=0;_203404<_203402.routes.length;_203404++){
var route=_203402.routes[_203404];
var _203405=[];
for(i=0;i<route.routeGeometry.length;i++){
var _203406=[];
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);
_203406.push(point);
}
if(_203406.length>0){
var _203407=new OpenLayers.Geometry.LineString(_203406);
_203405.push(_203407);
}
}
if(_203405.length>0){
var _203408=new OpenLayers.Geometry.MultiLineString(_203405);
var vector=new EMS.Feature.Vector(_203408);
vector.routeNumber=_203404;
vector.routeHandle=_203402.routeHandle;
vector.style=EMS.Services.LineFeatureStyle;
_203403.push(vector);
}
}
this._clearVectorFeatures();
if(_203403.length>0){
this.routeVectorLayer.addFeatures(_203403);
for(var i=0;i<_203403.length;i++){
this.vectors.push(_203403[i]);
}
}
this.routeVectorLayer.setVisibility(true);
},CLASS_NAME:"EMS.Services.RouteManager"});
EMS.Services.RouteManager2=OpenLayers.Class(EMS.Services.RouteManager,{route:function(_203409,_203410,options){
if(!this.itin){
this.itin=new EMS.Services.Itin2();
}
if(!_203409.preferences.contains("ROUTE_HANDLE_ONLY")){
_203409.preferences.push("ROUTE_HANDLE_ONLY");
}
this.mode="route2";
this.options=options;
this.routeVectorLayer=_203410;
this.itin.combinedRoute(_203409,OpenLayers.Function.bind(this._setupMapRoute,this),options);
},_plotRouteLine:function(_203411){
if(!this.routeVectorLayer){
return;
}
var _203412=[];
if(_203411.invalidRoute){
this.events.triggerEvent("invalidroute");
this.clearRoute();
return;
}
this.routeVectorLayer.setVisibility(false);
var _203413=[];
var _203414=_203411.polylines;
for(i=0;i<_203414.length;i++){
var _203415=[];
for(var j=0;j<_203414[i].length;j++){
var lon=_203414[i][j][0];
var lat=EMS.Util.latToSGP4(_203414[i][j][1]);
var point=new OpenLayers.Geometry.Point(lon,lat);
_203415.push(point);
}
if(_203415.length>0){
var _203416=new OpenLayers.Geometry.LineString(_203415);
_203413.push(_203416);
}
}
if(_203413.length>0){
var _203417=new OpenLayers.Geometry.MultiLineString(_203413);
var vector=new EMS.Feature.Vector(_203417);
vector.style=EMS.Services.LineFeatureStyle;
vector.routeHandle=_203411.routeHandle;
_203412.push(vector);
}
this._clearVectorFeatures();
if(_203412.length>0){
this.routeVectorLayer.addFeatures(_203412);
for(var i=0;i<_203412.length;i++){
this.vectors.push(_203412[i]);
}
}
this.routeVectorLayer.setVisibility(true);
},CLASS_NAME:"EMS.Services.RouteManager2"});
OpenLayers.Geometry.prototype.externalize=function(_203418){
throw "EMS Unsupported Geometry Type: "+this.CLASS_NAME;
};
OpenLayers.Geometry.LineString.prototype.externalize=function(_203419){
return _203419.formatPolyline(this);
};
OpenLayers.Geometry.LinearRing.prototype.externalize=function(_203420){
return _203420.formatClosedPolyline(this);
};
OpenLayers.Geometry.MultiLineString.prototype.externalize=function(_203421){
return _203421.formatGeometryContainer(this);
};
OpenLayers.Geometry.Polygon.prototype.externalize=function(_203422){
return _203422.formatGeometryContainer(this);
};
OpenLayers.Geometry.Point.prototype.externalize=function(_203423){
return _203423.formatPoint(this);
};
OpenLayers.Feature.Vector.prototype.externalize=function(_203424){
return _203424.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(_203425){
return _203425.formatVector(this);
}});
EMS.Feature=new Object();
EMS.Feature.Vector=OpenLayers.Class(OpenLayers.Feature.Vector,{routeHandle:null,initialize:function(_203426,_203427,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,_203428){
this.filter=filter;
this.lineReducer=_203428;
},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(_203429){
return {type:_203429.CLASS_NAME,components:this._formatComponents(_203429.components)};
},formatPolyline:function(line){
var _203430=this._filterPolyline(line.components);
var _203431=[];
for(var i=0;i<_203430.length;i++){
_203431.push(this._formatComponents(this._reducePolyline(_203430[i])));
}
return {type:line.CLASS_NAME,segments:_203431};
},formatClosedPolyline:function(line){
var _203432=[];
_203432.push(this._formatComponents(this._reducePolyline(line.components)));
return {type:line.CLASS_NAME,segments:_203432};
},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(_203433){
var _203434=[];
for(var i=0;i<_203433.length;i++){
_203434.push(_203433[i].externalize(this));
}
return _203434;
},_reducePolyline:function(_203435){
if(this.lineReducer){
return this.lineReducer.reduce(_203435);
}
return _203435;
},_filterPolyline:function(_203436){
if(this.filter){
return this.filter.filter(_203436);
}
return [_203436];
},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(_203437){
this.minDistance=_203437*this.factor;
},reduce:function(_203438){
var _203439=[];
var _203440=_203438[0];
_203439.push(_203440);
if(_203438.length>1){
var _203441=_203438.length-1;
for(var i=1;i<_203441;i++){
var _203442=_203438[i];
if(this.includePoint(_203440,_203442)){
_203439.push(_203442);
_203440=_203442;
}
}
_203439.push(_203438[_203441]);
}
return _203439;
},includePoint:function(_203443,_203444){
return (Math.abs(_203443.x-_203444.x)>this.minDistance)||(Math.abs(_203443.y-_203444.y)>this.minDistance);
},CLASS_NAME:"EMS.Geometry.SimpleLineReducer"});
EMS.Geometry.PolylineBoundsFilter=OpenLayers.Class({bounds:null,initialize:function(_203445){
this.bounds=_203445;
},filter:function(_203446){
var _203447=[];
if(_203446.length>1){
var _203448=[];
var _203449=_203446.length-1;
for(var i=0;i<_203449;i++){
var _203450=new OpenLayers.Bounds(_203446[i].x,_203446[i].y,_203446[i].x,_203446[i].y);
_203450.extend(_203446[i+1]);
if(this.bounds.intersectsBounds(_203450)){
if(_203448.length==0){
_203448.push(_203446[i]);
}
_203448.push(_203446[i+1]);
}else{
if(_203448.length>0){
_203447.push(_203448);
_203448=[];
}
}
}
if(_203448.length>1){
_203447.push(_203448);
}
}
return _203447;
},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 _203451=this.map.getLonLatFromViewPortPx(newXY);
this.map.setCenter(_203451,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 _203452=this.map.getResolution();
var _203453=new OpenLayers.Pixel((mouse.lon-center.lon)/_203452,(mouse.lat-center.lat)/_203452);
if(this.map.baseLayer!=null){
var _203454=this.map.baseLayer.resolutions[this.map.getZoom()+1];
}else{
var _203454=this.map.getResolution();
}
this.map.setCenter(new OpenLayers.LonLat(center.lon+(_203453.x*_203454),center.lat+(_203453.y*_203454)),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 _203455=this.map.getResolution();
var _203456=new OpenLayers.Pixel((mouse.lon-center.lon)/_203455,(mouse.lat-center.lat)/_203455);
if(this.map.baseLayer!=null){
var _203457=this.map.baseLayer.resolutions[this.map.getZoom()-1];
}else{
var _203457=this.map.getResolution();
}
this.map.setCenter(new OpenLayers.LonLat(mouse.lon-(_203456.x*_203457),mouse.lat-(_203456.y*_203457)),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 _203458=this.map.getLonLatFromViewPortPx(evt.xy);
this.map.setCenter(_203458,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 _203459=EMS.Util.getImagesLocation();
var img=_203459+"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=_203459+"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,_203460,_203461){
var _203462=element.childNodes[0];
var isChild=function(_203463,_203464){
while(_203463){
if(_203463==_203464){
return true;
}
_203463=_203463.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()+_203460));
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()+_203460;
}
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()+_203461;
}
element.isOver=false;
});
},createCorner:function(type,width,height,top,left,_203465){
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()+_203465+"')";
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 _203466=this.getRectPxBounds();
if((_203466.top<=0)||(_203466.left<=0)||(_203466.bottom>=this.size.h-this.hComp)||(_203466.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 _203467=this.getRectPxBounds();
var rectTop=_203467.top;
var _203468=_203467.left;
var _203469=Math.abs(_203467.getHeight());
var _203470=_203467.getWidth();
var newTop=Math.max(0,(rectTop-deltaY));
newTop=Math.min(newTop,this.ovmap.size.h-this.hComp-_203469);
var newLeft=Math.max(0,(_203468-deltaX));
newLeft=Math.min(newLeft,this.ovmap.size.w-this.wComp-_203470);
this.setRectPxBounds(new OpenLayers.Bounds(newLeft,newTop+_203469,newLeft+_203470,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 _203471=this.getRectPxBounds();
var _203472=_203471.getCenterPixel();
var deltaX=evt.xy.x-_203472.x;
var deltaY=evt.xy.y-_203472.y;
var top=_203471.top;
var left=_203471.left;
var height=Math.abs(_203471.getHeight());
var width=_203471.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(_203473){
this.maximizeDiv.style.display=_203473?"":"none";
this.minimizeDiv.style.display=_203473?"none":"";
},update:function(){
if(this.ovmap==null){
this.createMap();
}
this.updateOverview();
this.updateRectToMap();
},isSuitableOverview:function(){
var _203474=this.map.getExtent();
var _203475=this.map.maxExtent;
var _203476=new OpenLayers.Bounds(Math.max(_203474.left,_203475.left),Math.max(_203474.bottom,_203475.bottom),Math.min(_203474.right,_203475.right),Math.min(_203474.top,_203475.top));
var _203477=this.ovmap.getResolution()/this.map.getResolution();
return ((_203477>this.minRatio)&&(_203477<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(_203476)));
},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 _203478=this.ovmap.getResolution();
var _203479=_203478/mapRes;
if(_203479>this.maxRatio){
_203478=this.minRatio*mapRes;
}else{
if(_203479<=this.minRatio){
_203478=this.maxRatio*mapRes;
}
}
var newZoom=this.ovmap.getZoomForResolution(_203478);
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 _203480=this.getRectBoundsFromMapBounds(this.map.getExtent());
if(_203480){
this.setRectPxBounds(_203480);
}
},updateMapToRect:function(){
var _203481=this.getRectPxBounds();
var _203482=this.getMapBoundsFromRectBounds(_203481);
this.map.setCenter(_203482.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(_203483){
var top=Math.max(_203483.top,0);
var left=Math.max(_203483.left,0);
var bottom=Math.min(_203483.top+Math.abs(_203483.getHeight()),this.ovmap.size.h-this.hComp);
var right=Math.min(_203483.left+_203483.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(_203484){
var _203485=new OpenLayers.LonLat(_203484.left,_203484.bottom);
var _203486=new OpenLayers.LonLat(_203484.right,_203484.top);
var _203487=this.getOverviewPxFromLonLat(_203485);
var _203488=this.getOverviewPxFromLonLat(_203486);
var bounds=null;
if(_203487&&_203488){
bounds=new OpenLayers.Bounds(_203487.x,_203487.y,_203488.x,_203488.y);
}
return bounds;
},getMapBoundsFromRectBounds:function(_203489){
var _203490=new OpenLayers.Pixel(_203489.left,_203489.bottom);
var _203491=new OpenLayers.Pixel(_203489.right,_203489.top);
var _203492=this.getLonLatFromOverviewPx(_203490);
var _203493=this.getLonLatFromOverviewPx(_203491);
return new OpenLayers.Bounds(_203492.lon,_203492.lat,_203493.lon,_203493.lat);
},getLonLatFromOverviewPx:function(_203494){
var size=this.ovmap.size;
var res=this.ovmap.getResolution();
var center=this.ovmap.getExtent().getCenterLonLat();
var delta_x=_203494.x-(size.w/2);
var delta_y=_203494.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 _203495=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(70,22),EMS.Util.getImagesLocation()+"whereis-footprint.png");
_203495.style.position="relative";
var _203496=function(e){
var _203497=new OpenLayers.LonLat(this.map.center.lon,this.map.center.lat).asWGS84();
window.open("http://www.whereis.com/?y="+_203497.lat+"&x="+_203497.lon+"&z="+this.map.zoom,"_blank");
OpenLayers.Event.stop(e);
};
OpenLayers.Event.observe(_203495,"click",_203496.bindAsEventListener(this));
OpenLayers.Event.observe(_203495,"mouseover",function(){
_203495.style.cursor="pointer";
});
if(this.smallCopyright){
var _203498=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(46,22),EMS.Util.getImagesLocation()+"legals_sml.png");
}else{
var _203498=OpenLayers.Util.createAlphaImageDiv(null,null,new OpenLayers.Size(80,22),EMS.Util.getImagesLocation()+"legals.png");
}
_203498.style.position="absolute";
_203498.style.top="0px";
_203498.style.left="70px";
OpenLayers.Event.observe(_203498,"click",function(e){
window.open("http://www.whereis.com/products/terms-of-use/index.html","_blank");
OpenLayers.Event.stop(e);
});
OpenLayers.Event.observe(_203498,"mouseover",function(){
_203498.style.cursor="pointer";
});
this.element=this.div;
this.element.appendChild(_203495);
this.element.appendChild(_203498);
}
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 _203499=Math.cos(EMS.Util.sgp4ToLat(((this.map.getExtent().bottom+this.map.getExtent().top)/2))*Math.PI/180);
var scale=_203499*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 _203500=scale/4;
var _203501=this.map.getSize().w/4;
var _203502=this.map.getSize().w/scale;
var _203503=Math.round(_203500/magnitude(_203500))*magnitude(_203500);
var _203504=_203503*_203502;
if(_203503<1000){
_203503="&nbsp;"+_203503+"m";
}else{
_203503="&nbsp;"+(_203503/1000)+"km";
}
var _203505;
if(this.map.whereis_street_wms.getVisibility()){
_203505="black";
}else{
_203505="white";
}
this.element.innerHTML="<div class='"+this.displayClass+"Text' style='width: "+_203504+"px ; color:"+_203505+"'>"+_203503+"</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,_203506,_203507,_203508,options){
this.mapId=OpenLayers.Util.createUniqueID(this.CLASS_NAME.replace(/\./g,"")+"_map");
EMS.Popup.prototype.initialize.apply(this,[id,lonlat,size,"",anchor,_203506]);
this.locatables=_203507;
this.locatableRenderer=_203508;
OpenLayers.Util.extend(this,options||{});
this.history=[];
this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES,true);
},markerCreator:function(_203509){
var icon,lonlat;
if(_203509.length==1){
icon=EMS.Services.StandardIcons.greenPoi(this.map.tilePath,"");
lonlat=_203509[0].lonlat.clone();
}else{
icon=EMS.Services.StandardIcons.greenMultipoi(this.map.tilePath,_203509.length);
var bounds=new OpenLayers.Bounds(_203509[0].lonlat.lon,_203509[0].lonlat.lat,_203509[0].lonlat.lon,_203509[0].lonlat.lat);
for(var i=1;i<_203509.length;i++){
bounds.extend(_203509[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 _203510=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(5,32),new OpenLayers.Size(this.size.w-15,this.size.h-70),null,"absolute");
this.tab1ContentsDiv=_203510;
_203510.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 _203511=this.createImageDiv("multi-tab.gif",0,64,45,32,90,96,140,1);
var mapTab=new EMS.MultiPopupTab(tab1On,tab1Off,_203511,_203510);
this.contentDiv.appendChild(_203510);
this.contentDiv.appendChild(tab1On);
this.contentDiv.appendChild(tab1Off);
this.contentDiv.appendChild(_203511);
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 _203512=EMS.Util.defaultResolutions;
var _203513=new EMS.Util.ZoomCalculator(_203512,this.mapDiv);
var zoom=_203513.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 _203514=document.createElement("a");
_203514.className="ems-top-back";
_203514.href="#";
this.historyDiv.appendChild(_203514);
this.historyDiv.appendChild(document.createTextNode("  "));
var _203515=document.createElement("a");
_203515.href="#";
_203515.className="ems-back";
_203515.appendChild(document.createTextNode("Back"));
this.historyDiv.appendChild(_203515);
this.historyDiv.style.top=(this.size.h-65)+"px";
this.tab1ContentsDiv.appendChild(this.historyDiv);
OpenLayers.Event.observe(_203515,"click",OpenLayers.Function.bind(this.backInHistory,this));
OpenLayers.Event.observe(_203514,"click",OpenLayers.Function.bind(this.backInHistoryToTop,this));
return mapTab;
},createListTab:function(){
var _203516=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(5,32),new OpenLayers.Size(this.size.w-15,this.size.h-47),null,"absolute");
this.tab2ContentsDiv=_203516;
this.tab2ContentsDiv.style.overflow="auto";
_203516.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 _203517=this.createImageDiv("multi-tab.gif",45,64,45,32,90,96,186,1);
var listTab=new EMS.MultiPopupTab(tab2On,tab2Off,_203517,_203516);
this.contentDiv.appendChild(_203516);
this.contentDiv.appendChild(tab2On);
this.contentDiv.appendChild(tab2Off);
this.contentDiv.appendChild(_203517);
return listTab;
},createImageDiv:function(_203518,_203519,_203520,_203521,_203522,_203523,_203524,left,top){
var _203525=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(left,top),new OpenLayers.Size(_203521,_203522),null,"absolute");
_203525.style.overflow="hidden";
var image=OpenLayers.Util.createImage(null,new OpenLayers.Pixel(-_203519,-_203520),new OpenLayers.Size(_203523,_203524),EMS.Util.getImagesLocation()+_203518);
_203525.appendChild(image);
return _203525;
},mapInit:function(map){
this.map=map;
var _203526=new OpenLayers.Layer.Markers("Markers");
var _203527=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=_203526;
map.whereis_street_wms=_203527;
map.addLayer(map.whereis_street_wms);
map.addLayer(map.markersLayer);
var _203528=new EMS.CombinerCalculator(map.getResolution(),this.locatables);
this.history.push(this.locatables);
this.updateHistoryLinks();
var points=_203528.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(_203529,map){
var extent=this.getExtent(_203529,this.mapDiv);
var zoom=map.getZoomForExtent(extent);
var _203530=true;
for(var i=0;i<_203529.length;i++){
if(i==0){
var _203531=_203529[0].lonlat;
}else{
if(!_203531.equals(_203529[i].lonlat)){
_203530=false;
}
}
}
if(map.getZoom()==zoom||_203530){
this.tabs.showTab(this.listTab);
}
map.setCenter(extent.getCenterLonLat(),zoom);
var _203532=this.history.length==0?-1:this.history[this.history.length-1].length;
if(map.getZoom()!=zoom||_203532!=_203529.length){
this.history.push(_203529);
this.tab2ContentsDiv.innerHTML="";
var _203533=new EMS.CombinerCalculator(map.getResolution(),_203529);
var points=_203533.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<_203529.length;i++){
this.tab2ContentsDiv.appendChild(this.locatableRenderer(_203529[i]));
}
this.updateHistoryLinks();
var redIcon=EMS.Services.StandardIcons.redNumber(this.map.tilePath,_203529.length);
this.countDiv.innerHTML="<img src='"+redIcon.url+"'/><span style='display: block; margin-left: 2em; margin-top: -1.7em;'> place"+(_203529.length==1?"":"s")+"</span>";
}
},backInHistory:function(){
var _203534=this.history.pop();
_203534=this.history.pop();
console.assert(_203534,"Locatables present");
this.zoomMarker(_203534,this.multimap);
},backInHistoryToTop:function(){
var _203535=this.history[0];
this.history=[];
console.assert(_203535,"Locatables present");
this.zoomMarker(_203535,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(_203536,mapDiv){
var _203537=EMS.Util.defaultResolutions;
var _203538=new EMS.Util.ZoomCalculator(_203537,mapDiv);
var bounds;
for(var i=0;i<_203536.length;i++){
if(i==0){
bounds=new OpenLayers.Bounds(_203536[i].lonlat.lon,_203536[i].lonlat.lat,_203536[i].lonlat.lon,_203536[i].lonlat.lat);
}else{
bounds.extend(new OpenLayers.LonLat(_203536[i].lonlat.lon,_203536[i].lonlat.lat));
}
}
var zoom=_203538.getZoomForExtent(bounds);
var _203539=_203537[zoom];
bounds.extend(new OpenLayers.LonLat(bounds.left,bounds.top+_203539*66));
bounds.extend(new OpenLayers.LonLat(bounds.left-_203539*15,bounds.top));
bounds.extend(new OpenLayers.LonLat(bounds.right+_203539*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(_203540,_203541,_203542,_203543){
this.tabOnDiv=_203540;
this.tabOffDiv=_203541;
this.tabHoverDiv=_203542;
this.contentDiv=_203543;
OpenLayers.Event.observe(this.tabOffDiv,"mouseover",function(){
OpenLayers.Element.hide(_203541);
OpenLayers.Element.show(_203542);
});
OpenLayers.Event.observe(this.tabHoverDiv,"mouseout",function(){
if(OpenLayers.Element.visible(_203540)){
OpenLayers.Element.hide(_203541);
}else{
OpenLayers.Element.show(_203541);
}
OpenLayers.Element.hide(_203542);
});
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(_203544,_203545,options){
this.resolution=_203544;
this.locatableObjects=[].concat(_203545);
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 _203546=this.locatableObjects[i];
if(!_203546.combined){
var bounds=new OpenLayers.Bounds(_203546.lonlat.lon,_203546.lonlat.lat,_203546.lonlat.lon,_203546.lonlat.lat);
var _203547=[_203546];
_203546.combined=true;
var _203548,j;
for(j=i+1;j<this.locatableObjects.length;j++){
_203548=this.testForCloseness(_203546,this.locatableObjects[j],bounds);
if(_203548=="combine"){
bounds.extend(this.locatableObjects[j].lonlat);
this.locatableObjects[j].combined=true;
_203547.push(this.locatableObjects[j]);
}else{
if(_203548=="break"){
break;
}
}
}
for(j=i-1;j>=0;j--){
_203548=this.testForCloseness(_203546,this.locatableObjects[j],bounds);
if(_203548=="combine"){
bounds.extend(this.locatableObjects[j].lonlat);
this.locatableObjects[j].combined=true;
_203547.push(this.locatableObjects[j]);
}else{
if(_203548=="break"){
break;
}
}
}
results.push({lonlat:bounds.getCenterLonLat(),combined:_203547});
}
}
for(var i=0;i<this.locatableObjects.length;i++){
delete this.locatableObjects[i].combined;
}
return results;
},testForCloseness:function(_203549,_203550,bounds){
if(Math.abs((_203550.lonlat.lon-_203549.lonlat.lon)/this.resolution)>this.combinePixels){
return "break";
}
if(_203549!=_203550&&!_203550.combined){
var diffX=Math.abs(bounds.getCenterLonLat().lon-_203550.lonlat.lon)/this.resolution;
var diffY=Math.abs(bounds.getCenterLonLat().lat-_203550.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,_203551){
this.name=name;
this.iconFactory=_203551;
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 _203552=new Array();
for(var i=0;i<this.groups.length;i++){
_203552=_203552.concat(this.groups[i].markers);
}
_203552.sort(function(a,b){
return b.lonlat.lon-a.lonlat.lon;
});
var marker,candidateMarker;
var count=0;
var _203553=0,markerIdx1=0;
for(i=0;i<_203552.length;i++){
marker=_203552[i];
if(!this._markerVisible(marker)){
continue;
}
if(!marker.combined){
var _203554=marker;
var _203555=[this._copyMarker(_203554)];
var bounds=new OpenLayers.Bounds(marker.lonlat.lon,marker.lonlat.lat,marker.lonlat.lon,marker.lonlat.lat);
function testMarker(_203556){
if(!this._markerVisible(_203556)){
return true;
}
if(Math.abs((_203556.lonlat.lon-marker.lonlat.lon)/this.map.getResolution())>this.combinePixels){
return false;
}
if(_203554!=_203556&&!_203556.combined){
var diffX=Math.abs(bounds.getCenterLonLat().lon-_203556.lonlat.lon)/this.map.getResolution();
var diffY=Math.abs(bounds.getCenterLonLat().lat-_203556.lonlat.lat)/this.map.getResolution();
if(diffX<this.combinePixels&&diffY<this.combinePixels){
_203555.push(this._copyMarker(_203556));
_203556.combined=true;
bounds.extend(_203556.lonlat);
}
}
return true;
}
for(var j=i+1;j<_203552.length;j++){
candidateMarker=_203552[j];
if(!OpenLayers.Function.bind(testMarker,this)(candidateMarker)){
break;
}
}
for(j=i-1;j>=0;j--){
candidateMarker=_203552[j];
if(!OpenLayers.Function.bind(testMarker,this)(candidateMarker)){
break;
}
}
_203554.combined=true;
if(_203555.length==1){
this.markers.push(this._copyMarker(_203554));
}else{
this.markers.push(this._makeCombinedMarker(_203555,bounds));
}
}
count++;
}
},_makeCombinedMarker:function(_203557,bounds){
var _203558=null;
var _203559=false;
for(var i=0;i<_203557.length;i++){
if(_203558!=null&&_203557[i].group.name!=_203558){
_203559=true;
}
_203558=_203557[i].group.name;
}
var icon;
if(_203559){
icon=this.multigroupIconFactory(_203557);
}else{
icon=_203557[0].group.iconFactory(_203557);
}
var lonlat=bounds.getCenterLonLat();
var marker=new OpenLayers.Marker(lonlat,icon);
marker.combinedMarkers=_203557;
marker.combinedBounds=bounds;
return marker;
},_copyMarker:function(marker){
var _203560=new OpenLayers.Marker(marker.lonlat.clone(),marker.icon.clone());
_203560.group=marker.group;
return _203560;
},_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 _203561=0;
var _203562=0;
var groups=this.groups;
return function(){
while(true){
if(_203561<groups.length){
var group=groups[_203561];
var marker=group.markers[_203562++];
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{
_203561++;
_203562=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(_203563,_203564,options){
OpenLayers.Control.prototype.initialize.apply(this,[options]);
var _203565=OpenLayers.Util.extend({show:this.showMenu,hide:this.hideMenu},_203565);
this.handler=new EMS.Handler.RightClick(this,_203565,{});
this.menuDisplayOwner=_203563;
this.menuDisplayCallbacks=_203564;
},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,_203566,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,_203567){
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=_203567;
},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 _203568="";
_203568+=this.address.streetNumber;
_203568+=" "+this.address.street.fullName;
_203568+=" "+this.address.suburb;
_203568+=" "+this.address.state;
_203568+="<BR/><BR/>";
this.menu.innerHTML=_203568;
}
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,_203569,anchor,_203570,logoDiv,tabs){
EMS.Popup.prototype.initialize.apply(this,[id,lonlat,size?size:new OpenLayers.Size(304,286),_203569,anchor,_203570]);
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 _203571=OpenLayers.Util.createAlphaImageDiv(tabOn.id+"_left",new OpenLayers.Pixel(0,0),new OpenLayers.Size(1,33),EMS.Util.getImagesLocation()+"tab_end.gif");
var _203572=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(_203571);
tabOn.appendChild(_203572);
var tabOff=OpenLayers.Util.createDiv(null,pos,tab.headingWidth,null,"absolute");
tabOff.className="emsPopupTabOff";
tabOff.innerHTML=tab.heading;
var _203573=OpenLayers.Util.createDiv(null,pos,tab.headingWidth,null,"absolute");
_203573.className="emsPopupTabHover";
_203573.innerHTML=tab.heading;
this.currentPx=this.currentPx.add(tab.headingWidth.w,0);
this.contentDiv.appendChild(tabOn);
this.contentDiv.appendChild(tabOff);
this.contentDiv.appendChild(_203573);
this.contentDiv.appendChild(tab.contentDiv);
var aTab=new EMS.MultiPopupTab(tabOn,tabOff,_203573,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(_203574,_203575,_203576,_203577,_203578,_203579,_203580,left,top){
var _203581=OpenLayers.Util.createDiv(null,new OpenLayers.Pixel(left,top),new OpenLayers.Size(_203577,_203578),null,"absolute");
_203581.style.overflow="hidden";
var image=OpenLayers.Util.createImage(null,new OpenLayers.Pixel(-_203575,-_203576),new OpenLayers.Size(_203579,_203580),EMS.Util.getImagesLocation()+_203574);
_203581.appendChild(image);
return _203581;
}});
EMS.CustomTab=OpenLayers.Class({initialize:function(heading,_203582,_203583){
this.heading=heading;
this.contentDiv=_203582;
if(_203583==undefined){
this.headingWidth=new OpenLayers.Size(45,32);
}else{
this.headingWidth=new OpenLayers.Size(_203583,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(_203584,_203585,_203586,_203587){
if(_203585){
this.currentRoute=_203585;
}
if(_203586){
this.currentSegment=_203586;
}
if(_203587){
this.showRouteMarkers=_203587;
}
this.routeDetail=_203584;
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 _203588=new OpenLayers.Layer.Markers("Route Markers");
var _203589=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=_203588;
this.routeMap.whereis_street_wms=_203589;
this.routeMap.addLayer(_203589);
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(_203588);
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());
_203588.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]());
_203588.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());
_203588.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 _203590="<span>"+(this.currentSegment+1)+". "+this.getCurrentSegment().textualInstruction+"</span>";
_203590=_203590.replace("ROUNDABOUT","roundabout");
_203590=_203590.replace("Start at","Continue on");
_203590=_203590.replace("Stop at","Arrive at");
while(true){
_203590=_203590.replace("_","<strong>");
_203590=_203590.replace("_","</strong>");
if(_203590.indexOf("_")==-1){
break;
}
}
if(this.getCurrentSegment().travelTime!=0){
_203590=_203590+"<br /><span>Travel "+this.formatLength(this.getCurrentSegment().metres);
_203590=_203590+" ("+this.formatTime(this.getCurrentSegment().travelTime)+")</span>";
}
return _203590;
},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 _203591={geometryTypes:this.geometryTypes};
this.featureHandler=new EMS.Handler.DragMarkerHandler(this,this.layer,this.featureCallbacks,_203591);
},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 _203592=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]);
_203592=true;
}else{
if(this.feature&&(this.feature!=feature)){
this.callback("out",[this.feature]);
this.feature=null;
}
_203592=false;
}
}else{
if(this.feature){
this.callback("out",[this.feature]);
this.feature=null;
}
_203592=false;
}
return _203592;
},CLASS_NAME:"EMS.Handler.DragMarkerHandler"});

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

