/**
*	Copyright (C)2010 Mapsolute GmbH
*	All rights reserved
*	Filesize: 31537 byte
*/
var M24=function(){
}
var map=null;M24.init=function(settings){
if(map==null){
Map24.Webservices.SessionPatch={
Codebase:"MAP24_v3.6.79_20060530"
}
map=Map24.Webservices.getMap24Application({
AppKey:settings.appKey,MapArea:document.getElementById(settings.mapArea),MapWidth:settings.width,MapHeight:settings.height,Maptype:"JAVA"
});}
}
M24.setMGI=function(){
map.setMaptype("MGI");}
M24.setJava=function(){
map.setMaptype("JAVA");}
M24.centerOnLonLat=function(lon,lat,zoomMeters){
if(!M24.isValidCoordinate(lon,lat))
throw new Map24.Exceptions.InvalidArgument("Invalid coordinates (lon, lat) passed.",lon,"","M24.centerOnLonLat");M24.addMRC(
new Map24.Webservices.MRC.SetMapView({
Coordinates:new Map24.Coordinate(lon,lat),ClippingWidth:new Map24.Webservices.ClippingWidth(
{MinimumWidth:zoomMeters}
)
})
);if(AutoCommit)
M24.commit();}
M24.setZoomPercent=function(zoomPercent){
if(!Map24.isNumeric(zoomPercent))
throw new Map24.Exceptions.InvalidArgument("Parameter zoomPercent is not a number.",zoomPercent,"","M24.setZoomPercent");else if(zoomPercent<0)
throw new Map24.Exceptions.InvalidArgument("Parameter zoomPercent is smaller than 0",zoomPercent,"","M24.setZoomPercent");else if(zoomPercent>100)
throw new Map24.Exceptions.InvalidArgument("Parameter zoomPercent is greater than 100",zoomPercent,"","M24.setZoomPercent");M24.addMRC(
new Map24.Webservices.MRC.ModifyMapView({
Control:"ZOOM",Percentage:zoomPercent
})
);if(AutoCommit)
M24.commit();}
M24.setZoomMeters=function(zoomMeters){
if(!Map24.isNumeric(zoomMeters))
throw new Map24.Exceptions.InvalidArgument("Parameter zoomMeters is not a number.",zoomMeters,"","M24.setZoomMeters");else if(zoomMeters<0)
throw new Map24.Exceptions.InvalidArgument("Parameter zoomMeters is smaller than 0.",zoomMeters,"","M24.setZoomMeters");M24.addMRC(
new Map24.Webservices.MRC.ModifyMapView({
Control:"ZOOM",zoom:zoomMeters
})
);if(AutoCommit)
M24.commit();}
M24.zoomIn=function(){
M24.addMRC(new Map24.Webservices.MRC.ModifyMapView({Control:"ZOOMIN"}));if(AutoCommit)
M24.commit();}
M24.zoomOut=function(){
M24.addMRC(new Map24.Webservices.MRC.ModifyMapView({Control:"ZOOMOUT"}));if(AutoCommit)
M24.commit();}
M24.panTo=function(dir){
M24.addMRC(new Map24.Webservices.MRC.ModifyMapView({Control:dir}));if(AutoCommit)
M24.commit();}
M24.home=function(){
M24.addMRC(new Map24.Webservices.MRC.ModifyMapView({Control:"HOME"}));if(AutoCommit)
M24.commit();}
M24.back=function(){
M24.addMRC(new Map24.Webservices.MRC.ModifyMapView({Control:"BACK"}));if(AutoCommit)
M24.commit();}
M24.forward=function(){
M24.addMRC(new Map24.Webservices.MRC.ModifyMapView({Control:"FORWARD"}));if(AutoCommit)
M24.commit();}
M24.controlComponent=function(control,component){
if(control!="SHOW"&&control!="HIDE")
throw new Map24.Exceptions.InvalidArgument("Parameter control can have either the value \"SHOW\" or \"HIDE\".",control,"","M24.controlComponent");else if(component!="OV"&&component!="M3D"&&component!="TBAR"&&component!="M3DROUTE")
throw new Map24.Exceptions.InvalidArgument("Parameter component can have the values \"OV\", \"M3D\", \"TBAR\", \"M3DROUTE\".",component,"","M24.controlComponent");M24.addMRC(
new Map24.Webservices.MRC.ControlComponent({
Control:control,Component:component
})
);component="SHOW"+component;M24.addMRC(
new Map24.Webservices.MRC.ControlComponent({
Component:component,Control:control
})
);if(AutoCommit)
M24.commit();}
M24.addLabel=function(props){
if(!M24.isValidObjID(props.objID))
throw new Map24.Exceptions.InvalidArgument("Invalid props.objID passed.",props.objID,"","M24.addLabel");if(!M24.isValidCoordinate(props.lon,props.lat))
throw new Map24.Exceptions.InvalidArgument("Invalid coordinates (props.lon, props.lat) passed.",lon,"","M24.addLabel");if(!(props.color instanceof Map24.Color))
props.color=M24.BLACK;if(!(props.bgColor instanceof Map24.Color))
props.bgColor=M24.WHITE;if(!(props.brdColor instanceof Map24.Color))
props.brdColor=M24.RED;M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24Label({
MapObjectID:props.objID,Coordinate:new Map24.Coordinate(props.lon,props.lat),Text:props.text,Color:props.color,BgColor:props.bgColor,BorderColor:props.brdColor,Anchor:"CENTER"
})
);M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:props.objID
})
);if(AutoCommit)
M24.commit();}
M24.addLocation=function(props){
if(!M24.isValidObjID(props.objID))
throw new Map24.Exceptions.InvalidArgument("Invalid props.objID passed.",props.objID,"","M24.addLocation");if(!M24.isValidCoordinate(props.lon,props.lat))
throw new Map24.Exceptions.InvalidArgument("Invalid coordinates (props.lon, props.lat) passed.",lon,"","M24.addLocation");M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24Location({
MapObjectID:props.objID,Coordinate:new Map24.Coordinate(props.lon,props.lat),LogoURL:props.logoURL
})
);M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:props.objID
})
);if(AutoCommit)
M24.commit();}
M24.addPolyline=function(props){
if(!M24.isValidObjID(props.objID))
throw new Map24.Exceptions.InvalidArgument("Invalid props.objID passed.",props.objID,"","M24.addPolyline");if(Map24.isNull(props.coordArr))
throw new Map24.Exceptions.InvalidArgument("Parameter coordArr is null, \"null\" or undefined.",props.coordArr,"","M24.addPolyline");if(!(props.fillColor instanceof Map24.Color))
props.fillColor=M24.GREEN;M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24Polyline({
MapObjectID:props.objID,Coordinates:props.coordArr,Color:props.fillColor
})
);M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:props.objID
})
);if(AutoCommit)
M24.commit();}
M24.addPolygon=function(props){
if(!M24.isValidObjID(props.objID))
throw new Map24.Exceptions.InvalidArgument("Invalid props.objID passed.",props.objID,"","M24.addPolygon");if(Map24.isNull(props.coordArr))
throw new Map24.Exceptions.InvalidArgument("Parameter coordArr is null, \"null\" or undefined.",props.coordArr,"","M24.addPolygon");if(!(props.fillColor instanceof Map24.Color))
props.fillColor=M24.GREEN;M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24Polygon({
MapObjectID:props.objID,Coordinates:props.coordArr,FillColor:props.fillColor
})
);M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:props.objID
})
);if(AutoCommit)
M24.commit();}
M24.addOval=function(props){
if(!M24.isValidObjID(props.objID))
throw new Map24.Exceptions.InvalidArgument("Invalid props.objID passed.",props.objID,"","M24.addOval");if(!M24.isValidCoordinate(props.lon,props.lat))
throw new Map24.Exceptions.InvalidArgument("Invalid coordinates (props.lon, props.lat) passed.",props.lon,"","M24.addOval");if(!Map24.isNumeric(props.width))
throw new Map24.Exceptions.InvalidArgument("Parameter props.width is not a number.",props.width,"","M24.addOval");else if(props.width<0)
throw new Map24.Exceptions.InvalidArgument("Parameter props.width is smaller than 0.",props.width,"","M24.addOval");if(!Map24.isNumeric(props.height))
throw new Map24.Exceptions.InvalidArgument("Parameter props.height is not a number.",props.height,"","M24.addOval");else if(props.height<0)
throw new Map24.Exceptions.InvalidArgument("Parameter props.height is smaller than 0.",props.height,"","M24.addOval");if(!(props.fillColor instanceof Map24.Color))
props.fillColor=M24.RED;if(!(props.brdColor instanceof Map24.Color))
props.brdColor=M24.BLACK;M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24Oval({
MapObjectID:props.objID,Width:props.width,Height:props.height,Center:new Map24.Coordinate(props.lon,props.lat),FillColor:props.fillColor,BorderColor:props.brdColor
})
);M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:props.objID
})
);if(AutoCommit)
M24.commit();}
M24.centerOnObj=function(objID,zoomMeters){
if(!M24.isValidObjID(objID))
throw new Map24.Exceptions.InvalidArgument("Invalid objID passed.",objID,"","M24.centerOnObj");M24.addMRC(
new Map24.Webservices.MRC.SetMapView({
ClippingWidth:new Map24.Webservices.ClippingWidth(
{MinimumWidth:zoomMeters}
),MapObjectIDs:objID
})
);if(AutoCommit)
M24.commit();}
M24.hideObj=function(objID){
if(!M24.isValidObjID(objID))
throw new Map24.Exceptions.InvalidArgument("Invalid objID passed.",objID,"","M24.hideObj");M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"DISABLE",MapObjectIDs:objID
})
);if(AutoCommit)
M24.commit();}
M24.showObj=function(objID){
if(!M24.isValidObjID(objID))
throw new Map24.Exceptions.InvalidArgument("Invalid objID passed.",objID,"","M24.showObj");M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:objID
})
);if(AutoCommit)
M24.commit();}
M24.removeObj=function(objID){
if(!M24.isValidObjID(objID))
throw new Map24.Exceptions.InvalidArgument("Invalid objID passed.",objID,"","M24.removeObj");M24.addMRC(
new Map24.Webservices.MRC.RemoveMapObject({
MapObjectIDs:objID
})
);if(AutoCommit)
M24.commit();}
M24.geocode=function(text,onGeoFunc){
if(Map24.isNull(text))
throw new Map24.Exceptions.InvalidArgument("Nothing to geocode. ",text,"","M24.geocode");map.Webservices.sendRequest(
new Map24.Webservices.Request.MapSearchFree(map,{
SearchText:text,MaxNoOfAlternatives:100
})
);map.onMapSearchFree=function(event){
var geoRes=new Object();geoRes.Alternatives=event.Alternatives;geoRes.firstResult=geoRes.Alternatives[0];if(typeof geoRes.firstResult.PropertiesMajor["Street"]=="string")
geoRes.Street=geoRes.firstResult.PropertiesMajor["Street"];geoRes.Zip=geoRes.firstResult.PropertiesMajor["Zip"];geoRes.City=geoRes.firstResult.PropertiesMajor["City"];geoRes.County=geoRes.firstResult.PropertiesMajor["Cty"];geoRes.State=geoRes.firstResult.PropertiesMajor["Sta"];geoRes.Country=geoRes.firstResult.PropertiesMajor["Ctry"];geoRes.Lon=geoRes.firstResult.Coordinate.Longitude;geoRes.Lat=geoRes.firstResult.Coordinate.Latitude;onGeoFunc(geoRes);}
}
M24.calculateRouteAddr=function(props){
if(Map24.isNull(props.start))
throw new Map24.Exceptions.InvalidArgument("Parameter props.start is null, \"null\" or undefined.",props.start,"","M24.calculateRouteAddr");if(Map24.isNull(props.destination))
throw new Map24.Exceptions.InvalidArgument("Parameter props.destination is null, \"null\" or undefined.",props.destination,"","M24.calculateRouteAddr");if(Map24.isNull(props.onRoute))
throw new Map24.Exceptions.InvalidArgument("Parameter props.onRoute is null, \"null\" or undefined.",props.onRoute,"","M24.calculateRouteAddr");if(Map24.isNull(props.showRoute))
props.showRoute=true;if(Map24.isNull(props.language))
props.language="EN_GB";_geocodeStartAndDestination(props);return;}
M24.calculateRouteCoord=function(props){
var routeRequest=new Map24.Webservices.Request.CalculateRoute(map);routeRequest.Start=new Map24.Webservices.Request.CalculateRoute.CoordinateAndAddress();routeRequest.Start.Coordinate=props.startCoordinate;routeRequest.Destination=new Map24.Webservices.Request.CalculateRoute.CoordinateAndAddress();routeRequest.Destination.Coordinate=props.destinationCoordinate;routeRequest.DescriptionLanguage=props.language;routeRequest.CalculationMode=props.mode;if(!Map24.isNull(props.viaCoordArr)){
routeRequest.ViaPoints=new Array();for(i=0;i<props.viaCoordArr.length;i++){
var via=new Object();via.Coordinate=props.viaCoordArr[i];routeRequest.ViaPoints[i]=via;}
}
map.Webservices.sendRequest(routeRequest);map.onCalculateRoute=function(event){
event.TotalTime=_secondsToClock(event.Info.TotalTime);event.RouteID=event.Info.RouteID;if(props.language=='EN_GB'){
if(event.Info.TotalLength<1760){
event.TotalLength=Math.round(event.Info.TotalLength);event.TotalLengthUnit="yrd";}else{
event.TotalLength=Math.round(event.Info.TotalLength/1760);event.TotalLengthUnit="mi";}
}else{
if(event.Info.TotalLength<1000){
event.TotalLength=Math.round(event.Info.TotalLength);event.TotalLengthUnit="m";}else{
event.TotalLength=Math.round(event.Info.TotalLength/1000);event.TotalLengthUnit="km";}
}
var sumTime=new Number();var sumLength=new Number();for(var i=0;i<event.RouteSegments.length;i++){
var seg=event.RouteSegments[i];sumTime=sumTime + new Number(seg.Time);sumLength=sumLength + new Number(seg.SegmentLength);seg.CurrentTime=_secondsToClock(sumTime);if(props.language=='EN_GB'){
if(sumLength<1760){
seg.CurrentLengthUnit="yrd";seg.CurrentLength=Math.round(sumLength);}else{
seg.CurrentLength=Math.round(sumLength/1760);seg.CurrentLengthUnit="mi";}
}else{
if(sumLength<1000){
seg.CurrentLengthUnit="m";seg.CurrentLength=Math.round(sumLength);}else{
seg.CurrentLength=Math.round(sumLength/1000);seg.CurrentLengthUnit="km";}
}
seg.Direction=seg.Direction.Hint;for(var n in seg){
if(n=='Start'){
var c=new String(seg[n]).replace(/\n|\s/g,'');var coords=c.split("|");seg.Longitude=coords[0].replace("longitude=","");seg.Latitude=coords[1].replace("latitude=","");}
if(n=='Descriptions'){
seg.Description="";for(var z=0;z<seg[n].length;z++){
for(var ii in seg[n][z]){
var str=new String(seg[n][z][ii]);if(ii=='Text'){
str=str.replace(/\[\/M24/g," [/M24");str=str.replace(/\[\/SIG/g," [/SIG");var arr=str.split(" ");var result="";for(nn=0;nn<arr.length;nn++){
var tmp=arr[nn].replace(/(\[[\/]{0,}M24.*\])/g,"")+" ";tmp=tmp.replace(/(\[[\/]{0,}SIG.*\])/g,"")+" ";result +=tmp;}
if(result.lastIndexOf(" .")==result.length -4)
result=result.slice(0,result.length -5)+".";seg.Description +=result;}
}
}
}
}
}
if(props.onRoute=='undefined'||(props.showRoute!='undefined'&&(props.showRoute==true||props.showRoute=='true'))){
M24.addRoute(event,event.Info.RouteID);M24.showObj(event.Info.RouteID);M24.centerOnObj(event.Info.RouteID);}
if(props.onRoute!='undefined'&&props.onRoute!='')
props.onRoute(event);}
}
_secondsToClock=function(sec){
var th=new String(sec/3600);th=th.substr(0,th.indexOf('.'));if(th==''||th=='0')
th="00";else if(th.length==1)
th="0"+th;var tm=new String(Math.round(sec/60 - th*60));if(tm.length==1)
tm="0"+tm;return th+":"+tm;}
_geocodeStartAndDestination=function(props){
function onGeocodeStart(geoRes){
props.startCoordinate=geoRes.firstResult.Coordinate;M24.geocode(props.destination,onGeocodeDest);}
function onGeocodeDest(geoRes){
props.destinationCoordinate=geoRes.firstResult.Coordinate;if(!Map24.isNull(props.vias)&&props.vias.length>0&&props.vias!=''){
function onGeocodeVia(geoRes){
viaCoordArr[ viaIndx]=geoRes.firstResult.Coordinate;viaIndx++;if(viaIndx<props.vias.length){
M24.geocode(props.vias[ viaIndx],onGeocodeVia);}else{
props.viaCoordArr=viaCoordArr;M24.calculateRouteCoord(props);}
}
if(!(props.vias instanceof Array)){
props.vias=new Array(props.vias);}
viaIndx=0;var viaCoordArr=new Array();M24.geocode(props.vias[ viaIndx],onGeocodeVia);}else{
M24.calculateRouteCoord(props);}
}
M24.geocode(props.start,onGeocodeStart);}
M24.addRoute=function(routeRes,objID,color){
if(!M24.isValidObjID(objID))
throw new Map24.Exceptions.InvalidArgument("Invalid objID passed.",objID,"","M24.addRoute");if(!(color instanceof Map24.Color))
color=M24.GREEN;M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24RouteObject({
MapObjectID:objID,Map24RouteID:routeRes.Info.RouteID,Color:M24.RED
})
);if(AutoCommit)
M24.commit();}
M24.BLACK=new Map24.Color({R:0,G:0,B:0,A:255});M24.BLUE=new Map24.Color({R:0,G:0,B:255,A:200});M24.GREEN=new Map24.Color({R:0,G:255,B:0,A:100});M24.ORANGE=new Map24.Color({R:255,G:216,B:187,A:200});M24.PURPLE=new Map24.Color({R:0,G:0,B:255,A:100});M24.RED=new Map24.Color({R:255,G:0,B:0,A:100});M24.WHITE=new Map24.Color({R:255,G:255,B:255,A:255});LAYOUT_BUBBLE="bubble";LAYOUT_PLAIN="plain";LAYOUT_MAP24="map24";LAYOUT_SIZE_L="L";LAYOUT_SIZE_M="M";LAYOUT_SIZE_S="S";NORTH="NORTH";EAST="EAST";SOUTH="SOUTH";WEST="WEST";var activeTabs=new Array();activeTabs[0]=new Object();var amountTabs=new Array();amountTabs[0]=new Object();var MRCContainer=null;var AutoCommit=true;M24.addMRC=function(command){
if(MRCContainer==null&&map!=null)
MRCContainer=new Map24.Webservices.Request.MapletRemoteControl(map);MRCContainer.push(command);}
M24.commit=function(){
map.Webservices.sendRequest(MRCContainer);MRCContainer=null;}
M24.setAutoCommit=function(flag){
autoCommit=flag;}
M24.createCoordArray=function(){
var arr=new Map24.Webservices.CoordinatesArray();for(var i=0;i<arguments.length;i+=2){
M24.isValidCoordinate(arguments[i],arguments[i+1]);arr.push(new Map24.Coordinate(arguments[i],arguments[i+1]));}
return arr;}
M24.createMap24Color=function(r,g,b,a){
return new Map24.Color({R:r,G:g,B:b,A:a});}
M24.isValidCoordinate=function(longitude,latitude){
if(typeof longitude!="number")return false;if(typeof latitude!="number")return false;if(longitude>Map24.Coordinate.LONGITUDE_MAX||longitude<Map24.Coordinate.LONGITUDE_MIN)return false;if(latitude>Map24.Coordinate.LATITUDE_MAX||latitude<Map24.Coordinate.LATITUDE_MIN)return false;return true;}
M24.isValidObjID=function(objID){
if(Map24.isNull(objID))return false;if(objID=="")return false;if(typeof objID!="number"&&typeof objID!="string")return false;return true;}
M24.getDefaultLayoutSize=function(layout,size){
var s;if(size!=null&&size!='undefined'){
s=new String(size);s=s.toUpperCase();}
else{
s=new String(LAYOUT_SIZE_M);}
if(layout==LAYOUT_BUBBLE){
if(s==LAYOUT_SIZE_L)
return new Array(366,237,127);if(s==LAYOUT_SIZE_M)
return new Array(305,216,106);if(s==LAYOUT_SIZE_S)
return new Array(208,183,73);}
else if(layout==LAYOUT_MAP24){
if(s==LAYOUT_SIZE_L)
return new Array(290,175,130);if(s==LAYOUT_SIZE_M)
return new Array(235,151,106);if(s==LAYOUT_SIZE_S)
return new Array(138,123,78);}
else if(layout==LAYOUT_PLAIN){
if(s==LAYOUT_SIZE_L)
return new Array(260,180,140);if(s==LAYOUT_SIZE_M)
return new Array(229,155,120);if(s==LAYOUT_SIZE_S)
return new Array(150,135,100);}
}
M24.getToolTipLayout=function(layout,size){
var imageBaseURL="http://devnet.map24.com/files/tooltip/";var layoutStr=new String();var s;if(size!=null&&size!='undefined'){
s=new String(size);s=s.toUpperCase();}
else{
s=new String(LAYOUT_SIZE_M);}
if(layout==LAYOUT_BUBBLE||layout==''){
layoutStr="<div width=\"#WIDTH_PLACEHOLDER#\" height=\"#HEIGHT_PLACEHOLDER#\" font-face=\"Arial\" font-size=\"11\" style=\"overflow:hidden; padding: 0px; margin: 0px; border: 0px; background: url("+imageBaseURL+"tooltip_bubble_shade2_"+s+".gif)\">"+
"<p align=\"right\" style=\"padding-top:7px;padding-right:70px\">"+
"<a active=\"150,150,0\" link=\"0,114,189\" href=\"control:disable\">"+
"<img src=\""+imageBaseURL+"tooltip_close.gif\" width=\"14\" height=\"14\" alt=\"close\" title=\"close\" border=\"0\"/>"+
"</a>"+
"</p>"+
"<div height=\"#INNER_HEIGHT_PLACEHOLDER#\" style=\"overflow:scroll; padding:10px; padding-right:74px\">"+
"#HTML_PLACEHOLDER#"+
"</div>"+
"</div>";}
else if(layout==LAYOUT_MAP24){
layoutStr="<div font-family=\"Arial\" font-size=\"11\" style=\"overflow:hidden;width:#WIDTH_PLACEHOLDER#px; height:#HEIGHT_PLACEHOLDER#px;padding: 0px; margin: 0px; border: 0px;\">"+
"<div style=\"align:right;height:15px;position:absolute;top:0px;left:0px;padding: 0px; margin: 0px; border: 0px;color:#ffffff;\" bgcolor=\"#FF7021\">"+
"<a active=\"#ffffff\" link=\"#ffffff\" href=\"control:disable\" target=\"_self\"><b>[ X ]</b></a>"+
"</div>"+ 
"<div style=\"width:#WIDTH_PLACEHOLDER#px;height:#INNER_HEIGHT_PLACEHOLDER#px;position:absolute;top:15px;overflow:scroll;background-color:#ffffff;left:0px;padding: 5px; margin: 0px; border: 0px;\">"+
"#HTML_PLACEHOLDER#"+
"</div>"+
"<img src=\""+imageBaseURL+"tooltip_map24_bottom_"+s+".gif\"/>"+
"</div>";}
else if(layout==LAYOUT_PLAIN){
layoutStr="<div font-family=\"Arial\" font-size=\"11\" style=\"overflow:hidden;width:#WIDTH_PLACEHOLDER#px; height:#HEIGHT_PLACEHOLDER#px; background-color:#ffffff\">"+
"<div align=\"right\" style=\"padding: 0px; margin: 0px;\">"+
"<a active=\"150,150,0\" link=\"0,114,189\" href=\"control:disable\">[ x ] Close</a>"+
"<br/>"+
"</div>"+
"<div style=\"width:#WIDTH_PLACEHOLDER#px;height:#INNER_HEIGHT_PLACEHOLDER#px;overflow:scroll;left:0px;padding: 5px; margin: 0px; border: 0px;\">"+
"#HTML_PLACEHOLDER#"+
"</div>"+
"</div>";}
return layoutStr;}
M24.getTabbedToolTipLayout=function(layout,size){
var layoutStr=M24.getToolTipLayout(layout,size);if(layoutStr.indexOf("#HTML_PLACEHOLDER#")>-1)
layoutStr=new String(layoutStr.replace("#HTML_PLACEHOLDER#","#LINK_PLACEHOLDER##ARGS_PLACEHOLDER#"));return layoutStr;}
M24.getTabbedToolTipLinkCode=function(i,countArgs,size,objId){
var lCode=new String();lCode="<table><tr><td width=\"0\"></td>";for(n=0;n<countArgs+1;n++){
lCode +="<td><a href=\"\" onclick=\"Map24.dispatchEvent('"+objId+"TabTrigger"+n+"')\"><div";if(n==i)
lCode +=" style=\"font-weight:bold\"";lCode +="> | "+(n+1);if(n==countArgs)
lCode +=" |";lCode +="</div></a></td>";}
lCode +="</tr></table><br/>";return lCode;}
M24.addHTMLObject=function(props){
if(!M24.isValidObjID(props.objID))
throw new Map24.Exceptions.InvalidArgument("Invalid props.objID passed.",props.objID,"","M24.addHTMLObject");if(!M24.isValidCoordinate(props.lon,props.lat))
throw new Map24.Exceptions.InvalidArgument("Invalid coordinates (props.lon, props.lat) passed.",props.lon,"","M24.addHTMLObject");if(props.layout!=LAYOUT_BUBBLE&&props.layout!=LAYOUT_MAP24&&props.layout!=LAYOUT_PLAIN)
props.layout=LAYOUT_MAP24;if(props.size!=LAYOUT_SIZE_L&&props.size!=LAYOUT_SIZE_M&&props.size!=LAYOUT_SIZE_S)
props.size=LAYOUT_SIZE_M;_addHTMLObject({
objID:props.objID,lon:props.lon,lat:props.lat,html:props.content,layout:props.layout,size:props.size,enable:true 
});}
_addHTMLObject=function(props){
var content=M24.getToolTipLayout(props.layout,props.size);content=new String(content.replace("#HTML_PLACEHOLDER#",props.html));while(content.indexOf("#WIDTH_PLACEHOLDER#")>-1)
content=content.replace("#WIDTH_PLACEHOLDER#",M24.getDefaultLayoutSize(props.layout,props.size)[0]);while(content.indexOf("#HEIGHT_PLACEHOLDER#")>-1)
content=content.replace("#HEIGHT_PLACEHOLDER#",M24.getDefaultLayoutSize(props.layout,props.size)[1]);while(content.indexOf("#INNER_HEIGHT_PLACEHOLDER#")>-1)
content=content.replace("#INNER_HEIGHT_PLACEHOLDER#",(M24.getDefaultLayoutSize(props.layout,props.size)[2]));while(content.indexOf("#OBJID_PLACEHOLDER#")>-1)
content=content.replace("#OBJID_PLACEHOLDER#",props.objID);if(props.layout==LAYOUT_BUBBLE||props.layout==LAYOUT_PLAIN||props.layout==LAYOUT_MAP24||props.layout==''){
M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24HTMLObject({
MapObjectID:props.objID,Coordinate:new Map24.Coordinate(props.lon,props.lat),HTML:content,Orientation:new Map24.Webservices.MapObjectOrientation({
'Vertical':'TOP','Horizontal':'RIGHT','HOffset':0,'VOffset':0
})
})
);}
else{
M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24HTMLObject({
MapObjectID:props.objID,Coordinate:new Map24.Coordinate(props.lon,props.lat),HTML:content
})
);}
if(props.enable){
M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:props.objID
})
);}
if(AutoCommit)
M24.commit();}
M24.addLocationWithTooltip=function(props){
if(!M24.isValidObjID(props.locID))
throw new Map24.Exceptions.InvalidArgument("Invalid locID (props.locID) passed.",props.locID,"","M24.addLocationWithTooltip");if(!M24.isValidObjID(props.tooltipID))
throw new Map24.Exceptions.InvalidArgument("Invalid tooltipID (props.tooltipID) passed.",props.tooltipID,"","M24.addLocationWithTooltip");if(!M24.isValidCoordinate(props.lon,props.lat))
throw new Map24.Exceptions.InvalidArgument("Invalid coordinates (props.lon, props.lat) passed.",props.lon,"","M24.addLocationWithTooltip");if(props.layout!=LAYOUT_BUBBLE&&props.layout!=LAYOUT_MAP24&&props.layout!=LAYOUT_PLAIN)
props.layout=LAYOUT_MAP24;if(props.size!=LAYOUT_SIZE_L&&props.size!=LAYOUT_SIZE_M&&props.size!=LAYOUT_SIZE_S)
props.size=LAYOUT_SIZE_M;if(!(props.eventType=="OnClick"||props.eventType=="OnDblClick"||props.eventType=="OnMouseOver"))
props.eventType="OnClick";_addHTMLObject({
objID:props.tooltipID,lon:props.lon,lat:props.lat,html:props.content,layout:props.layout,size:props.size,enable:false
});_addLocationWithTooltip({
locID:props.locID,logoURL:props.logoURL,lon:props.lon,lat:props.lat,tooltipID:props.tooltipID,eventType:props.eventType
});}
_addLocationWithTooltip=function(props){
M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24Location({
MapObjectID:props.locID,Coordinate:new Map24.Coordinate(props.lon,props.lat),LogoURL:props.logoURL,Events:new Array(
new Map24.Webservices.MapObjectEvent({
ID:props.eventType,Commands:new Map24.Webservices.CommandsArray(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:props.tooltipID
})
)
})
)
})
);M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:props.locID
})
);M24.addMRC(
new Map24.Webservices.MRC.SetMapView({
ClippingWidth:new Map24.Webservices.ClippingWidth(
{MinimumWidth:5000}
),MapObjectIDs:props.locID
})
);if(AutoCommit)
M24.commit();}
_setActualTab=function(objID,objIndex){
activeTabs[0][objID]=objID+"tabbedHtmlObject_page_"+objIndex;}
_disableAllOtherTabs=function(objID,objIndex){
var amount=amountTabs[0][objID];var i=0;for(i;i<amount;i++){
M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"DISABLE",MapObjectIDs:objID+"tabbedHtmlObject_page_"+i
})
);}
M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:objID+"tabbedHtmlObject_page_"+objIndex
})
);if(AutoCommit)
M24.commit();}
M24.centerOnTabbedHTMLObject=function(objID,zoomMeters){
if(!M24.isValidObjID(objID))
throw new Map24.Exceptions.InvalidArgument("Invalid objID passed.",objID,"","M24.centerOnTabbedHTMLObject");M24.addMRC(
new Map24.Webservices.MRC.SetMapView({
ClippingWidth:new Map24.Webservices.ClippingWidth(
{MinimumWidth:zoomMeters}
),MapObjectIDs:activeTabs[0][objID]
})
);if(AutoCommit)
M24.commit();}
M24.hideTabbedHTMLObject=function(objID){
if(!M24.isValidObjID(objID))
throw new Map24.Exceptions.InvalidArgument("Invalid objID passed.",objID,"","M24.hideTabbedHTMLObject");M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"DISABLE",MapObjectIDs:activeTabs[0][objID]
})
);if(AutoCommit)
M24.commit();}
M24.showTabbedHTMLObject=function(objID){
if(!M24.isValidObjID(objID))
throw new Map24.Exceptions.InvalidArgument("Invalid objID passed.",objID,"","M24.showTabbedHTMLObject");M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:activeTabs[0][objID]
})
);if(AutoCommit)
M24.commit();}
M24.removeTabbedHTMLObject=function(objID){
if(!M24.isValidObjID(objID))
throw new Map24.Exceptions.InvalidArgument("Invalid objID passed.",objID,"","M24.removeTabbedHTMLObject");M24.addMRC(
new Map24.Webservices.MRC.RemoveMapObject({
MapObjectIDs:activeTabs[0][objID]
})
);if(AutoCommit)
M24.commit();}
M24.addTabbedHTMLObject=function(props){
if(!M24.isValidObjID(props.objID))
throw new Map24.Exceptions.InvalidArgument("Invalid props.objID passed.",props.objID,"","M24.addTabbedHTMLObject");if(!M24.isValidCoordinate(props.lon,props.lat))
throw new Map24.Exceptions.InvalidArgument("Invalid coordinates (props.lon, props.lat) passed.",props.lon,"","M24.addTabbedHTMLObject");if(props.layout!=LAYOUT_BUBBLE&&props.layout!=LAYOUT_MAP24&&props.layout!=LAYOUT_PLAIN)
props.layout=LAYOUT_MAP24;if(props.size!=LAYOUT_SIZE_L&&props.size!=LAYOUT_SIZE_M&&props.size!=LAYOUT_SIZE_S)
props.size=LAYOUT_SIZE_M;if(Map24.isNull(props.contentArr))
throw new Map24.Exceptions.InvalidArgument("Parameter contentArr is null, \"null\" or undefined.",props.contentArr,"","M24.addTabbedHTMLObject");_addTabbedHTMLObject({
objID:props.objID,lon:props.lon,lat:props.lat,contentArr:props.contentArr,layout:props.layout,size:props.size,enable:true 
});}
_addTabbedHTMLObject=function(props){
var i=0;var layout=props.layout;var size=props.size;amountTabs[0][props.objID]=props.contentArr.length;for(i;i<props.contentArr.length;i++){
var linkCode=new String();linkCode=M24.getTabbedToolTipLinkCode(i,props.contentArr.length-1,size,props.objID);var content=M24.getTabbedToolTipLayout(layout,size);var act=content.replace(/#LINK_PLACEHOLDER#/,linkCode);while(act.indexOf("#ARGS_PLACEHOLDER#")>-1)
act=act.replace("#ARGS_PLACEHOLDER#",props.contentArr[i]);while(act.indexOf("#WIDTH_PLACEHOLDER#")>-1)
act=act.replace("#WIDTH_PLACEHOLDER#",M24.getDefaultLayoutSize(layout,size)[0]);while(act.indexOf("#HEIGHT_PLACEHOLDER#")>-1)
act=act.replace("#HEIGHT_PLACEHOLDER#",M24.getDefaultLayoutSize(layout,size)[1]);while(act.indexOf("#INNER_HEIGHT_PLACEHOLDER#")>-1)
act=act.replace("#INNER_HEIGHT_PLACEHOLDER#",(M24.getDefaultLayoutSize(layout,size)[2]));while(act.indexOf("#OBJID_PLACEHOLDER#")>-1)
act=act.replace("#OBJID_PLACEHOLDER#",props.objID+"tabbedHtmlObject_page_"+i);if(layout==LAYOUT_BUBBLE||layout==LAYOUT_PLAIN||layout==LAYOUT_MAP24){
Map24.dump(act);M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24HTMLObject({
MapObjectID:props.objID+"tabbedHtmlObject_page_"+i,Coordinate:new Map24.Coordinate(props.lon,props.lat),HTML:act,Orientation:new Map24.Webservices.MapObjectOrientation({
'Vertical':'TOP','Horizontal':'RIGHT','HOffset':0,'VOffset':0
})
})
);}
else{
M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24HTMLObject({
MapObjectID:props.objID+"tabbedHtmlObject_page_"+i,Coordinate:new Map24.Coordinate(props.lon,props.lat),HTML:act
})
);}
M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24Location({
MapObjectID:props.objID+"TabTrigger"+i,Coordinate:new Map24.Coordinate(0,0),Events:new Array(
new Map24.Webservices.MapObjectEvent({
ID:"OnClick",Commands:new Map24.Webservices.CommandsArray(
new Map24.Webservices.MRC.Surf({
URL:"javascript:_disableAllOtherTabs("+"\""+props.objID+"\""+","+"\""+i+"\""+");"
}),new Map24.Webservices.MRC.Surf({
URL:"javascript:_setActualTab("+"\""+props.objID+"\""+","+"\""+i+"\""+");"
})
)
})
)
})
);}
if(props.enable){
M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:props.objID+"tabbedHtmlObject_page_0"
})
);}
_setActualTab(props.objID,0);if(AutoCommit)
M24.commit();}
M24.addLocationWithTabbedTooltip=function(props){
if(!M24.isValidObjID(props.locID))
throw new Map24.Exceptions.InvalidArgument("Invalid locID (props.locID) passed.",props.locID,"","M24.addLocationWithTooltip");if(!M24.isValidObjID(props.tooltipID))
throw new Map24.Exceptions.InvalidArgument("Invalid tooltipID (props.tooltipID) passed.",props.tooltipID,"","M24.addLocationWithTooltip");if(!M24.isValidCoordinate(props.lon,props.lat))
throw new Map24.Exceptions.InvalidArgument("Invalid coordinates (props.lon, props.lat) passed.",props.lon,"","M24.addLocationWithTooltip");if(props.layout!=LAYOUT_BUBBLE&&props.layout!=LAYOUT_MAP24&&props.layout!=LAYOUT_PLAIN)
props.layout=LAYOUT_MAP24;if(props.size!=LAYOUT_SIZE_L&&props.size!=LAYOUT_SIZE_M&&props.size!=LAYOUT_SIZE_S)
props.size=LAYOUT_SIZE_M;if(!(props.eventType=="OnClick"||props.eventType=="OnDblClick"||props.eventType=="OnMouseOver"))
props.eventType="OnClick";_addTabbedHTMLObject({
objID:props.tooltipID,lon:props.lon,lat:props.lat,contentArr:props.contentArr,layout:props.layout,size:props.size,enable:false
});_addLocationWithTabbedTooltip({
locID:props.locID,logoURL:props.logoURL,lon:props.lon,lat:props.lat,tooltipID:props.tooltipID,eventType:props.eventType
});}
_addLocationWithTabbedTooltip=function(props){
M24.addMRC(
new Map24.Webservices.MRC.DeclareMap24Location({
MapObjectID:props.locID,Coordinate:new Map24.Coordinate(props.lon,props.lat),LogoURL:props.logoURL,Events:new Array(
new Map24.Webservices.MapObjectEvent({
ID:props.eventType,Commands:new Map24.Webservices.CommandsArray(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:activeTabs[0][props.tooltipID]
})
)
})
)
})
);M24.addMRC(
new Map24.Webservices.MRC.ControlMapObject({
Control:"ENABLE",MapObjectIDs:props.locID
})
);if(AutoCommit)
M24.commit();}

