var imgdir = "/js/jcap/cimg/"; // identify directory where captcha images are located
var jfldid = "uword"; // identify word field id name
var jfldsz = 20; // identify word field size

function sjcap(jfldcls){
imgdir = encodeURIComponent(imgdir);
if (jfldcls == null){
jfldcls = "";
}
anum = (Math.floor(Math.random()*10))+1;
imgid = parseInt(anum);
cword = 
["b06979c654c4e5c214b7ab4b18635ac0","0a18f2c5f262fd7f232c9100fa2b6b80","92a9f7f4adab3276533bfdd2390654ee",
 "29932eb620841dc0e5ab95784f4471f7","e3fb5a5bc520a70f985ef86af191d534","237d029aa6b0066cded82dfa3c534601",
 "25008116b92ba883faa1c21e5f45b172","e4a973de977adc8d92b1b52b88cca7c5","06711c99658502c99e2cc71db15dd777",
 "654c6625da6aa75688e39fa530a83056"];

document.write("<p><img src=\"" + decodeURIComponent(imgdir) + imgid + ".jpg\" width=\"200\" height=\"70\" border=\"1\" alt=\"\"><\/p>");
document.write("<p><input type=\"text\" id=\"" + jfldid + "\" name=\"" + jfldid + "\" class=\"" + jfldcls + "\" size=\"" +  jfldsz + "\"><\/p>");
}

function jcap(){

var uword = hex_md5(document.getElementById(jfldid).value);

if (uword==cword[anum-1]) {
return true;
}

else {
alert("ERROR: Enter the code as it is shown.");
document.getElementById(jfldid).focus();
return false;
}
}