function survVal()
{

 if (document.surveygal1.First_Name.value == "")
  {
    alert("Please enter your First Name.");
    document.surveygal1.First_Name.focus();
    return (false);
  }

  if (document.surveygal1.First_Name.value.length < 1)
  {
    alert("Please enter your First Name.");
    document.surveygal1.First_Name.focus();
    return (false);
  }

  if (document.surveygal1.First_Name.value.length > 24)
  {
    alert("Please enter at most 24 characters in the \"First Name\" field.");
    document.surveygal1.First_Name.focus();
    return (false);
  }

  if (document.surveygal1.First_Name.value.indexOf(".", 0) >= 0)
 {
    alert("Please do not enter a period in the first name field.");
    document.surveygal1.First_Name.focus();
    return (false);
 }

  if (document.surveygal1.First_Name.value.indexOf(",", 0) >= 0)
 {
    alert("Please do not enter a comma in the first name field.");
    document.surveygal1.First_Name.focus();
    return (false);
 }

  if (document.surveygal1.Last_Name.value == "")
  {
    alert("Please enter your Last Name.");
    document.surveygal1.Last_Name.focus();
    return (false);
  }

  if (document.surveygal1.Last_Name.value.length < 2)
  {
    alert("Please enter your Last Name.");
    document.surveygal1.Last_Name.focus();
    return (false);
  }

  if (document.surveygal1.Last_Name.value.length > 24)
  {
    alert("Please enter at most 24 characters in the \"Last Name\" field.");
    document.surveygal1.Last_Name.focus();
    return (false);
  }

 if (document.surveygal1.Last_Name.value.indexOf(".", 0) >= 0)
 {
    alert("Please do not enter a period in the last name field.");
    document.surveygal1.Last_Name.focus();
    return (false);
 }

 if (document.surveygal1.Last_Name.value.indexOf(",", 0) >= 0)
 {
    alert("Please do not enter a comma in the last name field.");
    document.surveygal1.Last_Name.focus();
    return (false);
 }

  if (document.surveygal1.Address1.value == "")
  {
    alert("Please enter your Address.");
    document.surveygal1.Address1.focus();
    return (false);
  }

  if (document.surveygal1.Address1.value.length < 1)
  {
    alert("Please enter your Address.");
    document.surveygal1.Address1.focus();
    return (false);
  }

  if (document.surveygal1.Address1.value.length > 24)
  {
    alert("Please enter at most 24 characters in the Address field.");
    document.surveygal1.Address1.focus();
    return (false);
  }

 if (document.surveygal1.Address1.value.indexOf(",", 0) >= 0)
 {
    alert("Please do not enter a comma in the Address field.");
    document.surveygal1.Address1.focus();
    return (false);
 }

 if (document.surveygal1.Address2.value.indexOf(",", 0) >= 0)
 {
    alert("Please do not enter a comma in the Address field.");
    document.surveygal1.Address2.focus();
    return (false);
 }

  if (document.surveygal1.Address2.value.length > 24)
  {
    alert("Please enter at most 24 characters in the second Address field.");
    document.surveygal1.Address2.focus();
    return (false);
  }

if (document.surveygal1.City1.value.indexOf(",", 0) >= 0)
 {
    alert("Please only enter your city in the City field. No commas please!");
    document.surveygal1.City1.focus();
    return (false);
 }

  if (document.surveygal1.City1.value == "")
  {
    alert("Please enter your City.");
    document.surveygal1.City1.focus();
    return (false);
  }

  if (document.surveygal1.City1.value.length < 1)
  {
    alert("Please enter your City.");
    document.surveygal1.City1.focus();
    return (false);
  }

  if (document.surveygal1.City1.value.length > 24)
  {
    alert("Please enter at most 24 characters in the City field.");
    document.surveygal1.City1.focus();
    return (false);
  }

  if (document.surveygal1.state1.selectedIndex < 0)
  {
    alert("Please select your State.");
    document.surveygal1.state1.focus();
    return (false);
  }

  if (document.surveygal1.state1.selectedIndex == 0)
  {
    alert("Please select your State.");
    document.surveygal1.state1.focus();
    return (false);
  }

  if (document.surveygal1.Zip1.value == "")
  {
    alert("Please enter your Zip Code.");
    document.surveygal1.Zip1.focus();
    return (false);
  }

  if (document.surveygal1.Zip1.value.length < 5)
  {
    alert("Please enter your Zip Code.");
    document.surveygal1.Zip1.focus();
    return (false);
  }

  if (document.surveygal1.Zip1.value.length > 5)
  {
    alert("Please enter at least 5 numbers in the \"zip code\" field. Sorry, U.S. residents only..");
    document.surveygal1.Zip1.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = document.surveygal1.Zip1.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the Zip Code field.  Sorry, U.S. residents only.");
    document.surveygal1.Zip1.focus();
    return (false);
  }

if (document.surveygal1.Area_Code.value == "")
{
alert("Please enter a value for the \"Area Code\" field.");
document.surveygal1.Area_Code.style.backgroundColor = '#deadae';
document.surveygal1.Area_Code.focus();
return (false);
}

if (document.surveygal1.Area_Code.value.length < 3)
{
alert("Please enter at least 3 characters in the \"Area Code\" field.");
document.surveygal1.Area_Code.style.backgroundColor = '#deadae';
document.surveygal1.Area_Code.focus();
return (false);
}

if (document.surveygal1.Area_Code.value.length > 3)
{
alert("Please enter at most 3 characters in the \"Area Code\" field.");
document.surveygal1.Area_Code.style.backgroundColor = '#deadae';
document.surveygal1.Area_Code.focus();
return (false);
}

var checkOK = "0123456789";
var checkStr = document.surveygal1.Area_Code.value;
var allValid = true;
var validGroups = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else if (ch == "," && decPoints != 0)
{
validGroups = false;
break;
}
else if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only numbers in the \"Area Code\" field.");
document.surveygal1.Area_Code.style.backgroundColor = '#deadae';
document.surveygal1.Area_Code.focus();
return (false);
}

if (decPoints > 1 || !validGroups)
{
alert("Please enter a valid number in the \"Area Code\" field.");
document.surveygal1.Area_Code.style.backgroundColor = '#deadae';
document.surveygal1.Area_Code.focus();
return (false);
}

if (document.surveygal1.TeleExch.value == "")
{
alert("Please enter a value for the \"TeleExch\" field.");
document.surveygal1.TeleExch.style.backgroundColor = '#deadae';
document.surveygal1.TeleExch.focus();
return (false);
}

if (document.surveygal1.TeleExch.value.length < 3)
{
alert("Please enter at least 3 characters in the \"TeleExch\" field.");
document.surveygal1.TeleExch.style.backgroundColor = '#deadae';
document.surveygal1.TeleExch.focus();
return (false);
}

if (document.surveygal1.TeleExch.value.length > 3)
{
alert("Please enter at most 3 characters in the \"TeleExch\" field.");
document.surveygal1.TeleExch.style.backgroundColor = '#deadae';
document.surveygal1.TeleExch.focus();
return (false);
}

var checkOK = "0123456789";
var checkStr = document.surveygal1.TeleExch.value;
var allValid = true;
var validGroups = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else if (ch == "," && decPoints != 0)
{
validGroups = false;
break;
}
else if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only digit characters in the \"TeleExch\" field.");
document.surveygal1.TeleExch.style.backgroundColor = '#deadae';
document.surveygal1.TeleExch.focus();
return (false);
}

if (decPoints > 1 || !validGroups)
{
alert("Please enter a valid number in the \"TeleExch\" field.");
document.surveygal1.TeleExch.style.backgroundColor = '#deadae';
document.surveygal1.TeleExch.focus();
return (false);
}

if (document.surveygal1.TeleNumb.value == "")
{
alert("Please enter a value for the \"TeleNumb\" field.");
document.surveygal1.TeleNumb.style.backgroundColor = '#deadae';
document.surveygal1.TeleNumb.focus();
return (false);
}

if (document.surveygal1.TeleNumb.value.length < 4)
{
alert("Please enter at least 4 characters in the \"TeleNumb\" field.");
document.surveygal1.TeleNumb.style.backgroundColor = '#deadae';
document.surveygal1.TeleNumb.focus();
return (false);
}

if (document.surveygal1.TeleNumb.value.length > 4)
{
alert("Please enter at most 4 numbers in the \"TeleNumb\" field.");
document.surveygal1.TeleNumb.style.backgroundColor = '#deadae';
document.surveygal1.TeleNumb.focus();
return (false);
}

var checkOK = "0123456789";
var checkStr = document.surveygal1.TeleNumb.value;
var allValid = true;
var validGroups = true;
var decPoints = 0;
var allNum = "";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
if (ch == ".")
{
allNum += ".";
decPoints++;
}
else if (ch == "," && decPoints != 0)
{
validGroups = false;
break;
}
else if (ch != ",")
allNum += ch;
}
if (!allValid)
{
alert("Please enter only numbers in the \"TeleNumb\" field.");
document.surveygal1.TeleNumb.style.backgroundColor = '#deadae';

document.surveygal1.TeleNumb.focus();
return (false);
}

if (decPoints > 1 || !validGroups)
{
alert("Please enter a valid number in the \"TeleNumb\" field.");
document.surveygal1.TeleNumb.focus();
return (false);
}

  if (document.surveygal1.email.value == "")
  {
    alert("Please enter a valid email address.");
    document.surveygal1.email.focus();
    return (false);
  }

  if (document.surveygal1.email.value.length < 7)
  {
    alert("Please enter at least 7 characters in the \"email\" field.");
    document.surveygal1.email.focus();
    return (false);
  }

  if (document.surveygal1.email.value.length > 50)
  {
    alert("Please enter at most 50 characters in the \"email\" field.");
    document.surveygal1.email.focus();
    return (false);
  }

if (document.surveygal1.email.value.indexOf("@", 0) < 0)
 {
    alert("Please enter a valid email address.");
    document.surveygal1.email.focus();
    return (false);
 }

if (document.surveygal1.email.value.indexOf(".", 0) < 0)
 {
    alert("Please enter a valid email address.");
    document.surveygal1.email.focus();
    return false;
 }

  if (document.surveygal1.email.value.indexOf("www.", 0) >= 0)
 {
	alert ("Please enter a valid e-mail address. Valid email addresses do not start with \" www.\"");
	document.surveygal1.email.focus();
	return(false);
}

  if (document.surveygal1.email.value.indexOf(",", 0) >= 0)
 {
	alert ("Please enter a valid e-mail address. Valid email addresses do not contain commas.");
	document.surveygal1.email.focus();
	return(false);
}

    if (document.surveygal1.Age.value == "")
  {
    alert("Please enter your age.");
    document.surveygal1.Age.focus();
    return (false);
  }

  if (document.surveygal1.Age.value.length < 1)
  {
    alert("Please enter your age.");
    document.surveygal1.Age.focus();
    return (false);
  }

  if (document.surveygal1.Age.value.length > 2)
  {
    alert("Please enter no more than 2 numbers in the \"Age\" field.");
    document.surveygal1.Age.focus();
    return (false);
  }

  var checkOK = "0123456789";
  var checkStr = document.surveygal1.Age.value;
  var allValid = true;
  var validGroups = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Please enter only numbers in the \"Age\" field.");
    document.surveygal1.Age.focus();
    return (false);
  }

 if (document.surveygal1.Age.value < 13)
  {
    window.location = "http://www.surveygals.com/sg_13u.htm";
return (false);
  }

//cookie setting section 
var fn = document.surveygal1.First_Name.value;
//alert("fn = " + fn);
document.surveygal1.First_Name.value = fn;
document.cookie = "fncookie" + "=" + escape(document.surveygal1.First_Name.value) + "; path=/";

var ln = document.surveygal1.Last_Name.value;
//alert("ln = " + ln);
document.surveygal1.Last_Name.value = ln;
document.cookie = "lncookie" + "=" + escape(document.surveygal1.Last_Name.value) + "; path=/";

var ad = document.surveygal1.Address1.value;
//alert("ad = " + ad);
document.surveygal1.Address1.value = ad;
document.cookie = "adcookie" + "=" + escape(document.surveygal1.Address1.value) + "; path=/";


var a2 = document.surveygal1.Address2.value;
//alert("a2 = " + a2);
document.surveygal1.Address2.value = a2;
document.cookie = "a2cookie" + "=" + escape(document.surveygal1.Address2.value) + "; path=/";


var cy = document.surveygal1.City1.value;
//alert("cy = " + cy);
document.surveygal1.City1.value = cy;
document.cookie = "cycookie" + "=" + escape(document.surveygal1.City1.value) + "; path=/";

var st = document.surveygal1.state1.value;
//alert("st = " + st);
document.surveygal1.state1.value = st;
document.cookie = "stcookie" + "=" + escape(document.surveygal1.state1.value) + "; path=/";

var zp = document.surveygal1.Zip1.value;
//alert("zp = " + zp);
document.surveygal1.Zip1.value = zp;
document.cookie = "zpcookie" + "=" + escape(document.surveygal1.Zip1.value) + "; path=/";


var em = document.surveygal1.email.value;
//alert("em = " + em);
document.surveygal1.email.value = em;
document.cookie = "emlcookie" + "=" + escape(document.surveygal1.email.value) + "; path=/";

  return (true);
}

