function IsEmpty(aTextField) {
  if ((aTextField.value.length==0) || (aTextField.value==null)) {
    return true;
  }
  else { return false; }
}

function isNumber(aValue) { 
  myRegExp = /^-{0,1}\d*\.{0,1}\d{0,1}\d{0,1}$/
  myStr = new String(aValue)
return myRegExp.test(myStr); 
}

function roundOff(value, precision)
{
  value = "" + value //convert value to string
  precision = parseInt(precision);
  var whole = "" + Math.round(value * Math.pow(10, precision));
  var decPoint = whole.length - precision;
  if(decPoint != 0) {
    result = whole.substring(0, decPoint);
    result += ".";
    result += whole.substring(decPoint, whole.length);
  }
  else {
    result = whole;
  }
return result;
}

function submitForm() 
{
  document.forms[0].submit();
  return false;
}

function buyCheck() 
{
 
 if (document.forms[0].buying.checked) {
    document.forms[0].buytown.disabled = false;
    document.forms[0].buytown.style.Color="grey"
    document.forms[0].buyproperty.disabled = false;
    document.forms[0].buyprice.disabled = false;
  } else {
    document.forms[0].buytown.disabled = true;
    document.forms[0].buyproperty.disabled = true;
    document.forms[0].buyprice.disabled = true;
  }
}

function sellCheck() 
{
 
 if (document.forms[0].selling.checked) {
    document.forms[0].selltown.disabled = false;
    document.forms[0].sellproperty.disabled = false;
    document.forms[0].sellprice.disabled = false;
  } else {
    document.forms[0].selltown.disabled = true;
    document.forms[0].sellproperty.disabled = true;
    document.forms[0].sellprice.disabled = true;
  }
}