// JavaScript Document
function DrawCaptcha()

{	
	
	var a = Math.ceil(Math.random() * 9)+ '';
	var b = Math.ceil(Math.random() * 9)+ '';    

	var c = Math.ceil(Math.random() * 9)+ '';  

	var d = Math.ceil(Math.random() * 9)+ '';  

	var e = Math.ceil(Math.random() * 9)+ '';  

	var f = Math.ceil(Math.random() * 9)+ '';  

	var g = Math.ceil(Math.random() * 9)+ '';
	var h = Math.ceil(Math.random() * 9)+ '';
	var i = Math.ceil(Math.random() * 9)+ '';
	var j = Math.ceil(Math.random() * 9)+ '';  

	var code = a +  b +  c  + d  + e +  g + h + i +j;

	

	document.getElementById("txtCaptcha").value = code;

	//document.getElementById("txtInput").value = code;

}



    // Validate the Entered input aganist the generated security code function   

function ValidCaptcha()

{

	

	var str1 = removeSpaces(document.getElementById('txtCaptcha').value);

	var str2 = removeSpaces(document.getElementById('captcha').value);	

	if (str1 == str2) 

	{
		document.getElementById('captcha').style.borderColor="#DCDCDC";
		//document.getElementById('captcha_err').innerHTML="";

		return true;  

	}

	else

	{

		document.getElementById('captcha').style.borderColor="Red";
		return false;

	}//return false;

	

}



// Remove the spaces from the entered and generated code

function removeSpaces(string)

{

	return string.split(' ').join('');

}
