
function showPopup(url, width, height)
{
	window.open(url, "Version History", "toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0, resizable=0, width=" + width + ", height=" + height);
}

function resetFields()
{
	document.getElementById('response').innerHTML = '';
}

function sendLicense()
{
	document.getElementById("response").innerHTML = "<img src='images/ajax-loader.gif' alt='' />";
	
	var email = document.getElementById("email").value;
	var xhr;
	
	if (window.XMLHttpRequest)
	{ 
	    xhr = new XMLHttpRequest();
	} 
	else if (window.ActiveXObject)
	{
		try
		{
			xhr = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			xhr = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}

	xhr.onreadystatechange = function()
	{
		if(xhr.readyState == 4)
		{
			if(xhr.status == 200)
				document.getElementById("response").innerHTML = xhr.responseText;
			else
				document.getElementById("response").innerHTML = "Error Sending Request: " + xhr.status;
		}
	};

	xhr.open("POST", "send_license.php", true);
	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	xhr.send("email=" + escape(email));
}
