
_baseURL=getScriptSrc("apiloader.js");
_shellURL=_baseURL+"shell.swf";
_gatewaySWF=_baseURL+"gateway.swf";
function getScriptSrc(s){
var sSrc="";
var iCollection=document.getElementsByTagName("script").length;
var regX=new RegExp(s,"gi");
for(var i=0;i<iCollection;i++){
sSrc=document.getElementsByTagName("script")[i].src;
if(sSrc.indexOf(s)!=-1){
sSrc=sSrc.replace(regX,"");
var tmp_src=sSrc.split('?');
sSrc=tmp_src[0];
break;}}
return sSrc;}
function includeScript(scriptURL,type){
if(!type)type="text/javascript";
document.write("<script src=\""+_baseURL+scriptURL+"\" type=\""+type+"\" ><\/script>");}
includeScript("vbcallback.vbs","text/vbscript");/*
Macromedia(r)Flash(r)JavaScript Integration Kit License
Copyright(c)2005 Macromedia,inc. All rights reserved.
Redistribution and use in source and binary forms,with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The end-user documentation included with the redistribution,if any,must
include the following acknowledgment:
"This product includes software developed by Macromedia,Inc.(http:
Alternately,this acknowledgment may appear in the software itself,if and
wherever such third-party acknowledgments normally appear.
4. The name Macromedia must not be used to endorse or promote products derived
from this software without prior written permission. For written permission,
please contact devrelations@macromedia.com.
5. Products derived from this software may not be called "Macromedia" or
"Macromedia Flash",nor may "Macromedia" or "Macromedia Flash" appear in their
name.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING,BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MACROMEDIA OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT,INCIDENTAL,SPECIAL,
EXEMPLARY,OR CONSEQUENTIAL DAMAGES(INCLUDING,BUT NOT LIMITED TO,PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE,DATA,OR PROFITS;OR BUSINESS
INTERRUPTION)HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,WHETHER IN CONTRACT,
STRICT LIABILITY,OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.--
This code is part of the Flash/JavaScript Integration Kit:
http:
Created by:
Christian Cantrell
http:
mailto:cantrell@macromedia.com
Mike Chambers
http:
mailto:mesh@macromedia.com
Macromedia*/
function Exception(name,message){
if(name)
this.name=name;
if(message)
this.message=message;}
Exception.prototype.setName=function(name){
this.name=name;}
Exception.prototype.getName=function(){
return this.name;}
Exception.prototype.setMessage=function(msg){
this.message=msg;}
Exception.prototype.getMessage=function(){
return this.message;}/*
Macromedia(r)Flash(r)JavaScript Integration Kit License
Copyright(c)2005 Macromedia,inc. All rights reserved.
Redistribution and use in source and binary forms,with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The end-user documentation included with the redistribution,if any,must
include the following acknowledgment:
"This product includes software developed by Macromedia,Inc.(http:
Alternately,this acknowledgment may appear in the software itself,if and
wherever such third-party acknowledgments normally appear.
4. The name Macromedia must not be used to endorse or promote products derived
from this software without prior written permission. For written permission,
please contact devrelations@macromedia.com.
5. Products derived from this software may not be called "Macromedia" or
"Macromedia Flash",nor may "Macromedia" or "Macromedia Flash" appear in their
name.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING,BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MACROMEDIA OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT,INCIDENTAL,SPECIAL,
EXEMPLARY,OR CONSEQUENTIAL DAMAGES(INCLUDING,BUT NOT LIMITED TO,PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE,DATA,OR PROFITS;OR BUSINESS
INTERRUPTION)HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,WHETHER IN CONTRACT,
STRICT LIABILITY,OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.--
This code is part of the Flash/JavaScript Integration Kit:
http:
Created by:
Christian Cantrell
http:
mailto:cantrell@macromedia.com
Mike Chambers
http:
mailto:mesh@macromedia.com
Macromedia*/
function FlashTag(src,width,height,version){
if(arguments.length<4){
throw new Exception('RequiredParameterException',
'You must pass in a src, width, height, and version when creating a FlashTag.');}
this.src=src;
this.width=width;
this.height=height;
this.version=version;
this.id=null;
this.flashVars=null;
this.flashVarsStr=null;
this.genericParam=new Object();
this.ie=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
FlashTag.prototype.setSource=function(src){
this.src=src;}
FlashTag.prototype.setWidth=function(w){
this.width=width;}
FlashTag.prototype.setHeight=function(h){
this.h=height;}
FlashTag.prototype.setVersion=function(v){
this.version=v;}
FlashTag.prototype.setId=function(id){
this.id=id;}
FlashTag.prototype.setBgcolor=function(bgc){
if(bgc.charAt(0)!='#'){
bgc='#'+bgc;}
this.genericParam['bgcolor']=bgc;}
FlashTag.prototype.addFlashVars=function(fvs){
this.flashVarsStr=fvs;}
FlashTag.prototype.addFlashVar=function(n,v){
if(this.flashVars==null){
this.flashVars=new Object();}
this.flashVars[n]=v;}
FlashTag.prototype.removeFlashVar=function(n){
if(this.flashVars!=null){
this.flashVars[n]=null;}}
FlashTag.prototype.setSwliveconnect=function(swlc){
this.genericParam['swliveconnect']=swlc;}
FlashTag.prototype.setPlay=function(p){
this.genericParam['play']=p;}
FlashTag.prototype.setLoop=function(l){
this.genericParam['loop']=l;}
FlashTag.prototype.setMenu=function(m){
this.genericParam['menu']=m;}
FlashTag.prototype.setQuality=function(q){
if(q!='low'&&q!='high'&&q!='autolow'&&q!='autohigh'&&q!='best'){
throw new Exception('UnsupportedValueException',
'Supported values are "low", "high", "autolow", "autohigh", and "best".');}
this.genericParam['quality']=q;}
FlashTag.prototype.setScale=function(sc){
if(sc!='showall'&&sc!='noborder'&&sc!='exactfit'){
throw new Exception('UnsupportedValueException',
'Supported values are "showall", "noborder", and "exactfit".');}
this.genericParam['scale']=sc;}
FlashTag.prototype.setAlign=function(a){
if(a!='l'&&a!='t'&&a!='r'&&a!='b'){
throw new Exception('UnsupportedValueException',
'Supported values are "l", "t", "r" and "b".');}
this.genericParam['align']=a;}
FlashTag.prototype.setSalign=function(sa){
if(sa!='l'&&sa!='t'&&sa!='r'&&sa!='b'&&sa!='tl'&&sa!='tr'&&sa!='bl'&&sa!='br'){
throw new Exception('UnsupportedValueException',
'Supported values are "l", "t", "r", "b", "tl", "tr", "bl" and "br".');}
this.genericParam['salign']=sa;}
FlashTag.prototype.setWmode=function(wm){
if(wm!='window'&&wm!='opaque'&&wm!='transparent'){
throw new Exception('UnsupportedValueException',
'Supported values are "window", "opaque", and "transparent".');}
this.genericParam['wmode']=wm;}
FlashTag.prototype.setBase=function(base){
this.genericParam['base']=base;}
FlashTag.prototype.setAllowScriptAccess=function(sa){
if(sa!='never'&&sa!='always'){
throw new Exception('UnsupportedValueException',
'Supported values are "never" and "always".');}
this.genericParam['allowScriptAccess']=sa;}
FlashTag.prototype.toString=function(){
var flashTag=new String();
if(this.ie){
flashTag+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
if(this.id!=null){
flashTag+='id="'+this.id+'" ';}
flashTag+='codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
flashTag+='width="'+this.width+'" ';
flashTag+='height="'+this.height+'">';
flashTag+='<param name="movie" value="'+this.src+'"/>';
for(var n in this.genericParam){
if(this.genericParam[n]!=null){
flashTag+='<param name="'+n+'" value="'+this.genericParam[n]+'"/>';}}
if(this.flashVars!=null){
var fv=this.getFlashVarsAsString();
if(fv.length>0){
flashTag+='<param name="flashvars" value="'+fv+'"/>';}}
flashTag+='</object>';}
else{
flashTag+='<embed src="'+this.src+'"';
flashTag+=' width="'+this.width+'"';
flashTag+=' height="'+this.height+'"';
flashTag+=' type="application/x-shockwave-flash"';
if(this.id!=null){
flashTag+=' name="'+this.id+'"';}
for(var n in this.genericParam){
if(this.genericParam[n]!=null){
flashTag+=(' '+n+'="'+this.genericParam[n]+'"');}}
if(this.flashVars!=null){
var fv=this.getFlashVarsAsString();
if(fv.length>0){
flashTag+=' flashvars="'+fv+'"';}}
flashTag+=' pluginspage="http://www.macromedia.com/go/getflashplayer">';
flashTag+='</embed>';}
return flashTag;}
FlashTag.prototype.write=function(doc){
doc.write(this.toString());}
FlashTag.prototype.getFlashVarsAsString=function(){
var qs=new String();
for(var n in this.flashVars){
if(this.flashVars[n]!=null){
qs+=(escape(n)+'='+escape(this.flashVars[n])+'&');}}
if(this.flashVarsStr!=null){
return qs+this.flashVarsStr;}
return qs.substring(0,qs.length-1);}/*
Macromedia(r)Flash(r)JavaScript Integration Kit License
Copyright(c)2005 Macromedia,inc. All rights reserved.
Redistribution and use in source and binary forms,with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The end-user documentation included with the redistribution,if any,must
include the following acknowledgment:
"This product includes software developed by Macromedia,Inc.(http:
Alternately,this acknowledgment may appear in the software itself,if and
wherever such third-party acknowledgments normally appear.
4. The name Macromedia must not be used to endorse or promote products derived
from this software without prior written permission. For written permission,
please contact devrelations@macromedia.com.
5. Products derived from this software may not be called "Macromedia" or
"Macromedia Flash",nor may "Macromedia" or "Macromedia Flash" appear in their
name.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING,BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MACROMEDIA OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT,INCIDENTAL,SPECIAL,
EXEMPLARY,OR CONSEQUENTIAL DAMAGES(INCLUDING,BUT NOT LIMITED TO,PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE,DATA,OR PROFITS;OR BUSINESS
INTERRUPTION)HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,WHETHER IN CONTRACT,
STRICT LIABILITY,OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.--
This code is part of the Flash/JavaScript Integration Kit:
http:
Created by:
Christian Cantrell
http:
mailto:cantrell@macromedia.com
Mike Chambers
http:
mailto:mesh@macromedia.com
Macromedia*/
function FlashSerializer(useCdata){
this.useCdata=useCdata;}
FlashSerializer.prototype.serialize=function(args){
var qs=new String();
for(var i=0;i<args.length;++i){
switch(typeof(args[i])){
case 'undefined':
qs+='t'+(i)+'=undf';
break;
case 'string':
qs+='t'+(i)+'=str&d'+(i)+'='+escape(args[i]);
break;
case 'number':
qs+='t'+(i)+'=num&d'+(i)+'='+escape(args[i]);
break;
case 'boolean':
qs+='t'+(i)+'=bool&d'+(i)+'='+escape(args[i]);
break;
case 'object':
if(args[i]==null){
qs+='t'+(i)+'=null';}
else if(args[i]instanceof Date){
qs+='t'+(i)+'=date&d'+(i)+'='+escape(args[i].getTime());}
else{
try{
qs+='t'+(i)+'=xser&d'+(i)+'='+escape(this._serializeXML(args[i]));}
catch(exception){
throw new Exception("FlashSerializationException",
"The following error occurred during complex object serialization: "+exception.getMessage());}}
break;
default:
throw new Exception("FlashSerializationException",
"You can only serialize strings, numbers, booleans, dates, objects, arrays, nulls, and undefined.");}
if(i!=(args.length-1)){
qs+='&';}}
return qs;}
FlashSerializer.prototype._serializeXML=function(obj){
var doc=new Object();
doc.xml='<fp>';
try{
this._serializeNode(obj,doc,null);}
catch(exception){
if(exception.message){
throw new Exception("FlashSerializationException",
"Unable to serialize object because: "+exception.message);}
throw exception;}
doc.xml+='</fp>';
return doc.xml;}
FlashSerializer.prototype._serializeNode=function(obj,doc,name){
switch(typeof(obj)){
case 'undefined':
doc.xml+='<undf'+this._addName(name)+'/>';
break;
case 'string':
doc.xml+='<str'+this._addName(name)+'>'+this._escapeXml(obj)+'</str>';
break;
case 'number':
doc.xml+='<num'+this._addName(name)+'>'+obj+'</num>';
break;
case 'boolean':
doc.xml+='<bool'+this._addName(name)+' val="'+obj+'"/>';
break;
case 'object':
if(obj==null){
doc.xml+='<null'+this._addName(name)+'/>';}
else if(obj instanceof Date){
doc.xml+='<date'+this._addName(name)+'>'+obj.getTime()+'</date>';}
else if(obj instanceof Array){
doc.xml+='<array'+this._addName(name)+'>';
for(var i=0;i<obj.length;++i){
this._serializeNode(obj[i],doc,null);}
doc.xml+='</array>';}
else{
doc.xml+='<obj'+this._addName(name)+'>';
for(var n in obj){
if(typeof(obj[n])=='function')
continue;
this._serializeNode(obj[n],doc,n);}
doc.xml+='</obj>';}
break;
default:
throw new Exception("FlashSerializationException",
"You can only serialize strings, numbers, booleans, objects, dates, arrays, nulls and undefined");
break;}}
FlashSerializer.prototype._addName=function(name){
if(name!=null){
return ' name="'+name+'"';}
return '';}
FlashSerializer.prototype._escapeXml=function(str){
if(this.useCdata)
return '<![CDATA['+str+']]>';
else
return str.replace(/&/g,'&amp;').replace(/</g,'&lt;');}/*
Macromedia(r)Flash(r)JavaScript Integration Kit License
Copyright(c)2005 Macromedia,inc. All rights reserved.
Redistribution and use in source and binary forms,with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. The end-user documentation included with the redistribution,if any,must
include the following acknowledgment:
"This product includes software developed by Macromedia,Inc.(http:
Alternately,this acknowledgment may appear in the software itself,if and
wherever such third-party acknowledgments normally appear.
4. The name Macromedia must not be used to endorse or promote products derived
from this software without prior written permission. For written permission,
please contact devrelations@macromedia.com.
5. Products derived from this software may not be called "Macromedia" or
"Macromedia Flash",nor may "Macromedia" or "Macromedia Flash" appear in their
name.
THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES,
INCLUDING,BUT NOT LIMITED TO,THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MACROMEDIA OR
ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT,INCIDENTAL,SPECIAL,
EXEMPLARY,OR CONSEQUENTIAL DAMAGES(INCLUDING,BUT NOT LIMITED TO,PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE,DATA,OR PROFITS;OR BUSINESS
INTERRUPTION)HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,WHETHER IN CONTRACT,
STRICT LIABILITY,OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE)ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE,EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.--
This code is part of the Flash/JavaScript Integration Kit:
http:
Created by:
Christian Cantrell
http:
mailto:cantrell@macromedia.com
Mike Chambers
http:
mailto:mesh@macromedia.com
Macromedia*/
function FlashProxy(lcId,flashId,proxySwfName,callbackScope){
FlashProxy.fpmap[lcId]=this;
this.uid=lcId;
this.proxySwfName=proxySwfName;
this.callbackScope=callbackScope;
this.flashSerializer=new FlashSerializer(false);
this.q=new Array();
if(navigator.appName.indexOf('Internet Explorer')!=-1&&
navigator.platform.indexOf('Win')!=-1&&
navigator.userAgent.indexOf('Opera')==-1){
setUpVBCallback(flashId);}}
FlashProxy.prototype.call=function(){
if(arguments.length==0){
throw new Exception("Flash Proxy Exception",
"The first argument should be the function name followed by any number of additional arguments.");}
this.q.push(arguments);
if(this.q.length==1){
this._execute(arguments);}}
FlashProxy.prototype._execute=function(args){
var ft=new FlashTag(this.proxySwfName,1,1,'6,0,65,0');
ft.addFlashVar('lcId',this.uid);
ft.addFlashVar('functionName',args[0]);
if(args.length>1){
var justArgs=new Array();
for(var i=1;i<args.length;++i){
justArgs.push(args[i]);}
ft.addFlashVars(this.flashSerializer.serialize(justArgs));}
var divName='_flash_proxy_'+this.uid;
if(!document.getElementById(divName)){
var newTarget=document.createElement("div");
newTarget.id=divName;
document.body.appendChild(newTarget);}
var target=document.getElementById(divName);
target.innerHTML=ft.toString();}
FlashProxy.callJS=function(command,args){
var argsArray=eval(args);
var scope=FlashProxy.fpmap[argsArray.shift()].callbackScope;
if(scope&&(command.indexOf('.')<0)){
var functionToCall=scope[command];
functionToCall.apply(scope,argsArray);}
else{
var functionToCall=eval(command);
functionToCall.apply(functionToCall,argsArray);}}
FlashProxy.callComplete=function(uid){
var fp=FlashProxy.fpmap[uid];
if(fp!=null){
fp.q.shift();
if(fp.q.length>0){
fp._execute(fp.q[0]);}}}
FlashProxy.fpmap=new Object();
function ObjectUtil(){}
ObjectUtil.cleanObject=function(object){
var cleanObject=new Object();
for(var i in object){
if(i.charAt(0)!="_"){
cleanObject[i]=object[i];}}
return cleanObject;}
ObjectUtil.instanceOf=function(oObject,fClass){
while(oObject!=null){
if(oObject==fClass.prototype)
return true;
oObject=oObject.__proto__;}
return false;}
function SuggestedAddress(){}
SuggestedAddress.prototype.latlon=null;
SuggestedAddress.prototype.street=null;
SuggestedAddress.prototype.city=null;
SuggestedAddress.prototype.state=null;
SuggestedAddress.prototype.zip=null;
SuggestedAddress.prototype.country=null;
SuggestedAddress.prototype.zoomLevel=null;
SuggestedAddress.prototype.parseASObject=function(oAddress){
this.latlon=new LatLon(oAddress.lat,oAddress.lon);
this.street=oAddress.street;
this.city=oAddress.city;
this.state=oAddress.state;
this.zip=oAddress.zip;
this.country=oAddress.country;
this.status=oAddress.status;
this.zoomLevel=oAddress.mag;}
SuggestedAddress.prototype.toString=function(){
var s="";
s+=(this.street!=null)?this.street:"";
s+=(this.street!=null&&this.city!=null)?", ":"";
s+=(this.city!=null)?this.city:"";
s+=(s!=null&&this.state!=null)?", ":"";
s+=(this.state!=null)?this.state:"";
s+=(s!=null&&this.zip!=null)?" ":"";
s+=(this.zip!=null)?this.zip:"";
s+=(s!=null&&this.country!=null)?"; ":"";
s+=(this.country!=null)?this.country:"";
return s;
alert("toString: "+s);}
function LocalSearchResults(){
this.resultsCount=0;
this.totalResultsCount=0;
this.searchFilters=new Array();}
LocalSearchResults.prototype.resultsCount=null;
LocalSearchResults.prototype.totalResultsCount=null;
LocalSearchResults.prototype.searchFilters=null;
LocalSearchResults.prototype._parseASObject=function(search){
this.resultsCount=search.resultsCount;
this.totalResultsCount=search.totalResultsCount;
this.searchFilters=new Array();
for(var i=0;i<search.searchFilters.length;i++){
var filter=new LocalSearchFilter();
filter._parseASObject(search.searchFilters[i]);
this.searchFilters.push(filter);}}
function LocalSearchFilter(){}
LocalSearchFilter.TYPE_RATING="ratingfgc";
LocalSearchFilter.TYPE_CATEGORY="ycat2gc";
LocalSearchFilter.prototype.type=null;
LocalSearchFilter.prototype.name=null;
LocalSearchFilter.prototype.key=null;
LocalSearchFilter.prototype.count=null;
LocalSearchFilter.prototype._parseASObject=function(filter){
this.type=filter.type;
this.name=filter.name;
this.key=filter.key;
this.count=filter.count;}
function Point(nX,nY){
this.x=nX;
this.y=nY;}
Point.prototype.x=null;
Point.prototype.y=null;
function LatLon(latitude,longitude){
this.lat=latitude;
this.lon=longitude;}
LatLon.prototype.lat=null;
LatLon.prototype.lon=null;
function LatLonRect(minLat,minLon,maxLat,maxLon){
this.minLat=minLat;
this.minLon=minLon;
this.maxLat=maxLat;
this.maxLon=maxLon;}
LatLonRect.prototype.minLat=null;
LatLonRect.prototype.minLon=null;
LatLonRect.prototype.maxLat=null;
LatLonRect.prototype.maxLon=null;
function EventManager(){
this._aEventMap=new Array();}
EventManager.prototype._aEventMap=null;
EventManager.prototype.addEventListener=function(sEventType,sFunction,oObject){
for(var i=0;i<this._aEventMap.length;i++){
if(this._aEventMap[i].oObject==oObject&&
this._aEventMap[i].sFunction&&
this._aEventMap[i].sEventType==sEventType){
return false;}}
var o=new Object();
o.oObject=oObject;
o.sFunction=sFunction;
o.sEventType=sEventType;
this._aEventMap[this._aEventMap.length]=o;
return true;}
EventManager.prototype.removeEventListener=function(sEventType,sFunction,oObject){
for(var i=0;i<this._aEventMap.length;i++){
if(this._aEventMap[i].oObject==oObject&&
this._aEventMap[i].sFunction&&
this._aEventMap[i].sEventType==sEventType){
this._aEventMap.splice(i,1);
return true;}}
return false;}
EventManager.prototype.removeAllEventListeners=function(){
this._aEventMap=new Array();}
EventManager.prototype.dispatchYEvent=function(sEventType,oEvent){
if(oEvent==null)oEvent=new Object();
oEvent.target=this;
oEvent.type=sEventType;
for(var i=0;i<this._aEventMap.length;i++){
if(this._aEventMap[i].sEventType==sEventType){
var scope=(this._aEventMap[i].oObject)?this._aEventMap[i].oObject:this._aEventMap[i].sFunction;
this._aEventMap[i].sFunction.call(scope,oEvent);}}}
function CallQueue(){
this.base=EventManager;
this.base();
this._queue=new Array();}
CallQueue.prototype=new EventManager;
CallQueue.prototype._queue=null;
CallQueue.prototype.addCall=function(sMethodName,aArgs){
this._queue.push({methodName:sMethodName,args:aArgs});}
CallQueue.prototype.clearCallQueue=function(){
this._queue=new Array();}
CallQueue.prototype.flushCallQueue=function(){
for(var i=0;i<this._queue.length;i++){
var call=this._queue[i];
if(call.args==null)call.args=new Array();
this[call.methodName].apply(this,call.args);}
this.clearCallQueue();}
function Map(sContainerId,appid,oLocation,nZoomLevel,nMapViewType){
this.base=CallQueue;
this.base();
Map._instanceCount++;
this._zoomLevel=(nZoomLevel==null)?Map.DEFAULT_ZOOM:nZoomLevel;
this._mapViewType=nMapViewType||MapViews.MAP;
var uid=new Date().getTime();
var swfId="map_"+Map._instanceCount;
this._flashProxy=new FlashProxy(uid,swfId,_gatewaySWF,this);
if(appid!="undefined"&&appid!=null)this._appid=appid;
var tag=new FlashTag(_shellURL,"100%","100%",'7,0,14,0');
tag.setId(swfId);
tag.addFlashVar("lcId",uid);
tag.addFlashVar("showControls","false");
tag.addFlashVar("zoom",this._zoomLevel);
tag.addFlashVar("mapViewType",this._mapViewType);
tag.addFlashVar("appid",this._appid);
tag.addFlashVar("apptype","jsf");
if(oLocation instanceof LatLon){
this._center=oLocation;
tag.addFlashVar("lat",oLocation.lat);
tag.addFlashVar("lon",oLocation.lon);}
else if(oLocation==null){
this._center=Map.DEFAULT_LAT_LON;
tag.addFlashVar("lat",this._center.lat);
tag.addFlashVar("lon",this._center.lon);}
else{
tag.addFlashVar("address",oLocation);}
var target=document.getElementById(sContainerId);
target.innerHTML=tag.toString();}
Map._instanceCount=0;
Map.prototype=new CallQueue();
Map.DEFAULT_LAT_LON=new LatLon(39.23225,-99.84375);
Map.DEFAULT_ZOOM=14;
Map.EVENT_MOVE=new String("move");
Map.EVENT_TILE_LOADED=new String("tileLoaded");
Map.EVENT_PAN_START=new String("panStart");
Map.EVENT_PAN_STOP=new String("panStop");
Map.EVENT_ZOOM_START=new String("zoomStart");
Map.EVENT_ZOOM_STOP=new String("zoomStop");
Map.EVENT_ZOOM_END=Map.EVENT_ZOOM_STOP;
Map.EVENT_ZOOM=new String("zoom");
Map.EVENT_POI_OVER=new String("poiOver");
Map.EVENT_POI_OUT=new String("poiOut");
Map.EVENT_POI_EXPAND=new String("poiExpand");
Map.EVENT_POI_CLOSE=new String("poiClose");
Map.OVERLAY_POLYLINE_ERROR=new String("overlayPolylineError");
Map.OVERLAY_POLYLINE_SUCCESS=new String("overlayPolylineSuccess");
Map.EVENT_OVERLAY_GEOCODE_SUCCESS=new String("overlayGeocodeSuccess");
Map.EVENT_OVERLAY_GEOCODE_ERROR=new String("overlayGeocodeError");
Map.EVENT_MAP_GEOCODE_SUCCESS=new String("mapGeocodeSuccess");
Map.EVENT_MAP_GEOCODE_ERROR=new String("mapGeocodeError");
Map.EVENT_MARKER_GEOCODE_ERROR=new String("markerGeocodeError");
Map.EVENT_MARKER_GEOCODE_SUCCESS=new String("markerGeocodeSuccess");
Map.EVENT_INITIALIZE=new String("initialize");
Map.EVENT_TOOL_ADDED=new String("toolAdded");
Map.EVENT_TOOL_REMOVED=new String("toolRemoved");
Map.EVENT_TOOL_CHANGE=new String("toolChange");
Map.prototype._center=new LatLon();
Map.prototype._zoomLevel=-1;
Map.prototype._bounds=new Object();
Map.prototype._flashProxy=null;
Map.prototype._activeToolId=-1;
Map.prototype._appid="MMTest";
Map.prototype._initialized=false;
Map.prototype.setCenterByLatLon=function(latlon,nPanDuration){
if(!this.canCall("setCenterByLatLon",arguments))return;
this._flashProxy.call('setCenterByLatLon',latlon,nPanDuration);}
Map.prototype.setCenterByLatLonAndZoom=function(latlon,nZoomLevel){
if(!this.canCall("setCenterByLatLonAndZoom",arguments))return;
this._flashProxy.call('setCenterByLatLonAndZoom',latlon,nZoomLevel);}
Map.prototype.setCenterByPointDelta=function(delta,nPanDuration){
this._flashProxy.call('setCenterByPointDelta',delta,nPanDuration);}
Map.prototype.setCenterByAddress=function(sAddress,nPanDuration){
if(!this.canCall("setCenterByAddress",arguments))return;
this._flashProxy.call('setCenterByAddress',sAddress,nPanDuration);}
Map.prototype.getCenter=function(){
return this._center;}
Map.prototype.setAppID=function(arg){
this._appid=arg;}
Map.prototype.getAppID=function(){
return this._appid;}
Map.prototype.setZoomLevel=function(nZoomLevel){
if(!this.canCall("setZoomLevel",arguments))return;
this._zoomLevel=nZoomLevel;
this._flashProxy.call('setZoomLevel',nZoomLevel);}
Map.prototype.setMapViewType=function(nMapViewType){
if(!this.canCall("setMapViewType",arguments))return;
this._mapViewType=String(nMapViewType);
this._flashProxy.call('setMapViewType',this._mapViewType);}
Map.prototype.getZoomLevel=function(){
return this._zoomLevel;}
Map.prototype.getBounds=function(){
return this._bounds;}
Map.prototype.getBoundsReturn=function(bounds){
this._bounds=bounds;
return this._bounds;}
Map.prototype.setBounds=function(bounds){
if(!this.canCall("setBounds",arguments))return;
this._flashProxy.call('setBounds',bounds);}
Map.prototype.addWidget=function(widget){
if(!this.canCall("addWidget",arguments))return;
widget.initWidget(this);
this._flashProxy.call('addWidget',ObjectUtil.cleanObject(widget));}
Map.prototype.removeWidget=function(widget){
if(!this.canCall("removeWidget",arguments))return;
this._flashProxy.call('removeWidgetByActionScriptId',widget.actionScriptId);}
Map.prototype._setWidgetActionScriptId=function(javaScriptId,actionScriptId){
var w=Widget.getWidgetByJavaScriptId(javaScriptId.toString());
w.setActionScriptId(actionScriptId);}
Map.prototype.addOverlay=function(overlay){
if(!this.canCall("addOverlay",arguments))return;
overlay.initOverlay(this);
this._flashProxy.call('addOverlay',ObjectUtil.cleanObject(overlay));}
Map.prototype._setOverlayActionScriptId=function(javaScriptId,actionScriptId){
var o=Overlay.getOverlayByJavaScriptId(javaScriptId.toString());
o.setActionScriptId(actionScriptId);}
Map.prototype.removeOverlay=function(overlay){
if(!this.canCall("removeOverlay",arguments))return;
this._flashProxy.call('removeOverlay',overlay.actionScriptId);}
Map.prototype.removeAllOverlays=function(){
if(!this.canCall("removeAllOverlays",arguments))return;
this._flashProxy.call('removeAllOverlays');}
Map.prototype.addTool=function(tool,bActive){
if(!this.canCall("addTool",arguments))return;
tool.initTool(this);
this._flashProxy.call('addTool',ObjectUtil.cleanObject(tool),bActive);}
Map.prototype.removeTool=function(tool){
if(!this.canCall("removeTool",arguments))return;
this._flashProxy.call('removeToolByActionScriptId',tool.actionScriptId);}
Map.prototype.setActiveTool=function(tool){
if(!this.canCall("setActiveTool",arguments))return;
this._flashProxy.call('setActiveToolByActionScriptId',tool.actionScriptId);}
Map.prototype.getActiveTool=function(){
if(this._activeToolId==-1)return null;
return Tool.getToolByJavaScriptId(this._activeToolId);}
Map.prototype._setToolActionScriptId=function(javaScriptId,actionScriptId){
var t=Tool.getToolByJavaScriptId(javaScriptId.toString());
t.setActionScriptId(actionScriptId);}
Map.prototype.addMarkerByLatLon=function(marker,latlon){
if(!this.canCall("addMarkerByLatLon",arguments))return;
marker.initMarker(this);
this._flashProxy.call('addMarkerByLatLon',ObjectUtil.cleanObject(marker),latlon);}
Map.prototype.addMarkerByAddress=function(marker,address){
if(!this.canCall("addMarkerByAddress",arguments))return;
marker.initMarker(this);
this._flashProxy.call('addMarkerByAddress',ObjectUtil.cleanObject(marker),address);}
Map.prototype._setMarkerActionScriptId=function(javaScriptId,actionScriptId){
var m=Marker.getMarkerByJavaScriptId(javaScriptId);
m.setActionScriptId(actionScriptId);}
Map.prototype.removeMarker=function(marker){
if(!this.canCall("removeMarker",arguments))return;
this._flashProxy.call('removeMarkerByActionScriptId',marker.actionScriptId);}
Map.prototype.removeAllMarkers=function(){
if(!this.canCall("removeAllMarkers",arguments))return;
this._flashProxy.call('removeAllMarkers');}
Map.prototype.isInitialized=function(){
return(this._initialized==true);}
Map.prototype.enableKeyboardShortcuts=function(bEnabled){
if(!this.canCall("enableKeyboardShortcuts",arguments))return;
this._flashProxy.call('enableKeyboardShortcuts',bEnabled);}
Map.prototype.canCall=function(sMethodName,aArgs){
if(this.isInitialized()){
return true;}
else{
this.addCall(sMethodName,aArgs);
return false;}}
Map.prototype.dispatchMoveEvent=function(oEvent){
this._center=new LatLon(oEvent.center.lat,oEvent.center.lon);
this._bounds=oEvent.bounds;
this.dispatchYEvent(Map.EVENT_MOVE,oEvent);}
Map.prototype.dispatchTileLoadedEvent=function(oEvent){
this.dispatchYEvent(Map.EVENT_TILE_LOADED,oEvent);}
Map.prototype.dispatchPanToolDragStartEvent=function(toolId){
var tool=Tool.getToolByJavaScriptId(toolId);
tool.dispatchYEvent(PanTool.EVENT_DRAG_START);}
Map.prototype.dispatchPanToolDragStopEvent=function(toolId){
var tool=Tool.getToolByJavaScriptId(toolId);
tool.dispatchYEvent(PanTool.EVENT_DRAG_STOP);}
Map.prototype.dispatchPanStartEvent=function(oEvent){
this.dispatchYEvent(Map.EVENT_PAN_START,oEvent);}
Map.prototype.dispatchPanStopEvent=function(oEvent){
this._zoomLevel=oEvent.zoomLevel;
this._bounds=oEvent.bounds;
this.dispatchYEvent(Map.EVENT_PAN_STOP,oEvent);}
Map.prototype.dispatchZoomStartEvent=function(oEvent){
this.dispatchYEvent(Map.EVENT_ZOOM_START,oEvent);}
Map.prototype.dispatchZoomStopEvent=function(oEvent){
this._zoomLevel=oEvent.endZoomLevel;
this._bounds=oEvent.bounds;
this.dispatchYEvent(Map.EVENT_ZOOM_STOP,oEvent);}
Map.prototype.dispatchZoomEvent=function(oEvent){
this.dispatchYEvent(Map.EVENT_ZOOM,oEvent);}
Map.prototype.dispatchTypeChangeEvent=function(oEvent){
this.dispatchYEvent(Map.EVENT_TYPE_CHANGE,new Object());}
Map.prototype.dispatchCustomSWFMarkerEvent=function(javaScriptId,oEvent){
var marker=Marker.getMarkerByJavaScriptId(javaScriptId);
marker.dispatchYEvent(oEvent.type,oEvent);}
Map.prototype.dispatchCustomSWFOverlayEvent=function(javaScriptId,oEvent){
var overlay=Overlay.getOverlayByJavaScriptId(javaScriptId);
overlay.dispatchYEvent(oEvent.type,oEvent);}
Map.prototype.dispatchLocalSearchSuccessEvent=function(javaScriptId,oEvent){
var result=new LocalSearchResults();
result._parseASObject(oEvent.localSearchResults);
var overlay=Overlay.getOverlayByJavaScriptId(javaScriptId);
overlay.localSearchResults=result;
overlay.dispatchYEvent(oEvent.type,{localSearchResults:result});}
Map.prototype.dispatchLocalSearchErrorEvent=function(javaScriptId,oEvent){
var overlay=Overlay.getOverlayByJavaScriptId(javaScriptId);
overlay.dispatchYEvent(oEvent.type);}
Map.prototype.dispatchMapGeocodeError=function(oEvent){
var addresses=oEvent.suggestedAddresses;
var cleanAddresses=new Array();
if(addresses!=null){
for(var i=0;i<addresses.length;i++){
var address=new SuggestedAddress();
address.parseASObject(addresses[i]);
cleanAddresses.push(address);}}
this.dispatchYEvent(Map.EVENT_MAP_GEOCODE_ERROR,{suggestedAddresses:cleanAddresses,originalAddress:oEvent.originalAddress});}
Map.prototype.dispatchMapGeocodeSuccess=function(oEvent){
this.dispatchYEvent(Map.EVENT_MAP_GEOCODE_SUCCESS);}
Map.prototype.dispatchOverlayGeocodeError=function(oEvent){
this.dispatchYEvent(Map.EVENT_OVERLAY_GEOCODE_ERROR);}
Map.prototype.dispatchOverlayGeocodeSuccess=function(oEvent){
this.dispatchYEvent(Map.EVENT_OVERLAY_GEOCODE_SUCCESS);}
Map.prototype.dispatchPoiOver=function(oEvent){
this.dispatchYEvent(Map.EVENT_POI_OVER,oEvent);}
Map.prototype.dispatchPoiOut=function(oEvent){
this.dispatchYEvent(Map.EVENT_POI_OUT,oEvent);}
Map.prototype.dispatchPoiExpand=function(oEvent){
this.dispatchYEvent(Map.EVENT_POI_EXPAND,oEvent);}
Map.prototype.dispatchPoiClose=function(oEvent){
this.dispatchYEvent(Map.EVENT_POI_CLOSE,oEvent);}
Map.prototype.dispatchMarkerGeocodeSuccess=function(oEvent){
this.dispatchYEvent(Map.EVENT_MARKER_GEOCODE_SUCCESS,{marker:Marker.getMarkerByJavaScriptId(oEvent.markerId)});}
Map.prototype.dispatchMarkerGeocodeError=function(oEvent){
var marker=Marker.getMarkerByJavaScriptId(oEvent.markerId);
var addresses=oEvent.suggestedAddresses;
var cleanAddresses=new Array();
if(addresses){
for(var i=0;i<addresses.length;i++){
var address=new SuggestedAddress();
address.parseASObject(addresses[i]);
cleanAddresses.push(address);}}
this.dispatchYEvent(Map.EVENT_MARKER_GEOCODE_ERROR,{marker:marker,
suggestedAddresses:cleanAddresses,
originalAddress:oEvent.originalAddress});}
Map.prototype.dispatchMapInitializedEvent=function(oEvent){
this._center=new LatLon(oEvent.center.y,oEvent.center.x);
this._bounds=new LatLonRect(oEvent.bounds.minLat,oEvent.bounds.minLon,oEvent.bounds.maxLat,oEvent.bounds.maxLon);
this._zoomLevel=oEvent.zoomLevel;
this._initialized=true;
this.flushCallQueue();
this.dispatchYEvent(Map.EVENT_INITIALIZE);}
Map.prototype.dispatchToolAddedEvent=function(oEvent){
var tool=Tool.getToolByJavaScriptId(oEvent.toolId);
this.dispatchYEvent(Map.EVENT_TOOL_ADDED,{tool:tool});}
Map.prototype.dispatchToolChangeEvent=function(oEvent){
var tool=Tool.getToolByJavaScriptId(oEvent.toolId);
this.dispatchYEvent(Map.EVENT_TOOL_CHANGE,{tool:tool});
this._activeToolId=oEvent.toolId;}
Map.prototype.dispatchToolRemovedEvent=function(oEvent){
var tool=Tool.getToolByJavaScriptId(oEvent.toolId);
this.dispatchYEvent(Map.EVENT_TOOL_REMOVED,{tool:tool});}
Map.prototype.dispatchPolylineError=function(oEvent){
this.dispatchYEvent(Map.OVERLAY_POLYLINE_ERROR,oEvent);}
Map.prototype.dispatchPolylineSuccess=function(oEvent){
this.dispatchYEvent(Map.OVERLAY_POLYLINE_SUCCESS,oEvent);}
var MapViews={};
MapViews.MAP=new String("map");
MapViews.HYBRID=new String("hybrid");
MapViews.SATELLITE=new String("satellite");
function Marker(){
this.base=CallQueue;
this.base.call(this);
this.javaScriptId=Marker._instanceCount++;
Marker._javaScriptIdMap[this.javaScriptId.toString()]=this;}
Marker.prototype=new CallQueue();
Marker.TYPE_POI="poi";
Marker.TYPE_WAYPOINT="waypoint";
Marker.TYPE_CUSTOM_SWF="customSWF";
Marker.TYPE_CUSTOM_IMAGE="customImage";
Marker.EVENT_INTIALIZE="markerInitialize";
Marker.prototype.markerType="";
Marker.prototype.javaScriptId=null;
Marker.prototype.actionScriptId=null;
Marker.prototype._map=null;
Marker.prototype._visible=true;
Marker.prototype._initialized=false;
Marker._instanceCount=0;
Marker._javaScriptIdMap=new Array();
Marker.getMarkerByJavaScriptId=function(sJavaScriptId){
return Marker._javaScriptIdMap[sJavaScriptId.toString()];}
Marker.prototype.initMarker=function(map){
this._map=map;}
Marker.prototype.setActionScriptId=function(actionScriptId){
this.actionScriptId=actionScriptId;
this._initialized=true;
this.flushCallQueue();
this.dispatchYEvent(Marker.EVENT_INITIALIZE);}
Marker.prototype.isInitialized=function(){
return this._initialized;}
Marker.prototype.canCall=function(sMethodName,aArgs){
if(this.isInitialized()){
return true;}
else{
this.addCall(sMethodName,aArgs);
return false;}}
Marker.prototype.show=function(){
if(!this.canCall("show"))return;
this._visible=true;
this._map._flashProxy.call("showMarker",this.actionScriptId);}
Marker.prototype.hide=function(){
if(!this.canCall("hide"))return;
this._visible=false;
this._map._flashProxy.call("hideMarker",this.actionScriptId);}
Marker.prototype.isVisible=function(){
return this._visible;}
Marker.prototype.getMarkerType=function(){
return this.markerType;}
Marker.prototype.getJavaScriptId=function(){
return this.javaScriptId;}
Marker.prototype.getActionScriptId=function(){
return this.actionScriptId;}
function CustomPOIMarker(sIndex,sTitle,sDescription,nMarkerColor,nStrokeColor){
this.base=Marker;
this.base();
this.index=sIndex;
this.title=sTitle;
this.description=sDescription;
this.markerColor=nMarkerColor;
this.strokeColor=nStrokeColor;}
CustomPOIMarker.prototype=new Marker;
CustomPOIMarker.prototype.index="";
CustomPOIMarker.prototype.title="";
CustomPOIMarker.prototype.description="";
CustomPOIMarker.prototype.markerColor=0x999900;
CustomPOIMarker.prototype.markerColor=0xFFFFFF;
CustomPOIMarker.prototype.markerType=Marker.TYPE_POI;/*
CustomPOIMarker.prototype.setIndex=function(sIndex){
this.index=sIndex;
this._map._flashProxy.call("setPOIMarkerIndex",this.actionScriptId,this.index);}
CustomPOIMarker.prototype.setTitle=function(sTitle){
this.title=sTitle;
this._map._flashProxy.call("setPOIMarkerTitle",this.actionScriptId,this.title);}
CustomPOIMarker.prototype.setDescription=function(sDescription){
this.description=sDescription;
this._map._flashProxy.call("setPOIMarkerDescription",this.actionScriptId,this.description);}
CustomPOIMarker.prototype.setMarkerColor=function(nColor){
this.markerColor=nColor;
this._map._flashProxy.call("setPOIMarkerMarkerColor",this.actionScriptId,this.markerColor);}
CustomPOIMarker.prototype.setStrokeColor=function(nColor){
this.strokeColor=nColor;
this._map._flashProxy.call("setPOIMarkerStrokeColor",this.actionScriptId,this.markerColor);}*/
CustomPOIMarker.prototype.open=function(){
if(!this.canCall("open"))return;
this._map._flashProxy.call("openMarker",this.actionScriptId,this.markerColor);}
CustomPOIMarker.prototype.close=function(){
if(!this.canCall("close"))return;
this._map._flashProxy.call("closeMarker",this.actionScriptId,this.markerColor);}
function WaypointMarker(sWaypointIndex){
this.base=Marker;
this.base();
if(sWaypointIndex)
this.waypointIndex=sWaypointIndex;}
WaypointMarker.prototype=new Marker;
WaypointMarker.prototype.waypointIndex="";
WaypointMarker.prototype.markerType=Marker.TYPE_WAYPOINT;
WaypointMarker.prototype.setWaypointIndex=function(sWaypointIndex){
this.waypointIndex=sWaypointIndex;
if(!this.canCall("setWaypointIndex",arguments))return;
this._map._flashProxy.call("setWaypointMarkerIndex",this.actionScriptId,this.waypointIndex);}
WaypointMarker.prototype.getWaypointIndex=function(){
return this.waypointIndex;}
function CustomSWFMarker(sUrl){
this.url=sUrl;
this.base=Marker;
this.base();}
CustomSWFMarker.prototype=new Marker;
CustomSWFMarker.prototype.markerType=Marker.TYPE_CUSTOM_SWF;
CustomSWFMarker.prototype.url="";
CustomSWFMarker.prototype.getURL=function(){
return this.url;}
CustomSWFMarker.prototype.callCustomMethod=function(sMethodName,aMethodArgs){
if(!this.canCall("callCustomMethod",arguments))return;
this._map._flashProxy.call("callCustomMarkerMethod",this.actionScriptId,sMethodName,aMethodArgs);}
CustomSWFMarker.prototype.addEventListener=function(sEventType,sFunction,oObject){
if(!this.canCall("addEventListener",arguments))return;
this._map._flashProxy.call("addCustomSWFMarkerEventListener",this.actionScriptId,sEventType);
EventManager.prototype.addEventListener.call(this,sEventType,sFunction,oObject);}
function CustomImageMarker(sURL){
this.url=sURL;
this.base=Marker;
this.base();}
CustomImageMarker.prototype=new Marker;
CustomImageMarker.prototype.markerType=Marker.TYPE_CUSTOM_IMAGE;
CustomImageMarker.prototype.url="";
CustomImageMarker.prototype.getURL=function(){
return this.url;}
function Overlay(){
this.base=CallQueue;
this.base();
this.javaScriptId=Overlay._instanceCount++;
Overlay._javaScriptIdMap[this.javaScriptId.toString()]=this;
this._visible=true;}
Overlay.prototype=new CallQueue;
Overlay.TYPE_TRAFFIC="traffic";
Overlay.TYPE_CUSTOM_SWF="customSWF";
Overlay.TYPE_LOCAL_SEARCH="localSearch";
Overlay.TYPE_GEO_RSS="geoRSS";
Overlay.TYPE_POLYLINE="polyline";
Overlay.EVENT_INITIALIZE="overlayInitialize";
Overlay.prototype.overlayType="";
Overlay.prototype.javaScriptId=null;
Overlay.prototype.actionScriptId=null;
Overlay.prototype._map=null;
Overlay.prototype._visible=false;
Overlay.prototype._initialized=false;
Overlay._instanceCount=0;
Overlay._javaScriptIdMap=new Array();
Overlay.getOverlayByJavaScriptId=function(sJavaScriptId){
var ret=Overlay._javaScriptIdMap[sJavaScriptId];
return ret;}
Overlay.prototype.initOverlay=function(map){
this._map=map;}
Overlay.prototype.setActionScriptId=function(actionScriptId){
this.actionScriptId=actionScriptId;
this._initialized=true;
this.flushCallQueue();
this.dispatchYEvent(Overlay.EVENT_INITIALIZE);}
Overlay.prototype.canCall=function(sMethodName,aArgs){
if(this.isInitialized()){
return true;}
else{
this.addCall(sMethodName,aArgs);
return false;}}
Overlay.prototype.isInitialized=function(){
return this._initialized;}/**Make the overlay visible*/
Overlay.prototype.show=function(){
if(!this.canCall("show"))return;
this._visible=true;
this._map._flashProxy.call("showOverlay",this.actionScriptId);}
Overlay.prototype.hide=function(){
if(!this.canCall("hide"))return;
this._visible=false;
this._map._flashProxy.call("hideOverlay",this.actionScriptId);}
Overlay.prototype.isVisible=function(){
return this._visible;}
Overlay.prototype.getMarkerType=function(){
return this.markerType;}
Overlay.prototype.getJavaScriptId=function(){
return this.javaScriptId;}
Overlay.prototype.getActionScriptId=function(){
return this.actionScriptId;}
function TrafficOverlay(){
this.base=Overlay;
this.base();}
TrafficOverlay.prototype=new Overlay;
TrafficOverlay.prototype.overlayType=Overlay.TYPE_TRAFFIC;
function LocalSearchOverlay(){
this.base=Overlay;
this.base();}
LocalSearchOverlay.EVENT_SEARCH_SUCCESS="searchSuccess";
LocalSearchOverlay.EVENT_SEARCH_ERROR="searchError";
LocalSearchOverlay.prototype=new Overlay;
LocalSearchOverlay.prototype.localSearchResults=null;
LocalSearchOverlay.prototype.overlayType=Overlay.TYPE_LOCAL_SEARCH;
LocalSearchOverlay.prototype.search=function(sSearchTerms,latlon,nStartIndex,nResults,nRadius,sCategoryFilter,sRatingFilter){
if(!this.canCall("search",arguments))return;
this._map._flashProxy.call("localSearchOverlaySearch",this.actionScriptId,sSearchTerms,latlon,nStartIndex,nResults,nRadius,sCategoryFilter,sRatingFilter);}
LocalSearchOverlay.prototype.clear=function(){
this.localSearchResults=null;
if(!this.canCall("clear"))return;
this._map._flashProxy.call("localSearchOverlayClear",this.actionScriptId);}
function CustomSWFOverlay(sURL){
this.url=sURL;
this.base=Overlay;
this.base();}
CustomSWFOverlay.prototype=new Overlay;
CustomSWFOverlay.prototype.overlayType=Overlay.TYPE_CUSTOM_SWF;
CustomSWFOverlay.prototype.url=null;
CustomSWFOverlay.prototype.callCustomMethod=function(sMethodName,aMethodArgs){
if(!this.canCall("callCustomMethod",arguments))return;
this._map._flashProxy.call("callCustomSWFOverlayMethod",this.actionScriptId,sMethodName,aMethodArgs);}
CustomSWFOverlay.prototype.addEventListener=function(sEventType,sFunction,oObject){
if(!this.canCall("addEventListener",arguments))return;
this._map._flashProxy.call("addCustomSWFOverlayEventListener",this.actionScriptId,sEventType);
EventManager.prototype.addEventListener.call(this,sEventType,sFunction,oObject);}
function GeoRSSOverlay(_url,_updateMap){
this.base=Overlay;
this.base();
this.url=_url;
this.updateMap=_updateMap;}
GeoRSSOverlay.prototype=new Overlay;
GeoRSSOverlay.prototype.overlayType=Overlay.TYPE_GEO_RSS;
GeoRSSOverlay.prototype.url=null;
GeoRSSOverlay.prototype.updateMap=null;
function PolylineOverlay(args){
this.base=Overlay;
this.base();
this.url=args;}
PolylineOverlay.prototype=new Overlay;
PolylineOverlay.OVERLAY_POLYLINE_SUCCESS=new String("overlayPolylineSuccess");
PolylineOverlay.EVENT_OVERLAY_GEOCODE_SUCCESS=new String("overlayGeocodeSuccess");
PolylineOverlay.MOVE=new String("move");
PolylineOverlay.DRAW=new String("draw");
PolylineOverlay.prototype.overlayType=Overlay.TYPE_POLYLINE;
PolylineOverlay.prototype.url=null;
PolylineOverlay.prototype.setUrl=function(data){
if(!this.canCall("setUrl",arguments))return;
this.url=data;
this._map._flashProxy.call("setPolylineUrl",this.actionScriptId,data);}
PolylineOverlay.prototype.getUrl=function(){
return this.url;}
PolylineOverlay.prototype.dataProvider=null;
PolylineOverlay.prototype.setDataProvider=function(data){
if(!this.canCall("setDataProvider",arguments))return;
this.dataProvider=data;
this._map._flashProxy.call("setPolylineDataProvider",this.actionScriptId,data);}
PolylineOverlay.prototype.getDataProvider=function(){
return this.dataProvider;}
function Widget(){
this.base=CallQueue;
this.base();
this._visible=true;
this.javaScriptId=Widget._instanceCount++;
Widget._javaScriptIdMap[this.javaScriptId.toString()]=this;}
Widget.prototype=new CallQueue;
Widget.TYPE_NAVIGATOR="navigator";
Widget.TYPE_SATELLITE_CONTROL="satelliteControl";
Widget.TYPE_TOOL_BAR="toolBar";
Widget.EVENT_INITIALIZE="widgetInitialize";
Widget._instanceCount=0;
Widget._javaScriptIdMap=new Array();
Widget.getWidgetByJavaScriptId=function(nJavaScriptId){
return Widget._javaScriptIdMap[nJavaScriptId.toString()];}
Widget.prototype._initialized=false;
Widget.prototype.widgetType="";
Widget.prototype.javaScriptId=null;
Widget.prototype.actionScriptId=null;
Widget.prototype._map=null;
Widget.prototype.initWidget=function(map){
this._map=map;}
Widget.prototype.setActionScriptId=function(actionScriptId){
this.actionScriptId=actionScriptId;
this._initialized=true;
this.flushCallQueue();
this.dispatchYEvent(Tool.EVENT_INITIALIZE);}
Widget.prototype.canCall=function(sMethodName,aArgs){
if(this.isInitialized()){
return true;}
else{
this.addCall(sMethodName,aArgs);
return false;}}
Widget.prototype.isInitialized=function(){
return this._initialized;}
Widget.prototype.show=function(){
if(!this.canCall("show"))return;
this._visible=true;
this._map._flashProxy.call("showWidget",this.actionScriptId);}
Widget.prototype.hide=function(){
if(!this.canCall("hide"))return;
this._visible=false;
this._map._flashProxy.call("hideWidget",this.actionScriptId);}
Widget.prototype.isVisible=function(){
return this._visible;}
Widget.prototype.getWidgetType=function(){
return this.widgetType;}
function ToolBarWidget(){
this.base=Widget;
this.base();}
ToolBarWidget.prototype=new Widget;
ToolBarWidget.prototype.widgetType=Widget.TYPE_TOOL_BAR;
ToolBarWidget.prototype.open=function(){
if(!this.canCall("open"))return;
this._map._flashProxy.call("openToolBarWidget",this.actionScriptId);}
ToolBarWidget.prototype.close=function(){
if(!this.canCall("close"))return;
this._map._flashProxy.call("closeToolBarWidget",this.actionScriptId);}
function NavigatorWidget(iState){
this.initialState=iState;
this.base=Widget;
this.base();}
NavigatorWidget.prototype=new Widget;
NavigatorWidget.prototype.widgetType=Widget.TYPE_NAVIGATOR;
NavigatorWidget.prototype.initialState="";
NavigatorWidget.prototype.open=function(){
if(!this.canCall("open"))return;
this._map._flashProxy.call("openNavigatorWidget",this.actionScriptId);}
NavigatorWidget.prototype.close=function(){
if(!this.canCall("close"))return;
this._map._flashProxy.call("closeNavigatorWidget",this.actionScriptId);}
function SatelliteControlWidget(iState){
this.initialState=iState;
this.base=Widget;
this.base();}
SatelliteControlWidget.prototype=new Widget;
SatelliteControlWidget.prototype.widgetType=Widget.TYPE_SATELLITE_CONTROL;
SatelliteControlWidget.prototype.initialState="";
function Tool(){
this.base=CallQueue;
this.base();
this._visible=true;
this.javaScriptId=Tool._instanceCount++;
Tool._javaScriptIdMap[this.javaScriptId.toString()]=this;}
Tool.prototype=new CallQueue();
Tool.TYPE_PAN="pan";
Tool.TYPE_CUSTOM_SWF="customSWF";
Tool.EVENT_INITIALIZE="toolInitialize";
Tool._instanceCount=0;
Tool._javaScriptIdMap=new Array();
Tool.prototype._initialized=false;
Tool.prototype.toolType="";
Tool.prototype.javaScriptId=null;
Tool.prototype.actionScriptId=null;
Tool.prototype._map=null;
Tool.prototype.initTool=function(map){
this._map=map;}
Tool.prototype.setActionScriptId=function(actionScriptId){
this.actionScriptId=actionScriptId;
this._initialized=true;
this.dispatchYEvent(Tool.EVENT_INITIALIZE);}
Tool.prototype.isInitialized=function(){
return this._initialized;}
Tool.getToolByJavaScriptId=function(nJavaScriptId){
return Tool._javaScriptIdMap[nJavaScriptId.toString()];}
Tool.prototype.getToolType=function(){
return this.toolType;}
function PanTool(){
this.base=Tool;
this.base();}
PanTool.prototype=new Tool();
PanTool.EVENT_DRAG_START=new String("dragStart");
PanTool.EVENT_DRAG_STOP=new String("dragStop");
PanTool.prototype.toolType=Tool.TYPE_PAN;
function CustomSWFTool(sUrl,sIconUrl){
this.base=Tool;
this.base();
this.url=sUrl;
this.iconUrl=sIconUrl;}
CustomSWFTool.prototype=new Tool;
CustomSWFTool.prototype.toolType=Tool.TYPE_CUSTOM_SWF;
CustomSWFTool.prototype.url=null;
CustomSWFTool.prototype.iconUrl=null;

