﻿// JScript File for VEMap3D


//This function adds the MapDotNet Logo to the map
function AddLogo()
{
    var browser;
    var theMap = document.getElementById("theMapTop");//If you change the name of the mapdiv then this needs to be changed.
    if (window.ActiveXObject) { browser = 'ie'; }
    else if (document.implementation && document.implementation.createDocument) { browser='moz'; }
    
    var myLogo;
    if(browser == 'ie')
    {
        myLogo = document.createElement("DIV");
        myLogo.className="mdnlogo mdnlogo_ie";
        myLogo.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Images/mdn-logo-glow12small.png', sizingMethod='scale')";
        myLogo.style.display = "block";
        myLogo.style.left = "100px";
        myLogo.style.bottom = "8px";
        
    }else
    {
        myLogo = document.createElement("IMG");
        myLogo.className="mdnlogo";
        myLogo.src = "Images/mdn-logo-glow12small.png";
        myLogo.style.display = "block";
        myLogo.style.left = "100px";
        myLogo.style.bottom = "8px";
        myLogo.style.height = "33px";
    }
    
    theMap.appendChild(myLogo);
}

// mouse hover drill-down now emitted if needed


// handle browser resize
function MDNBrowserResizeWrapper()
{
    var w = COMGetMapWidth();
    var h = COMGetMapHeight();
    
    if (w < 100) {w = 100;}
    if (h < 100) {h = 100;}
    
    var mapDiv = document.getElementById( MDNGetVEMapContainerID() );
   
    mapDiv.style.width = w + 'px';
    mapDiv.style.height = h + 'px';
    
    MDNGetVEMap().Resize(w, h);
    if(w<640){w=640;}
    document.getElementById('routingDiv').style.width = w +"px";
    if(document.getElementById('routingDiv').style.height != "75px")
    {
        document.getElementById('routingDiv').style.height = h +"px";
        document.getElementById('drivingDirectionsDiv').style.height = h-95+"px";
         document.getElementById('drivingDirectionsDiv').style.width = w - 20+"px";
        document.getElementById('drivingDirectionsDiv').style.overflow = "scroll";
    }
    
    MDNEndEnvChange();
}