function getS()
{
	xmlhttp = getHttp();
	if(xmlhttp == null)
	{
	  alert("Your browser does not support XMLHTTP!");
	  return;
	}

	xmlhttp.onreadystatechange=function()
	{
		if(xmlhttp.readyState==4)
		{
			document.getElementById('asize').innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET", "whichws.php", true);
	xmlhttp.send(null);

}
function getC(size)
{
	xmlhttp = getHttp();

	if(xmlhttp == null)
	{
	  alert("Your browser does not support XMLHTTP!");
	  return;
	}

	xmlhttp.onreadystatechange=function()
	{
		if(xmlhttp.readyState==4)
		{
			document.getElementById("atype").innerHTML=xmlhttp.responseText;
		}
	}
	xmlhttp.open("GET", "whichws.php?s=" + size, true);
	xmlhttp.send(null);
}

function getUnit(size, type)
{
	xmlhttp = getHttp();

	if(xmlhttp == null)
	{
	  alert("Your browser does not support XMLHTTP!");
	  return;
	}

	xmlhttp.onreadystatechange=function()
	{
		if(xmlhttp.readyState==4)
		{
			document.getElementById("unitData").innerHTML=xmlhttp.responseText + '<br/><br/><a href="which.php" title="CHART" style="font-size:smaller;" onclick="hideContent(\'unitselectionform\'); return !window.open(this.href, \'product\', \'scrollbars=1,resizable=1\'); clearSelections();">See the entire chart</a>';
		}
	}
	xmlhttp.open("GET", "whichws.php?s=" + size + "&c=" + type, true);
	xmlhttp.send(null)
}

function clearSelections()
{
	removeContent("unitData");
	removeContent("atype");
	removeContent("asize");
}
function getHttp()
{
	var xmlhttp = null;
	if (window.XMLHttpRequest)
	{
	  // code for IE7+, Firefox, Chrome, Opera, Safari
	  xmlhttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
	  // code for IE6, IE5
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return xmlhttp;
}

function removeContent(d)
{
	document.getElementById(d).innerHTML = "&nbsp;";
}
function hideContent(d) {
	document.getElementById(d).style.display = "none";
}
function showContent(d) {
	document.getElementById(d).style.display = "block";
}
function reverseDisplay(d) {
	if(document.getElementById(d).style.display == "none") {
		document.getElementById(d).style.display = "block";
	}
	else {
		document.getElementById(d).style.display = "none";
	}
}
