

// holds an instance of XMLHttpRequest
var xmlHttp_remove = createXmlHttpRequestObject();
// creates an XMLHttpRequest instance
function createXmlHttpRequestObject()
{
// will store the reference to the XMLHttpRequest object
var xmlHttp_remove;
// this should work for all browsers except IE6 and older
try
{
// try to create xmlHttp_removeRequest object
xmlHttp_remove = new XMLHttpRequest();
}
catch(e)
{
// assume IE6 or older
try
{
xmlHttp_remove = new ActiveXObject("Microsoft.XMLHttp");
}
catch(e) { }
}
// return the created object or display an error message
if (!xmlHttp_remove)
alert("Error creating the XMLHttpRequest object.");
else
return xmlHttp_remove;
}
	// called to read a file from the server
	
	 
	var count='';
	function process(name,email,phone,message,root)
	{
		//alert('abc')
		//var sport = document.getElementById("sport").value;
		
		var url = root+"contact_.php?name="+name+"&email="+email+"&phone="+phone+"&message="+message;
		
		
		if (xmlHttp_remove)
		{
		// try to connect to the server
			try
			{
			
			xmlHttp_remove.open("POST", url, true);
			xmlHttp_remove.onreadystatechange = handleRequestStateChange_remove;
			xmlHttp_remove.send(null);
			}
			// display the error in case of failure
			catch (e)
			{
			alert("Can't connect to server:\n" + e.toString());
			}
		}

		
	}
	
	
	
	
	
	
	// function that handles the HTTP response
	function handleRequestStateChange_remove()
	{
	// obtain a reference to the <div> element on the page
	//var loader = document.getElementById("loading");
	// display the status of the request
	if (xmlHttp_remove.readyState == 1)
	{

	}/*
	else if (xmlHttp_remove.readyState == 2)
	{
	myDiv.innerHTML += "Request status: 2 (loaded) <br/>";
	}
	else if (xmlHttp_remove.readyState == 3)
	{
	myDiv.innerHTML += "Request status: 3 (interactive) <br/>";
	}
	// when readyState is 4, we also read the server response
	*/
	else if (xmlHttp_remove.readyState == 4)
	{
		// continue only if HTTP status is "OK"
		
		if (xmlHttp_remove.status == 200)
		{
				
			try
			{
				
				response_remove = xmlHttp_remove.responseText;
				document.getElementById("thnks").style.display = "block";
				//document.getElementById("thnks").innerHTML = response_remove;
				
				
			}
			catch(e)
			{
			// display error message
				alert("Error reading the response: " + e.toString());
			}
		}
		else
		{
			// display status message
		alert("There was a problem retrieving the data:\n" +
		xmlHttp_remove.statusText);
		}
		
	}
}


