var form;
var http;
var isWorking;
var form_mode;
function checkCaptchaVerification(frm, objId, mode)
{	
	form = frm; 
	form_mode = mode;
	var url = site_url+"ajax_captcha_check.php?module=CaptchaCheck";
	//var contentType = "application/x-www-form-urlencoded; charset=UTF-8";
	var params = "&objId="+objId;
  	url = url+params;
	//alert(url);return false;
	http = getHTTPObject();
	isWorking = false;
	if(!isWorking)
	{
		isWorking = true;
  		http.open("GET", url, true);
		http.onreadystatechange=handleHttpResponse_status;
		http.send(null);
  	}
}
function handleHttpResponse_status() 
{ 
	if (http.readyState == 4) 
	{	
      	isWorking = false;
    	if (http.responseText.indexOf('invalid') == -1) 
		{
    		var xmlDocument = http.responseXML; 
			var objIdvar = xmlDocument.getElementsByTagName('exist').item(0).firstChild.data;
			//alert(objIdvar);
			
			if(objIdvar == '1')
			{
				alert("Entered answer is not right ...Please Try Again.");
				form.vCaptchaVal.focus();
				form.vCaptchaVal.value = '';
				return false;
			}
			else if(objIdvar == '-1')
			{
				alert("Please Enter Answer");
				form.vCaptchaVal.focus();
				return false;
			}
			else
			{
				//document.frminq.submit();
				//document.frmcontact.submit();
				document.getElementById('mode').value = form_mode;
				form.submit();
			}
		}
	}
}