function addEvent(elm, evType, fn, useCapture) {
  // cross-browser event handling for IE5+, NS6 and Mozilla
  // By Scott Andrew
  if (elm.addEventListener) {
    elm.addEventListener(evType, fn, useCapture);
    return true;
  } else if (elm.attachEvent) {
    var r = elm.attachEvent('on' + evType, fn);
    EventCache.add(elm, evType, fn);
    return r;
  } else {
    elm['on' + evType] = fn;
  }
}

addEvent(window, 'unload', EventCache.flush, false);

function init() {
  if (GBrowserIsCompatible()) {
    var map = new GMap2(document.getElementById("map"));
    //map.addControl(new GSmallMapControl());
    map.addControl(new GLargeMapControl());
    //map.addControl(new GMapTypeControl());
    map.addControl(new GOverviewMapControl());
    map.addControl(new GScaleControl(), new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(10, 40)));
    
    map.setCenter(new GLatLng(54.5831, 16.8508), 14);
    
    // Place a marker in the center of the map and open the info window
    // automatically
    var marker = new GMarker(map.getCenter());
    //GEvent.addListener(marker, "click", function() {
    //  marker.openInfoWindowTabsHtml(infoTabs);
    //});
    map.addOverlay(marker);
    //marker.openInfoWindowTabsHtml(infoTabs); 
  }
}

//addEvent(window, 'load', init, false);

// -->

<!-- qradek dadaj do ulubionych -->
function dodaj() {
	var tytul = 'Noclegi nad morzem';
	var url = 'http://www.morze.turystyka.pl';
	if (window.external) window.external.AddFavorite(url, tytul);
	if (window.sidebar) window.sidebar.addPanel(tytul, url, "");
}

function startowa() {
	document.body.style.behavior = "url(#default#homepage)";
	document.body.setHomePage("morze.turystyka.pl");
}

function showImg( img_src, img_w, img_h, scrollvalue) {
	if (scrollvalue=='yes') {
		img_w_n = img_w+90;
		img_h_n = img_h+60;
	} else {
		img_w_n = img_w;
		img_h_n = img_h;
	}
	img_w_o = img_w;
   var popup = window.open('','','width=' + img_w_n + ',height=' + img_h_n + ',resizable=0,scrollbars='+scrollvalue+',menubar=no');
   popup.document.open();
   popup.document.write('<html><head><title>Morze.Turystyka.pl<\/title><\/head>');
   popup.document.write('<body style="margin: 0;padding: 0; background-color: #404040;">');
   popup.document.write('<a href="javascript:window.close();" style="border: none; display: block; margin: 0 ;border: none; padding: 0;"><img style="margin: 0; padding: 0; border: none;" src=' + img_src + ' /></a>');
   popup.document.write('<\/body><\/html>');
//   popup.document.focus();
   popup.document.close();
}

