/*
 * Google maps for AVE
 *
 * javascript loading
 *
 */


var geocoder;
var map;

function gmInitialize() {
        geocoder = new google.maps.Geocoder();
        var latlng = new google.maps.LatLng(49.339441,16.924438);
        var myOptions = {
                zoom: 6,
                center: latlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP
        }

        map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
}


function gmCodeAddress(address) {
        if (geocoder) {
                geocoder.geocode( { 'address': address}, function(results, status) {
                        if (status == google.maps.GeocoderStatus.OK) {
                                map.setCenter(results[0].geometry.location);
                                map.setZoom(15);

                                var marker = new google.maps.Marker({
                                        map: map,
                                        position: results[0].geometry.location,
                                        color: "blue"
                                });
                        }
                });
        }
}
