
function displayContent(url,div){
	var xmlhttp;
	xmlhttp=null;
	// code for Mozilla, etc.
	if (window.XMLHttpRequest) {
	  xmlhttp=new XMLHttpRequest();
	}
	// code for IE
	else if (window.ActiveXObject) {
	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	if (xmlhttp!=null) {
	  xmlhttp.onreadystatechange= function() {state_Change(xmlhttp,div,url);};
	  xmlhttp.open("GET",url,true,"HSWebUser","H1st0r1cPr0f1l3");
	  xmlhttp.send(null);
	}
}



function state_Change(httpobj,div) { 
	// if xmlhttp shows "loaded"
	if (httpobj.readyState==4) {
	  // if "OK"
		if (httpobj.status==200) {
			document.getElementById(div).innerHTML = httpobj.responseText;
		}
	  	else {
			alert("Problem retrieving data:" + httpobj.statusText);
		}
	}
	else {
		document.getElementById(div).innerHTML = "<p>Please Wait....</p>";
	}
}

function handleDropdown(url, dd1, div)
{
  //var idx = dd1.selectedIndex;
  //var val = dd1[idx].text;
  
  var dropdownIndex = document.getElementById(dd1).selectedIndex;
  var val = document.getElementById(dd1)[dropdownIndex].value;
  
  var theURL = url + '?dropdownValue=' + val;

  displayContent(theURL, div);
}






