var IE = document.all?true:false
if (!IE) {
   //document.captureEvents(Event.MOUSEMOVE);
   document.onmousemove=mousePos;
   var netX, netY;
}
function posX() {
	if (IE) {
	   tempX=document.body.scrollLeft + event.clientX;
	}
	if (tempX<0) {
	   tempX=0;
	}
	return tempX;
}
function posY(e) {
	if (IE) {
	    tempY = event.clientY + document.body.scrollTop;
	}
	if (tempY<0) {
	   tempY=0;
	}
	return tempY;
}
function mousePos(e) {
	netX=e.pageX;
	netY=e.pageY;
}
function popPokaz(pX, pY, src) {
	if (IE){
	   document.all.pop.style.visibility='visible';
	   document.all.pop.innerHTML=src;
	   document.all.pop.style.left=posX()+pX+"px";
	   document.all.pop.style.top=posY()+pY+"px";
	}
	else {
		 document.getElementById("pop").style.visibility='visible';
		 document.getElementById("pop").style.left=netX+pX+"px";
		 document.getElementById("pop").style.top=netY+pY+"px";
		 document.getElementById("pop").innerHTML=src;
	}
}
function popPrzesun(pX, pY) {
	if (IE) {
	   document.all.pop.style.left=posX()+pX+"px";
	   document.all.pop.style.top=posY()+pY+"px";
	}
	else {
		 document.getElementById("pop").style.left=netX+pX+"px";
		 document.getElementById("pop").style.top=netY+pY+"px";
	}
}
function popZamknij() {
	if (IE) {
	   document.all.pop.innerHTML='';
	   document.all.pop.style.visibility='hidden';
	}
	else {
		 document.getElementById("pop").style.visibility='hidden';
		 document.getElementById("pop").innerHTML='';
	}
}
function popKom(tresc) {
	text='<table width=300 nowrap cellspacing=0 cellpadding=0 cellpadding=0 border=0><tr><td colspan=3 bgcolor=#47668F height=1></td></tr>';
	text+='<tr><td width=1 bgcolor=#47668F></td><td style="background-color: #FFCC99; font-size:9px;"><div style=margin:2px;>'+tresc+'</div></td><td width=1 bgcolor=#47668F></td><td width=1 rowspan=2 bgcolor=#47668F></td></tr>';
	text+='<tr><td colspan=3 bgcolor=#47668F height=1></td></tr></table>';
	popPokaz(5, 20, text);
}
function popLinkPrzesun() {
	popPrzesun(5, 20);
}
function popSrodekPrzesun() {
	popPrzesun(-90, 20);
}



/*
 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
 * Digest Algorithm, as defined in RFC 1321.
 * Copyright (C) Paul Johnston 1999 - 2000.
 * Updated by Greg Holt 2000 - 2001.
 * See http://pajhome.org.uk/site/legal.html for details.
 */

/*
 * Convert a 32-bit number to a hex string with ls-byte first
 */
var hex_chr = "0123456789abcdef";
function rhex(num)
{
  str = "";
  for(j = 0; j <= 3; j++)
    str += hex_chr.charAt((num >> (j * 8 + 4)) & 0x0F) +
           hex_chr.charAt((num >> (j * 8)) & 0x0F);
  return str;
}

/*
 * Convert a string to a sequence of 16-word blocks, stored as an array.
 * Append padding bits and the length, as described in the MD5 standard.
 */
function str2blks_MD5(str)
{
  nblk = ((str.length + 8) >> 6) + 1;
  blks = new Array(nblk * 16);
  for(i = 0; i < nblk * 16; i++) blks[i] = 0;
  for(i = 0; i < str.length; i++)
    blks[i >> 2] |= str.charCodeAt(i) << ((i % 4) * 8);
  blks[i >> 2] |= 0x80 << ((i % 4) * 8);
  blks[nblk * 16 - 2] = str.length * 8;
  return blks;
}

/*
 * Add integers, wrapping at 2^32. This uses 16-bit operations internally 
 * to work around bugs in some JS interpreters.
 */
function add(x, y)
{
  var lsw = (x & 0xFFFF) + (y & 0xFFFF);
  var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
  return (msw << 16) | (lsw & 0xFFFF);
}

/*
 * Bitwise rotate a 32-bit number to the left
 */
function rol(num, cnt)
{
  return (num << cnt) | (num >>> (32 - cnt));
}

/*
 * These functions implement the basic operation for each round of the
 * algorithm.
 */
function cmn(q, a, b, x, s, t)
{
  return add(rol(add(add(a, q), add(x, t)), s), b);
}
function ff(a, b, c, d, x, s, t)
{
  return cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function gg(a, b, c, d, x, s, t)
{
  return cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function hh(a, b, c, d, x, s, t)
{
  return cmn(b ^ c ^ d, a, b, x, s, t);
}
function ii(a, b, c, d, x, s, t)
{
  return cmn(c ^ (b | (~d)), a, b, x, s, t);
}

/*
 * Take a string and return the hex representation of its MD5.
 */
function calcMD5(str)
{
  x = str2blks_MD5(str);
  a =  1733084193;
  b = -271733879;
  c = -1733084194;
  d =  271733878;

  for(i = 0; i < x.length; i += 16)
  {
    olda = a;
    oldb = b;
    oldc = c;
    oldd = d;

    a = ff(a, b, c, d, x[i+ 0], 7 , -680876936);
    d = ff(d, a, b, c, x[i+ 1], 12, -389564586);
    c = ff(c, d, a, b, x[i+ 2], 17,  606105819);
    b = ff(b, c, d, a, x[i+ 3], 22, -1044530330);
    a = ff(a, b, c, d, x[i+ 4], 7 , -176418897);
    d = ff(d, a, b, c, x[i+ 5], 12,  1200080426);
    c = ff(c, d, a, b, x[i+ 6], 17, -1473231341);
    b = ff(b, c, d, a, x[i+ 7], 22, -45705983);
    a = ff(a, b, c, d, x[i+ 8], 7 ,  1770035416);
    d = ff(d, a, b, c, x[i+ 9], 12, -1958414417);
    c = ff(c, d, a, b, x[i+10], 17, -42063);
    b = ff(b, c, d, a, x[i+11], 22, -1990404162);
    a = ff(a, b, c, d, x[i+12], 7 ,  1804603682);
    d = ff(d, a, b, c, x[i+13], 12, -40341101);
    c = ff(c, d, a, b, x[i+14], 17, -1502002290);
    b = ff(b, c, d, a, x[i+15], 22,  1236535329);    

    a = gg(a, b, c, d, x[i+ 1], 5 , -165796510);
    d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
    c = gg(c, d, a, b, x[i+11], 14,  643717713);
    b = gg(b, c, d, a, x[i+ 0], 20, -373897302);
    a = gg(a, b, c, d, x[i+ 5], 5 , -701558691);
    d = gg(d, a, b, c, x[i+10], 9 ,  38016083);
    c = gg(c, d, a, b, x[i+15], 14, -660478335);
    b = gg(b, c, d, a, x[i+ 4], 20, -405537848);
    a = gg(a, b, c, d, x[i+ 9], 5 ,  568446438);
    d = gg(d, a, b, c, x[i+14], 9 , -1019803690);
    c = gg(c, d, a, b, x[i+ 3], 14, -187363961);
    b = gg(b, c, d, a, x[i+ 8], 20,  1163531501);
    a = gg(a, b, c, d, x[i+13], 5 , -1444681467);
    d = gg(d, a, b, c, x[i+ 2], 9 , -51403784);
    c = gg(c, d, a, b, x[i+ 7], 14,  1735328473);
    b = gg(b, c, d, a, x[i+12], 20, -1926607734);
    
    a = hh(a, b, c, d, x[i+ 5], 4 , -378558);
    d = hh(d, a, b, c, x[i+ 8], 11, -2023074463);
    c = hh(c, d, a, b, x[i+11], 16,  1839030562);
    b = hh(b, c, d, a, x[i+14], 23, -35309556);
    a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
    d = hh(d, a, b, c, x[i+ 4], 11,  1272893353);
    c = hh(c, d, a, b, x[i+ 7], 16, -155497632);
    b = hh(b, c, d, a, x[i+10], 23, -1094730640);
    a = hh(a, b, c, d, x[i+13], 4 ,  681279174);
    d = hh(d, a, b, c, x[i+ 0], 11, -358537222);
    c = hh(c, d, a, b, x[i+ 3], 16, -723021979);
    b = hh(b, c, d, a, x[i+ 6], 23,  76029189);
    a = hh(a, b, c, d, x[i+ 9], 4 , -640364487);
    d = hh(d, a, b, c, x[i+12], 11, -421815835);
    c = hh(c, d, a, b, x[i+15], 16,  530743020);
    b = hh(b, c, d, a, x[i+ 2], 23, -995338651);

    a = ii(a, b, c, d, x[i+ 0], 6 , -198630844);
    d = ii(d, a, b, c, x[i+ 7], 10,  1126891415);
    c = ii(c, d, a, b, x[i+14], 15, -1416354905);
    b = ii(b, c, d, a, x[i+ 5], 21, -57434055);
    a = ii(a, b, c, d, x[i+12], 6 ,  1700485571);
    d = ii(d, a, b, c, x[i+ 3], 10, -1894986606);
    c = ii(c, d, a, b, x[i+10], 15, -1051523);
    b = ii(b, c, d, a, x[i+ 1], 21, -2054922799);
    a = ii(a, b, c, d, x[i+ 8], 6 ,  1873313359);
    d = ii(d, a, b, c, x[i+15], 10, -30611744);
    c = ii(c, d, a, b, x[i+ 6], 15, -1560198380);
    b = ii(b, c, d, a, x[i+13], 21,  1309151649);
    a = ii(a, b, c, d, x[i+ 4], 6 , -145523070);
    d = ii(d, a, b, c, x[i+11], 10, -1120210379);
    c = ii(c, d, a, b, x[i+ 2], 15,  718787309);
    b = ii(b, c, d, a, x[i+ 9], 21, -343485551);

    a = add(a, olda);
    b = add(b, oldb);
    c = add(c, oldc);
    d = add(d, oldd);
  }
  return rhex(a) + rhex(b) + rhex(c) + rhex(d);
}
 

/*funkcje ver2*/
var koszCur = 0;


function Produkt(nazwa,link,cena,bezSpacji){
 this.nazwa      = nazwa;
 this.link  	 = link;
 this.cena  	 = cena;
 this.bezSpacji  = bezSpacji;
}
function Link(nazwa,link){
	this.nazwa = nazwa;
	this.link = link;
}

/*cena szukarka*/
cenaCur = 0;
function linkiUp(a,idPrefix,limit){
	cenaCur--;
	
	if(cenaCur<=0){cenaCur = 0;}
	var end = cenaCur+limit;	
	if(end > a.length ){end = a.length -limit}
	var j = 1;	
	for(var i=cenaCur;i<end;i++){
		var id = idPrefix+j;
		var  el = document.getElementById(id);
		el.innerHTML = '<a href="'+a[i].link+'">'+a[i].nazwa+'</a>';		
		j++;
	}
}
function linkiDw(a,idPrefix,limit){	
	cenaCur++;
	var end = cenaCur+limit;		
	if(end > a.length ){end = a.length -limit}
	var j = 1;	
	for(var i=cenaCur;i<end;i++){
		var id = idPrefix+j;
		var  el = document.getElementById(id);
		el.innerHTML = '<a href="'+a[i].link+'">'+a[i].nazwa+'</a>';
		//alert(j);
		j++;
	}
}
function fillCena(a,idPrefix,limit){
	j=1;
	for(var i=0;i<limit;i++){
		var id = idPrefix+j;
		var  el = document.getElementById(id);		
		el.innerHTML = '<a href="'+a[i].link+'">'+a[i].nazwa+'</a>';
		j++;
	}			
}
/*cena szukarka*/
ProducentCur = 0;
function PlinkiUp(a,idPrefix,limit){
	ProducentCur--;
	var end = 0;
	if(a.length>=limit){
		if(ProducentCur<=0){ProducentCur = 0;}
		end = ProducentCur+limit;	
		if(end > a.length ){end = a.length -limit}
	}else{ end = a.length; ProducentCur = 0; }
	//alert('cur = '+ProducentCur +' end='+end+ ' lenght='+a.length)	
	var j = 1;	
	for(var i=ProducentCur;i<end;i++){
		var id = idPrefix+j;
		var  el = document.getElementById(id);
		el.innerHTML = '<a href="'+a[i].link+'">'+a[i].nazwa+'</a>';		
		j++;
	}
}
function PlinkiDw(a,idPrefix,limit){	
	ProducentCur++;
	var end = 0;
	if(a.length >= limit){
		end = ProducentCur+limit;		
		if(end > a.length ){end = a.length; ProducentCur = a.length -limit;}
		if(end <=0){end= a.length; ProducentCur--; return; }
	}	
	else{end = a.length; ProducentCur = 0;}
	//alert('cur = '+ProducentCur +' end='+end+ ' lenght='+a.length)	
	var j = 1;
	for(var i=ProducentCur;i<end;i++){
		var id = idPrefix+j;
		var  el = document.getElementById(id);
		el.innerHTML = '<a href="'+a[i].link+'" style="margin:0px;padding:0px;border:0px;">'+a[i].nazwa+'</a>';		
		j++;
	}
}
function fillPlinki(a,idPrefix,limit){
	j=1;
	for(var i=0;i<limit;i++){
		if(a[i] == null){ continue; }
		if(a[i].link ==""){ continue; }
		var id = idPrefix+j;
		var  el = document.getElementById(id);
		el.innerHTML = '<a href="'+a[i].link+'">'+a[i].nazwa+'</a>';				
		j++;
	}
}
/*Pokrewne szukarka*/
KategoirePokrewneCur = 0;
function kategoriePokrewneUp(a,idPrefix,limit){
	KategoirePokrewneCur--;
	
	if(KategoirePokrewneCur<=0){KategoirePokrewneCur = 0;}
	var end = KategoirePokrewneCur+limit;	
	if(end > a.length ){end = a.length -limit}
	var j = 1;		
	for(var i=KategoirePokrewneCur;i<end;i++){
		var id = idPrefix+j;
		var  el = document.getElementById(id);
		var nazwa = a[i].nazwa;
		var nazwaShort = nazwa;
		if(nazwa.length>30){ nazwaShort = nazwa.substr(0,30)+'...';}
		
		el.innerHTML = '<a href="'+a[i].link+'" alt="'+nazwa+'" title="'+nazwa+'">'+nazwaShort+'</a>';		
		j++;
	}
}
function kategoriePokrewneDw(a,idPrefix,limit){	
	KategoirePokrewneCur++;
	//alert('aaaa'+ ' lenght='+a.length);
	var end = KategoirePokrewneCur+limit;		
	if(end > a.length ){end = a.length -limit}
	var j = 1;
	//alert('cur = '+KategoirePokrewneCur +' end='+end+ ' lenght='+a.length)	
	for(var i=KategoirePokrewneCur;i<end;i++){
		var id = idPrefix+j;
		var  el = document.getElementById(id);
		var nazwa = a[i].nazwa;
		var nazwaShort = nazwa;
		if(nazwa.length>30){ nazwaShort = nazwa.substr(0,30)+'...';}		
		el.innerHTML = '<a href="'+a[i].link+'" alt="'+nazwa+'" title="'+nazwa+'">'+nazwaShort+'</a>';		
		j++;
	}
}
function fillKategoriePokrewne(a,idPrefix,limit){
	j=1;
	for(var i=0;i<limit;i++){		
		if(a[i] == null){ return; }
		var id = idPrefix+j;
		var  el = document.getElementById(id);
		var nazwa = a[i].nazwa;
		var nazwaShort = nazwa;
		if(nazwa.length>30){ nazwaShort = nazwa.substr(0,30)+'...';}
		el.innerHTML = '<a href="'+a[i].link+'" alt="'+nazwa+'" title="'+nazwa+'">'+nazwaShort+'</a>';
		j++;
	}
}
/*cena szukarka*/

function KoszUp(){
	koszCur++;	
	dispalyProduct();
}

function dispalyProduct(){
	var dl = koszZawartosc.length -1;	
	var endKur =koszCur+3;
	
	if((koszCur+3) >=dl){ koszCur = dl-3; }
	if(dl>=endKur){dl = endKur; }
	
	
	j = 1;
	for(i=koszCur;i<=dl;i++){
		if(koszZawartosc[i] == null){ continue; }
		var nazwa = koszZawartosc[i].nazwa;
		var link  = koszZawartosc[i].link;
		var cena  = koszZawartosc[i].cena;
		var bezSpacji  = koszZawartosc[i].bezSpacji;
		var nazwaShort = nazwa;
		if(nazwa.length>9){ nazwaShort = nazwa.substr(0,9)+'...';}
		//alert(link);
		var s ='<a href="'+link+'" alt="'+nazwa+'" title="'+nazwa+'">&nbsp;&nbsp;'+nazwaShort+'</a>'+cena+' zł';
		document.getElementById('kosz'+j).innerHTML = s;
		j++;
	}
}

function KoszDw(){
	koszCur--;
	if(koszCur <=0){koszCur = 0;}
	//alert(koszCur);
	dispalyProduct();
}

function showHideId(idName){
	var el = document.getElementById(idName);			
	var display = el.style.display;		
	
	if(display =='block'){ el.style.display='none';  removeKat(idName);}
	else{ el.style.display='block'; addKat(idName); }		
}

function getAllKat(){
	var kat =  GetCookie("kategorie");
	if(kat==null){return false;}
	var kat =  GetCookie("kategorie");
	var tab = kat.split("|_|");		
	for(i=0; i<tab.length;i++){ 
		
		var el = tab[i];
		//alert(el+ ' i = '+ i);
		//if(i == 1){continue;}
		if(el == ""){ continue;}
		//alert(el);;
		document.getElementById(el).style.display="block";
		
	}
}
function clearKat(){
	SetCookie ("kategorie", "");	
}

function addKat(idKat)
{
	var expdate = new Date ();
	FixCookieDate (expdate); // Correct for Mac date bug - call only once for given Date object!
	expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000)); // 24 hrs from now 	
	var kat =  GetCookie("kategorie");
	if(kat == null){ kat='';}
	SetCookie ("kategorie", kat+idKat+"|_|",expdate,"/","capslock.pl");	
}
function removeKat(idKat){	
	var expdate = new Date ();
	FixCookieDate (expdate); // Correct for Mac date bug - call only once for given Date object!
	expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000)); // 24 hrs from now 	
	var kat =  GetCookie("kategorie");
	if(kat == null){ kat=''; return false;}	
	var str  = "";
	var tab = kat.split("|_|");
	kat = "";
	for(i=0; i<tab.length;i++){ if(tab[i] == idKat){ continue; }
		if((i+1) == tab.length){kat+=tab[i];}
		else{kat+=tab[i]+"|_|"};
	}
	SetCookie ("kategorie", kat,expdate,"/","capslock.pl");	
}
function FixCookieDate (date) {
  var base = new Date(0);
  var skew = base.getTime(); // dawn of (Unix) time - should be 0
  if (skew > 0)  // Except on the Mac - ahead of its time
    date.setTime (date.getTime() - skew);
}
function GetCookie (name) {
  var arg = name + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
      return getCookieVal (j);
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}
function getCookieVal (offset) {
  var endstr = document.cookie.indexOf (";", offset);
  if (endstr == -1)
    endstr = document.cookie.length;
  return unescape(document.cookie.substring(offset, endstr));
}
function SetCookie (name,value,expires,path,domain,secure) {
  document.cookie = name + "=" + escape (value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}
function DeleteCookie (name,path,domain) {
  if (GetCookie(name)) {
    document.cookie = name + "=" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}




/* Simple AJAX Code-Kit (SACK) v1.6.1 */
/* ©2005 Gregory Wild-Smith */
/* www.twilightuniverse.com */
/* Software licenced under a modified X11 licence,
   see documentation or authors website for more details */

function sack(file) {
	this.xmlhttp = null;

	this.resetData = function() {
		this.method = "POST";
  		this.queryStringSeparator = "?";
		this.argumentSeparator = "&";
		this.URLString = "";
		this.encodeURIString = true;
  		this.execute = false;
  		this.element = null;
		this.elementObj = null;
		this.requestFile = file;
		this.vars = new Object();
		this.responseStatus = new Array(2);
  	};

	this.resetFunctions = function() {
  		this.onLoading = function() { };
  		this.onLoaded = function() { };
  		this.onInteractive = function() { };
  		this.onCompletion = function() { };
  		this.onError = function() { };
		this.onFail = function() { };
	};

	this.reset = function() {
		this.resetFunctions();
		this.resetData();
	};

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				this.xmlhttp = null;
			}
		}

		if (! this.xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlhttp = new XMLHttpRequest();
			} else {
				this.failed = true;
			}
		}
	};

	this.setVar = function(name, value){
		this.vars[name] = Array(value, false);
	};

	this.encVar = function(name, value, returnvars) {
		if (true == returnvars) {
			return Array(encodeURIComponent(name), encodeURIComponent(value));
		} else {
			this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
		}
	}

	this.processURLString = function(string, encode) {
		encoded = encodeURIComponent(this.argumentSeparator);
		regexp = new RegExp(this.argumentSeparator + "|" + encoded);
		varArray = string.split(regexp);
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split("=");
			if (true == encode){
				this.encVar(urlVars[0], urlVars[1]);
			} else {
				this.setVar(urlVars[0], urlVars[1]);
			}
		}
	}

	this.createURLString = function(urlstring) {
		if (this.encodeURIString && this.URLString.length) {
			this.processURLString(this.URLString, true);
		}

		if (urlstring) {
			if (this.URLString.length) {
				this.URLString += this.argumentSeparator + urlstring;
			} else {
				this.URLString = urlstring;
			}
		}

		// prevents caching of URLString
		this.setVar("rndval", new Date().getTime());

		urlstringtemp = new Array();
		for (key in this.vars) {
			if (false == this.vars[key][1] && true == this.encodeURIString) {
				encoded = this.encVar(key, this.vars[key][0], true);
				delete this.vars[key];
				this.vars[encoded[0]] = Array(encoded[1], true);
				key = encoded[0];
			}

			urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
		}
		if (urlstring){
			this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
		} else {
			this.URLString += urlstringtemp.join(this.argumentSeparator);
		}
	}

	this.runResponse = function() {
		eval(this.response);
	}

	this.runAJAX = function(urlstring) {
		if (this.failed) {
			this.onFail();
		} else {
			this.createURLString(urlstring);
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
					try {
						this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
					} catch (e) { }
				}

				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState) {
						case 1:
							self.onLoading();
							break;
						case 2:
							self.onLoaded();
							break;
						case 3:
							self.onInteractive();
							break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;

							if (self.execute) {
								self.runResponse();
							}

							if (self.elementObj) {
								elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input"
								|| elemNodeName == "select"
								|| elemNodeName == "option"
								|| elemNodeName == "textarea") {
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							if (self.responseStatus[0] == "200") {
								self.onCompletion();
							} else {
								self.onError();
							}

							self.URLString = "";
							break;
					}
				};

				this.xmlhttp.send(this.URLString);
			}
		}
	};

	this.reset();
	this.createAJAX();
}


var ajax = new sack();

function whenLoading(){
/*	winW =  Math.round(document.body.offsetWidth/2)-150;
	winH = Math.round(screen.availHeight/2)-200;	
	var el = document.getElementById('ajax_box');
	el.style.display = 'block';
	el.style.top  = winH+'px';
	el.style.left = winW+'px';					
*/
}
function whenLoaded(){
	var el = document.getElementById('ajax_box');
	el.style.display = 'none';	
}
function whenInteractive(){}
function whenCompleted(){	
	if (ajax.responseStatus){
		var string = "<p>Status Code: " + ajax.responseStatus[0] + "</p><p>Status Message: " + ajax.responseStatus[1] + "</p><p>URLString Sent: " + ajax.URLString + "</p>";
	} else {
		var string = "<p>URLString Sent: " + ajax.URLString + "</p>";
	}
	
	var val = "";
	var a = new Array(); 
	var b = new Array();
	val = ajax.response;		
	a = val.split("|___|");	
	
	var id_pole2 = document.getElementById('id_pole2');		
	id_pole2.length = a.length-1
	for(i = 0;i<(a.length-1);i++){
		var c = new Array();
		c = a[i].split("|_|");
		id_pole2.options[i].text = c[1];
		id_pole2.options[i].value = c[0];
		//b[i] = new OptionCp(c[0],c[1]);		
	}
	
}
function OptionCp(id,name){
	this.id = id;
	this.name = name;
}

function getPodKat(){		
	var val = document.getElementById('id_pole1').value;
	document.location.href="http://"+val+"?f=1";
	/*
	ajax.method = 'POST';
	ajax.setVar("id_pole1", val);		
	ajax.requestFile = "/mod/__ajax_main_szukaj.php";	
	ajax.element = 'replaceme';
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenCompleted;	
	ajax.runAJAX();
	*/
}

function whenProducentCompleted(){	
	if (ajax.responseStatus){
		var string = "<p>Status Code: " + ajax.responseStatus[0] + "</p><p>Status Message: " + ajax.responseStatus[1] + "</p><p>URLString Sent: " + ajax.URLString + "</p>";
	} else {
		var string = "<p>URLString Sent: " + ajax.URLString + "</p>";
	}
	
	var val = "";
	val = ajax.response;		
	//alert('val = '+ val);
	a = val.split("|___|");	
	
	var id_pole2 = document.getElementById('id_pole3');		
	id_pole2.length = a.length-1
	for(i = 0;i<(a.length-1);i++){
		var c = new Array();
		c = a[i].split("|_|");
		id_pole2.options[i].text = c[1];
		id_pole2.options[i].value = c[0];		
	}
}
function getProducentKat(){		
	var val = document.getElementById('id_pole2').value;
	//alert('val = '+val);
	ajax.method = 'POST';
	ajax.setVar("id_pole2", val);		
	ajax.setVar("id_pole1", "");		
	ajax.requestFile = "/mod/__ajax_main_szukaj.php";	
	ajax.element = 'replaceme';
	ajax.onLoading = whenLoading;
	ajax.onLoaded = whenLoaded; 
	ajax.onInteractive = whenInteractive;
	ajax.onCompletion = whenProducentCompleted;	
	ajax.runAJAX();
}
function sendForm(idName){
	var val = document.getElementById('id_pole2').value;	
	
	document.location.href="http://"+val+"?f=1";
	return;
	/*
	var el = document.getElementById(idName);
	el.submit();
	*/
}

function whenLoadedKosz(){
	//var el = document.getElementById('ajax_box');
	//el.style.display = 'none';	
}

function whenLoadingKosz(){
		var winW =  Math.round(document.body.offsetWidth/2)-110;
		var winH =  90;
		document.getElementById('ajax_box').style.top  = winH+'px';
		document.getElementById('ajax_box').style.left = winW+'px';
		document.getElementById('ajax_b').innerHTML  = 'Usuwam z kosza ...';		
		document.getElementById('ajax_box').style.display = 'block';		
}


function nodes(idEl,ciagSzukany){
		var el = document.getElementById(idEl);
		for( var x = 0; el.childNodes[x]; x++ ){
			if(el.childNodes[x].innerHTML == null){continue; }			
			var subEl = el.childNodes[x];
			for( var x = 0; subEl.childNodes[x]; x++ ){
				if( subEl.childNodes[x].innerHTML == null ){ continue; }			
				var dEl = subEl.childNodes[x];
				if(find(dEl,ciagSzukany) == true){
					
					return true;
				}
				
			}
		}
		return false;
	}

function find(cDiv,ciagSzukany)
{
		for( var x = 0; cDiv.childNodes[x]; x++ ){
			if(cDiv.childNodes[x].href == null){ continue; }
			if(cDiv.childNodes[x].href.indexOf(ciagSzukany) >0){ 
					cDiv.style.color='#000';
					cDiv.style.fontWeight='bold';
			return true; 
			}
		}
		return false;
}	

var gIdDiv = null;
function whenDeleted(){	
	var divId = gIdDiv;
	if (ajax.responseStatus){
		var string = "<p>Status Code: " + ajax.responseStatus[0] + "</p><p>Status Message: " + ajax.		responseStatus[1] + "</p><p>URLString Sent: " + ajax.URLString + "</p>";
	} else {
		var string = "<p>URLString Sent: " + ajax.URLString + "</p>";
	}
	//alert(divId);
	var tmpArr =new Array();
	document.getElementById(divId).style.display = 'none';	
	var sResponse = ajax.response.replace(/^\s+|\s+$/, '');
	if(sResponse == "0"){
		document.getElementById('kosz_pelny').style.display = 'none';
		document.getElementById('spanZamawiam').style.display = 'none';
		document.getElementById('kosz_pusty').style.display = 'block';
	}
	
	
	var dl = koszZawartosc.length;
	var rem = -1;
	for(i=0;i<dl;i++){	
		var url = koszZawartosc[i].link;
		var lastPos = url.lastIndexOf('/')+1;  //alert(lastPos);
		var id = url.substr(lastPos); //alert(id);
		var thisId = divId.substr(5); 
		if(thisId == id){ rem = i; /*alert(id+ ' ' +i+' '+thisId);*/ break;}
	}
	k = 0;
	for(j = 0;j<dl;j++){
		if(j == rem){ continue; }		 
		tmpArr[k] = new Produkt(koszZawartosc[j].nazwa,koszZawartosc[j].link,koszZawartosc[j].cena,koszZawartosc[j].bezSpacji);						
		k++;
	}
	koszZawartosc = new Array();	
	koszZawartosc = tmpArr;
	dl = 0;
	dl = koszZawartosc.length;	
	var ji = 1;
	var suma = 0;
	document.getElementById('kosz1').innerHTML = '';
	document.getElementById('kosz2').innerHTML = '';
	document.getElementById('kosz3').innerHTML = '';
	document.getElementById('kosz4').innerHTML = '';
	
		for(jj =0; jj<dl ;jj++){
			if(koszZawartosc[jj] == null){ continue; }
			suma += eval(koszZawartosc[jj].cena);
			if(jj>4){continue;}	
			
			
			var nazwa = koszZawartosc[jj].nazwa;
			var link  = koszZawartosc[jj].link;
			var cena  = koszZawartosc[jj].cena;
			var bezSpacji  = koszZawartosc[jj].bezSpacji;
			var nazwaShort = nazwa;
			if(nazwa.length>9){ nazwaShort = nazwa.substr(0,9)+'...';}
			var s ='<a href="'+link+'" alt="'+nazwa+'" title="'+nazwa+'">&nbsp;&nbsp;'+nazwaShort+'</a>'+cena+' zł';			
			if(ji==1){
				document.getElementById('kosz1').innerHTML = s;
			}
			if(ji==2){
				document.getElementById('kosz2').innerHTML = s;
			}
			if(ji==3){
				document.getElementById('kosz3').innerHTML = s;
			}
			if(ji==4){
				document.getElementById('kosz4').innerHTML = s;
			}
			ji++;
		}
		//document.getElementById('suma_wszystkich').innerHTML = suma;	
		document.getElementById('ajax_box').style.display = 'none';	
		document.getElementById('ajax_b').innerHTML  = 'Dodaję do kosza ...';			
}
function rmAjaxKosz(prodId,divId,ses){	
			gIdDiv = divId
			ajax.method = 'POST';			
			ajax.setVar("sess",ses);		
			ajax.setVar("prodId",prodId);		
			ajax.requestFile = '/mod/__ajax_main_szukaj.php';	
			ajax.element = 'replaceme';
			ajax.onLoading = whenLoadingKosz;
			ajax.onLoaded = whenLoadedKosz;
			ajax.onInteractive = whenInteractive;			
			ajax.onCompletion = whenDeleted;	
			ajax.runAJAX();
}



function whenLoadingKodPromocyjny(){
		var winW =  Math.round(document.body.offsetWidth/2)-110;
		var winH =  90;
		document.getElementById('ajax_box').style.top  = winH+'px';
		document.getElementById('ajax_box').style.left = winW+'px';
		document.getElementById('ajax_b').innerHTML  = 'Proszę czekać ...';		
		document.getElementById('ajax_box').style.display = 'block';		
}

function onCompletionKodPromocyjny(){	
	var divId = gIdDiv;
	if (ajax.responseStatus){
		var string = "<p>Status Code: " + ajax.responseStatus[0] + "</p><p>Status Message: " + ajax.		responseStatus[1] + "</p><p>URLString Sent: " + ajax.URLString + "</p>";
	} else {
		var string = "<p>URLString Sent: " + ajax.URLString + "</p>";
	}				
		document.getElementById('ajax_box').style.display = 'none';	
		document.getElementById('ajax_b').innerHTML  = 'Dodaję do kosza ...';
		
		
		var sResponse = ajax.response.replace(/^\s+|\s+$/, '');		
		try{
			if(sResponse == "error 1"){
				throw "Twój kod promocyjny jest niepoprawny";
			}								
				var aResponseAll = sResponse.split("|__|");
				for(i=0; i<aResponseAll.length;i++){
					if(aResponseAll[i]==""){ continue ; }
					var sOne = aResponseAll[i];
					var aOne = sOne.split("|_|");
					var sKodProduktu = aOne[0];
					sKodProduktu = sKodProduktu.replace(/^\s+|\s+$/, '');
					var glownyDiv = "promocja"+sKodProduktu;
					var nazwaElement  ="cena"+sKodProduktu;
					var rabatElement = "rabat"+sKodProduktu;
					var cenaVartosc = aOne[1];
					var rabatVartosc = aOne[2];
					if(sKodProduktu== 'suma'){
						//alert(aOne[1]+" "+aOne[2]+" ");						
						document.getElementById('cena_suma_rabat_sw').innerHTML = aOne[2];
						document.getElementById('rabat_suma_rabat_sw').innerHTML = "-"+aOne[1];
						document.getElementById('promocja_suma_rabat_sw').style.display = 'block';
						
						if(document.getElementById('cena_suma_rabat_sw_end')!=null){
							document.getElementById('cena_suma_rabat_sw_end').innerHTML = aOne[2];							
							document.getElementById('rabat_suma_rabat_sw_end').innerHTML = "-"+aOne[1];
							document.getElementById('promocja_suma_rabat_sw_end').style.display = 'block';							
						}						
						continue; 
					}										
					if(document.getElementById(nazwaElement)== null){ continue; }						
						document.getElementById(nazwaElement).innerHTML = cenaVartosc;
						document.getElementById(rabatElement).innerHTML = "-"+rabatVartosc;
						document.getElementById(glownyDiv).style.display = 'block';
						if(document.getElementById(nazwaElement+"_end")!=null){
							document.getElementById(nazwaElement+"_end").innerHTML = cenaVartosc;
							document.getElementById(rabatElement+"_end").innerHTML = "-"+rabatVartosc;
							document.getElementById(glownyDiv+"_end").style.display = 'block';
						}						
				}			
		}
		catch(e){	
			var winW =  Math.round(document.body.offsetWidth/2)-110;		
			var winH =  90;
			var alert_span  = document.getElementById('alert_span');
			var ajax_box_el = document.getElementById('ajax_box_alert');
			alert_span.innerHTML = e;
			ajax_box_el.style.top  = winH +'px';
			ajax_box_el.style.left = (winW) +'px';	
			ajax_box_el.style.display = 'block'
			return;
		}
}



function kodPromocyjnyAjaxKosz(SESSION){
			ajax = new sack(); 
			ajax.method = 'POST';			
			var kod = "";
			if(document.getElementById('kodPromocyjnyKoniec') !=null){
				kod =document.getElementById('kodPromocyjnyKoniec').value;
			}else{
				kod = document.getElementById('kodPromocyjny').value;
			}							
			ajax.setVar("SESSION",SESSION);
			ajax.setVar("kodPromocyjnyAjaxKosz","ok");
			ajax.setVar("promoKod",kod);
			
			ajax.requestFile = '/mod/__ajax_main_szukaj.php';	
			ajax.element = 'replaceme';
			ajax.onLoading = whenLoadingKodPromocyjny;
			ajax.onLoaded = whenLoadedKosz;
			ajax.onInteractive = whenInteractive;			
			ajax.onCompletion = onCompletionKodPromocyjny;	
			ajax.runAJAX();
}



function whenLoadingUpdateDaneUser(){		
		
		var x = findPosX(document.getElementById('iNrMieszkania'));
		var y = findPosY(document.getElementById('iNrMieszkania'));			
		document.getElementById('ajax_box').style.top  = (y-100)+'px';
		document.getElementById('ajax_box').style.left = (x-180)+'px';		
		document.getElementById('ajax_b').innerHTML  = 'Proszę czekać ...';		
		document.getElementById('ajax_box').style.display = 'block';
}
function onCompletionUpdateDaneUser(){		
	if (ajax.responseStatus){
		var string = "<p>Status Code: " + ajax.responseStatus[0] + "</p><p>Status Message: " + ajax.		responseStatus[1] + "</p><p>URLString Sent: " + ajax.URLString + "</p>";
	} else {
		var string = "<p>URLString Sent: " + ajax.URLString + "</p>";
	}				
		document.getElementById('ajax_box').style.display = 'none';	
		document.getElementById('ajax_b').innerHTML  = 'Dodaję do kosza ...';
		var sResponse = ajax.response.replace(/^\s+|\s+$/, '');
		
		document.getElementById('sImie').style.backgroundColor = '#ffffff';
		document.getElementById('sNazwisko').style.backgroundColor = '#ffffff';
		document.getElementById('sUlica').style.backgroundColor = '#ffffff';
		document.getElementById('sMail').style.backgroundColor = '#ffffff';
		document.getElementById('sTelefon').style.backgroundColor = '#ffffff';
		document.getElementById('iNrDomu').style.backgroundColor = '#ffffff';
		document.getElementById('iNrMieszkania').style.backgroundColor = '#ffffff';
		document.getElementById('sMiasto').style.backgroundColor = '#ffffff';
		document.getElementById('sKod').style.backgroundColor = '#ffffff';
		
		try{
			if(sResponse == "error sImie"){
				document.getElementById('sImie').style.backgroundColor = '#FF0000';
				throw "Prosze podaj imie";
			}
			if(sResponse == "error sNazwisko"){
				document.getElementById('sNazwisko').style.backgroundColor = '#FF0000';
				throw "Prosze podaj nazwisko";
			}
			if(sResponse == "error sUlica"){
				document.getElementById('sUlica').style.backgroundColor = '#FF0000';
				throw "Prosze podaj Ulice";
			}
			if(sResponse == "error sMail"){
				document.getElementById('sMail').style.backgroundColor = '#FF0000';
				throw "Prosze podaj adres mail";
			}
			
			if(sResponse == "error sTelefon"){
				document.getElementById('sTelefon').style.backgroundColor = '#FF0000';
				throw "Prosze podaj telefon";
			}
			
			if(sResponse == "error iNrDomu"){
				document.getElementById('iNrDomu').style.backgroundColor = '#FF0000';
				throw "Prosze podaj  nr domu";
			}
			
			if(sResponse == "error iNrMieszkania"){
				document.getElementById('iNrMieszkania').style.backgroundColor = '#FF0000';
				throw "Prosze podaj  nr mieszkania";
			}
			
			if(sResponse == "error sMiasto"){
				document.getElementById('sMiasto').style.backgroundColor = '#FF0000';
				throw "Prosze podaj miasto";
			}
			if(sResponse == "error sKod"){
				document.getElementById('sKod').style.backgroundColor = '#FF0000';
				throw "Prosze podaj kod pocztowy";
			}
			var x = findPosX(document.getElementById('iNrMieszkania'));
			var y = findPosY(document.getElementById('iNrMieszkania'));			
			var alert_span  = document.getElementById('alert_span');
			var ajax_box_el = document.getElementById('ajax_box_alert');
			alert_span.innerHTML = "Twoje dane zostały zmienione";
			ajax_box_el.style.top  = (y-100) +'px';
			ajax_box_el.style.left = (x-180) +'px';	
			ajax_box_el.style.display = 'block';
		}
		catch(e){ 			
			var alert_span  = document.getElementById('alert_span');
			var ajax_box_el = document.getElementById('ajax_box_alert');
			var x = findPosX(document.getElementById('iNrMieszkania'));
			var y = findPosY(document.getElementById('iNrMieszkania'));			
			ajax_box_el.style.top  = (y-100) +'px';
			ajax_box_el.style.left = (x-180) +'px';	
			
			
			alert_span.innerHTML = e;
			
			ajax_box_el.style.display = 'block';			
		}
}

function updateDaneUserAjax(SESSION,iIdUser){
			ajax = new sack(); 
			ajax.method = 'POST';
			ajax.setVar("SESSION_ID",SESSION);
			ajax.setVar("iIdUser",iIdUser);
			ajax.setVar("update_dane",true);
			
			ajax.setVar("sImie",document.getElementById('sImie').value);
			ajax.setVar("sNazwisko",document.getElementById('sNazwisko').value);
			ajax.setVar("sMail",document.getElementById('sMail').value);
			ajax.setVar("sTelefon",document.getElementById('sTelefon').value);
			ajax.setVar("sUlica",document.getElementById('sUlica').value);
			ajax.setVar("iNrDomu",document.getElementById('iNrDomu').value);
			ajax.setVar("iNrMieszkania",document.getElementById('iNrMieszkania').value);
			ajax.setVar("sMiasto",document.getElementById('sMiasto').value);
			ajax.setVar("sKod",document.getElementById('sKod').value);
			ajax.setVar("sNip",document.getElementById('sNip').value);
			ajax.setVar("sFirma",document.getElementById('sFirma').value);
			
			ajax.requestFile = '/mod/__ajax_main_szukaj.php';	
			ajax.element = 'replaceme';
			ajax.onLoading 		= whenLoadingUpdateDaneUser;
			ajax.onLoaded 		= whenLoadedKosz;
			ajax.onInteractive 	= whenInteractive;			
			ajax.onCompletion 	= onCompletionUpdateDaneUser;	
			ajax.runAJAX();
}


var gEl = null;
var gElSm = null;
var gX  = 0;
var gXX = 0;
var gY = 0;
var gYY = 0;
var iii = 200;
var gXSmall =0;
var gYSmall =0;
var bRozwiniete = false;
var bMoznaZwijac = 0;
var ileProduktow = 0;
function initMe(){
	if(bRozwiniete == true){return;}
	bRozwiniete = true;
	gEl = document.getElementById('smoth');
	gElSm = document.getElementById('basketSmall');
	gXSmall = findPosX(gElSm);
	gYSmall = findPosY(gElSm);	
	gX = gEl.style.width; gX = parseInt(gX);
	gY = gEl.style.height;gY = parseInt(gY);
	gEl.style.border='2px solid #E9E7E8';
	gEl.style.display= 'block';	
	gXSmall +=150;
	gEl.style.left=gXSmall+'px';
	gEl.style.top=gYSmall+'px';
}

function smoothMe(){
	//alert(gXSmall);
	if (navigator.appVersion.indexOf("MSIE")!=-1){
		
		gXX = 480;
		gYY=192;		
		gXSmall -=480;
		//alert('gXSmall'+gXSmall);
		//return;
	}

	var x = gXX;
	var y = gYY;
	gEl.style.width = x+'px';
	gEl.style.height = y+'px';
	if(gXX>440)
	{
		gEl.style.left=(gXSmall+5)+'px';
		document.getElementById('basketIn').style.display= 'block';
		gEl.style.border='0px solid white';
		bMoznaZwijac = 1;
//		alert('gXX'+gXX+' gYY'+gYY+' gXSmall'+gXSmall);
	
		return;
	}
	
	gEl.style.left=gXSmall+'px';
	gXX+=40;
	gYY+=16;
	gXSmall -=40;	
	
	
	setTimeout('smoothMe()',1);
}

function rollMe(){
	if(bMoznaZwijac <= 0){ bMoznaZwijac++; return ;}
	document.getElementById('basketIn').style.display= 'none';
	gEl.style.border='2px solid #E9E7E8';
	smoothOut();
}
function smoothOut(){
	if (navigator.appVersion.indexOf("MSIE")!=-1){
		
		gXX =0;
		gYY=0;		
		gXSmall +=480;
		//alert('gXSmall'+gXSmall);
		//return;
	}

	var x = gXX;
	var y = gYY;
	gEl.style.width = x+'px';
	gEl.style.height = y+'px';
	if(gXX<=0){
		gEl.style.left=(gXSmall)+'px';	
		gEl.style.display= 'none';	
		bMoznaZwijac = 0;
		bRozwiniete = false;
		//alert('gXX'+gXX+' gYY'+gYY+' gXSmall'+gXSmall);
		return;
	}
		
	
	gEl.style.left=gXSmall+'px';
	gXX-=40;
	gYY-=16;
	gXSmall +=40;	
	setTimeout('smoothOut()',1);
}
function alertMe(){
	smoothMe();	
}

function findPosX(obj){
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}
function findPosY(obj){
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}
/*
function doKoszaSzukarka(idProduktu ,brutto , netto, nazwa ,prUrl,powUrl,produktIlosc){
		var flaga;
		flaga = 1;
		if(produktIlosc == 'snazamow.gif'){
			flaga = confirm("Towar tylko na zamówienie\n Dzwoń: 089-533-20-10 ; 601-369-723\n Jeżeli otrzymałe¶ potwierdzenie dostępności towaru kliknij: Ok.");
			//alert(flaga);
		}
		if(flaga == true){
		document.fkupProdukt.elements[1].value = idProduktu;
		document.fkupProdukt.elements[2].value = brutto;
		document.fkupProdukt.elements[3].value = netto;
		
		a = document.fkupProdukt.kup_id.value= idProduktu;
		b = document.fkupProdukt.kup_netto.value= netto;
		c = document.fkupProdukt.kup_brutto.value= brutto;
		d = document.fkupProdukt.kup_nazwa.value= nazwa;
		f = document.fkupProdukt.kup_url.value= prUrl;
		f = document.fkupProdukt.kup_powurl.value= powUrl;
//		alert(f);
		document.fkupProdukt.submit();
		}
	}
*/
var moveUpEl = null
	
function moveLeftUpElement(){
	if(moveUpEl == null){
		moveUpEl = document.getElementById('moveUpEl')
	}		
	var x = moveUpEl.style.left.replace("px","");
	x--;
	if(x<-2000){x = 0}
	moveUpEl.style.left=x+"px";
	setTimeout("moveLeftUpElement()",50);
	return true;	
}

function showHide(idName){
	var el = document.getElementById(idName);			
	var display = el.style.display;			
	if(display =='block'){ el.style.display='none';}
	else{ el.style.display='block'; }
	return true;
}

function PoliczRate(koszyk) {
window.open('http://www.zagiel.com.pl/kalkulator/index_smart.php?action=getklientdet_si_rata&shopNo=16440754&goodsValue='+koszyk, 'Policz_rate','width=630,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
}

function PokazZasadyZagiel()
{
window.open('http://www.zagiel.com.pl/kalkulator/jak_kupic.html', 'nowe_okno',
'width=600,height=500,directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no');
}