document.write("<br><table border='0' cellspacing='0' cellpadding='4' bgcolor='#800000'><tr><td align='center'>");
document.write("<b style='color:#FFFFFF !important;'>Please select the correct answer below so we<br>know this is not an automated spambot entry.<br></b>");

var choices = 3;
var now = new Date()
var sec = now.getSeconds()
var drop = sec % choices;
drop +=1;
var wrong = "<option>wrong</option>";
var correct = "<option>CORRECT ANSWER</option>";

function verify()
{
	if (FrontPage_Form1_Validator(theForm) == true){

		if (document.forms[0].answer.selectedIndex != drop)
			 {
				 alert("Please Select the Correct Answer")
			 }
		else
			 {
			 document.forms[0].submit()
			 return true
			 }
	}
}

document.write("<select size='1' name='answer' style='background-color: #FFD57D'><option>Please Select the Correct Answer</option>");

switch(drop)
{
   case 1:
      droporder= correct+wrong+wrong+wrong;
      break;
   case 2:
      droporder= wrong+correct+wrong+wrong;
      break;
   case 3:
      droporder= wrong+wrong+correct+wrong;
      break;
}

document.write(droporder);
document.write("</select></td></tr></table><br>");


function FrontPage_Form1_Validator(theForm)
{
	if (theForm.Comments.value == "")
  {
    alert("Please enter a value for the \"Comments\" field.");
    theForm.Comments.focus();
    return (false);
  }

  if (theForm.Comments.value.length < 5)
  {
    alert("Please enter at least 5 characters in the \"Comments\" field.");
    theForm.Comments.focus();
    return (false);
  }

  if (theForm.Username.value == "")
  {
    alert("Please enter a value for the \"User Name\" field.");
    theForm.Username.focus();
    return (false);
  }

  if (theForm.Username.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"User Name\" field.");
    theForm.Username.focus();
    return (false);
  }

  if (theForm.Username.value.length > 256)
  {
    alert("Please enter at most 256 characters in the \"User Name\" field.");
    theForm.Username.focus();
    return (false);
  }

  if (theForm.UserEmail.value == "")
  {
    alert("Please enter a value for the \"User Email\" field.");
    theForm.UserEmail.focus();
    return (false);
  }

  if (theForm.UserEmail.value.length < 3)
  {
    alert("Please enter at least 3 characters in the \"User Email\" field.");
    theForm.UserEmail.focus();
    return (false);
  }

  if (theForm.UserEmail.value.length > 256)
  {
    alert("Please enter at most 256 characters in the \"User Email\" field.");
    theForm.UserEmail.focus();
    return (false);
  }

	//email validation
  var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
  if (!(filter.test(theForm.UserEmail.value)))
  {
    alert("Please enter a valid \"Email\".");
    theForm.UserEmail.focus();
    return (false);
  }
  
  return (true);
}