var map=null

function GetMap(){
var ffv=0
var ffn="Firefox/"
var ffp=navigator.userAgent.indexOf(ffn)
if(ffp !=-1)ffv=parseFloat(navigator.userAgent.substring(ffp+ffn.length))
if(ffv>=1.5){
Msn.Drawing.Graphic.CreateGraphic=function(f,b){return new Msn.Drawing.SVGGraphic(f,b)}}
map=new VEMap('myMap')
map.LoadMap(new VELatLong(-80.059,26.4611),5,'h',false)
map.SetScaleBarDistanceUnit(VEDistanceUnit.Kilometers)
map.DisambiguationCallback=Disambiguation
map.ShowDisambiguationDialog(false)
//map.AttachEvent('oninitmode',ModeChange)
//map.AttachEvent('onclick',SetDelayedFocus)
//map.AddControl(document.getElementById("mySearch"))
//map.AddControl(document.getElementById("myDisambiguation"))
//AddShim(document.getElementById("mySearch"),"mySearchShim")
SetFocus()
}


//function ResizeMap(){
//if(map !=null){
//if(typeof(window.innerWidth)=='number'){
//map.Resize(window.innerWidth,window.innerHeight)}
//else if(document.documentElement&&(document.documentElement.clientWidth || document.documentElement.clientHeight)){
//map.Resize(document.documentElement.clientWidth,document.documentElement.clientHeight)}
//}
//}

//function UnloadMap(){
//if(map !=null){
//map.Dispose()}
//}

//function Keypress(e){
//if(e.keyCode==13){
//Search(document.getElementById('SearchInput').value)}
//}

//function Search(s){
//DisambiguationClose()
//if(s !=''){
//map.Find(null,s,1,SearchResults)}}

//function SearchResultsXXX(results){
//map.Clear()
//map.AddPushpin(new VEPushpin("sPin",results[0].LatLong,"arrow.gif","","","PP"))}

function Disambiguation(e){
//var r="<div style='float:left'>Multiple results. Choose or refine search.</div><div style='float:right;cursor:pointer;' onclick='DisambiguationClose();'>X</div><br />"
//for(x=0;x<e.length;x++){
//r+="<a onclick='Search(\""+e[x].ID+"\");' href='#'>"+e[x].ID+"</a><br>"}
//document.getElementById('myDisambiguation').innerHTML=r
//document.getElementById('myDisambiguation').style.display="block"
//AddShim(document.getElementById("myDisambiguation"),"myDisambiguationShim")
}

function DisambiguationClose(){
//document.getElementById("myDisambiguation").style.display="none"
//RemoveShim("myDisambiguationShim")
}

function AddShim(el,sid){
//if(map.GetMapMode()==VEMapMode.Mode3D){
//var s=document.createElement("iframe")
//s.id=sid
//s.frameBorder="0"
//s.style.position="absolute"
//s.style.zIndex="1"
//s.style.top=el.offsetTop
//s.style.left=el.offsetLeft
//s.width=el.offsetWidth
//s.height=el.offsetHeight
//s.scrolling="no"
//s.className="Shim"
//el.shimElement=s
//el.parentNode.insertBefore(s,el)}
}

function RemoveShim(sid){
//var msh=document.getElementById(sid)
//if(msh!=null)msh.parentNode.removeChild(msh)
//msh=null
}

function ModeChange(){
//if(map.GetMapMode()==VEMapMode.Mode3D){
//AddShim(document.getElementById("mySearch"),"mySearchShim")
//if(document.getElementById("myDisambiguation").style.display=="block"){
//AddShim(document.getElementById("myDisambiguation"),"myDisambiguationShim")}
//}else{
//RemoveShim("mySearchShim")
//RemoveShim("myDisambiguationShim")}
}

function GetLocation(){
//if(document.getElementById('myDisambiguation').style.display=="none"){
//var mc=map.GetCenter()
//var mla=mc.Latitude
//var mlo=mc.Longitude
//var s=""
//if(mla<-8.67&&mla>-45.34&&mlo>110.92&&mlo<158.20){
//if(mlo<129){
//if(s.indexOf("WA")==-1)
//s=s+", WA"
//}else if(mlo<138&&mla>-26){
//if(s.indexOf("NT")==-1)
//s=s+", NT"
//}else if(mlo<141&&mla<-26){
//if(s.indexOf("SA")==-1)
//s=s+", SA"
//}else if(mla>-28.23){
//if(s.indexOf("QLD")==-1)
//s=s+", QLD"
//}else if(mla>-36.8){
//if(mla<-35.16&&mla>-35.93&&mlo>148.8&&mlo<149.21){
//if(s.indexOf("ACT")==-1)
//s=s+", ACT"
//}else{
//if(s.indexOf("NSW")==-1)
//s=s+", NSW"}
//}else if(mla>-40){
//if(s.indexOf("VIC")==-1)
//s=s+", VIC"
//}else{
//if(s.indexOf("TAS")==-1)
//s=s+", TAS"}
//if(s.indexOf("AUS")==-1)
//s=s+", AUS"}
//document.getElementById("SearchInput").value=s
//SetFocus()}
}

function SetFocus(){
//var elm=document.getElementById("SearchInput")
//if(elm.setSelectionRange){
//elm.focus()
//elm.setSelectionRange(0,0)}
//else if(elm.createTextRange){
//var r=elm.createTextRange()
//r.collapse(true)
//r.moveEnd('character',0)
//r.moveStart('character',0)
//r.select()}
}

function SetDelayedFocus(){
if(map.GetMapMode()!=VEMapMode.Mode3D){
setTimeout("SetFocus()",100)}
}

