<!-- //

var from = escape(document.referrer);
var query = location.search;
var colorDepth = window.screen.colorDepth;			
var res = window.screen.width + "," + window.screen.height;
document.write("<img src='statystyka/zlicz.php?referer=" + from + "&query=" + query + "&kolory=" + colorDepth + "&rozdzielczosc=" + res + "' align='middle' style='display:none'>");

function Rozpoznanie(warstwa)
{
	if(document.all)
	{
		warstwa = document.all(warstwa);
	}
	else if(document.getElementById)
	{
		warstwa = document.getElementById(warstwa);
	}
   else if(document.layers)
	{
		warstwa = document.layers[warstwa];
	}
   return warstwa;
}

function PowiekszZdjecie(url)
{
	var okno = null;
	if(okno) okno.close();
	var ScrWidth = 640;
	var ScrHeight = 480;
	var width = 640;
	var height = 640;
	if(window.screen)
  	{
   	ScrWidth = window.screen.width; 
		ScrHeight = window.screen.height;
  	}
  	PosX = Math.round((ScrWidth - width) / 2);
  	PosY = Math.round((ScrHeight - height) / 2);
  	width = width;
  	height = height;
  	okno = window.open("pokaz_zdjecie.php?url="+url, "zdjecie", "menubar=no,toolbar=no,location=no,directories=no,status=yes,scrollbars=no,resizable=no,copyhistory=no,width=" + width + ",height=" + height + ",left=" + PosX + ",top=" + PosY);
  	okno.focus();	
}

function policz()
{
	var f = document.forms["cennik"];
	var cena = 0.00;

	if(f.elements["silnik"].length == undefined)
	{
		cena = parseFloat(f.elements["silnik"].value);
	}
	else
	{
		for(var i = 0; i < f.elements["silnik"].length; i++)
		{
			if(f.elements["silnik"][i].checked)
			{
				cena = parseFloat(f.elements["silnik"][i].value);
			}
		}
	}

	var wyp_ilosc = f.elements["wyp_ilosc"].value;
	for(i = 0; i < wyp_ilosc; i++)
	{
		if(f.elements["wyp"+i].checked)
		{
			cena = cena + parseFloat(f.elements["wyp"+i].value);
		}
	}
	
	var obiekt = Rozpoznanie("cena");
	obiekt.value = FormatWaluty(cena);
}

function FormatIlosci(num)
{
	num = num.toString().replace(/\$|\,/g,"");
	if(isNaN(num))
	{
		num = "0";
	}
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num+0.50000000001);
	return num;
}

function FormatWaluty(num)
{
	num = num.toString().replace(/\$|\,/g,"");
	if(isNaN(num))
	{
		num = "0";
	}
	sign = (num == (num = Math.abs(num)));
	num = Math.floor(num*100+0.50000000001);
	cents = num % 100;
	num = Math.floor(num/100).toString();
	if(cents < 10)
	{
		cents = "0" + cents;
	}
	for(var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
	{
		num = num.substring(0,num.length-(4*i+3))+' '+ num.substring(num.length-(4*i+3));
	}
	return (((sign)?"":"-") + "" + num + "," + cents);
}

// -->
