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);

<!-- 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();
}

function showMap( object, img_h, img_w) {
  var $adres = 'http://www.morze.turystyka.pl/map.php?id=';
  var $url = $adres+object;
  //alert($url);
  noweOkno = window.open($url, 'Mapa', 'menubar=no, toolbar=no, location=no, scrollbars=no, resizable=no, status=no, width='+img_w+', height='+img_h+'');
  noweOkno.focus();
}

