function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false}
else {return true}
}
}


function validate_country(field,alerttxt)
{
with (field)
{
if (value=="none")
  {alert(alerttxt);return false}
else {return true}
}
}



function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@")
dotpos=value.lastIndexOf(".")
if (apos<1||dotpos-apos<2)
  {alert(alerttxt);return false}
else {return true}
}
}

function validate_phone(field,alerttxt)
{

if (field.value==null||field.value=="")
{

if(confirm(alerttxt))
{
return true;
}

else 
{
return false;
}

}

}


function validate_form_Newsletter(thisform)
{
with (thisform)
{


if (validate_required(fname,"Please fill out the First Name!")==false)
  {fname.focus();return false}

if (validate_required(lname,"Please fill out the Last Name!")==false)
  {lname.focus();return false}

if (validate_required(email,"Please fill out the Email!")==false)
  {email.focus();return false}
  else
  {if (validate_email(email,"Not a valid e-mail address!")==false)
  {email.focus();return false}
  }

/*if (validate_country(country,"Please select the Country!")==false)
  {lname.focus();return false}*/

if (validate_required(whatled,"What led you to our website? Please fill it!")==false)
  {whatled.focus();return false}

if (validate_phone(tel,"We have noticed you have not included your phone number with your details. From time to time we call our prospective investment clients with pre launch opportunities before they go to market. Without your phone number we will be unable to contact you. Proceed without phone number?")==false)
  {tel.focus();return false}

}
 }

function validate_form_Careers(thisform)
{
with (thisform)
{


if (validate_required(fname,"Please fill out the First Name!")==false)
  {fname.focus();return false}

if (validate_required(lname,"Please fill out the Last Name!")==false)
  {lname.focus();return false}

if (validate_required(email,"Please fill out the Email!")==false)
  {email.focus();return false}
  else
  {if (validate_email(email,"Not a valid e-mail address!")==false)
  {email.focus();return false}
  }

if (validate_required(address,"Please fill out the Address!")==false)
  {address.focus();return false}

if (validate_required(whatled,"What led you to our website? Please fill it!")==false)
  {whatled.focus();return false}

if (validate_phone(tel,"We have noticed you have not included your phone number with your details. From time to time we call our prospective investment clients with pre launch opportunities before they go to market. Without your phone number we will be unable to contact you. Proceed without phone number?")==false)
  {tel.focus();return false}

}
 }

 function validate_form_Resale(thisform)
{
with (thisform)
{


if (validate_required(fname,"Please fill out the First Name!")==false)
  {fname.focus();return false}

if (validate_required(lname,"Please fill out the Last Name!")==false)
  {lname.focus();return false}

if (validate_required(email,"Please fill out the Email!")==false)
  {email.focus();return false}
  else
  {if (validate_email(email,"Not a valid e-mail address!")==false)
  {email.focus();return false}
  }

if (validate_required(address,"Please fill out the Address!")==false)
  {address.focus();return false}

  if (validate_required(postcode,"Please fill out the Postcode!")==false)
  {postcode.focus();return false}


  if (validate_required(paddress,"Please fill out the Property Address!")==false)
  {paddress.focus();return false}

  if (validate_required(location,"Please fill out the Property Location!")==false)
  {location.focus();return false}


  if (validate_required(price,"Please fill out the Expected Price!")==false)
  {price.focus();return false}

if (validate_required(whatled,"What led you to our website? Please fill it!")==false)
  {whatled.focus();return false}

if (validate_phone(tel,"We have noticed you have not included your phone number with your details. From time to time we call our prospective investment clients with pre launch opportunities before they go to market. Without your phone number we will be unable to contact you. Proceed without phone number?")==false)
  {tel.focus();return false}

}
 }


  function validate_form_Register(thisform)
{
with (thisform)
{


if (validate_required(fname,"Please fill out the First Name!")==false)
  {fname.focus();return false}

if (validate_required(lname,"Please fill out the Last Name!")==false)
  {lname.focus();return false}

if (validate_required(email,"Please fill out the Email!")==false)
  {email.focus();return false}
  else
  {if (validate_email(email,"Not a valid e-mail address!")==false)
  {email.focus();return false}
  }


if (validate_required(address,"Address must be filled out!")==false)
  {address.focus();return false}

if (validate_required(whatled,"What led you to our website? Please fill it!")==false)
  {whatled.focus();return false}

if (validate_phone(tel,"We have noticed you have not included your phone number with your details. From time to time we call our prospective investment clients with pre launch opportunities before they go to market. Without your phone number we will be unable to contact you. Proceed without phone number?")==false)
  {tel.focus();return false}

}
 }


 function validate_form_Callback(thisform)
{
with (thisform)
{


if (validate_required(fname,"Please fill out the First Name!")==false)
  {fname.focus();return false}

if (validate_required(lname,"Please fill out the Last Name!")==false)
  {lname.focus();return false}

if (validate_required(email,"Please fill out the Email!")==false)
  {email.focus();return false}
  else
  {if (validate_email(email,"Not a valid e-mail address!")==false)
  {email.focus();return false}
  }


if (validate_required(whatled,"What led you to our website? Please fill it!")==false)
  {whatled.focus();return false}

if (validate_phone(tel,"We have noticed you have not included your phone number with your details. From time to time we call our prospective investment clients with pre launch opportunities before they go to market. Without your phone number we will be unable to contact you. Proceed without phone number?")==false)
  {tel.focus();return false}

}
 }


  function validate_form_Property(thisform)
{
with (thisform)
{


if (validate_required(fname,"Please fill out the First Name!")==false)
  {fname.focus();return false}

if (validate_required(lname,"Please fill out the Last Name!")==false)
  {lname.focus();return false}

if (validate_required(email,"Please fill out the Email!")==false)
  {email.focus();return false}
  else
  {if (validate_email(email,"Not a valid e-mail address!")==false)
  {email.focus();return false}
  }

  if (validate_required(property,"Please fill out the Property in question!")==false)
  {property.focus();return false}

if (validate_required(whatled,"What led you to our website? Please fill it!")==false)
  {whatled.focus();return false}

if (validate_phone(tel,"We have noticed you have not included your phone number with your details. From time to time we call our prospective investment clients with pre launch opportunities before they go to market. Without your phone number we will be unable to contact you. Proceed without phone number?")==false)
  {tel.focus();return false}

}
 }

