var httpObject;
function createHttpObject()
{
	document.getElementById('searchResults').innerHTML = '<p>Searching...</p>';
	try{httpObject = new XMLHttpRequest();}
	catch(e)
	{
		try{httpObject = new ActiveXObject('Msxml2.XMLHTTP');}
		catch(e)
		{
			try{httpObject = new ActiveXObject('Microsoft.XMLHTTP');}
			catch(e)
			{
				document.getElementById('searchResults').innerHTML = '<p>Some functionality on this page may not work: please upgrade your browser.</p>';
				return false;
			}
		}
	}
	searchForBands();
}

function searchForBands()
{
	var month = document.forms[0].monthSelect.value;
	var year = document.forms[0].yearSelect.value;
	var url = 'scripts/bandSearch.php?year='+year+'&month='+month;
	httpObject.onreadystatechange=showResults;
	httpObject.open('GET', url, true);
	httpObject.send(null);
}

function showResults()
{
	if(httpObject.readyState==4)
	{
		document.getElementById('searchResults').innerHTML = httpObject.responseText;
		setPos();
	}
}