function showurlin(url, dest, options)
{
  if (dest == 'popup')
  {
    /*
    if(url.match(/\.asp/)) {
      if(url.match(/\?/))
        window.open(url + '&opener=' + window.location.href, '', options);
      else
        window.open(url + '?opener=' + window.location.href, '', options);
    }
    else
    */
      window.open(url, '', options);
  }
  else if (dest == 'original')
  {
    if (window.opener.location)
      window.opener.location.href = url;
  }
}

function toDollars(amount)
{	
	var sAmount = amount.toString()
	var iDotPos = sAmount.lastIndexOf('.');

	if(iDotPos == -1)
		sAmount += '.00';
	else
	{
		sAmount = sAmount.substr(0, iDotPos + 3);
		for(i=sAmount.length; i < iDotPos + 3; i++)
			sAmount += '0';
	}

	return '$' + sAmount;
}

function GetStampDuty(Land_PurchasePrice)
{
	return Land_Sales(Land_PurchasePrice);
}

function GetStampCost()
{
	return 0;
}

function Land_Sales(Land_PurchasePrice)
{
	var amount = 0;
	
	switch(true)
	{
		case (Land_PurchasePrice > 1000000):
			amount = getRate(5.5, Land_PurchasePrice - 1000000) + 40490;
			break
		case (Land_PurchasePrice > 300000):
			amount = getRate(4.5, Land_PurchasePrice - 300000) + 8990;
			break
		case (Land_PurchasePrice > 80000):
			amount = getRate(3.5, Land_PurchasePrice - 80000) + 1290;
			break
		case (Land_PurchasePrice > 30000):
			amount = getRate(1.75, Land_PurchasePrice - 30000) + 415;
			break
		case (Land_PurchasePrice > 14000):
			amount = getRate(1.5, Land_PurchasePrice - 14000) + 175;
			break
		default:
			amount = getRate(1.25, Land_PurchasePrice);
	}
	
	if (Land_PurchasePrice > 3000000)
	{
		amount += (Math.round((Land_PurchasePrice - 3000000) / 100) + 1) * 7;
	}
	return amount;
}


function getRate(rate, amount)
{
	var n = Math.ceil(amount / 100);
	
	return rate * n;
}