

function Form_Validator(theForm)
{
  var radioSelected = false;
  theForm.jamaika.value	= false;

function strfunc() {} ; mmm = new strfunc() ; nnn = 0
// --------------------------------
mmm[nnn++] = "a href";
mmm[nnn++] = "[url=";
mmm[nnn++] = "www.";
mmm[nnn++] = "http://";

// --------------------------------


function strfunc() {} ; m = new strfunc() ; n = 0
// --------------------------------

m[n++] = "(091)";
m[n++] = "india";
m[n++] = "nigeria";
m[n++] = "pakistan";
m[n++] = "dubai";
m[n++] = "karnataka";
m[n++] = "home worker";
m[n++] = "work at home";
m[n++] = "work from home";
m[n++] = "place ads";
m[n++] = "xanax";
m[n++] = "levitra";
m[n++] = "fuck";
m[n++] = "Apple I";
m[n++] = "chokolate_baby";
m[n++] = "7031929349";
m[n++] = "electronics.warehouseltd";
m[n++] = "558490113";
m[n++] = "lisabenson";


// --------------------------------


function strfunc() {} ; mm = new strfunc() ; nn = 0
// --------------------------------
mm[nn++] = "javascript";
mm[nn++] = "bestbulgarianproperties";
mm[nn++] = "night_watcher";
mm[nn++] = "rainbowpromotions";
mm[nn++] = "x.x.x.x";


// --------------------------------


  for (i = 0;  i < theForm.section.length;  i++)
  {
    if (theForm.section[i].checked)
        radioSelected = true;
  }

  if (!radioSelected)
  {
    alert("Please select one of the \"section\" options.");
    return (false);
  }

  if (theForm.title.value == "")
  {
    alert("Please enter a value for the \"Ad Title\" field.");
    theForm.title.focus();
    return (false);
  }

  if (theForm.title.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"Ad Title\" field.");
    theForm.title.focus();
    return (false);
 }

fs = theForm.comments.value + theForm.title.value + theForm.realname.value + theForm.username.value + theForm.country.value + theForm.telephone.value + theForm.city.value + theForm.url.value;
fs = fs.toUpperCase();
for (i = 0;i < n;i++)
{
	if (fs.indexOf(m[i].toUpperCase()) > -1)
	{
		alert("Sorry, this kind of advert is not allowed!");
		return(false);
	}
}



leng = theForm.comments.value.length;

  if (leng == 0) {
    alert("Please enter a value for the \"Ad Text\" field.");
    theForm.comments.focus();
    return (false);
  }
  else if (leng < 15) {
    alert("Please enter at least 15 characters in the \"Ad Text\" field.");
    theForm.comments.focus();
    return (false);
  }
  else if (leng > 1000) {
      alert("Your advert is too complicated. Please type it again more slowly !");
      theForm.comments.focus();
      return (false);
  }
  else if (leng > 500 ) {
        alert("Your advert is too long !");
        theForm.comments.focus();
        return (false);
  }


  if (theForm.realname.value == "")
  {
    alert("Please enter a value for the \"Your Name\" field.");
    theForm.realname.focus();
    return (false);
  }
  else if (theForm.realname.value.length < 4)
  {
    alert("Please enter at least 4 characters in the \"Your Name\" field.");
    theForm.realname.focus();
    return (false);
  }

   if (theForm.username.value.indexOf("@") == -1)
    {
      alert("Please enter a valid email address!");
      theForm.username.focus();
      return (false);
  }

   if (theForm.username.value.indexOf(".") == -1)
      {
        alert("Please enter a valid email address.");
        theForm.username.focus();
        return (false);
  }


for (i = 0;i < nn;i++)
{
	if (fs.indexOf(mm[i].toUpperCase()) > -1)
	{
		theForm.country.value = "divert";
		break;
	}
}


fs = theForm.comments.value;
fs = fs.toUpperCase();
for (i = 0;i < nnn;i++)
{
	if (fs.indexOf(mmm[i].toUpperCase()) > -1)
	{
		alert("Html text (like http://; www. etc) is NOT allowed in the advert body !\n\nYou can enter your website in the \"Website\" field");
		theForm.country.value = "divert";
		break;
	}
}


  theForm.jamaika.value	= true;

  return (true);


}


