function ShowHideMap(id, Callback) {
    if ($('#' + id).is(":hidden")) {
        $('#' + id).height("280px");
        $('#' + id).slideDown("slow"/*, function() { Callback.call(); }*/);
        Callback.call();
    }
    else {
        $('#' + id).slideUp("slow");
    }
}

function createMarker(point, balloonmessage) {
  var baseIcon = new GIcon(G_DEFAULT_ICON);
  baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
  baseIcon.iconSize = new GSize(20, 34);
  baseIcon.shadowSize = new GSize(37, 34);
  baseIcon.iconAnchor = new GPoint(9, 34);
  baseIcon.infoWindowAnchor = new GPoint(9, 2);
  var letteredIcon = new GIcon(baseIcon);
  letteredIcon.image = "http://www.google.com/mapfiles/marker.png";

  // Set up our GMarkerOptions object
  markerOptions = { icon:letteredIcon };
  var marker = new GMarker(point, markerOptions);
  //marker.openInfoWindowHtml(balloonmessage);

  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(balloonmessage);
  });
  return marker;
}

function GenerateGMapsObject(div, latlng, markertext) {
    div.style.width = '408px'; div.style.height = '280px';
    MapObject = new GMap2(div);
    MapObject.setCenter(latlng, 14);
    MapObject.addControl(new GSmallMapControl());
    MapObject.addControl(new GMapTypeControl());
    MapObject.setMapType(G_HYBRID_MAP);
    var MarkerHQ = createMarker(latlng, markertext);
    MapObject.addOverlay(MarkerHQ);
    MarkerHQ.openInfoWindowHtml(markertext);
    MapObject.checkResize();
}

function InitializeHQ(){
    /*var MapDivisionHQ = document.getElementById('map_hq');
    MapDivisionHQ.style.width = '408px'; MapDivisionHQ.style.height = '280px';
    MapHQ = new GMap2(MapDivisionHQ);
    latlngHQ = new GLatLng(41.021922, 29.043667);
    MapHQ.setCenter(latlngHQ, 14);
    MapHQ.addControl(new GSmallMapControl());
    MapHQ.addControl(new GMapTypeControl());
    MapHQ.setMapType(G_HYBRID_MAP);
    var MarkerHQ = createMarker(latlngHQ, 'GENEL MUDURLUK');
    MapHQ.addOverlay(MarkerHQ);
    MarkerHQ.openInfoWindowHtml('GENEL MUDURLUK');
    MapHQ.checkResize();*/
    GenerateGMapsObject(document.getElementById('map_hq'), new GLatLng(41.021922, 29.043667), 'GENEL MUDURLUK');
}
//InitializeHQ()

function InitializeGDA(){
	/*var MapDivisionGDA = document.getElementById('map_gda');
	MapDivisionGDA.style.width = '408px'; MapDivisionGDA.style.height = '280px';
	MapGDA = new GMap2(MapDivisionGDA);
	latlngGDA = new GLatLng(36.993401, 35.325336);
	MapGDA.setCenter(latlngGDA, 14);
	MapGDA.addControl(new GSmallMapControl());
	MapGDA.addControl(new GMapTypeControl());
	MapGDA.setMapType(G_HYBRID_MAP);
	var MarkerGDA = createMarker(latlngGDA, 'GUNEY VE DOGU ANADOLU BOLGE MUDURLUGU');
	MapGDA.addOverlay(MarkerGDA);
	MarkerGDA.openInfoWindowHtml('GUNEY VE DOGU ANADOLU BOLGE MUDURLUGU');
	MapGDA.checkResize();*/
    GenerateGMapsObject(document.getElementById('map_gda'), new GLatLng(36.993401, 35.325336), 'GUNEY VE DOGU ANADOLU BOLGE MUDURLUGU');
}
//InitializeGDA();

function InitializeEGE(){
	/*var MapDivisionEGE = document.getElementById('map_ege');
	MapDivisionEGE.style.width = '408px'; MapDivisionEGE.style.height = '280px';
	MapEGE = new GMap2(MapDivisionEGE);
	latlngEGE = new GLatLng(38.428723, 27.135587);
	MapEGE.setCenter(latlngEGE, 14);
	//MapDivisionEGE.style.display = 'none';
	MapEGE.addControl(new GSmallMapControl());
	MapEGE.addControl(new GMapTypeControl());
	MapEGE.setMapType(G_HYBRID_MAP);
	var MarkerEGE = createMarker(latlngEGE, 'EGE BOLGE MUDURLUGU');
	MapEGE.addOverlay(MarkerEGE);
	MarkerEGE.openInfoWindowHtml('EGE BOLGE MUDURLUGU');
	MapEGE.checkResize();*/
    GenerateGMapsObject(document.getElementById('map_ege'), new GLatLng(38.428723, 27.135587), 'EGE BOLGE MUDURLUGU');
}
//InitializeEGE();