
function createRequestObject()
{
var xmlHttp=null;
try
 {
 // Firefox, Opera 8.0+, Safari
 xmlHttp=new XMLHttpRequest();
 }
catch (e)
 {
 // Internet Explorer
 try
  {
  xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
  }
 catch (e)
  {
  xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
 }


return xmlHttp;
}


function createRequestObjectOLD()
{
	try
	{
		xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch(e)
	{
		alert('Sorry, but your browser doesn\'t support XMLHttpRequest.');
	}
	return xmlhttp;
}

var http = createRequestObject();
var sess = createRequestObject();

// IMAGE REFRESHING

// SUBMISSION

function check()
{
	var submission = document.getElementById('captcha').value;
	var submission2 = document.getElementById('uid').value;
	var url = '/captcha_process.php?captcha=' + submission + '&' + 'uid=' + submission2;
	//var url = 'eee.fff?www=333';
	docheck(url, displaycheck);

}

function docheck(url, callback)
{
	http.open('GET', url, true);
	http.onreadystatechange = displaycheck;
	http.send(null);
}

function displaycheck()
{
	if(http.readyState == 4)
	{
		var showcheck = http.responseText;
		if(showcheck == '1')
		{
			document.getElementById('captcha').style.border = '1px solid #49c24f';
			document.getElementById('captcha').style.background = '#bcffbf';
			document.getElementById('Submit1').disabled = false;
			document.getElementById('jsok').value = 'AOK';

		}
		if(showcheck == '0')
		{
			document.getElementById('captcha').style.border = '1px solid #c24949';
			document.getElementById('captcha').style.background = '#ffbcbc';
			document.getElementById('Submit1').disabled = true;
			document.getElementById('jsok').value = '';

		}
	}
}
function fcheck()
{
if (document.getElementById('Submit1').disabled == false)
	{
	return true;
	}
else
	{
	return false;
	}
}
