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.sellerFirstName ) {
	var strVal = form.sellerFirstName.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerFirstName.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerFirstNameErr').innerHTML = "Missing: First Name";
      if(form.sellerFirstName.type) { 
        if(form.sellerFirstName.style.display != 'none') form.sellerFirstName.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('sellerFirstNameErr').innerHTML = "";
    }
  }
  
  
  if ( form.sellerSurName ) {
	var strVal = form.sellerSurName.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerSurName.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerSurNameErr').innerHTML = "Missing: Last Name";
      if(form.sellerSurName.type) { 
        if(form.sellerSurName.style.display != 'none') form.sellerSurName.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerSurNameErr').innerHTML = "";
    }
  }
  
  
  if ( form.sellerMobileNo ) {
var strVal = form.sellerMobileNo.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerMobileNo.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerMobileNoErr').innerHTML = "Missing: Mobile Number";
      if(form.sellerMobileNo.type) { 
        if(form.sellerMobileNo.style.display != 'none') form.sellerMobileNo.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerMobileNoErr').innerHTML = "";
    }
  }
  
  /*if ( form.sellerMobileNo ) {
    if ( ! isPhoneNumber ( form.sellerMobileNo.value )) {
      document.getElementById('sellerMobileNoErr').innerHTML = "Invalid";
      form.sellerMobileNo.focus();
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('sellerMobileNoErr').innerHTML = "";
    }
  }*/
  
  if ( form.sellerHomePhone ) {
	var strVal = form.sellerHomePhone.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerHomePhone.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerHomePhoneErr').innerHTML = "Missing: Phone number";
      if(form.sellerHomePhone.type) { 
        if(form.sellerHomePhone.style.display != 'none') form.sellerHomePhone.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerHomePhoneErr').innerHTML = "";
    }
  }
  
    /*if ( form.sellerHomePhone ) {
    if ( ! isPhoneNumber ( form.sellerHomePhone.value ))  {
      document.getElementById('sellerHomePhoneErr').innerHTML = "Invalid";
      form.sellerHomePhone.focus();
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerHomePhoneErr').innerHTML = "";
    }
  }*/
  
  if ( form.sellerEmailAddress ) {
	var strVal = form.sellerEmailAddress.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerEmailAddress.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerEmailAddressErr').innerHTML = "Missing: Email Address";
      if(form.sellerEmailAddress.type) { 
        if(form.sellerEmailAddress.style.display != 'none') form.sellerEmailAddress.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerEmailAddressErr').innerHTML = "";
    }
  }
  
  if ( form.sellerEmailAddress ) {
    if ( ! isEmail ( form.sellerEmailAddress.value ) ) {
      document.getElementById('sellerEmailAddressErr').innerHTML = "Enter Valid Email";
      form.sellerEmailAddress.focus();
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerEmailAddressErr').innerHTML = "";
    }
  }
  
  if ( form.sellerConfirmEmail ) {
	var strVal = form.sellerConfirmEmail.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerConfirmEmail.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerConfirmEmailErr').innerHTML = "Missing: Email Address";
      if(form.sellerConfirmEmail.type) { 
        if(form.sellerConfirmEmail.style.display != 'none') form.sellerConfirmEmail.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerConfirmEmailErr').innerHTML = "";
    }
  }
  
  if ( form.sellerConfirmEmail ) {
    if ( ! isEmail ( form.sellerConfirmEmail.value ) ) {
      document.getElementById('sellerConfirmEmailErr').innerHTML = "Enter Valid Email";
      form.sellerConfirmEmail.focus();
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerConfirmEmailErr').innerHTML = "";
    }
  }
  
  if (form.sellerEmailAddress.value!=form.sellerConfirmEmail.value)
  {
	document.getElementById('sellerConfirmEmailErr').innerHTML = "Email address mismatch";
	form.sellerConfirmEmail.focus();
    alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	return ( false );
  }
  else
  {
	document.getElementById('sellerConfirmEmailErr').innerHTML = "";
  }
  
  
  if ( form.sellerHouseNo ) {
	var strVal = form.sellerHouseNo.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerHouseNo.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerHouseNoErr').innerHTML = "Missing: House/Flat number";
      if(form.sellerHouseNo.type) { 
        if(form.sellerHouseNo.style.display != 'none') form.sellerHouseNo.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerHouseNoErr').innerHTML = "";
    }
  }
  
  /*if (form.sellerHouseNo)
  {
	if ( !isValid(form.sellerHouseNo.value,lwr+upr+numb)) {
      document.getElementById('sellerHouseNoErr').innerHTML = "Invalid House/Flat number";
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerHouseNoErr').innerHTML = "";
    }
  }*/
  
  
  if ( form.sellerStreet ) {
	var strVal = form.sellerStreet.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerStreet.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerStreetErr').innerHTML = "Missing: Street";
      if(form.sellerStreet.type) { 
        if(form.sellerStreet.style.display != 'none') form.sellerStreet.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerStreetErr').innerHTML = "";
    }
  }
  
  /*if (form.sellerStreet)
  {
	if ( !isValid(form.sellerStreet.value,lwr+upr+numb+spc)) {
      document.getElementById('sellerStreetErr').innerHTML = "Invalid Street";
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerStreetErr').innerHTML = "";
    }
  }*/
  
  
  
  if ( form.sellerTown ) {
	var strVal = form.sellerTown.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerTown.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerTownErr').innerHTML = "Missing: Town";
      if(form.sellerTown.type) { 
        if(form.sellerTown.style.display != 'none') form.sellerTown.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerTownErr').innerHTML = "";
    }
  }
  
  /*if (form.sellerTown)
  {
	if ( !isValid(form.sellerTown.value,lwr+upr+numb+spc)) {
      document.getElementById('sellerTownErr').innerHTML = "Invalid Town";
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerTownErr').innerHTML = "";
    }
  }*/
  
  if ( form.sellerCounty ) {
	var strVal = form.sellerCounty.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerCounty.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerCountyErr').innerHTML = "Missing: County";
      if(form.sellerCounty.type) { 
        if(form.sellerCounty.style.display != 'none') form.sellerCounty.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerCountyErr').innerHTML = "";
    }
  }
  
  if ( form.sellerPostCode1 ) {
	var strVal = form.sellerPostCode1.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerPostCode1.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerPostCodeErr').innerHTML = "Missing: Postcode";
      if(form.sellerPostCode1.type) { 
        if(form.sellerPostCode1.style.display != 'none') form.sellerPostCode1.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('sellerPostCodeErr').innerHTML = "";
    }
  }
  
  if ( form.sellerPostCode2 ) {
	var strVal = form.sellerPostCode2.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.sellerPostCode2.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('sellerPostCodeErr').innerHTML = "Missing: Postcode";
      if(form.sellerPostCode2.type) { 
        if(form.sellerPostCode2.style.display != 'none') form.sellerPostCode2.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  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();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('propertyTypeErr').innerHTML = "";
    }
  }
  
  if ( form.holdType ) {
	var strVal = form.holdType.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.holdType.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('holdTypeErr').innerHTML = "Missing: Freehold or Leasehold";
      if(form.holdType.type) { 
        if(form.holdType.style.display != 'none') form.holdType.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('holdTypeErr').innerHTML = "";
    }
  }
  
  if ( form.authority ) {
	var strVal = form.authority.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.authority.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('authorityErr').innerHTML = "Missing: Ex-Local Authority";
      if(form.authority.type) { 
        if(form.authority.style.display != 'none') form.authority.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('authorityErr').innerHTML = "";
    }
  }
  
  if ( form.noOfBedRooms ) {
var strVal = form.noOfBedRooms.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.noOfBedRooms.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('noOfBedRoomsErr').innerHTML = "Missing: Number Of Beds";
      if(form.noOfBedRooms.type) { 
        if(form.noOfBedRooms.style.display != 'none') form.noOfBedRooms.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('noOfBedRoomsErr').innerHTML = "";
    }
  }
  
  if ( form.noOfBathRooms ) {
var strVal = form.noOfBathRooms.value.replace(rgExp1, '');
strVal = strVal.replace(/\n/g,'');
strVal = strVal.replace(rgExp3, '');
strVal = strVal.replace(rgExp2, '');
    if (  (form.noOfBathRooms.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('noOfBathRoomsErr').innerHTML = "Missing: Number of Bathrooms/Toilets";
      if(form.noOfBathRooms.type) { 
        if(form.noOfBathRooms.style.display != 'none') form.noOfBathRooms.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('noOfBathRoomsErr').innerHTML = "";
    }
  }
  
  if ( form.noOfReceptionRooms ) {
	var strVal = form.noOfReceptionRooms.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.noOfReceptionRooms.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('noOfReceptionRoomsErr').innerHTML = "Missing: Number of Reception Rooms";
      if(form.noOfReceptionRooms.type) { 
        if(form.noOfReceptionRooms.style.display != 'none') form.noOfReceptionRooms.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('noOfReceptionRoomsErr').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();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  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();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('offRoadParkingErr').innerHTML = "";
    }
  }
  
  if ( form.gardenType ) {
	var strVal = form.gardenType.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.gardenType.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('gardenTypeErr').innerHTML = "Missing: Garden";
      if(form.gardenType.type) { 
        if(form.gardenType.style.display != 'none') form.gardenType.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('gardenTypeErr').innerHTML = "";
    }
  }
  
  if ( form.propertyCondition ) {
	var strVal = form.propertyCondition.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.propertyCondition.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('propertyConditionErr').innerHTML = "Missing: Property Condition";
      if(form.propertyCondition.type) { 
        if(form.propertyCondition.style.display != 'none') form.propertyCondition.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('propertyConditionErr').innerHTML = "";
    }
  }
  
  if ( form.newKitchen ) {
	var strVal = form.newKitchen.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.newKitchen.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('newKitchenErr').innerHTML = "Missing: New Kitchen";
      if(form.newKitchen.type) { 
        if(form.newKitchen.style.display != 'none') form.newKitchen.focus();
      }
      alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
	  return ( false );
    }
    else{
      document.getElementById('newKitchenErr').innerHTML = "";
    }
  }
  
  if ( form.newBathroom ) {
	var strVal = form.newBathroom.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.newBathroom.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('newBathroomErr').innerHTML = "Missing: New Bathroom";
      if(form.newBathroom.type) { 
        if(form.newBathroom.style.display != 'none') form.newBathroom.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('newBathroomErr').innerHTML = "";
    }
  }
  
  if ( form.centralHeating ) {
	var strVal = form.centralHeating.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.centralHeating.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('centralHeatingErr').innerHTML = "Missing: Central Heating";
      if(form.centralHeating.type) { 
        if(form.centralHeating.style.display != 'none') form.centralHeating.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('centralHeatingErr').innerHTML = "";
    }
  }
  
  if ( form.reWiring ) {
	var strVal = form.reWiring.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.reWiring.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('reWiringErr').innerHTML = "Missing: Re Wiring";
      if(form.reWiring.type) { 
        if(form.reWiring.style.display != 'none') form.reWiring.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('reWiringErr').innerHTML = "";
    }
  }
  
  
  if ( form.newWindows ) {
	var strVal = form.newWindows.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.newWindows.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('newWindowsErr').innerHTML = "Missing: New Windows";
      if(form.newWindows.type) { 
        if(form.newWindows.style.display != 'none') form.newWindows.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('newWindowsErr').innerHTML = "";
    }
  }
  
  
  if ( form.needsDecorating ) {
	var strVal = form.needsDecorating.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.needsDecorating.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('needsDecoratingErr').innerHTML = "Missing: Needs Decorating";
      if(form.needsDecorating.type) { 
        if(form.needsDecorating.style.display != 'none') form.needsDecorating.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('needsDecoratingErr').innerHTML = "";
    }
  }
  
  if ( form.newCarpet ) {
	var strVal = form.newCarpet.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.newCarpet.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('newCarpetErr').innerHTML = "Missing: New Carpets";
      if(form.newCarpet.type) { 
        if(form.newCarpet.style.display != 'none') form.newCarpet.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('newCarpetErr').innerHTML = "";
    }
  }
  
  if ( form.marketValue ) {
	var strVal = form.marketValue.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.marketValue.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('marketValueErr').innerHTML = "Missing: Estimated Open Market Value";
      if(form.marketValue.type) { 
        if(form.marketValue.style.display != 'none') form.marketValue.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('marketValueErr').innerHTML = "";
    }
  }
  
  if ( form.marketValue ) {
	myexp = /^[0-9]+$/;
	if ( ! myexp.test ( form.marketValue.value ) ) {
      document.getElementById('marketValueErr').innerHTML = "Enter Valid Value";
      form.marketValue.focus();
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('marketValueErr').innerHTML = "";
    }
  }
  
  if ( form.arriveAtThisFigure ) {
	var strVal = form.arriveAtThisFigure.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.arriveAtThisFigure.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('arriveAtThisFigureErr').innerHTML = "Missing: How did you arrive at this figure";
      if(form.arriveAtThisFigure.type) { 
        if(form.arriveAtThisFigure.style.display != 'none') form.arriveAtThisFigure.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('arriveAtThisFigureErr').innerHTML = "";
    }
  }
  
  if ( form.askingPrice ) {
	var strVal = form.askingPrice.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.askingPrice.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('askingPriceErr').innerHTML = "Missing: Asking price for A Quick Cash Sale";
      if(form.askingPrice.type) { 
        if(form.askingPrice.style.display != 'none') form.askingPrice.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('askingPriceErr').innerHTML = "";
    }
  }
  
  if ( form.askingPrice ) {
	myexp = /^[0-9]+$/;
	if ( ! myexp.test ( form.askingPrice.value ) ) {
      document.getElementById('askingPriceErr').innerHTML = "Enter Valid Value";
      form.askingPrice.focus();
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('askingPriceErr').innerHTML = "";
    }
  }
  
  if ( form.mortgageBalance ) {
	var strVal = form.mortgageBalance.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.mortgageBalance.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('mortgageBalanceErr').innerHTML = "Missing: Outstanding Mortgage";
      if(form.mortgageBalance.type) { 
        if(form.mortgageBalance.style.display != 'none') form.mortgageBalance.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('mortgageBalanceErr').innerHTML = "";
    }
  }
  
  if ( form.mortgageBalance ) {
	myexp = /^[0-9]+$/;
	if ( ! myexp.test ( form.mortgageBalance.value ) ) {
      document.getElementById('mortgageBalanceErr').innerHTML = "Enter Valid Value";
      form.mortgageBalance.focus();
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('mortgageBalanceErr').innerHTML = "";
    }
  }
  
  if ( form.loanOnProperty ) {
	var strVal = form.loanOnProperty.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.loanOnProperty.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('loanOnPropertyErr').innerHTML = "Missing: Loans Secured against the property?";
      if(form.loanOnProperty.type) { 
        if(form.loanOnProperty.style.display != 'none') form.loanOnProperty.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('loanOnPropertyErr').innerHTML = "";
	  if (strVal=="Yes")
	  {
		  if ( form.securedLoanAmount ) {
			var strVal = form.securedLoanAmount.value.replace(rgExp1, '');
			strVal = strVal.replace(/\n/g,'');
			strVal = strVal.replace(rgExp3, '');
			strVal = strVal.replace(rgExp2, '');
			if (  (form.securedLoanAmount.disabled == false) && (! doesExist ( strVal )) ) {
			  document.getElementById('securedLoanAmountErr').innerHTML = "Missing: If \"Yes\" how much?";
			  if(form.securedLoanAmount.type) { 
				if(form.securedLoanAmount.style.display != 'none') form.securedLoanAmount.focus();
			  }
			  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
			  return ( false );
			}
			else{
			  document.getElementById('securedLoanAmountErr').innerHTML = "";
			}
		  }
		  
		  if ( form.securedLoanAmount ) {
			myexp = /^[0-9]+$/;
			if ( ! myexp.test ( form.securedLoanAmount.value ) ) {
			  document.getElementById('securedLoanAmountErr').innerHTML = "Enter Valid Value";
			  form.securedLoanAmount.focus();
			  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
			  return ( false );
			}
			else{
			  document.getElementById('securedLoanAmountErr').innerHTML = "";
			}
		  }
		  
	  }
	  else
	  {
		document.getElementById('securedLoanAmountErr').innerHTML = "";
	  }
    }
  }
  
  
  if ( form.whyDoSell ) {
	var strVal = form.whyDoSell.value.replace(rgExp1, '');
	strVal = strVal.replace(/\n/g,'');
	strVal = strVal.replace(rgExp3, '');
	strVal = strVal.replace(rgExp2, '');
    if (  (form.whyDoSell.disabled == false) && (! doesExist ( strVal )) ) {
      document.getElementById('whyDoSellErr').innerHTML = "Missing: Why do you want to sell?";
      if(form.whyDoSell.type) { 
        if(form.whyDoSell.style.display != 'none') form.whyDoSell.focus();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('whyDoSellErr').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();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      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();
			  }
			  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
			  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();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      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();
			  }
			  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
			  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();
			  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
			  return ( false );
			}
			else{
			  document.getElementById('reducedPriceAmountErr').innerHTML = "";
			}
		  }
		  
	  }
	  else
	  {
		document.getElementById('securedLoanAmountErr').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();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      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();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      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();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      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();
      }
	  alert('Please check your form entries are correct. You may need to scroll to the top of the form to see the warnings.');
      return ( false );
    }
    else{
      document.getElementById('tenantRentAffordErr').innerHTML = "";
    }
  }
  return ( true );
}
function validateAndSubmit() {
  var form = document.frmRegister;
  var ok = validateForm();
  if ( ok ) form.submit;
  return ( ok );
}
