function isEmpty(s) {return ((s == null) || (s.length == 0)); }
var whitespace = " \t\n\r";
function isWhitespace (s) {
  var i;
  if (isEmpty(s)) return true;
  for (i = 0; i < s.length; i++) {
    var c = s.charAt(i);
    if (whitespace.indexOf(c) == -1) return false;
  }
  return true;
}
var numb = "0123456789";
var lwr  = "abcdefghijklmnopqrstuvwxyz";
var upr  = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var phspl  = "-()+ ";
var spc  = " ";
var addressspc  = ",'";
var eml  = "-@_.";
var dot  = ".";
function isValid(parm,val) {
  if (parm == "") return true;
  for (i=0; i<parm.length; i++) {
    if (val.indexOf(parm.charAt(i),0) == -1) return false;
  }
  return true;
}
function doesExist (s) { return ( ! isEmpty(s) && ! isWhitespace (s) ); }
var iEmail = "Invalid Email ID.";
function isEmail (parm) {
  var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid
  var reg2 = /^.+\@(\[?)[a-zA-Z0-9\_\-\.]+\.([a-zA-Z\-]{2,3}|[0-9]{1,3})(\]?)$/; // valid
  if ((!reg1.test(parm) && reg2.test(parm) && isValid(parm,lwr+upr+numb+eml)) || (isEmpty(parm))){ // if syntax is valid 
     return ( true ); 
  } else { 
     return ( false ); 
  } 
 }
 
 function isPhoneNumber(parm) {
  var reg2 = /^\+?[0-9/\s]+$/; // valid
  if ((reg2.test(parm)) || (isEmpty(parm))){ // if syntax is valid 
     return ( true ); 
  } else { 
     return ( false ); 
  } 
 }
 
 function validateForm() {
  
  var form = document.frmRegister;
  var dtDifRegExp = (/-|\/|\./);
  var dtDifRepVal = "/";
  var rgExp1 = /<\S[^><]*>/g;  var rgExp2 = /\&(.*)\;/i;  var rgExp3 = /^\s*|\s*$/g;
  
  if ( form.firstname ) {
	var strVal = form.firstname.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.firstname.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('firstnameErr').innerHTML = "Missing: First Name";
      if(form.firstname.type) { 
        if(form.firstname.style.display != 'none') form.firstname.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('firstnameErr').innerHTML = "";
    }
  }
  
  
  if ( form.surname ) {
	var strVal = form.surname.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.surname.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('surnameErr').innerHTML = "Missing: Last Name";
      if(form.surname.type) { 
        if(form.surname.style.display != 'none') form.surname.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('surnameErr').innerHTML = "";
    }
  }
  
  
  if ( form.mobile ) {
  	var strVal = form.mobile.value.replace(rgExp1, '');
  	strVal = strVal.replace(/\n/g,'');
  	strVal = strVal.replace(rgExp3, '');
  	strVal = strVal.replace(rgExp2, '');
    if (  (form.mobile.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('mobileErr').innerHTML = "Missing: Mobile Number";
      if(form.mobile.type) { 
        if(form.mobile.style.display != 'none') form.mobile.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('mobileErr').innerHTML = "";
    }
  }
  
  /*if ( form.mobile ) {
    if ( ! isPhoneNumber ( form.mobile.value )) {
      document.getElementById('mobileErr').innerHTML = "Invalid";
      form.mobile.focus();
	  validateAllFormFields();
      return ( false );
    }
    else{
      document.getElementById('mobileErr').innerHTML = "";
    }
  }*/
  
  if ( form.homephone ) {
	var strVal = form.homephone.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.homephone.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('homephoneErr').innerHTML = "Missing: Phone number";
      if(form.homephone.type) { 
        if(form.homephone.style.display != 'none') form.homephone.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('homephoneErr').innerHTML = "";
    }
  }
  
    /*if ( form.homephone ) {
    if ( ! isPhoneNumber ( form.homephone.value ))  {
      document.getElementById('homephoneErr').innerHTML = "Invalid";
      form.homephone.focus();
      validateAllFormFields();
	  return ( false );
    }
    else{
      document.getElementById('homephoneErr').innerHTML = "";
    }
  }*/
  
  if ( form.emailaddress ) {
	var strVal = form.emailaddress.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.emailaddress.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('emailaddressErr').innerHTML = "Missing: Email Address";
      if(form.emailaddress.type) { 
        if(form.emailaddress.style.display != 'none') form.emailaddress.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('emailaddressErr').innerHTML = "";
    }
  }
  
  if ( form.emailaddress ) {
    if ( ! isEmail ( form.emailaddress.value ) ) {
      //document.getElementById('emailaddressErr').innerHTML = "Enter Valid Email";
      form.emailaddress.focus();
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('emailaddressErr').innerHTML = "";
    }
  }
  
  if ( form.confirmemail ) {
	var strVal = form.confirmemail.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.confirmemail.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('confirmemailErr').innerHTML = "Missing: Email Address";
      if(form.confirmemail.type) { 
        if(form.confirmemail.style.display != 'none') form.confirmemail.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('confirmemailErr').innerHTML = "";
    }
  }
  
  if ( form.confirmemail ) {
    if ( ! isEmail ( form.confirmemail.value ) ) {
      //document.getElementById('confirmemailErr').innerHTML = "Enter Valid Email";
      form.confirmemail.focus();
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('confirmemailErr').innerHTML = "";
    }
  }
  
  if (form.emailaddress.value!=form.confirmemail.value)
  {
	//document.getElementById('confirmemailErr').innerHTML = "Email address mismatch";
	form.confirmemail.focus();
    validateAllFormFields();
	return ( false );
  }
  else
  {
	//document.getElementById('confirmemailErr').innerHTML = "";
  }
  
  
  if ( form.houseno ) {
	var strVal = form.houseno.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.houseno.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('housenoErr').innerHTML = "Missing: House/Flat number";
      if(form.houseno.type) { 
        if(form.houseno.style.display != 'none') form.houseno.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('housenoErr').innerHTML = "";
    }
  }
  
  /*if (form.houseno)
  {
	if ( !isValid(form.houseno.value,lwr+upr+numb)) {
      document.getElementById('housenoErr').innerHTML = "Invalid House/Flat number";
      validateAllFormFields();
	  return ( false );
    }
    else{
      document.getElementById('housenoErr').innerHTML = "";
    }
  }*/
  
  
  if ( form.street ) {
	var strVal = form.street.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.street.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('streetErr').innerHTML = "Missing: Street";
      if(form.street.type) { 
        if(form.street.style.display != 'none') form.street.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('streetErr').innerHTML = "";
    }
  }
  
  /*if (form.street)
  {
	if ( !isValid(form.street.value,lwr+upr+numb+spc)) {
      document.getElementById('streetErr').innerHTML = "Invalid Street";
      validateAllFormFields();
	  return ( false );
    }
    else{
      document.getElementById('streetErr').innerHTML = "";
    }
  }*/
  
  
  
  if ( form.town ) {
	var strVal = form.town.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.town.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('townErr').innerHTML = "Missing: Town";
      if(form.town.type) { 
        if(form.town.style.display != 'none') form.town.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('townErr').innerHTML = "";
    }
  }
  
  /*if (form.town)
  {
	if ( !isValid(form.town.value,lwr+upr+numb+spc)) {
      document.getElementById('townErr').innerHTML = "Invalid Town";
      validateAllFormFields();
	  return ( false );
    }
    else{
      document.getElementById('townErr').innerHTML = "";
    }
  }*/
  
  if ( form.county ) {
	var strVal = form.county.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.county.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('countyErr').innerHTML = "Missing: County";
      if(form.county.type) { 
        if(form.county.style.display != 'none') form.county.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('countyErr').innerHTML = "";
    }
  }
  
  if ( form.postcode1 ) {
	var strVal = form.postcode1.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.postcode1.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('sellerPostCodeErr').innerHTML = "Missing: Postcode";
      if(form.postcode1.type) { 
        if(form.postcode1.style.display != 'none') form.postcode1.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('sellerPostCodeErr').innerHTML = "";
    }
  }
  
  if ( form.postcode2 ) {
	var strVal = form.postcode2.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.postcode2.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('sellerPostCodeErr').innerHTML = "Missing: Postcode";
      if(form.postcode2.type) { 
        if(form.postcode2.style.display != 'none') form.postcode2.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('sellerPostCodeErr').innerHTML = "";
    }
  }
  
  
  
  if ( form.propertytype ) {
	var strVal = form.propertytype.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.propertytype.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('propertytypeErr').innerHTML = "Missing: Property Type";
      if(form.propertytype.type) { 
        if(form.propertytype.style.display != 'none') form.propertytype.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('propertytypeErr').innerHTML = "";
    }
  }
  
  if ( form.freehold ) {
	var strVal = form.freehold.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.freehold.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('freeholdErr').innerHTML = "Missing: Freehold or Leasehold";
      if(form.freehold.type) { 
        if(form.freehold.style.display != 'none') form.freehold.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('freeholdErr').innerHTML = "";
    }
  }
  
  if ( form.exlocalauthority ) {
	var strVal = form.exlocalauthority.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.exlocalauthority.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('exlocalauthorityErr').innerHTML = "Missing: Ex-Local exlocalauthority";
      if(form.exlocalauthority.type) { 
        if(form.exlocalauthority.style.display != 'none') form.exlocalauthority.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('exlocalauthorityErr').innerHTML = "";
    }
  }
  
  if ( form.bedrooms ) {
  	var strVal = form.bedrooms.value.replace(rgExp1, '');
  	strVal = strVal.replace(/\n/g,'');
  	strVal = strVal.replace(rgExp3, '');
  	strVal = strVal.replace(rgExp2, '');
    if (  (form.bedrooms.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('bedroomsErr').innerHTML = "Missing: Number Of Beds";
      if(form.bedrooms.type) { 
        if(form.bedrooms.style.display != 'none') form.bedrooms.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('bedroomsErr').innerHTML = "";
    }
  }
  
  if ( form.toliets ) {
  	var strVal = form.toliets.value.replace(rgExp1, '');
  	strVal = strVal.replace(/\n/g,'');
  	strVal = strVal.replace(rgExp3, '');
  	strVal = strVal.replace(rgExp2, '');
  	
    if (  (form.toliets.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('tolietsErr').innerHTML = "Missing: Number of Bathrooms/Toilets";
      if(form.toliets.type) { 
        if(form.toliets.style.display != 'none') form.toliets.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('tolietsErr').innerHTML = "";
    }
  }
  
  if ( form.receptions ) {
	var strVal = form.receptions.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.receptions.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('receptionsErr').innerHTML = "Missing: Number of Reception Rooms";
      if(form.receptions.type) { 
        if(form.receptions.style.display != 'none') form.receptions.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('receptionsErr').innerHTML = "";
    }
  }
  
  if ( form.garage ) {
	var strVal = form.garage.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.garage.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('garageErr').innerHTML = "Missing: Garage";
      if(form.garage.type) { 
        if(form.garage.style.display != 'none') form.garage.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('garageErr').innerHTML = "";
    }
  }
  
  if ( form.offroadparking ) {
	var strVal = form.offroadparking.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.offroadparking.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('offroadparkingErr').innerHTML = "Missing: Parking";
      if(form.offroadparking.type) { 
        if(form.offroadparking.style.display != 'none') form.offroadparking.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('offroadparkingErr').innerHTML = "";
    }
  }
  
  if ( form.garden ) {
	var strVal = form.garden.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.garden.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('gardenErr').innerHTML = "Missing: Garden";
      if(form.garden.type) { 
        if(form.garden.style.display != 'none') form.garden.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
     // document.getElementById('gardenErr').innerHTML = "";
    }
  }
  
  if ( form.condition ) {
	var strVal = form.condition.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.condition.disabled == false) && (! doesExist ( strVal )) ) {
     // document.getElementById('conditionErr').innerHTML = "Missing: Property Condition";
      if(form.condition.type) { 
        if(form.condition.style.display != 'none') form.condition.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('conditionErr').innerHTML = "";
    }
  }
  
  if ( form.new_kitchen ) {
	var strVal = form.new_kitchen.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.new_kitchen.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('new_kitchenErr').innerHTML = "Missing: New Kitchen";
      if(form.new_kitchen.type) { 
        if(form.new_kitchen.style.display != 'none') form.new_kitchen.focus();
      }
      validateAllFormFields();
	  return ( false );
    }
    else{
      //document.getElementById('new_kitchenErr').innerHTML = "";
    }
  }
  
  if ( form.new_bathroom ) {
	var strVal = form.new_bathroom.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.new_bathroom.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('new_bathroomErr').innerHTML = "Missing: New Bathroom";
      if(form.new_bathroom.type) { 
        if(form.new_bathroom.style.display != 'none') form.new_bathroom.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('new_bathroomErr').innerHTML = "";
    }
  }
  
  if ( form.central_heating ) {
	var strVal = form.central_heating.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.central_heating.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('central_heatingErr').innerHTML = "Missing: Central Heating";
      if(form.central_heating.type) { 
        if(form.central_heating.style.display != 'none') form.central_heating.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('central_heatingErr').innerHTML = "";
    }
  }
  
  if ( form.re_wiring ) {
	var strVal = form.re_wiring.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.re_wiring.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('re_wiringErr').innerHTML = "Missing: Re Wiring";
      if(form.re_wiring.type) { 
        if(form.re_wiring.style.display != 'none') form.re_wiring.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('re_wiringErr').innerHTML = "";
    }
  }
  
  
  if ( form.new_windows ) {
	var strVal = form.new_windows.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.new_windows.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('new_windowsErr').innerHTML = "Missing: New Windows";
      if(form.new_windows.type) { 
        if(form.new_windows.style.display != 'none') form.new_windows.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('new_windowsErr').innerHTML = "";
    }
  }
  
  
  if ( form.needs_decorating ) {
	var strVal = form.needs_decorating.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.needs_decorating.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('needs_decoratingErr').innerHTML = "Missing: Needs Decorating";
      if(form.needs_decorating.type) { 
        if(form.needs_decorating.style.display != 'none') form.needs_decorating.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('needs_decoratingErr').innerHTML = "";
    }
  }
  
  if ( form.new_carpets ) {
	var strVal = form.new_carpets.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.new_carpets.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('new_carpetsErr').innerHTML = "Missing: New Carpets";
      if(form.new_carpets.type) { 
        if(form.new_carpets.style.display != 'none') form.new_carpets.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('new_carpetsErr').innerHTML = "";
    }
  }
  
  if ( form.market_value ) {
	var strVal = form.market_value.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.market_value.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('market_valueErr').innerHTML = "Missing: Estimated Open Market Value";
      if(form.market_value.type) { 
        if(form.market_value.style.display != 'none') form.market_value.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('market_valueErr').innerHTML = "";
    }
  }
  
  if ( form.market_value ) {
	myexp = /^[0-9]+$/;
	if ( ! myexp.test ( form.market_value.value ) ) {
      //document.getElementById('market_valueErr').innerHTML = "Enter Valid Value";
      form.market_value.focus();
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('market_valueErr').innerHTML = "";
    }
  }
  
  if ( form.arrive_at_this_figure ) {
	var strVal = form.arrive_at_this_figure.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.arrive_at_this_figure.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('arrive_at_this_figureErr').innerHTML = "Missing: How did you arrive at this figure";
      if(form.arrive_at_this_figure.type) { 
        if(form.arrive_at_this_figure.style.display != 'none') form.arrive_at_this_figure.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('arrive_at_this_figureErr').innerHTML = "";
    }
  }
  
  if ( form.asking_price ) {
	var strVal = form.asking_price.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.asking_price.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('asking_priceErr').innerHTML = "Missing: Asking price for A Quick Cash Sale";
      if(form.asking_price.type) { 
        if(form.asking_price.style.display != 'none') form.asking_price.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('asking_priceErr').innerHTML = "";
    }
  }
  
  if ( form.asking_price ) {
	myexp = /^[0-9]+$/;
	if ( ! myexp.test ( form.asking_price.value ) ) {
      //document.getElementById('asking_priceErr').innerHTML = "Enter Valid Value";
      form.asking_price.focus();
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('asking_priceErr').innerHTML = "";
    }
  }
  
  if ( form.mortgage_balance ) {
	var strVal = form.mortgage_balance.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.mortgage_balance.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('mortgage_balanceErr').innerHTML = "Missing: Outstanding Mortgage";
      if(form.mortgage_balance.type) { 
        if(form.mortgage_balance.style.display != 'none') form.mortgage_balance.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('mortgage_balanceErr').innerHTML = "";
    }
  }
  
  if ( form.mortgage_balance ) {
	myexp = /^[0-9]+$/;
	if ( ! myexp.test ( form.mortgage_balance.value ) ) {
      //document.getElementById('mortgage_balanceErr').innerHTML = "Enter Valid Value";
      form.mortgage_balance.focus();
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('mortgage_balanceErr').innerHTML = "";
    }
  }
  
  if ( form.loans ) {
	var strVal = form.loans.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.loans.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('loansErr').innerHTML = "Missing: Loans Secured against the property?";
      if(form.loans.type) { 
        if(form.loans.style.display != 'none') form.loans.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('loansErr').innerHTML = "";
	  if (strVal=="Yes")
	  {
		  if ( form.secured_loan_amount ) {
			var strVal = form.secured_loan_amount.value.replace(rgExp1, '');
			strVal = strVal.replace(/\n/g,'');
			strVal = strVal.replace(rgExp3, '');
			strVal = strVal.replace(rgExp2, '');
			if (  (form.secured_loan_amount.disabled == false) && (! doesExist ( strVal )) ) {
			  //document.getElementById('secured_loan_amountErr').innerHTML = "Missing: If \"Yes\" how much?";
			  if(form.secured_loan_amount.type) { 
				if(form.secured_loan_amount.style.display != 'none') form.secured_loan_amount.focus();
			  }
			  validateAllFormFields();
			  return ( false );
			}
			else{
			 // document.getElementById('secured_loan_amountErr').innerHTML = "";
			}
		  }
		  
		  if ( form.secured_loan_amount ) {
			myexp = /^[0-9]+$/;
			if ( ! myexp.test ( form.secured_loan_amount.value ) ) {
			  //document.getElementById('secured_loan_amountErr').innerHTML = "Enter Valid Value";
			  form.secured_loan_amount.focus();
			  validateAllFormFields();
			  return ( false );
			}
			else{
			  //document.getElementById('secured_loan_amountErr').innerHTML = "";
			}
		  }
		  
	  }
	  else
	  {
		//document.getElementById('secured_loan_amountErr').innerHTML = "";
	  }
    }
  }
  
  
  if ( form.reason ) {
	var strVal = form.reason.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.reason.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('reasonErr').innerHTML = "Missing: Why do you want to sell?";
      if(form.reason.type) { 
        if(form.reason.style.display != 'none') form.reason.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('reasonErr').innerHTML = "";
    }
  }
  
  
  if ( form.onmarket ) {
var strVal = form.onmarket.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.onmarket.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('onmarketErr').innerHTML = "Missing: On the market with an estate agent?";
      if(form.onmarket.type) { 
        if(form.onmarket.style.display != 'none') form.onmarket.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('onmarketErr').innerHTML = "";
	  /*if (strVal=="Yes")
	  {
		  if ( form.marketHowLong ) {
			var strVal = form.marketHowLong.value.replace(rgExp1, '');
			strVal = strVal.replace(/\n/g,'');
			strVal = strVal.replace(rgExp3, '');
			strVal = strVal.replace(rgExp2, '');
			if (  (form.marketHowLong.disabled == false) && (! doesExist ( strVal )) ) {
			  document.getElementById('marketHowLongErr').innerHTML = "Missing: If \"Yes\" for how Long?";
			  if(form.marketHowLong.type) { 
				if(form.marketHowLong.style.display != 'none') form.marketHowLong.focus();
			  }
			  validateAllFormFields();
			  return ( false );
			}
			else{
			  document.getElementById('marketHowLongErr').innerHTML = "";
			}
		  }
	  }
	  else
	  {
		document.getElementById('marketHowLongErr').innerHTML = "";
	  }*/
    }
  }
  
  if ( form.reducedprice ) {
var strVal = form.reducedprice.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.reducedprice.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('reducedpriceErr').innerHTML = "Missing: Has the price ever been reduced?";
      if(form.reducedprice.type) { 
        if(form.reducedprice.style.display != 'none') form.reducedprice.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('reducedpriceErr').innerHTML = "";
	  /*if (strVal=="Yes")
	  {
		  if ( form.reducedpriceAmount ) {
			var strVal = form.reducedpriceAmount.value.replace(rgExp1, '');
			strVal = strVal.replace(/\n/g,'');
			strVal = strVal.replace(rgExp3, '');
			strVal = strVal.replace(rgExp2, '');
			if (  (form.reducedpriceAmount.disabled == false) && (! doesExist ( strVal )) ) {
			  document.getElementById('reducedpriceAmountErr').innerHTML = "Missing: If \"Yes\" how much by and when?";
			  if(form.reducedpriceAmount.type) { 
				if(form.reducedpriceAmount.style.display != 'none') form.reducedpriceAmount.focus();
			  }
			  validateAllFormFields();
			  return ( false );
			}
			else{
			  document.getElementById('reducedpriceAmountErr').innerHTML = "";
			}
		  }
		  
		  if ( form.reducedpriceAmount ) {
			myexp = /^[0-9]+$/;
			if ( ! myexp.test ( form.reducedpriceAmount.value ) ) {
			  document.getElementById('reducedpriceAmountErr').innerHTML = "Enter Valid Value";
			  form.reducedpriceAmount.focus();
			  validateAllFormFields();
			  return ( false );
			}
			else{
			  document.getElementById('reducedpriceAmountErr').innerHTML = "";
			}
		  }
		  
	  }
	  else
	  {
		document.getElementById('secured_loan_amountErr').innerHTML = "";
	  }*/
    }
  }
  /*
  if ( form.tenantJobTwo ) {
var strVal = form.tenantJobTwo.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.tenantJobTwo.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('tenantJobTwoErr').innerHTML = "Missing: 2nd Applicant?";
      if(form.tenantJobTwo.type) { 
        if(form.tenantJobTwo.style.display != 'none') form.tenantJobTwo.focus();
      }
      return ( false );
    }
    else{
      document.getElementById('tenantJobTwoErr').innerHTML = "";
    }
  }*/
  if ( form.tenantEarnOne ) {
var strVal = form.tenantEarnOne.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.tenantEarnOne.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('tenantEarnOneErr').innerHTML = "Missing: 1st Applicant?";
      if(form.tenantEarnOne.type) { 
        if(form.tenantEarnOne.style.display != 'none') form.tenantEarnOne.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('tenantEarnOneErr').innerHTML = "";
    }
  }
  /*
  if ( form.tenantEarnTwo ) {
var strVal = form.tenantEarnTwo.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.tenantEarnTwo.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('tenantEarnTwoErr').innerHTML = "Missing: 2nd Applicant?";
      if(form.tenantEarnTwo.type) { 
        if(form.tenantEarnTwo.style.display != 'none') form.tenantEarnTwo.focus();
      }
      return ( false );
    }
    else{
      document.getElementById('tenantEarnTwoErr').innerHTML = "";
    }
  }
  */
  if ( form.tenantOtherFigure ) {
var strVal = form.tenantOtherFigure.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.tenantOtherFigure.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('tenantOtherFigureErr').innerHTML = "Missing: Other Figure";
      if(form.tenantOtherFigure.type) { 
        if(form.tenantOtherFigure.style.display != 'none') form.tenantOtherFigure.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('tenantOtherFigureErr').innerHTML = "";
    }
  }
  if ( form.tenantRent ) {
var strVal = form.tenantRent.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.tenantRent.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('tenantRentErr').innerHTML = "Missing: What Rent are you paying at present?";
      if(form.tenantRent.type) { 
        if(form.tenantRent.style.display != 'none') form.tenantRent.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('tenantRentErr').innerHTML = "";
    }
  }
  if ( form.tenantRentAfford ) {
var strVal = form.tenantRentAfford.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.tenantRentAfford.disabled == false) && (! doesExist ( strVal )) ) {
      //document.getElementById('tenantRentAffordErr').innerHTML = "Missing: What Rent can you afford each month?";
      if(form.tenantRentAfford.type) { 
        if(form.tenantRentAfford.style.display != 'none') form.tenantRentAfford.focus();
      }
	  validateAllFormFields();
      return ( false );
    }
    else{
      //document.getElementById('tenantRentAffordErr').innerHTML = "";
    }
  }
  return ( true );
}
function validateAndSubmit() {
  var form = document.frmRegister;
  var ok = validateForm();  
  if ( ok ) form.submit;
  return ( ok );
}


function validateAllFormFields() {
  
  var form = document.frmRegister;
  var dtDifRegExp = (/-|\/|\./);
  var dtDifRepVal = "/";
  var rgExp1 = /<\S[^><]*>/g;  var rgExp2 = /\&(.*)\;/i;  var rgExp3 = /^\s*|\s*$/g;
  var dispRslt = "";
  
  if ( form.firstname ) {
	var strVal = form.firstname.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');	
    if (  (form.firstname.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt = '- Missing: First Name.\n';
    }
    
  }
  
  if ( form.surname ) {
	var strVal = form.surname.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');	
    if (  (form.surname.disabled == false) && (! doesExist ( strVal )) ) {      
      dispRslt += '- Missing: Last Name.\n';
    }    
  }
  
  
  if ( form.mobile ) {
  	var strVal = form.mobile.value.replace(rgExp1, '');
  	strVal = strVal.replace(/\n/g,'');
  	strVal = strVal.replace(rgExp3, '');
  	strVal = strVal.replace(rgExp2, '');
  	
  	if (  (form.mobile.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Mobile Number.\n';
    }
  }

  if ( form.homephone ) {
	var strVal = form.homephone.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.homephone.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Phone Number.\n';
    }
  }
  
  if ( form.emailaddress ) {
	var strVal = form.emailaddress.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.emailaddress.disabled == false) && (! doesExist ( strVal )) ) {      
      dispRslt += '- Missing: Email Address.\n';
    }
  }
  
  if ( form.emailaddress ) {
    if ( ! isEmail ( form.emailaddress.value ) ) {
      dispRslt += '- Enter Valid Email Address.\n';
    }
  }
  
  if ( form.confirmemail ) {
	var strVal = form.confirmemail.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.confirmemail.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Confirm Email Address.\n';
    }
  }
  
  if ( form.confirmemail ) {
    if ( ! isEmail ( form.confirmemail.value ) ) {      
      dispRslt += '- Enter Valid Confirm Email Address.\n';
    }
  }
  
  if (form.emailaddress.value!=form.confirmemail.value)
  {
	dispRslt += '- Email address mismatch.\n';
  }
  
  if ( form.houseno ) {
	var strVal = form.houseno.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.houseno.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: House/Flat number.\n';
    }
  }

  if ( form.street ) {
	var strVal = form.street.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.street.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Street.\n';
    }
  }
  
  if ( form.town ) {
	var strVal = form.town.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.town.disabled == false) && (! doesExist ( strVal )) ) {      
      dispRslt += '- Missing: Town.\n';
    }
  }
 
  if ( form.county ) {
	var strVal = form.county.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.county.disabled == false) && (! doesExist ( strVal )) ) {      
      dispRslt += '- Missing: County.\n';
    }
  }
  
  if ( form.postcode1 && form.postcode2 ) {
	var strVal1 = form.postcode1.value.replace(rgExp1, '');
	strVal1 = strVal1.replace(/\n/g,'');
	strVal1 = strVal1.replace(rgExp3, '');
	strVal1 = strVal1.replace(rgExp2, '');
	
	var strVal2 = form.postcode2.value.replace(rgExp1, '');
	strVal2 = strVal2.replace(/\n/g,'');
	strVal2 = strVal2.replace(rgExp3, '');
	strVal2 = strVal2.replace(rgExp2, '');
    if (  (form.postcode1.disabled == false) && (! doesExist ( strVal1 )) || (form.postcode2.disabled == false) && (! doesExist ( strVal2 )) ) {      
      dispRslt += '- Missing: Postcode.\n';
    }
  }
  
  if ( form.propertytype ) {
	var strVal = form.propertytype.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.propertytype.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Property Type.\n';
    }
  }
  
  if ( form.freehold ) {
	var strVal = form.freehold.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.freehold.disabled == false) && (! doesExist ( strVal )) ) {      
      dispRslt += '- Missing: Freehold or Leasehold.\n';
    }
  }
  
  if ( form.exlocalauthority ) {
	var strVal = form.exlocalauthority.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.exlocalauthority.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Ex-Local Authority.\n';
    }
  }
   
  if ( form.bedrooms ) {
  	var strVal = form.bedrooms.value.replace(rgExp1, '');
  	strVal = strVal.replace(/\n/g,'');
  	strVal = strVal.replace(rgExp3, '');
  	strVal = strVal.replace(rgExp2, '');  	
    if (  (form.bedrooms.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Number Of Beds.\n';
    }
  }
  
  if ( form.toliets ) {
  	var strVal = form.toliets.value.replace(rgExp1, '');
  	strVal = strVal.replace(/\n/g,'');
  	strVal = strVal.replace(rgExp3, '');
  	strVal = strVal.replace(rgExp2, '');
    if (  (form.toliets.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Number of Bathrooms/Toilets.\n';
    }
  }
  
  if ( form.receptions ) {
	var strVal = form.receptions.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.receptions.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Number of Reception Rooms.\n';
    }
  }
  
  if ( form.garage ) {
	var strVal = form.garage.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.garage.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Garage.\n';
    }
  }
  
  if ( form.offroadparking ) {
	var strVal = form.offroadparking.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.offroadparking.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Parking.\n';
    }
  }
  
  if ( form.garden ) {
	var strVal = form.garden.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.garden.disabled == false) && (! doesExist ( strVal )) ) {      
      dispRslt += '- Missing: Garden.\n';
    }
  }
  
  if ( form.condition ) {
	var strVal = form.condition.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.condition.disabled == false) && (! doesExist ( strVal )) ) {      
      dispRslt += '- Missing: Property Condition.\n';
    }
  }
  
  if ( form.new_kitchen ) {
	var strVal = form.new_kitchen.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.new_kitchen.disabled == false) && (! doesExist ( strVal )) ) {      
      dispRslt += '- Missing: New Kitchen.\n';
    }
  }
  
  if ( form.new_bathroom ) {
	var strVal = form.new_bathroom.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.new_bathroom.disabled == false) && (! doesExist ( strVal )) ) {      
      dispRslt += '- Missing: New Bathroom.\n';
    }
  }
  
  if ( form.central_heating ) {
	var strVal = form.central_heating.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.central_heating.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Central Heating.\n';
    }
  }
  
  if ( form.re_wiring ) {
	var strVal = form.re_wiring.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.re_wiring.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Re Wiring.\n';
    }
  }
  
  
  if ( form.new_windows ) {
	var strVal = form.new_windows.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.new_windows.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: New Windows.\n';
    }
  }
  
  
  if ( form.needs_decorating ) {
	var strVal = form.needs_decorating.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.needs_decorating.disabled == false) && (! doesExist ( strVal )) ) {      
      dispRslt += '- Missing: Needs Decorating.\n';
    }
  }
  
  if ( form.new_carpets ) {
	var strVal = form.new_carpets.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.new_carpets.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: New Carpets.\n';
    }
  }
  
  if ( form.market_value ) {
	var strVal = form.market_value.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.market_value.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Estimated Open Market Value.\n';
    }
  }
  
  if ( form.market_value ) {
	var strVal = form.market_value.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');

  	myexp = /^[0-9]+$/;
	if ( (form.market_value.value) && !myexp.test ( form.market_value.value ) ) {
      dispRslt += '- Enter Valid Estimated Open Market Value.\n';
    }
  }
  
  if ( form.arrive_at_this_figure ) {
	var strVal = form.arrive_at_this_figure.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.arrive_at_this_figure.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: How did you arrive at this figure.\n';
    }
  }
  
  if ( form.asking_price ) {
	var strVal = form.asking_price.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.asking_price.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Asking price for A Quick Cash Sale.\n';
    }
  }
  
  if ( form.asking_price ) {
	var strVal = form.asking_price.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');

	myexp = /^[0-9]+$/;
	if ( (form.asking_price.value) && !myexp.test ( form.asking_price.value ) ) {
      dispRslt += '- Enter Valid Asking price for A Quick Cash Sale.\n';
    }
  }
  
  if ( form.mortgage_balance ) {
	var strVal = form.mortgage_balance.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.mortgage_balance.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Outstanding Mortgage.\n';
    }
  }
  
  if ( form.mortgage_balance ) {
	var strVal = form.mortgage_balance.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
 	
	myexp = /^[0-9]+$/;
	if ( (form.mortgage_balance.value) && !	myexp.test ( form.mortgage_balance.value ) ) {      
      dispRslt += '- Enter Valid Outstanding Mortgage Value.\n';
    }
  }
  
  if ( form.loans ) 	{
	var strVal = form.loans.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.loans.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Loans Secured against the property?\n';
    } else {
	  if (strVal=="Yes") {
		  if ( form.secured_loan_amount ) {
			var strVal = form.secured_loan_amount.value.replace(rgExp1, '');
			strVal = strVal.replace(/\n/g,'');
			strVal = strVal.replace(rgExp3, '');
			strVal = strVal.replace(rgExp2, '');
			if (  (form.secured_loan_amount.disabled == false) && (! doesExist ( strVal )) ) {
			  dispRslt += '- Missing: If \"Yes\" how much?\n';
			}
		  }
		  
		  if ( form.secured_loan_amount ) {
			myexp = /^[0-9]+$/;
			if ( ! myexp.test ( form.secured_loan_amount.value ) ) {
			  dispRslt += '- Enter Valid Value. If \"Yes\" how much?\n';
			}
		  }
		  
	  }
    }
  }  
  
  if ( form.reason ) {
	var strVal = form.reason.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.reason.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Why do you want to sell?\n';
    }
  }
  

  if ( form.onmarket ) {
  	var strVal = form.onmarket.value.replace(rgExp1, '');
  	strVal = strVal.replace(/\n/g,'');
  	strVal = strVal.replace(rgExp3, '');
  	strVal = strVal.replace(rgExp2, '');
  	
    if (  (form.onmarket.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Is your Property on the Market?\n';
    }
  }
    
  if ( form.reducedprice ) {
  	var strVal = form.reducedprice.value.replace(rgExp1, '');
  	strVal = strVal.replace(/\n/g,'');
  	strVal = strVal.replace(rgExp3, '');
  	strVal = strVal.replace(rgExp2, '');
    if (  (form.reducedprice.disabled == false) && (! doesExist ( strVal )) ) {
      dispRslt += '- Missing: Has the price ever been reduced?\n';
    }
  }
  
  if (dispRslt) {
  	alert('The following error(s) occurred:\n' + dispRslt);
  	return false;  	
  } else {
  	return true;
  }
}

