    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);
    var is_ie6    = (is_ie && (is_major == 4) && (agt.indexOf("msie 6.")!=-1) );
    var is_ie6up  = (is_ie && !is_ie3 && !is_ie4 && !is_ie5 && !is_ie5_5);
    var is_opera = (window.opera)?true:false;
    var is_opera7 = (window.opera)?true:false;
    var is_gecko = (agt.indexOf('gecko') != -1);


if(document.all && !document.getElementById)
    document.getElementById = function(id) { return document.all[id]; }

if(document.all && !document.getElementsByTagName)
    document.getElementsByTagName = function(tag) { return document.all.tags(tag); }


var lo = 1;
	function sof (a) {
	if (document.getElementById('foto' + lo)) document.getElementById('foto' + lo).style.display = 'none';
	document.getElementById('oferta' + lo).style.display = 'none';
	document.getElementById('lin' + lo).className = '';
	lo = a;
	if (document.getElementById('foto' + lo)) document.getElementById('foto' + lo).style.display = '';
	document.getElementById('oferta' + lo).style.display = '';
	document.getElementById('lin' + lo).className = 'selected';

}

function footReset() {
	f = document.getElementById('footer').style.position="relative";
	f = document.getElementById('footer').style.position="absolute";
	//alert('test');

}


function flash(name,src,x,y,ver,opcja) {
	

	if (opcja == 'w3c') {
		document.write ('<object id="'+name+'" type="application/x-shockwave-flash" data="'+src+'" width="'+x+'" height="'+y+'" >');
		document.write ('<param name="movie" value="'+src+'" >');
		document.write ('<param name="swliveconnect" value="true">');
		document.write ('</object>');
	}
	else {

		document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write ('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+ver+',0,0,0"');
		document.write ('width='+x+' height='+y+' id="'+name+'">');
		document.write ('<param name=movie value="'+src+'">');
		document.write ('<param name=quality value=high>');

		if (opcja == 'transparent') document.write ('<param name="wmode" value="transparent">');

		document.write ('<param name="swliveconnect" value="true">');
		document.write ('<embed src="'+src+'" quality="high" width="'+x+'" height="'+y+'"');
		document.write (' type="application/x-shockwave-flash"');
		document.write (' pluginspage="http://www.macromedia.com/downloads/"');
		document.write (' name="'+name+'" swliveconnect="true">');
		document.write ('</embed>');
		document.write ('</object>');
	}
}


function setSize() {

	ww = (window.innerWidth)?window.innerWidth:document.body.clientWidth
	if (ww>800) {
		document.getElementById('container').style.marginLeft = '-490px';
		document.getElementById('container').style.width = '980px';
	}
	else {
		document.getElementById('container').style.marginLeft = '-389px';
		document.getElementById('container').style.width = '954px';
	}
}


function oW (path,Xsiz,Ysiz,popUnder) {
	var przed = '';
	if (!(Xsiz > 0)) { Xsiz = 450; }
	if (!(Ysiz > 0)) { Ysiz = 300; }
	w = window.open(przed+path, 'fotozoom', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,fullscreen=no,channelmode=no,width='+Xsiz+',height='+Ysiz+',top=30,left=30');
	if (popUnder) {
		w.blur();
		window.focus();
	}
	else {
		w.focus();
	}
	void(0);
}



function pobierz(nazwa) {
    if (document.cookie.length > 0) {
        startc = document.cookie.indexOf(nazwa + "=");
        if (startc != -1) {
            startc += nazwa.length + 1;
            endc = document.cookie.indexOf(";", startc);
            if (endc == -1) {
                endc = document.cookie.length;
            }
            return unescape(document.cookie.substring(startc,endc));
        }
	return false;
    }
    return false;
}

function rejestruj(nazwa, wartosc,dni) {
    var dzisiaj=new Date();
    var wygasnie=new Date();
    !dni ?dni=7 :"";
    wygasnie.setTime(dzisiaj.getTime()+1000*60*60*24*dni);
	document.cookie=nazwa+"="+escape(wartosc)+";expires="+wygasnie.toGMTString();
}

function sClear(obj,itxt) {
	if (obj.value == itxt) obj.value = '';
}
function sReturn(obj,itxt) {
	if (obj.value == '') obj.value = itxt;
}

function init() {
	

}

function el(x) { return document.getElementById(x); }

function edOpts(s,tf,n) {	
	for (var i=1, option; option = s.options[i]; i++) {
		if ((n != null && option.value == n) || n == null) {
			 option.disabled = tf;
			 if (tf == true && s.selectedIndex == i) s.selectedIndex = 0;
		} 
	}
}

function switchZest(tv) {

	el('ztypl').style.display=(tv)?'':'none';
	edOpts(el('ztyp'),false);
	//alert (tv.substr(1) + '::' + tv.substr(0,1));
	//if (tv.substr(0,1) == '-') {
	//	edOpts(el('ztyp'),true,tv.substr(1));
	//}
	edOpts(el('ztyp'),true,tv);
}

window.onload = init;

function cq (kod,zm) {

		var tmpIl = eval( "document.grupa[\"il["+kod+"]\"].value;");

		++tmpIl;

		--tmpIl;

		reszta = tmpIl%zm;

		if ((zm > 0) && (tmpIl < 999999) ) {

			eval( "document.grupa[\"il["+kod+"]\"].value = tmpIl + zm - reszta;");

		}

		else if ((zm < 0) && (tmpIl > 0)){

			if ( reszta > 0 ) { eval( "document.grupa[\"il["+kod+"]\"].value = tmpIl - reszta;"); }

			else {	eval( "document.grupa[\"il["+kod+"]\"].value = tmpIl + zm;"); }

		}

	if (document.getElementById('zzm')) {

			

			document.getElementById('zzm').className  = "bma";

		}

}



function rq (kod,zm) {

		var tmpIl = eval( "document.grupa[\"il["+kod+"]\"].value;");

		++tmpIl;

		--tmpIl;

		reszta = tmpIl%zm;

		if (!(tmpIl >= 0)) {

			alert ("Wprowadzono nie poprawna wartosc!");

			eval( "document.grupa[\"il["+kod+"]\"].value = 0;");

		}

		else if (reszta > 0) {

			alert ("Ilosc musi byæ wielokrotnoscia liczby "+zm);

			eval( "document.grupa[\"il["+kod+"]\"].value = tmpIl - reszta;");

		}

		if (document.getElementById('zzm')) {

			

			document.getElementById('zzm').className  = "bma";

		}



}


function switchModel(mid) {

	document.getElementById('pstan').innerHTML = typy[mid][0];
	document.getElementById('pcena').innerHTML = typy[mid][1];
}

function showSubMenu(obj) {

	if (document.getElementsByTagName)
		var x = document.getElementsByTagName('ul');
	else if (document.all)
		var x = document.all.tags('ul');
	for (var i=0;i<x.length;i++) 
		if (x[i].className == 'menuProd') x[i].style.display = "none";


	kids = obj.childNodes;
 	for (var i = 0; i < kids.length; i++) {
 

		t = kids[i].tagName;
 		if (t == 'UL') {

			kids[i].style.display = "";
			break;
		}
 
	}

	void(0);
}


function clearOpts(os) {
	for(a = 1; a <= 5; ++a) {
		if (a != os && document.getElementById('cecha'+a)) {
			s = document.getElementById('cecha'+a);
			s.options.length = 0;
		}
	}
}


var xrozmiary = {'CO':['UK24','UK26','UK28','UK30','UK32','UK34','UK36','UK38','UK40','UK42'],
'BR':['UK24','UK26','UK28','UK30','UK32','UK34','UK36','UK38','UK40','UK42','UK44'],
'JRW':['6Y','8Y','10Y','12Y','14Y','16Y'],
'JRM':['6Y','8Y','10Y','12Y','14Y','16Y'],
'SH':['36','37','39','40','41','42','43','44','45','46','47','48']};

var grppath = {'CO':'/sklep/stroje_plywackie/damskie',
'BR':'/sklep/stroje_plywackie/meskie',
'JRW':'/sklep/stroje_plywackie/juniorskie_damskie',
'JRM':'/sklep/stroje_plywackie/juniorskie_meskie',
'SH':'/sklep/klapkibuty'}


function relrozm() {
	var v = document.getElementById('rgrp').value
	
	var s = document.getElementById('rozm');

	s.options.length = 0;
	if (v) {
		s.style.display = '';
		s.options[0] = new Option('- wybierz rozmiar -','');
	}
	else {
		s.style.display = 'none';  
		s.options[0] = new Option('-----------','');
	}
	if (xrozmiary[v]) {
	for (var i = 0; i < xrozmiary[v].length; ++i) {
		if (v == 'JRW' || v == 'JRM') 
			s.options[(i+1)] = new Option(xrozmiary[v][i].replace('Y',' lat'),xrozmiary[v][i]);
		else
			s.options[(i+1)] = new Option(xrozmiary[v][i],xrozmiary[v][i]);
		if (selrozm.substr(1) == xrozmiary[v][i]) {
			s.selectedIndex = i+1;
		}
	}
	}


}

function searchRozm(v) {
	var grp = document.getElementById('rgrp').value
	if (v) document.location.href =	grppath[grp]+'/query-rozmiary,*2F'+v+'.html';
}

function adSet(ison) {
if (ison) 
	document.getElementById('adtitle').SetVariable('domena', ison.innerHTML);
else 
	document.getElementById('adtitle').SetVariable('domena', 'Aukcja-domen.com');
}



function number_format(a, b, c, d) {
 if (b == null) b = 2;
 if (c == null) c = ',';
 if (d == null) d = ' ';
 a = Math.round(a * Math.pow(10, b)) / Math.pow(10, b);
 e = a + '';
 f = e.split('.');
 if (!f[0]) {
  f[0] = '0';
 }
 if (!f[1]) {
  f[1] = '';
 }
 if (f[1].length < b) {
  g = f[1];
  for (i=f[1].length + 1; i <= b; i++) {
   g += '0';
  }
  f[1] = g;
 }
 if(d != '' && f[0].length > 3) {
  h = f[0];
  f[0] = '';
  for(j = 3; j < h.length; j+=3) {
   i = h.slice(h.length - j, h.length - j + 3);
   f[0] = d + i +  f[0] + '';
  }
  j = h.substr(0, (h.length % 3 == 0) ? 3 : (h.length % 3));
  f[0] = j + f[0];
 }
 c = (b <= 0) ? '' : c;
 return f[0] + c + f[1];
}


$(document).ready( function(){

	$('.sp-kill').hide();
	$('.display-none').hide();
	$('.sp-kill input').val('nospam');

	$('img.actItemYoutube').each(function(){
		if (this.alt != '') {
			$(this).after('<object type="application/x-shockwave-flash" style="width: ' + this.width + 'px; height:' + this.height + 'px;" data="' + this.alt + '"><param name="movie" value="' + this.alt + '" /><param name="wmode" value="transparent" /></object>');
		}

		
	});

	$('a.login-required').click(function() {
		this.innerHTML = $(this).attr('nicetitle');
		return false;
	});

	$('img.actItemYoutube').remove();

});