﻿// JScript File
var map;
var icon;
    
function load() {
    if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map"));
        map.addControl(new GLargeMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(38, -110), 5);
        
        //Create Marker Icon
        icon = new GIcon();
        icon.image = "../images/markers/gray.png";
        icon.shadow = "../images/markers/shadow.png";
        icon.iconSize = new GSize(20, 34);
        icon.shadowSize = new GSize(37, 34);
        icon.iconAnchor = new GPoint(10, 34);
        icon.infoWindowAnchor = new GPoint(10, 1);
    }
}

function createMarker5(latitude,longitude,description,marker,shadow)
{
    var variable;
    var point = new GLatLng(latitude,longitude);
    icon.image = "../images/markers/" + marker;
    icon.shadow = "../images/markers/" + shadow;
    icon.iconSize = new GSize(32, 32);
    icon.shadowSize = new GSize(59, 32);
    icon.iconAnchor = new GPoint(16, 32);
    icon.infoWindowAnchor = new GPoint(16, 1);
    var marker = new GMarker(point,icon);
    GEvent.addListener(marker, "mouseover", function() {
        variable=true;
        setTimeout(function(){
            if(variable)
                marker.openInfoWindowHtml(description);
        },2000);     
    });
    GEvent.addListener(marker, "mouseout", function() {
        variable = false;});
    GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(description);   
    });
    map.addOverlay(marker);
}

function createMarker4(latitude,longitude,description,marker)
{
    var variable;
    var point = new GLatLng(latitude,longitude);
    icon.image = "../images/markers/" + marker;
    icon.iconSize = new GSize(22, 34);
    icon.shadowSize = new GSize(37, 34);
    icon.iconAnchor = new GPoint(11, 34);
    icon.infoWindowAnchor = new GPoint(11, 1);
    var marker = new GMarker(point,icon);
    GEvent.addListener(marker, "mouseover", function() {
        variable=true;
        setTimeout(function(){
            if(variable)
                marker.openInfoWindowHtml(description);
        },2000);     
    });
    GEvent.addListener(marker, "mouseout", function() {
        variable = false;});
    GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(description);   
    });
    map.addOverlay(marker);
}

function createMarker3(latitude,longitude,description,marker,size)
{
    var variable;
    var point = new GLatLng(latitude,longitude);
    icon.image = "../images/markers/" + marker;
    if(size == 1)
    {
        icon.iconSize = new GSize(12,20);
        icon.shadowSize = new GSize(22,20);
        icon.iconAnchor = new GPoint(6,20);
        icon.infoWindowAnchor = new GPoint(6,1);
    }
    else if(size == 2)
    {
        icon.iconSize = new GSize(15,25);
        icon.shadowSize = new GSize(30,25);
        icon.iconAnchor = new GPoint(8,25);
        icon.infoWindowAnchor = new GPoint(8,1);
    }
    else
    {
        icon.iconSize = new GSize(20, 34);
        icon.shadowSize = new GSize(37, 34);
        icon.iconAnchor = new GPoint(10, 34);
        icon.infoWindowAnchor = new GPoint(10, 1);
    }
    var marker = new GMarker(point,icon);
    GEvent.addListener(marker, "mouseover", function() {
        variable=true;
        setTimeout(function(){
            if(variable)
                marker.openInfoWindowHtml(description);
        },2000);     
    });
    GEvent.addListener(marker, "mouseout", function() {
        variable = false;});
    GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(description);   
    });
    map.addOverlay(marker);
}
    
function createMarker2(latitude,longitude,description,marker)
{
    var variable;
    var point = new GLatLng(latitude,longitude);
    icon.image = "../images/markers/" + marker;
    icon.iconSize = new GSize(20, 34);
    icon.shadowSize = new GSize(37, 34);
    icon.iconAnchor = new GPoint(10, 34);
    icon.infoWindowAnchor = new GPoint(10, 1);
    var marker = new GMarker(point,icon);
    GEvent.addListener(marker, "mouseover", function() {
        variable=true;
        setTimeout(function(){
            if(variable)
                marker.openInfoWindowHtml(description);
        },2000);     
    });
    GEvent.addListener(marker, "mouseout", function() {
        variable = false;});
    GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(description);   
    });
    map.addOverlay(marker);
}

function createMarker(latitude,longitude,description)
{
    var point = new GLatLng(latitude,longitude);
    var marker = new GMarker(point);
    GEvent.addListener(marker, "mouseover", function() {
        variable=true;
        setTimeout(function(){
            if(variable)
                marker.openInfoWindowHtml(description);
        },2000);     
    });
    GEvent.addListener(marker, "mouseout", function() {
        variable = false;});
    GEvent.addListener(marker, "click", function() {
        marker.openInfoWindowHtml(description);   
    });
    map.addOverlay(marker);
}