    function initializeGooglePlusOne(div_id) {
    	if (jQuery.browser.msie && (jQuery.browser.version.slice(0,1) < 9)) return;
        if (div_id == undefined) div_id = "google-plusone";

        if (googlePlusIsInit==true){
        	if (gapi != undefined){
        		gapi.plusone.render(div_id, {"size": "standard", "annotation":"none"});
        	}
        }
        else{
        	var iterations=0;
        	var interval = setInterval(function(){
        		iterations++;
        		if (iterations>100) clearInterval (interval);
                if (googlePlusIsInit==true){
                	if (gapi != undefined){
	                	clearInterval (interval);
	                	gapi.plusone.render(div_id, {"size": "standard", "annotation":"none"});
                	}
                }
        	},500);
        }
    }

    function getCoords(address) {
        gMAP_geocoder = new google.maps.Geocoder();
        gMAP_geocoder.geocode( {'address': address}, function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                gMAP_initLat = results[0].geometry.location.lat().toFixed(6);
                gMAP_initLng = results[0].geometry.location.lng().toFixed(6);
                locationAddress = "";

                //set this position to current location
                $.post('/site/setLocationPosition',
                    {'lat': gMAP_initLat, 'lng': gMAP_initLng, 'location_id' : gMAP_initLocationId},
                    initializeGoogleMap
                );
            }
        });
        return false;
    }

    function initializeGoogleMap() {
        if (gMAP_initId == undefined) gMAP_initId = 0;
        if ((!gMAP_initLat || !gMAP_initLng) && gMAP_locationAddress) {
            getCoords(gMAP_locationAddress);
            return false;
        }

        if (gMAP_initLat && gMAP_initLng) {
            $("#google-map"+gMAP_initId).css("width", "385px");
            $("#google-map"+gMAP_initId).css("height", "230px");

            var myOptions = {
                    zoom: 5,
                    mapTypeId: google.maps.MapTypeId.ROADMAP,
                    
                    panControl: true,
                    panControlOptions: {},

                    zoomControl: true,
                    zoomControlOptions: {
                        position: google.maps.ControlPosition.LEFT_TOP
                    },

                    mapTypeControl: false,
                    scaleControl: false,
                    streetViewControl: false,
                    overviewMapControl: true,
                    scrollwheel: false,
                    draggableCursor: 'pointer'
            };

            gMAP_map = new google.maps.Map(document.getElementById("google-map"+gMAP_initId),myOptions);
            pointer = new google.maps.LatLng(gMAP_initLat, gMAP_initLng);
            gMAP_map.setCenter(pointer);

            var marker = new google.maps.Marker({
                position: new google.maps.LatLng(gMAP_initLat, gMAP_initLng)
            });
            marker.setMap(gMAP_map);
            
            google.maps.event.addListener(gMAP_map, 'mousedown', function(event) {
                gMAP_map.setOptions({ draggableCursor: 'hand', scrollwheel: true });
            });
        }
    }

    /*
    $(document).ready(function() {
        if( $("#map_canvas").length > 0 ) {
            var latlng = new google.maps.LatLng(-34.397, 150.644);
            var myOptions = {
                zoom: 8,
                center: latlng,
                mapTypeId: google.maps.MapTypeId.ROADMAP,
                panControl: true,
                panControlOptions: {
                    // position: google.maps.ControlPosition.LEFT_TOP
                },
                zoomControl: true,
                zoomControlOptions: {
                    //style: google.maps.ZoomControlStyle.LARGE,
                    position: google.maps.ControlPosition.LEFT_TOP
                },
                mapTypeControl: false,
                scaleControl: false,
                streetViewControl: false,
                overviewMapControl: true
            };
            var map = new google.maps.Map($("#map_canvas"), myOptions);
        }
    });
     */

