
function reverse()
{var to=document.getElementById("textbox_to_address").value;var from=document.getElementById("textbox_from_address").value;if(document.getElementById("textbox_to_address").readOnly)
{document.getElementById("textbox_from_address").readOnly=true;document.getElementById("textbox_to_address").readOnly=false;}
else
{document.getElementById("textbox_from_address").readOnly=false;document.getElementById("textbox_to_address").readOnly=true;}
document.getElementById("textbox_to_address").value=from;document.getElementById("textbox_from_address").value=to;}
function MyHandleTokenError()
{alert("Map token is invalid.");}
function MyHandleTokenExpire()
{alert("Map token has expired.");}
function AddPinCenter(map,title,description)
{var icon="/g/map/arrow-lg.gif";var pin=new VECustomIconSpecification();pin.Image=icon;pin.TextContent=" ";pin.ImageOffset=new VEPixel(1,-2);shape=new VEShape(VEShapeType.Pushpin,map.GetCenter());shape.SetCustomIcon(pin);shape.SetTitle(title);shape.SetDescription(description);map.AddShape(shape);}
function AddPin(map,latitude,longitude,number,title,description)
{var icon="<span class='ve_pin'>&nbsp;"+number+"&nbsp;</span>";var pin=new VECustomIconSpecification();pin.CustomHTML=icon;var latlong=new VELatLong(latitude,longitude);var shape=new VEShape(VEShapeType.Pushpin,latlong);shape.SetCustomIcon(pin);shape.SetTitle(title);shape.SetDescription(description);map.AddShape(shape);}
function Zoom(map,level)
{map.SetZoomLevel(level);}
function querySt(ji){hu=window.location.search.substring(1);gy=hu.split("&");for(i=0;i<gy.length;i++){ft=gy[i].split("=");if(ft[0]==ji){if(ft[1].length>0){return ft[1];}}}}
function InitMap(mapDiv)
{map=new VEMap(mapDiv);map.SetDashboardSize(VEDashboardSize.Tiny);map.LoadMap();AddLogos(mapDiv);}
function InitMapWithAddr(mapDiv,address)
{HideMap(mapDiv);map=new VEMap(mapDiv);map.SetDashboardSize(VEDashboardSize.Tiny);map.LoadMap();FindAddress(map,address,FindCallback);}
function InitMapWithLatLong(mapDiv,latitude,longitude)
{var latLon=new VELatLong(latitude,longitude);map=new VEMap(mapDiv);map.SetDashboardSize(VEDashboardSize.Tiny);map.LoadMap(latLon,15);AddPushpin(map,latLon.Latitude,latLon.Longitude,"","Testing.1.2.3.","/resources/images/local.com.pushpin.gif");AddLogos(mapDiv);}
function AddLogos(mapDiv,veDiv,localDiv)
{var veLogoEl=document.getElementById(veDiv);var localLogoEl=document.getElementById(localDiv);var mapEl=document.getElementById(mapDiv);mapEl.appendChild(veLogoEl);mapEl.appendChild(localLogoEl);veLogoEl.style.display="";localLogoEl.style.display="";}
function FindAddress(map,address,callback)
{map.Find(null,address,null,null,null,null,true,false,false,false,callback);}
function FindCallback(shape,results,place)
{map.Clear();var latlong=place[0].LatLong;var content="FindCallBack";AddPushpin(map,latlong.Latitude,latlong.Longitude,"Latitude: "+latlong.Latitude+" - Longitude: "+latlong.Longitude,content,"/resources/images/local.com.pushpin.gif");AddLogos("vemDefault");map.SetCenterAndZoom(latlong,15);ShowMap("vemDefault");}
function ShowMap(mapDiv)
{var mapEl=document.getElementById(mapDiv).style.visibility="visible";}
function HideMap(mapDiv)
{var mapEl=document.getElementById(mapDiv).style.visibility="hidden";}
function AddPushpin(map,latitude,longitude,title,description,icon)
{var latlong=new VELatLong(latitude,longitude);var shape=new VEShape(VEShapeType.Pushpin,latlong);map.ClearInfoBoxStyles();shape.SetTitle(title);shape.SetDescription(description);if(icon)
{shape.SetCustomIcon(icon);}
map.AddShape(shape);}