﻿function pt_periodchange(srcobj,addition)
{
	var price_period = srcobj.value.split("|");
	var renewprice = price_period[1];
	var renewpricedph = ((price_period[1]*1.19).toFixed(2)).replace('.',',');
	var totprice = (price_period[1]*1+addition).toString(10);
	var totpricedph = (((price_period[1]*1+addition)*1.19).toFixed(2)).replace('.',',');
	if (price_period[1].length > 3)
	{
		renewprice = price_period[1].substr(0,price_period[1].length-3) + ' ' + price_period[1].substr(price_period[1].length-3,3);
	}
	if (renewpricedph.length >6)
	{
		renewpricedph = renewpricedph.substr(0,renewpricedph.length-6) + ' ' + renewpricedph.substr(renewpricedph.length-6,6);
	}
	if (totprice.length > 3)
	{
		totprice = totprice.substr(0,totprice.length-3) + ' ' + totprice.substr(totprice.length-3,3);
	}
	if (totpricedph.length >6)
	{
		totpricedph = totpricedph.substr(0,totpricedph.length-6) + ' ' + totpricedph.substr(totpricedph.length-6,6);
	}
	document.getElementById("renewprice").innerHTML = renewprice + ',- Kč';	
	document.getElementById("renewpricedph").innerHTML = renewpricedph + ' Kč';	
	document.getElementById("totprice").innerHTML = totprice + ',- Kč';	
	document.getElementById("totpricedph").innerHTML = totpricedph + ' Kč';	
	document.getElementById("totalpricedph").innerHTML =  totpricedph + ' Kč';	
}
