function checkEmail(str1) // Creates a new checkUser function.
{
	if (str1.length==0) // checks if the str variable inside the checkUser function is equal to 0
	{
		document.getElementById("validateCheckEmail").innerHTML=""; // Gets the html object by it's id, in this case it's id is validateCheck
		return; // Returns the end result of the function
	}
	xmlHttp1=GetXmlHttpObject1();
	if (xmlHttp1==null) // Checks whether the users browser allows ajax
	{
		alert ("Please use a browser that has ajax enabled!"); // Alerts if the users browser does not support ajax
		return; // Returns the function
	}
	var url="emailcheck.php"; // Creates a new variable called url
	url=url+"?email="+str1; // Assigns an id to the php file (usercheck.php?id=user)
	url=url+"&sid="+Math.random(); // Assigns a random math function to the url
	xmlHttp1.onreadystatechange=stateChanged1; // If the forms state has changed
	xmlHttp1.open("GET",url,true); // Gets a pages content using ajax
	xmlHttp1.send(null);
}

function stateChanged1()
{
	if (xmlHttp1.readyState==4)
	{
	document.getElementById("validateCheckEmail").innerHTML=xmlHttp1.responseText;
	}
}

function GetXmlHttpObject1()
{
	var xmlHttp1=null;
	try
	{
		xmlHttp1=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttp1=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xmlHttp1=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
return xmlHttp1;
}