function sub() {
var form = document.getElementById('form1');
var opcje = "'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=0,scrollbars=no,width=200,height=100'";
var mail = form.email.value;
window.open('modules/subskrypcja/okno.php?email=' +mail,'',opcje);
}
function okno(obrazek, wys, szer) {
var L='<HTML><BODY BODY leftmargin=0 topmargin=0>\n\n\t<center>\n\t\t<a href="javascript:window.close()">\n\t\t<img src="';
var R='" title="Kliknij na zdjecie\nby zamkn¹æ okno" width='+szer+', height='+wys+' img border="0">\n\t</a>\n\t<center>\n\n</BODY>\n</HTML>';
NoweOkno=window.open('','','toolbar=no,menubar=no,location=no,personalbar=no,scrollbars=auto,directories=no,status=no,resizable=yes,width='+szer+',height='+wys);
NoweOkno.document.open();
NoweOkno.document.write(L+obrazek+R);
NoweOkno.document.close();
NoweOkno.focus();
}
var preloadImgs = new Array();
var preloadImgsQueued=0; 
var preloadError = false; 
var preloadWhenOK = '';
var preloadWhenErr = ''; 
function preload(plik, liczbaKlatek) {
if (document.images) {
var i = preloadImgs.length;
preloadImgs[i] = new Image();
preloadImgs[i].src = plik;
preloadImgsQueued += liczbaKlatek;
preloadImgs[i].onload = ok;
preloadImgs[i].onerror = blad;
}
}
function ok() {
preloadImgsQueued--;
if (preloadImgsQueued<=0) all_done();
}
function blad() {
preloadError = true;
preloadImgsQueued--;
if (preloadImgsQueued<=0) all_done();
}
function all_done() {
if (preloadError) eval(preloadWhenErr)
else eval(preloadWhenOK);
}
function preloadWhenReady(when_ok, when_err) {
preloadWhenOK = when_ok;
preloadWhenErr = when_err;
if (preloadImgsQueued<=0) all_done();
}
preload('grafika/0.gif', 10);
preload('grafika/1.gif', 10);
function showMyPopup1(elementId, id) {
var coords = {x: 0, y: 0};
  var el = document.images[elementId];
  while (el) {
    coords.x += el.offsetLeft;
    coords.y += el.offsetTop;
	el = el.offsetParent;
  }
mW=coords.x+15;
mH=coords.y;
switch (id) {
case "1":
{ 
r='<TABLE cellspacing=0 cellpadding=0 style="border:1px solid #6b6b6b;" width=90><TR><TD><TABLE cellspacing=0 cellpadding=0 width=90 class=pobo >'
r+='<TR><TD class=a2b NOWRAP><DIV class=p6w>imprezy</DIV></TD></TR>'
r+='<TR><TD onClick="location.href=\'imprezy.php\'" class="dpna a2" NOWRAP><DIV onMouseOut="this.style.backgroundColor=\'#f3f3f3\'" onMouseOver="this.style.backgroundColor=\'#FFFFFF\'"><DIV class=p6><A class=popl href="imprezy.php" id="test">aktualne</A></DIV></DIV></TD></TR>'
r+='<TR><TD class=pobr><IMG src=0 height=1 width=1 alt=""></TD></TR>'
r+='<TR><TD onClick="location.href=\'impr_arch.php\'" class="dpna a2" NOWRAP><DIV onMouseOut="this.style.backgroundColor=\'#f3f3f3\'" onMouseOver="this.style.backgroundColor=\'#FFFFFF\'"><DIV class=p6><A class=popl href="impr_arch.php">archiwum</A></DIV></DIV></TD></TR>'
r+='<TR><TD class=pobr><IMG src=0 height=1 width=1 alt=""></TD></TR>'
r+='<TR><TD onClick="location.href=\'imprezy.php?action=form\'" class="dpna a2" NOWRAP><DIV onMouseOut="this.style.backgroundColor=\'#f3f3f3\'" onMouseOver="this.style.backgroundColor=\'#FFFFFF\'"><DIV class=p6><A class=popl href="imprezy.php?action=form">zg³o¶</A></DIV></DIV></TD></TR>'
r+='<TR><TD class=pobr><IMG src=0 height=1 width=1 alt=""></TD></TR>'
r+='</TABLE></TD></TR></TABLE>'
break;}
case "2":
{ 
r='<TABLE cellspacing="0" cellpadding="0" style="border:1px solid #6b6b6b;" width=90><TR><TD><TABLE cellspacing=0 cellpadding="0" width="90" class="pobo">'
r+='<TR><TD class=a2b NOWRAP><DIV class=p6w>booking</DIV></TD></TR>'
r+='<TR><TD onClick="location.href=\'booking.php\'" class="dpna a2" NOWRAP><DIV onMouseOut="this.style.backgroundColor=\'#f3f3f3\'" onMouseOver="this.style.backgroundColor=\'#FFFFFF\'"><DIV class=p6><A class=popl href="booking.php">sylwetki</A></DIV></DIV></TD></TR>'
r+='<TR><TD class=pobr><IMG src=0 height=1 width=1 alt=""></TD></TR>'
r+='<TR><TD class=pobr><IMG src=0 height=1 width=1 alt=""></TD></TR>'
r+='<TR><TD onClick="location.href=\'booking.php?action=form\'" class="dpna a2" NOWRAP><DIV onMouseOut="this.style.backgroundColor=\'#f3f3f3\'" onMouseOver="this.style.backgroundColor=\'#FFFFFF\'"><DIV class=p6><A class=popl href="booking.php?action=form">zg³o¶</A></DIV></DIV></TD></TR>'
r+='<TR><TD class=pobr><IMG src=0 height=1 width=1 alt=""></TD></TR>'
r+='</TABLE></TD></TR></TABLE>'
break;}
}
return overlib(r, WIDTH, 170, STICKY, NOCLOSE, TIMEOUT, 2000, MOUSEOFF, WRAP, DELAY, 250, FIXX, mW, FIXY, mH, FULLHTML);
}
function zmien(grafika,plik) {document.images[grafika].src=plik;document.close();}
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
	   anchor.getAttribute("rel") == "external")
	 anchor.target = "_blank";
 }
}
function textCounter(field, countfield, maxlimit) {
  if (field.value.length > maxlimit)
      {field.value = field.value.substring(0, maxlimit);}
      else
      {countfield.value = maxlimit - field.value.length;}
  }

window.onload = externalLinks;
