var map = null;

	function loadMap() {            

            var myOptions = {
                zoom:16,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                mapTypeControl:false,
                navigationControl:true,
                navigationControlOptions : {style: google.maps.NavigationControlStyle.SMALL}
            }
            map = new google.maps.Map(document.getElementById("map"), myOptions);

            
        }

        function setMapCenter(centerPoint) {

            var pointMT = new google.maps.LatLng(45.5024299, -73.5759860);
            var pointNE = new google.maps.LatLng(43.6548473, -70.2547699);
            var pointNY = new google.maps.LatLng(42.6815017, -73.7916626);
            var pointEU = new google.maps.LatLng(48.8843034, 2.2611077);
            
            var customIcon = new google.maps.MarkerImage(
            '<content:contextURL/>/img/marker_icon_02.png',
            new google.maps.Size(16, 16),
            new google.maps.Point(0,0),
            new google.maps.Point(0, 16));

            if(centerPoint == "MT") {
                map.setCenter(pointMT);
                var marker = new google.maps.Marker({ icon:customIcon, position:pointMT, map:map });
            } else if(centerPoint == "NE") {
                map.setCenter(pointNE);
                var marker = new google.maps.Marker({ icon:customIcon, position:pointNE, map:map });
            } else if(centerPoint == "NY") {
                map.setCenter(pointNY);
                var marker = new google.maps.Marker({ icon:customIcon, position:pointNY, map:map });
            } else if(centerPoint == "EU") {
                map.setCenter(pointEU);
                var marker = new google.maps.Marker({ icon:customIcon, position:pointEU, map:map });
            }
        }


        var popupStatus = 0;

        function loadPopup(centerPoint) {
            if(popupStatus==0){
                setMapCenter(centerPoint);
                if($("#popup").css('visibility') == 'hidden') {
                    $("#popup").css('visibility','visible');
                }
                $("#popup").fadeIn("slow");
                popupStatus = 1;
            }
        }

        function disablePopup(){

            if(popupStatus==1){
                $("#popup").fadeOut("slow");
                popupStatus = 0;
            }
        }


