﻿function GetMapDiv()
{
    return document.getElementById('divMap');
}
     
function setMapImage(imageUrl)
{
    var divMap = GetMapDiv();
    divMap.style.backgroundImage = 'url(' + imageUrl + ')';
}

function addAreaToMap(areaTitle, markLeft, markTop, titleLeft, titleTop, stateIdEnteredByUser, areaIdEnteredByUser, url)
{
    var divMap = GetMapDiv();
    
    var m = new Image();
    m.src = "../../../../Images/AreaPositioning/Marker.gif?v=3";
    m.style.left = markLeft + "px";
    m.style.top = markTop + "px";
    m.style.position = 'absolute';
    m.style.border = 'none';
    m.style.cursor = 'pointer';
    
    if (url == null)
    { 
        url = '../' + stateIdEnteredByUser + '/' + areaIdEnteredByUser + '/' + 'Clinics.aspx';
    }
    m.onclick = function(){location.href = url;}
    
	var color = 'black';
	
	var t = document.createElement("span");
    t.style.left = titleLeft + "px";
    t.style.top = titleTop + "px";
    t.style.position = 'absolute';
    t.style.cursor = 'default';
    t.style.cursor = 'pointer';
    t.style.color = color;
    t.innerHTML = areaTitle;
    t.onclick = function(){location.href = url;}
    
    divMap.appendChild(m);
    divMap.appendChild(t);
}


