var IE6, IE7, IE, FF, O;

with(window.navigator.userAgent) {
	if(indexOf('MSIE') != -1) {
		IE = true;
		if(indexOf('MSIE 7') != -1) IE7 = true;
		else IE6 = true;
	}
	else if(indexOf('Gecko') != -1) FF = true;
	else if(indexOf('Opera') != -1) O = true;
}

function hexdec(n) { return parseInt(n, 16); }

d_s = new Array();
d_sdata = 'f8.0,0,1c1,4c3,0,0,1,0|f5.0,0,1b1c,1b1c,1,0,0,0|26.0,0,6ee2,7422,1,0,0,0|83.0,0,1d2e,332b,1,0,0,0|c9.0,0,1806,230a,1,0,0,0|c9.771,0,1806,230a,1,0,0,0|fc.0,0,1db0,1db0,1,0,0,0|85.0,0,206c,3b32,1,0,0,0|67.0,0,1c50,32ee,1,0,0,0|d3.0,0,1a86,509b,1,0,0,0|d3.e61,0,1ff2,2442,1,0,0,0|d3.d61,0,1f3e,29ad,1,0,0,0|d3.b61,0,1dec,2356,1,0,0,0|d3.75,0,2038,33fa,1,0,0,0|d3.f61,0,2756,2e64,1,0,0,0|d3.071,0,22b0,2e54,1,0,0,0|d3.471,0,292a,321b,1,0,0,0|d3.c61,0,1a86,33ad,1,0,0,0|b.0,0,cb,33b6,0,1,1,1|b.6e,0,332,1860,0,0,1,1|b.6a,0,14c,20c4,0,1,1,1|b.7a,0,3cd,1a18,0,0,1,1|b.8a,0,19f,1c34,0,1,1,1|b.1b,0,333,b67,0,0,1,1|b.2b,0,2ac,15f2,0,0,1,1|b.aa,0,cb,1bd2,0,1,1,1|b.e9,0,244,33b6,0,0,1,1|b.ba,0,405,1651,0,0,1,1|b.8b,0,792,a44,0,0,1,1|b.6c,0,338,1d23,0,0,1,1|b.ca,0,3cf,1c74,0,0,1,1|b.1c,0,225,2242,0,0,1,1|b.5b,0,4c9,136a,0,0,1,1|b.ea,0,363,1488,0,0,1,1|b.6b,0,294,1794,0,0,1,1|b.fa,0,364,181e,0,0,1,1|b.9a,0,235,2586,0,0,1,1|b.5a,0,1f0,1d9e,0,0,1,1|b.941,0,26d,1068,0,0,1,1|b.69,0,25f,1c49,0,0,1,1|b.0b,0,234,1a94,0,0,1,1|b.d01,0,337,1cd2,0,0,1,1|b.84,0,264,1e1d,0,0,1,1|b.7b,0,324,1d2d,0,0,1,1|b.3b,0,170,1f1a,0,1,1,1|b.da,0,2dc,1465,0,0,1,1|49.0,0,187e,2760,1,0,0,0|e3.0,0,19da,3596,1,0,0,0|e3.351,0,19da,3596,1,0,0,0|e3.551,0,23ee,3596,1,0,0,0|82.0,0,36f,4e2,0,1,0,0|c8.0,0,1e78,27ba,1,0,0,0|76.0,0,1f33,26de,1,0,0,0|73.0,0,105,29b8,1,0,1,0|97.0,0,1c6c,2282,1,0,0,0|c4.0,0,12be,3710,1,0,0,0|9.0,0,c1,20fd,1,1,1,1|9.5f,0,212,906,1,1,1,0|e4.0,0,2703,3322,1,0,0,0|a1.0,0,d8c,274a,1,0,0,0|a1.461,0,1836,274a,1,0,0,0|51.0,0,cd,7bbb,1,1,1,0|51.d91,0,518,14c7,0,0,1,0|51.14,0,152,29b8,1,1,1,0|51.f3,0,10e,29b8,1,0,1,0|51.24,0,eb,29b8,1,1,1,0|51.d3,0,df,7bbb,0,0,1,0|51.05,0,253,19ed,0,0,1,0|51.e4,0,272,1275,0,0,1,0|51.d4,0,11d,1e2b,0,0,1,0|51.a91,0,14d,3a3,0,0,1,0|51.b4,0,11d,3338,0,0,1,0|51.15,0,e3,29b8,1,0,1,0|51.94,0,119,1dca,0,0,1,0|51.af,0,231,1db0,0,0,1,0|51.931,0,347,dfa,0,0,1,0|51.c4,0,cd,1c90,0,0,1,0|51.25,0,28f,25f8,1,0,1,0|51.a4,0,264,1965,0,0,1,0|51.35,0,1c2,16d7,0,0,1,0|51.e3,0,11f,1e28,0,0,1,0|18.0,0,1d2e,2904,1,0,0,0|4.0,0,4dd,50fc,1,0,0,0|4.a71,0,7c5,175c,1,0,0,0|f7.0,0,10a,1f3f,1,0,1,0|f2.0,0,ef,1b81,0,1,1,1|f2.4e,0,ef,1b81,0,0,1,1|31.0,0,1351,3039,1,0,0,0|2.0,0,44b,cdef,1,0,0,0|2.3,0,44b,79b1,1,0,0,0|2.951,0,577,1771,1,0,0,0|2.c,0,4cb,cdef,1,0,0,0|2.5e,0,549,12a2,1,0,0,0|25.0,0,2909,34d2,1,0,0,0|c1.0,0,555,faad,1,0,1,0|c1.06,0,1a3b,1e46,1,0,0,0|c1.d11,0,168d,2431,1,0,0,0|c1.c11,0,c94,3113,1,0,0,0|c1.711,0,555,faad,1,0,1,0|c1.b11,0,bcc,2e6b,1,0,0,0|c1.16,0,e54,2df3,1,0,0,0|96.0,0,1865,1a65,1,0,0,0|d9.0,0,203a,53ac,1,0,0,0|77.0,0,149b,4838,1,0,0,0|d2.0,0,ddd,ddd,0,0,1,1|c.0,0,a8,27bb,1,1,1,1|c.661,0,443,2354,0,0,1,0|c.541,0,2ee,5dc,0,0,1,1|c.4d,0,31b,1a1e,0,0,1,1|c.f11,0,d1,d1,0,0,1,1|c.2d,0,271,37f,0,0,1,1|c.5d,0,166,251c,1,0,1,1|c.cd,0,102,225,0,0,1,1|c.8c,0,176,18ce,1,1,1,1|c.66,0,c2,231a,0,0,1,0|c.b91,0,418,1af8,0,0,1,0|c.dc,0,192,dac,0,0,1,1|c.6f,0,a8,216a,0,0,1,0|c.c9,0,c5,2738,0,1,1,0|c.cc,0,257,1929,0,0,1,1|c.021,0,144,184,0,0,1,1|c.841,0,1a3,185d,1,0,1,1|c.ce,0,120,176f,0,0,1,1|c.641,0,299,36a,0,0,1,1|c.9c,0,163,167a,0,0,1,1|08.0,0,1697,22e0,1,0,0,0|7.0,0,b8,7e92,1,1,1,0|7.51,0,b8,24cc,1,0,1,0|7.561,0,289,47d,0,0,1,0|7.fe,0,21b,1e0a,1,0,1,0|7.72,0,26c,19dc,1,0,1,0|7.e1,0,18f,2102,1,0,1,0|7.a41,0,528,1a2c,1,0,1,0|7.42,0,528,5b36,1,0,0,0|7.f1,0,5ba,7e92,1,0,0,0|7.21,0,41b,5333,1,0,0,0|7.41,0,435,54f7,1,0,0,0|7.62,0,21b,1f8e,1,0,1,0|7.f2,0,492,1eb6,1,0,1,0|7.3f,0,435,1edd,1,0,0,0|a8.0,0,1a8e,25a1,1,0,0,0|a3.0,0,3246,3246,1,0,0,0|5.0,0,b8,3c19,1,1,1,1|5.2f,0,181,211a,1,0,1,0|5.02,0,b8,26bf,1,1,1,0|5.1f,0,733,21bf,1,0,0,0|5.4f,0,c1,1f1d,0,0,1,0|5.f,0,244,1f55,1,0,1,0|5.8f,0,c5,2882,0,0,1,0|5.611,0,113b,1a72,1,0,0,0|5.44,0,2cf,19fa,1,0,1,0|5.0c,0,2ea,1e30,1,0,1,0|5.54,0,34b,1f0c,1,0,1,0|5.32,0,407,2339,1,0,1,0|5.3c,0,32e,1a3b,1,0,1,0|5.64,0,141,3c19,1,0,1,0|5.d,0,545,2a65,1,0,0,0|5.0f,0,739,184c,1,0,0,0|5.e,0,1fb,303d,1,0,1,0|32.0,0,554,2030,1,1,0,0|32.671,0,1a72,2030,1,0,0,0|d1.0,0,d65,3520,1,0,1,0|d1.13,0,d65,27cc,1,0,0,0|e1.0,0,120a,2f92,1,0,0,0|e1.23,0,120a,2f92,1,0,0,0|03.0,0,e97,feb,1,0,0,0|36.0,0,369,32e6,1,0,1,0|36.251,0,b1b,32e6,1,0,0,0|36.78,0,51e,2710,1,0,1,0|36.c71,0,369,23c8,1,0,1,0|05.0,0,1626,68f4,1,0,0,0|b6.0,0,1d29,4e8e,1,0,0,0|91.0,0,a27,2ed6,1,0,0,0|95.0,0,231e,231e,1,0,0,0|35.0,0,231e,389a,1,0,0,0|e.0,0,c9b,2fe9,1,0,0,0|c6.0,0,1310,236e,1,0,0,0|c6.081,0,1310,1955,1,0,0,0|f3.0,0,1766,3752,1,0,0,0|f3.95,0,206a,2f10,1,0,0,0|41.0,0,13af,6ad7,1,0,0,0|23.0,0,21a,7c6,0,1,1,0|17.0,0,1ebc,254c,1,0,0,0|f1.0,0,1398,950e,1,0,0,0|f1.43,0,1c66,4766,1,0,0,0|f1.791,0,2d26,5bd4,1,0,0,0|f1.33,0,1398,950e,1,0,0,0|f1.691,0,3229,4eff,1,0,0,0|f1.67,0,19ab,501c,1,0,0,0|24.0,0,173c,443c,1,0,0,0|24.17,0,1897,1ecd,1,0,0,0|24.37,0,173c,259c,1,0,0,0|24.47,0,219d,22f6,1,0,0,0|24.f71,0,1dfb,1f54,1,0,0,0|24.e71,0,2530,443c,1,0,0,0|24.b5,0,17d4,2d94,1,0,0,0|16.0,0,547,1dd6,1,0,0,0|16.f6,0,fe6,1aea,1,0,0,0|81.0,0,635,40dd,1,0,0,0|81.731,0,635,40dd,1,0,0,0|11.0,0,159e,7e66,1,0,0,0|01.0,0,612,578f,1,0,1,0|01.901,0,189a,2df8,1,0,0,0|01.301,0,126e,578f,1,0,0,0|01.a1,0,13cc,4aae,1,0,0,0|87.0,0,1ebc,2b3a,1,0,0,0|22.0,0,2d3,1c2d,0,1,1,1|22.f51,0,56a,139b,0,0,1,0|22.7e,0,3cd,1c2d,0,0,1,1|53.0,0,7b8,e73,1,1,0,1|45.0,0,2b53,4b28,1,0,0,0|78.0,0,195a,1b4e,1,0,0,0|59.0,0,ff3,2123,1,0,0,0|04.0,0,2459,4367,1,0,0,0|71.0,0,2652,7fe6,1,0,0,0|71.63,0,2c4c,7122,1,0,0,0|71.381,0,3d4a,4944,1,0,0,0|71.c6,0,2a42,4abe,1,0,0,0|71.481,0,3276,3276,1,0,0,0|71.73,0,26fa,4a40,1,0,0,0|71.d6,0,2b3e,30fc,1,0,0,0|71.b71,0,2db4,2db4,1,0,0,0|71.281,0,2be6,64fe,1,0,0,0|71.e6,0,2652,4ce0,1,0,0,0|a4.0,0,e6,1c1f,0,0,1,1|a4.48,0,370,3f0,0,0,1,0|a4.68,0,1bd,11ad,0,0,1,1|a4.58,0,173,e0e,0,0,1,0|a4.e51,0,348,1022,0,0,1,0|a4.28,0,16c,4c9,0,0,1,0|a4.ee,0,e6,14ac,0,0,1,0|a4.38,0,1ff,1c1f,0,0,1,1|a4.f7,0,18e,1002,0,0,1,0|a4.86,0,eb,19ab,0,0,1,0|8.0,0,5a0,38cc,1,0,0,0|8.a31,0,97b,38cc,1,0,0,0|8.d41,0,97b,1f29,1,0,0,0|8.d31,0,5a0,1e40,1,0,0,0|8.631,0,801,10f3,1,0,0,0|98.0,0,1388,215c,1,0,0,0|d8.0,0,638,3816,1,0,1,0|d8.e31,0,638,1a7b,0,0,1,0|d8.521,0,1161,1161,1,0,0,0|d8.e91,0,11d9,11d9,0,0,1,0|d8.621,0,1fa8,1fa8,1,0,0,0|d8.421,0,faf,1113,1,0,0,0|d8.c21,0,26d9,3816,0,0,1,0|d8.b21,0,219f,219f,1,0,0,0|b4.0,0,1fe6,33c0,1,0,0,0|69.0,0,1c16,2d50,1,0,0,0|33.0,0,312,b22,1,1,0,0|43.0,0,289,450,0,1,1,0|34.0,0,1fb8,4e00,1,0,0,0|37.0,0,1937,2ebc,1,0,0,0|84.0,0,823,936,0,1,0,0|21.0,0,1765,8037,1,0,0,0|21.861,0,20dd,2b87,1,0,0,0|21.c1,0,179a,4fdb,1,0,0,0|21.b6,0,27dc,2ef8,1,0,0,0|21.d1,0,1765,3b13,1,0,0,0|21.181,0,2e22,3e60,1,0,0,0|c5.0,0,120a,250d,1,0,0,0|d5.0,0,1d0,1d9b,0,0,1,1|d5.9e,0,459,1241,0,0,1,1|d5.7d,0,268,182f,0,0,1,1|d5.8d,0,1d0,1241,0,0,1,1|d5.ae,0,297,f18,0,0,1,1|93.0,0,181,2252,0,1,1,1|93.de,0,2b2,1b51,0,0,1,1|93.65,0,2c6,2122,0,0,1,0|93.ed,0,3b1,147a,0,0,1,0|93.591,0,4e4,2252,0,0,1,0|93.151,0,5d6,1db9,0,0,1,0|f.0,0,d5b,3c80,1,0,0,0|64.0,0,1033,4b75,1,0,0,0|64.99,0,1dba,2558,1,0,0,0|64.a6,0,1033,1d56,1,0,0,0|64.f5,0,160d,42de,1,0,0,0|55.0,0,f82,204e,1,0,0,0|72.0,0,162,1e04,1,1,1,1|72.eb,0,313,1c98,0,0,1,1|72.4c,0,37f,1e04,1,0,1,1|72.b01,0,38e,1975,0,0,1,1|72.3e,0,4e5,1776,0,0,1,1|72.db,0,378,1a16,0,0,1,1|72.161,0,40e,1bda,0,0,1,0|72.fb,0,162,1d4c,1,0,1,1|c2.0,0,bae,116c,1,1,0,0|d.0,0,112e,a27e,1,0,0,0|d.61,0,112e,a27e,1,0,0,0|d.341,0,128c,36c2,1,0,0,0|d.a3,0,14f8,3ece,1,0,0,0|d.c5,0,138d,416c,1,0,0,0|d.751,0,1432,308c,1,0,0,0|d.93,0,13aa,4428,1,0,0,0|44.0,0,17c5,373c,1,0,0,0|44.d5,0,17c5,373c,1,0,0,0|6.0,0,3dd,1fe0,1,0,0,0|6.211,0,590,1f07,1,0,0,0|3.0,0,405,f420,1,0,0,0|3.4,0,405,f420,1,0,0,0|3.d7,0,4e1,3741,1,0,0,0|3.11,0,57f,3ad6,1,0,0,0|63.0,0,2a8,1528,1,1,0,0|63.9f,0,818,1528,1,0,0,0|1c.0,0,ea6,ea6,1,0,0,0|02.0,0,1310,2772,1,0,0,0|02.b3,0,1310,2772,1,0,0,0|42.0,0,ad,1e0c,0,1,1,0|12.0,0,3bf,dd4,1,1,0,0|12.97,0,da2,dd4,1,0,0,0|b5.0,0,17e8,35ac,1,0,0,0|a.0,0,6e,aff0,1,1,1,1|a.3a,0,2d6,1892,0,0,1,1|a.441,0,23c,b2a,0,0,1,1|a.49,0,11d,24dc,1,1,1,1|a.c01,0,279,2212,0,0,1,0|a.0a,0,21b,1546,0,0,1,1|a.74,0,cb,22a1,0,1,1,0|a.12,0,ba,aff0,1,0,1,0|a.36,0,343,2043,0,0,1,0|a.c8,0,179,1b90,1,1,1,1|a.a9,0,1ae,2bfc,0,0,1,0|a.46,0,89,2966,0,0,1,0|a.cb,0,105,23a8,0,0,1,1|a.85,0,101,147f,0,0,1,0|a.f8,0,1ea,13af,0,0,1,1|a.261,0,194,964,0,1,1,1|a.c91,0,3ad,1afd,0,0,1,0|a.011,0,1cb,19b8,0,0,1,1|a.96,0,34e,1e39,0,0,1,0|a.19,0,1a4,952,0,1,1,1|a.76,0,d1,2616,1,0,1,0|a.b41,0,143,cbe,0,0,1,1|a.2c,0,3a2,1aa6,0,0,1,1|a.22,0,188,21d1,1,1,1,0|a.811,0,40d,1546,0,0,1,1|a.a5,0,11d,262b,1,0,1,0|a.e8,0,18c,21e5,1,1,1,1|a.d8,0,101,161e,0,1,1,1|a.29,0,124,1aac,1,1,1,1|a.b8,0,2c4,1a14,1,1,1,1|a.9d,0,313,14ce,0,0,1,1|a.f9,0,15d,1620,0,1,1,1|a.311,0,256,1a54,0,1,1,1|a.411,0,6ce,d35,1,1,1,1|a.ab,0,80,2962,0,0,1,0|a.bb,0,1d6,1215,0,1,1,1|a.55,0,6e,25e6,1,1,1,0|e9.0,0,2562,3444,1,0,0,0|e9.581,0,2d1e,3444,1,0,0,0|e9.c81,0,2562,2dd2,1,0,0,0|d4.0,0,1ee6,25f4,1,0,0,0|all,0,0,0,1,1,1,1'.split('|');
for(i in d_sdata) { d = d_sdata[i].split(','); if(d[0]) eval('d_s[\''+d[0]+'\'] = new Array('+d[1]+','+hexdec(d[2])+','+hexdec(d[3])+','+d[4]+','+d[5]+','+d[6]+','+d[7]+');'); }
d_sdata = null;

dojazdy_miasta = new Array(); dojazdy_miasta['WAW'] = 'Warszawa'; dojazdy_miasta['POZ'] = 'Poznań'; dojazdy_miasta['GDY'] = 'Gdynia'; dojazdy_miasta['KRK'] = 'Kraków'; dojazdy_miasta['KTW'] = 'Katowice'; dojazdy_miasta['WRO'] = 'Wrocław'; dojazdy_miasta['LDZ'] = 'Łódź'; dojazdy_miasta['GDN'] = 'Gdańsk'; dojazdy_miasta['OLS'] = 'Olsztyn'; dojazdy_miasta['BZG'] = 'Bydgoszcz'; dojazdy_miasta['CZS'] = 'Częstochowa'; dojazdy_miasta['LBL'] = 'Lublin'; dojazdy_miasta['BBL'] = 'Bielsko-Biała'; dojazdy_miasta['OPO'] = 'Opole'; dojazdy_miasta['SZZ'] = 'Szczecin'; dojazdy_miasta['RAD'] = 'Radom'; dojazdy_miasta['RZE'] = 'Rzeszów'; dojazdy_miasta['ZGR'] = 'Zielona Góra'; dojazdy_miasta['KOS'] = 'Koszalin'; dojazdy_miasta['TXL'] = 'Berlin'; dojazdy_miasta['DRS'] = 'Drezno'; dojazdy_miasta['FRA'] = 'Frankfurt'; dojazdy_miasta['SUW'] = 'Suwałki'; 

var e_cache = new Array();
function e(o, c) { if(!e_cache[o] || c) e_cache[o] = document.getElementById(o); return e_cache[o]; }

function l(u) { s = document.createElement('script'); s.type = 'text/javascript'; s.defer = true; s.src = u; document.body.appendChild(s); }

function p_s_d(o) {
	if(!o) o = 'all';
	cenymin = 5;
	cenymax = 5000;

	f_s = e('search');

	f_s.s_dj.length = 0;
	f_s.s_dj.options[0] = new Option('dowolny',0);

	if(d_s[o]) {
		if(d_s[o][0]) for(i in d_s[o][0]) {
			if(d_s[o][0][i][2]) d_s[o][3] = 1;
			if(d_s[o][0][i][3]) d_s[o][4] = 1;
			if(d_s[o][0][i][4]) d_s[o][5] = 1;
		}
		if(d_s[o][3]) f_s.s_dj.options[f_s.s_dj.length] = new Option('samolot','S');
		if(d_s[o][4]) f_s.s_dj.options[f_s.s_dj.length] = new Option('autokar','B');
		if(d_s[o][5]) f_s.s_dj.options[f_s.s_dj.length] = new Option('własny','W');
	}

	if(!d_s[o][1] || !d_s[o][2]) {
		d_s[o][1] = cenymin;
		d_s[o][2] = cenymax;
	}

	f_s.s_c.length = 0;
	f_s.s_c.options[0] = new Option('dowolna',0);

	for(i = d_s[o][1]; i <= d_s[o][2]; i += 1000) {
		step = 1000;

		if(d_s[o][2] - d_s[o][1] < step) break;

		if(i >= 5000) {
			if(f_s.s_c.length > 1) f_s.s_c.options[f_s.s_c.length] = new Option('powyżej 5000 zł','5000|');
			break;
		}
		if(i % 1000 != 0) {
			i = i - (i % 1000);
			f_s.s_c.options[f_s.s_c.length] = new Option('do '+(1000+d_s[o][1]-(d_s[o][1] % 1000)+ ' zł'),'|'+(1000+d_s[o][1] - (d_s[o][1] % 1000)));
		}

		if(i > d_s[o][2] - step) {
			f_s.s_c.options[f_s.s_c.length] = new Option('powyżej '+(d_s[o][2]-(d_s[o][2] % step)+ ' zł'),(d_s[o][2]-(d_s[o][2] % step))+'|');
			break;
		}

		if(i > d_s[o][1]) f_s.s_c.options[f_s.s_c.length] = new Option(('do '+(i+step)+' zł'),('0|'+(i+step)));
	}
}

function p_s_dj(destynacja) {
	f_s = e('s');
	o = f_s.s_p.value;

	f_s.s_dj.length = 0;
	f_s.s_dj.options[0] = new Option('dowolny', 0);

	if(d_s[o][0] && destynacja != 0) {
		for(i in d_s[o][0]) if(d_s[o][0][i][0] == destynacja) {
			if(d_s[o][0][i][2]) f_s.s_dj.options[f_s.s_dj.length] = new Option('samolot','S');
			if(d_s[o][0][i][3]) f_s.s_dj.options[f_s.s_dj.length] = new Option('autokar','B');
			if(d_s[o][0][i][4]) f_s.s_dj.options[f_s.s_dj.length] = new Option('własny','W');
		}
	} else {
		if(d_s[o][3]) f_s.s_dj.options[f_s.s_dj.length] = new Option('samolot','S');
		if(d_s[o][4]) f_s.s_dj.options[f_s.s_dj.length] = new Option('autokar','B');
		if(d_s[o][5]) f_s.s_dj.options[f_s.s_dj.length] = new Option('własny','W');
	}
}

function c_d(d, m) {
	if(sys_m > m.value || (sys_d > d.value && sys_m == m.value)) {
		var sys_Y = 2009;
	} else {
		var sys_Y = 2008;
	}
	var data = new Date(sys_Y, (m.value - 1), d.value);

	if(sys_m == m.value && d.value < sys_d) {
		m.value=sys_m + 1;
		return;
	}

	if(data.getMonth() != (m.value - 1) || data.getDate() != d.value) {
		var data = new Date(sys_Y, m.value, 0);
		d.value=data.getDate();
		return;
	}
}

var email = /(^([a-z0-9\-\+\._]+)+@([a-z0-9\-]+\.)+(com|net|edu|mil|gov|org|int|info|name|([a-z]{2}))$)/i

function c_e(o) {
	obj = e(o);
	if(!email.test(obj.value)) {
		alert('Prosimy podać prawidłowy adres e-mail.');
		obj.select();
		return false;
	}
	return true;
}

function a() {
	f_s1 = e('search_adv1');
	f_s2 = e('search_adv2');
	if(f_s1.style.display == 'inline') {
		f_s1.style.display = 'none';
		f_s2.style.display = 'none';
		e('search').className='';
		e('s_f').value='';
		e('s_m').value='';
		e('s_cat').value='';
		e('s_f').value='';
		e('s_o').value='';
		e('s_n').value='';
		e('s_adv_a').innerHTML='wyszukiwanie zaawansowane';
	} else {
		f_s1.style.display = 'inline';
		f_s2.style.display = 'inline';
		e('search').className='adv';
		e('s_adv_a').innerHTML='wyszukiwanie standardowe';
	}
}

function s_fl(o) {
	if(e('s_l') && o.id=="s_fm" && o.checked==true) { e('s_l').checked=false; return true; }
	if(e('s_fm') && o.id=="s_l" && o.checked==true) { e('s_fm').checked=false; return true; }
}

function swf() {
	var url;
	var w;
	var h;
	var id;
	var style;
	this.draw = draw;
	function draw(url, w, h, id, style) {
		this.url = url;
		this.w = w;
		this.h = h;
		this.id = id;
		this.style = style;
		document.write('<'+'script type="text/javascript" src="/js/f.js"><'+'/script>');
	}
}
swf = new swf;

function c(a) { t = new Date(); new Image().src='/js/statystyki.js?'+a+','+t.getTime(); return true; }

function scrollDiv(o, d) { t = e(o).getElementsByTagName('div'); j = 0; u = new Array(); scrollCache = new Array(); for(i in t) if(t[i].id) { u[j] = t[i]; scrollCache[j] = t[i].innerHTML; j++; } for(i = 0; i < j; i++) u[i].innerHTML = scrollCache[d == 'rew'? (i? i - 1: j - 1): (i == j - 1? 0: i + 1)]; }

var mRI = 0;
var mRB;

function mRU(o, b) {
	if(!mRI) {
		o = e(o);
		if(!o) return false;

		o.style.visibility='hidden';
		o.style.display='inline';

		t = o.getElementsByTagName('A');
		for(i in t) t[i].onmouseover = mRU;

		o.onmouseover = mRU;
		o.onmouseout = mRD;
		b.onmouseout = mRD;

		m = new Object();
		m.x1 = getX(b); m.x2 = getX(o); m.w1 = getW(b); m.w2 = getW(o); m.y1 = getY(b); m.y2 = getY(o); m.h1 = getH(b); m.h2 = getH(o); 
						
		m.object = o;
		m.speed = 10;
		m.frames = 10;
		m.count = 0;
		m.shadow = true;
		mRI = m;
		mRDraw(1);
	}
	mRI.count++;
}

function mRDraw(a) {

	m = mRI;
	o = m.object;

	x1 = m.x1; x2 = m.x2; w1 = m.w1; w2 = m.w2; y1 = m.y1; y2 = m.y2; h1 = m.h1; h2 = m.h2;

	if(typeof(mRB) != 'object') {
		mRB = document.createElement('div');
		with(mRB.style) {
			border = '1px solid #cde4ed';
			background = '#ffffff';
			width = (a? w1: w2) + 'px';
			height = (a? h1: h2) + 'px';
			position = 'absolute';
			zIndex = 50;
			left = (a? x1: x2) + 'px';
			top = (a? y1: y2) + 'px';
		}
		m.i = m.frames;
		if(m.shadow) e(o.id+'Shadow').style.display = 'none';
		o.style.visibility='visible';
		o.style.display = 'none';
		w = (a? w1: w2);
		h = (a? h1: h2);
		document.body.appendChild(mRB);
	}

	if(h > 0 && w > 0 && --m.i) {
	w = w - (a? -1: 1) * w2 / m.frames + (a? -1: 1) * w1 / m.frames;
	h = h - (a? -1: 1) * h2 / m.frames + (a? -1: 1) * h1 / m.frames;

		with(mRB.style) {
			left = Math.floor(x2 - (x1 > x2? -1: 1) * (a? m.i: m.frames - m.i) * Math.abs(x1 - x2) / m.frames) + 'px';
			top = Math.floor(y2 - (y1 > y2? -1: 1) * (a? m.i: m.frames - m.i) * Math.abs(y1 - y2) / m.frames) + 'px';

			width = w + 'px';
			height = h + 'px';
		}
		setTimeout('mRDraw('+a+')', m.speed);
	} else {
		document.body.removeChild(mRB);
		mRB = void(0);
		if(a) {
			o.style.display = 'inline';
			if(m.shadow) e(o.id+'Shadow').style.display = 'block';
		} else {
			if(m.shadow) e(o.id+'Shadow').style.display = 'none';
			mRI = void(0);
		}
	}
}

function mRD() { setTimeout('mRDrawWait('+mRI.count+')', 333); }
function mRDrawWait(p) { if(mRI.count == p) mRDraw(0); }

function getInt(n) { return n == 'auto'? 0: parseInt(n.replace('px', '')); }
function getStyle(o, s) { if(o.currentStyle) return o.currentStyle[s]; else if(window.getComputedStyle) return document.defaultView.getComputedStyle(o, null).getPropertyValue(s.replace(/([A-Z]+)/g, '-$1').toLowerCase()); }
function getX(o) { return getXY(o, 1); }
function getY(o) { return getXY(o, 0); }
function getW(o) { return getInt(getStyle(o, 'width')) + getInt(getStyle(o, 'paddingLeft')) + getInt(getStyle(o, 'paddingRight')); }
function getH(o) { return getInt(getStyle(o, 'height')) + getInt(getStyle(o, 'paddingTop')) + getInt(getStyle(o, 'paddingBottom')); }
function getXY(o, xy) { var p = 0; if(o.offsetParent) while(1) { p += (xy? o.offsetLeft: o.offsetTop); if(!o.offsetParent) break; o = o.offsetParent; } else if(o.x || o.y) p += (xy? o.x: o.y); return p; }

var link = {
	install: function() {
		var t = document.getElementsByTagName('form');
		for(i = 0;i<t.length;i++) {
			var u = t[i].getElementsByTagName('select');
			for(j=0;j<u.length;j++) u[j].onkeydown = function() { if(window.event.keyCode == 13) {this.form.submit();void(0);return false;} };
		}
		return true;
	}
}

function onMouseOut(evt, o) {

	i = evt.toElement || evt.relatedTarget;

	while(i) {
		if(i == o) return false;
		else if(i.tagName == 'HTML') return true;

		i = i.parentNode;
	}
}

