var SatMapWrapper = function () {
    satMap = new GMap2(document.getElementById("sat"));
    satMap.setCenter(new GLatLng(DEFAULT_LOCATION.latitude,DEFAULT_LOCATION.longitude), 3);
	satMap.disableDragging();
	satMap.disableDoubleClickZoom();
};
SatMapWrapper.prototype.show = function () {
	this.active = true;
	$('satContainer').show();
	var areaOffset = Element.cumulativeOffset($('satContainer'));
    $('sat').style.top = (areaOffset[1]) + 'px';
    $('sat').style.left = (areaOffset[0]) + 'px';	
};
SatMapWrapper.prototype.hide = function () {
	this.active = false;
	$('satContainer').hide();
	$('sat').style.left = '-400px';
};
SatMapWrapper.prototype.setSat = function (sat) {
	this._createMarker(sat.iconUrl);
};
SatMapWrapper.prototype.setCenter = function (latLng) {
	satMap.setCenter(latLng);
}
SatMapWrapper.prototype.moveIcon = function (latitude,longitude) {
	this.marker.setPoint(new GLatLng(latitude,longitude));
	//satMap.setCenter(new GLatLng(latitude,longitude));
	this.marker.show();
};
SatMapWrapper.prototype.reset = function () {
};
/**
 * Tabs
 */
SatMapWrapper.prototype.escape = function () {
	$('satContainer').hide();
	$('sat').style.left = '-400px';
};
SatMapWrapper.prototype.restore = function () {
	if (this.active && menu.isCurrentModeDetail()) this.show();
};
SatMapWrapper.prototype._createMarker = function (url) {
	if (this.marker)
		satMap.removeOverlay(this.marker);
	this.marker = null;
	var icon = new GIcon();
    icon.image = url; 
    icon.iconAnchor = new GPoint(16, 16);
    var markeropts = new Object();
    markeropts.icon = icon;
	this.marker = new GMarker(new GLatLng(0,0),markeropts);
	satMap.addOverlay(this.marker);	
	this.marker.hide();
}
