function GetStampDuty(PurchasePrice, IsInvestment, IsFirstHouseLand, IsFirstVacantLand)
{
	if(IsInvestment) return Investment(PurchasePrice);
	if(IsFirstHouseLand) return FirstHouseLand(PurchasePrice);
	if(IsFirstVacantLand) return FirstVacantLand(PurchasePrice);
	
	return 0;
}

function GetStampingCost()
{
	return 10;
}

function GetTransferCost() {
    return 10;
}

function Investment(PurchasePrice)
{
	var amount = 0;
	
	switch(true)
	{
		case (PurchasePrice > 1000000):
			amount = getRate(5.5, PurchasePrice - 1000000) + 40490;
			break
		case (PurchasePrice > 300000):
			amount = getRate(4.5, PurchasePrice - 300000) + 8990;
			break
		case (PurchasePrice > 80000):
			amount = getRate(3.5, PurchasePrice - 80000) + 1290;
			break
		case (PurchasePrice > 30000):
			amount = getRate(1.75, PurchasePrice - 30000) + 415;
			break
		case (PurchasePrice > 14000):
			amount = getRate(1.5, PurchasePrice - 14000) + 175;
			break
		default:
			amount = getRate(1.25, PurchasePrice);
	}
	
	if (PurchasePrice > 3000000)
	{
		amount += (Math.round((PurchasePrice - 3000000) / 100) + 1) * 7;
	}
	return amount;
}

function FirstHouseLand(PurchasePrice)
{
	if(PurchasePrice <= 500000) return 0;
	
	if(PurchasePrice <= 600000) return (PurchasePrice * 0.2249) - 112450;

	return Investment();
}

function FirstVacantLand(PurchasePrice)
{
	if(PurchasePrice <= 300000) return 0;
	
	if(PurchasePrice <= 450000) return (PurchasePrice * 0.1049) - 31470;
	
	return Investment();
}

function getRate(rate, amount)
{
	var n = Math.ceil(amount / 100);
	
	return rate * n;
}
