<!-- Begin
var max_units = 200; // quantities in excess of max_units all have the same unit price
var currency = " zł"; // currency sign used in 'formatMessage()'
// Edit this function to reflect your discount prices! 
function getDiscountPrice(units) {
// Note: It is important to work your way down from max to min amounts!
if (units >= 751) return 0.88;
if (units >= 501) return 0.90;
if (units >= 301) return 0.95;
if (units >= 50) return 1.00;
if (units <= 49) return 0;
}
function getNumberOfUnits() {
var units = document.calculator.units.value; 
return (units == "") ? 0 : units;
}
function showResult(result) {
// adjust the following line if result must popup somewhere else
document.calculator.respons.value = result;	
}
function formatMessage(units, unit_price) {
return units + " * " + formatPrice(unit_price) + currency + " + VAT" + " = " + formatPrice(units * unit_price * 1.22) + currency + " brutto";
}
// AltUnits (alternate units): add extra units to reach minimum for next discount price
function getAltUnits(units) {
var discount_price = getDiscountPrice(units);
if (units < max_units) do { units++ } while (discount_price == getDiscountPrice(units));
return units;
}
function findPrice() {
var units = getNumberOfUnits();
var unit_price = getDiscountPrice(units);
var alt_units = getAltUnits(units);
var alt_unit_price = getDiscountPrice(alt_units);
var result;
if ((units * unit_price) < (alt_units * alt_unit_price)) 
result = formatMessage(units, unit_price); 
else
result = formatMessage(alt_units, alt_unit_price);
showResult(result);
}
function formatPrice(value) {
var result= Math.floor(value) + ".";
var cents = 100 * (value-Math.floor(value)) + 0.5;
result += Math.floor(cents / 10);
result += Math.floor(cents % 10);
return result;
}
function filterNonNumeric(field) {
var result = new String();
var numbers = "0123456789.";
var chars = field.value.split(""); // create array 
for (i = 0; i < chars.length; i++) {
if (numbers.indexOf(chars[i]) != -1) result += chars[i];
}
if (field.value != result) field.value = result;
}
//  End -->
<!--
function licznik()
{
var cena_www = 2.5;
var cena_poddomena = 1;
var cena_htaccess = 1;
var cena_php = 7.5;
var cena_pgsql = 6.5;
var cena_mysql = 9.5;
var cena_mail = 1;
var cena_alias = 0.1;
var cena_cgi = 7;
var cena_stats = 1.5;
var cena_p10 = 1.5;
var cena_p150 = 2.5;
var cena_p300 = 3.5;
var cena_p1000 = 6;
var cena_t1000_ena = 7.5;
var cena_t1000_dis = 15;

	if (document.calc.www.checked) {
		var vwww = document.calc.www.value = cena_www * document.calc.ile_www.value;
	} else {
		var vwww = document.calc.www.value = 0;
	}

	if (document.calc.poddomena.checked) {
		var vpoddomena = document.calc.poddomena.value = cena_poddomena * document.calc.ile_poddomena.value;
	} else {
		var vpoddomena =  document.calc.poddomena.value = 0;
	}

	if (document.calc.htaccess.checked) {
		var vhtaccess = document.calc.htaccess.value = cena_htaccess;
	} else {
		var vhtaccess =  document.calc.htaccess.value = 0;
	}

	if (document.calc.php.checked) {
		var vphp = document.calc.php.value = cena_php;
	} else {
		var vphp = document.calc.php.value = 0;
	}
	
	if (document.calc.pgsql.checked) {
		var vpgsql = document.calc.pgsql.value = cena_pgsql;
	} else {
		var vpgsql = document.calc.pgsql.value = 0;
	}
	
	if (document.calc.mysql.checked) {
		var vmysql = document.calc.mysql.value = cena_mysql;
	} else {
		var vmysql = document.calc.mysql.value = 0;
	}
	
	if (document.calc.mail.checked) {
		var vmail = document.calc.mail.value = cena_mail * document.calc.ile_mail.value;
	} else {
		var vmail = document.calc.mail.value = 0;
	}
	
	if (document.calc.alias.checked) {
		var valias = document.calc.aliasvalue = cena_alias * document.calc.ile_alias.value;
	} else {
		var valias = document.calc.alias.value = 0;
	}
	
	if (document.calc.cgi.checked) {
		var vcgi = document.calc.cgi.value = cena_cgi;
	} else {
		var vcgi = document.calc.cgi.value = 0;
	}
	
	if (document.calc.stats.checked) {
		var vstats = document.calc.stats.value = cena_stats;
	} else {
		var vstats = document.calc.stats.value = 0;
	}
	
	if (document.calc.p10.checked) {
		var vp10 = document.calc.p10.value = cena_p10 * document.calc.ile_p10.value;
	} else {
		var vp10 = document.calc.p10.value = 0;
	}
	
	if (document.calc.p150.checked) {
		var vp150 = document.calc.p150.value = cena_p150 * document.calc.ile_p150.value;
	} else {
		var vp150 = document.calc.p150.value = 0;
	}
        if (document.calc.p300.checked) {
                var vp300 = document.calc.p300.value = cena_p300 * document.calc.ile_p300.value;
        } else {
                var vp300 = document.calc.p300.value = 0;
        }
        if (document.calc.p1000.checked) {
                var vp1000 = document.calc.p1000.value = cena_p1000 * document.calc.ile_p1000.value;
        } else {
                var vp1000 = document.calc.p1000.value = 0;
        }

        if (document.calc.t1000_ena.checked) {
                var vt1000_ena = document.calc.t1000_ena.value = cena_t1000_ena * document.calc.ile_t1000_ena.value;
        } else {
                var vt1000_ena = document.calc.t1000_ena.value = 0;
        }


	document.calc.month.value = Math.round((vwww + vpoddomena + vhtaccess + vphp + vpgsql + vmysql + vmail + valias + vcgi + vstats + vp10 + vp150 + vp300 + vp1000 + vt1000_ena ) * 10) / 10;
	document.calc.three_month.value = Math.round((( vwww + vpoddomena + vhtaccess + vphp + vpgsql + vmysql + vmail + valias + vcgi + vstats + vp10 + vp150 + vp300 + vp1000 + vt1000_ena ) * 3) * 10) / 10;
	document.calc.six_month.value = Math.round((( vwww + vpoddomena + vhtaccess + vphp + vpgsql + vmysql + vmail + valias + vcgi + vstats + vp10 + vp150 + vp300 + vp1000 + vt1000_ena ) * 6) * 10) / 10;
	document.calc.year.value = Math.round((( vwww + vpoddomena + vhtaccess + vphp + vpgsql + vmysql + vmail + valias + vcgi + vstats + vp10 + vp150 + vp300 + vp1000 + vt1000_ena ) * 12) * 10) / 10;
}
-->
