
	
// Set Variables	
	var site	=	'';  // this needs to be the 'root' of the site
	
	var first	=	(Math.floor(Math.random()*10))+'';
	var second	=	(Math.floor(Math.random()*10))+'';
	var third	=	(Math.floor(Math.random()*10))+'';
	var fourth	=	(Math.floor(Math.random()*10))+'';
	var fith	=	(Math.floor(Math.random()*10))+'';
	
	var captcha	=	(first + second + third + fourth + fith);


	
function jscaptcha()
{
// Display the Captcha Images
	
	//document.write("<label>&nbsp;</label>");
	document.write("<div id=\"jscaptcha\" style=\"border: 1px solid #f90; width: 155px;\">");
	document.write("<img src=\"" + site + "images/" + first	+ ".gif\" alt=\"\">");
	document.write("<img src=\"" + site + "images/" + second + ".gif\" alt=\"\">");
	document.write("<img src=\"" + site + "images/" + third + ".gif\" alt=\"\">");
	document.write("<img src=\"" + site + "images/" + fourth + ".gif\" alt=\"\">");
	document.write("<img src=\"" + site + "images/" + fith + ".gif\" alt=\"\">");
	document.write("</div>");
	
	
// Display the Input Box
//	document.write("<label>Enter Numbers from the Image</label>");
//	document.write("<input type=\"text\" name=\"jscaptchaInput\">");
	
}

function jscaptchaSubmit(frm)
{
	if(alltrim(frm.jscaptchaInput.value)=='')
{
alert("Please enter image code shown");
document.getElementById('jscaptchaInput').focus();
return false;
}
	if(frm.jscaptchaInput.value != captcha)
	{
		alert("Image code is wrong !");
document.getElementById('jscaptchaInput').focus();
return false;		
	}
	
	return true;
}
