function ShowMap( Elem) {

    this.element= Elem;
    this.show();
}

function ShowCityMap( Elem ) {
this.element= Elem;
	this.show();
}    


function CloseObjects() {
}

CloseObjects.prototype = new GControl();
CloseObjects.prototype.initialize = function(map) {
    var container = document.createElement("div");
    var zoomInDiv2 = document.createElement("div");
    
    container.appendChild(zoomInDiv2);

    
    
    map.getContainer().appendChild(container);
    return container;
}
CloseObjects.prototype.getDefaultPosition = function() {
    return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(7, 7));
}


ShowMap.prototype.show = function() {
    if (GBrowserIsCompatible()) {
	var map   = new GMap2( this.element );
	//srodek mapy
	var center = new GLatLng(50.36583176765975, 19.091835021972656);	
	
	//lotnisko
	var point = new GLatLng(50.4712177107157, 19.074068069458008);
	
	//villa ewa
	var point1 = new GLatLng(50.2582517, 19.0366317);
	
	//szydlowski
	var point2 = new GLatLng(50.2611681, 19.0333574);
	
	//villa lena
	var point3 = new GLatLng(50.2615887, 19.0248545);
	
	//dal
	var point4 = new GLatLng(50.2621263, 19.0235719);
	
	//villa karolina
	var point5 = new GLatLng(50.2577268, 19.0227288);
	
	//gryf
	var point6 = new GLatLng(50.2578311, 19.0223089);
	
	//parking1
	var point7 = new GLatLng(50.47077043943829, 19.07277524471283);
	
	//parking2
	var point8 = new GLatLng(50.47067483892174, 19.07353699207306);
	
	//parking3
	var point9 = new GLatLng(50.47053826641996, 19.07351553440094);
	
	map.setCenter( center, 10 ); //zoom
	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());

    scale = new GScaleControl(); 
    scale.printable=function(){return true}; 
    map.addControl(scale); 
    
    map.addControl(new CloseObjects());
	//		map.addControl(new GMapTypeControl());

	var lotnisko = new GIcon();
	lotnisko.image = "http://www.aironline.pl/datastore/images/lotniska/lotnisko.gif";
	lotnisko.iconSize = new GSize(30, 40);
	lotnisko.iconAnchor = new GPoint(6, 20);
	lotnisko.infoWindowAnchor = new GPoint(5, 1);
	
	var parking = new GIcon();
	parking.image = "http://www.aironline.pl/datastore/images/lotniska/parking.gif";
	parking.iconSize = new GSize(20, 26);
	parking.iconAnchor = new GPoint(6, 20);
	parking.infoWindowAnchor = new GPoint(5, 1);
	
	var hotel = new GIcon();
	hotel.image = "http://www.aironline.pl/datastore/images/lotniska/hotel.gif";
	hotel.iconSize = new GSize(21, 28);
	hotel.iconAnchor = new GPoint(6, 20);
	hotel.infoWindowAnchor = new GPoint(5, 1);
	
	var parking1 = new GIcon();
	parking1.image = "http://www.aironline.pl/datastore/images/lotniska/parking_1.gif";
	parking1.iconSize = new GSize(20, 26);
	parking1.iconAnchor = new GPoint(6, 20);
	parking1.infoWindowAnchor = new GPoint(5, 1);
	
	var parking2 = new GIcon();
	parking2.image = "http://www.aironline.pl/datastore/images/lotniska/parking_2.gif";
	parking2.iconSize = new GSize(20, 26);
	parking2.iconAnchor = new GPoint(6, 20);
	parking2.infoWindowAnchor = new GPoint(5, 1);
	
	var parking3 = new GIcon();
	parking3.image = "http://www.aironline.pl/datastore/images/lotniska/parking_3.gif";
	parking3.iconSize = new GSize(20, 26);
	parking3.iconAnchor = new GPoint(6, 20);
	parking3.infoWindowAnchor = new GPoint(5, 1);
	
	var marker = new GMarker(point , lotnisko);
	map.addOverlay(marker);
	
	var marker1 = new GMarker(point1 , hotel);
	map.addOverlay(marker1);
	
	var marker2 = new GMarker(point2 , hotel);
	map.addOverlay(marker2);
	
	var marker3 = new GMarker(point3 , hotel);
	map.addOverlay(marker3);
	
	var marker4 = new GMarker(point4 , hotel);
	map.addOverlay(marker4);
	
	var marker5 = new GMarker(point5 , hotel);
	map.addOverlay(marker5);
	
	var marker6 = new GMarker(point6 , hotel);
	map.addOverlay(marker6);
	
	
	var marker7 = new GMarker(point7 , parking1);
	map.addOverlay(marker7);	
	
	var marker8 = new GMarker(point8 , parking2);
	map.addOverlay(marker8);
	
	var marker9 = new GMarker(point9 , parking3);
	map.addOverlay(marker9);
	
	//Lotnisko
	GEvent.addListener(marker, "mouseover", function() {marker.openInfoWindowHtml("<div style='margin:5px 0px'>Port Lotniczy w Katowicach<br />ul. Wolności 90<br />41-960 Ożarowice</div><div style='text-align:center; line-height:16px; margin-top:8px; width:200px'>Zaplanuj trasę na lotnisko.<form method='get' target='_blank' action='http://maps.google.com/maps'><input type='hidden' name='dir' value='to' />Adres: <input type='text' name='saddr' value='miasto, ulica, nr' onClick=this.value='' /><input type='hidden' name='daddr' value='50.4712177107157, 19.074068069458008' /><br /><input type='submit' value='Pokaż trasę' /></form></div>");});
	
	GEvent.addListener(marker1, "mouseover", function() {marker1.openInfoWindowHtml("<img style='width:60px; float:left; margin-right:10px' src='http://www.odkryjpolske.pl/admin/datastore/upload/place/a_front_senator_katowice_small.jpg' /><div style='float:left; width:200px'><span style='font-weight:bold'>Hotel Senator Katowice ***</span><br />ul. 1-go Maja 3, Katowice<br /><a href='http://www.odkryjpolske.pl/hotele/katowice/senator_katowice/'>Rezerwuj</a></div>");});

	GEvent.addListener(marker2, "mouseover", function() {marker2.openInfoWindowHtml("<img style='width:60px; float:left; margin-right:10px' src='http://www.odkryjpolske.pl/admin/datastore/upload/place/a_front_novotel_katowice_small.jpg' /><div style='float:left; width:200px'><span style='font-weight:bold'>Hotel Novotel Katowice ****</span><br />Al. Roździeńskiego 16, Katowice<br /><a href='http://www.odkryjpolske.pl/hotele/katowice/novotel_katowice_centrum/'>Rezerwuj</a></div>");});
	
	GEvent.addListener(marker3, "mouseover", function() {marker3.openInfoWindowHtml("<img style='width:60px; float:left; margin-right:10px' src='http://www.odkryjpolske.pl/admin/datastore/upload/place/a_front_qubus_katowice_small.jpg' /><div style='float:left; width:200px'><span style='font-weight:bold'>Qubus Hotel Prestige ****</span><br />ul. Uniwersytecka 13, Katowice<br /><a href='http://www.odkryjpolske.pl/hotele/katowice/qubus_hotel_prestige/'>Rezerwuj</a></div>");});
	
	GEvent.addListener(marker4, "mouseover", function() {marker4.openInfoWindowHtml("<img style='width:60px; float:left; margin-right:10px' src='http://www.odkryjpolske.pl/admin/datastore/upload/place/a_front_katowice_katowice_small.jpg' /><div style='float:left; width:200px'><span style='font-weight:bold'>Hotel Katowice **</span><br />Al. Korfantego 9, Katowice<br /><a href='http://www.odkryjpolske.pl/hotele/katowice/katowice/'>Rezerwuj</a></div>");});
	
	GEvent.addListener(marker5, "mouseover", function() {marker5.openInfoWindowHtml("<img style='width:60px; float:left; margin-right:10px' src='http://www.odkryjpolske.pl/admin/datastore/upload/place/a_front_monopol_katowice_small.jpg' /><div style='float:left; width:200px'><span style='font-weight:bold'>Hotel Monopol Katowice *****</span><br />ul. Dworcowa 5, Katowice<br /><a href='http://www.odkryjpolske.pl/hotele/katowice/monopol_katowice/'>Rezerwuj</a></div>");});
	
	GEvent.addListener(marker6, "mouseover", function() {marker6.openInfoWindowHtml("<img style='width:60px; float:left; margin-right:10px' src='http://www.odkryjpolske.pl/admin/datastore/upload/place/a_front_diament_katowice_small.jpg' /><div style='float:left; width:200px'><span style='font-weight:bold'>Hotel Diament Katowice ***</span><br />ul. Dworcowa 9, Katowice<br /><br /><a href='http://www.odkryjpolske.pl/hotele/katowice/diament_katowice/'>Rezerwuj</a></div>");});

	}	
}
