// A TextualZoomControl is a GControl that displays textual "Zoom In"
// and "Zoom Out" buttons (as opposed to the iconic buttons used in
// Google Maps).
function ExpandControl() {
}


function customizeGeoMashup(mashup) {
//		mashup.map.MapTypeControl(GHierarchicalMapTypeControl)
		mashup.map.addMapType(G_PHYSICAL_MAP)
		
    ExpandControl.prototype = new GControl();

    ExpandControl.prototype.initialize = function(map) {
        var container = document.createElement("div");

        container.title = "Expand Map";
        this.setOuterStyle_(container);
        var zoomInDiv = document.createElement("div");
        this.setInnerStyle_(zoomInDiv);
        container.appendChild(zoomInDiv);
        zoomInDiv.appendChild(document.createTextNode("Expand"));
        GEvent.addDomListener(zoomInDiv, "click", function() {
            var g = document.getElementById("geoMashup");
            var center = map.getCenter();
            if (container.title == "Expand Map") {
                container.title = "Shrink Map";
                zoomInDiv.innerHTML = "Shrink";
                g.style.height = "540px";
            } else {
                container.title = "Expand Map";
                zoomInDiv.innerHTML = "Expand";
                g.style.height = "175px";
            }
            map.checkResize();
            map.setCenter(center);
        });

        map.getContainer().appendChild(container);
        return container;
    }

    ExpandControl.prototype.getDefaultPosition = function() {
        return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(7, 7));
    }

    ExpandControl.prototype.setOuterStyle_ = function(button) {
        button.style.backgroundColor = "white";
        button.style.fontFamily = "Arial, sans-serif";
        button.style.fontSize = "12px";
        button.style.border = "1px solid black";
        button.style.textAlign = "center";
        button.style.width = "5.5em";
        button.style.cursor = "pointer";
    }     

    ExpandControl.prototype.setInnerStyle_ = function(button) {
        button.style.backgroundColor = "white";
        button.style.fontFamily = "Arial, sans-serif";
        button.style.fontSize = "12px";
        button.style.borderStyle = "solid";
        button.style.borderColor = "white #B0B0B0 #B0B0B0 white";
        button.style.borderWidth = "1px";
    }    

mashup.map.addControl(new ExpandControl());

}
