
function onPageLoad()
{
 document.getElementById("p1").innerHTML=Math.round(Math.random()* (100000 - 1000) + 10);
}

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

function validate_quote(field,alerttxt)
{
var secNum = document.getElementById("p1").innerHTML;

with (field)
{

if (value !=secNum)
  {alert(alerttxt);return false;}
else {return true}
}
}


function validate_form(thisform)
{
with (thisform)
{
if (validate_required(securityNum,"Please enter the numbers displayed in the above image!")==false)
  {securityNum.focus();return false;}
if (validate_quote(securityNum,"The number you have entered does not match the number displayed in the above image! If you can not read the number in the image clearly, click on the link: Generate New Number")==false)
  {securityNum.focus();return false;}
}
}
