var xmlHttp

// this is the function that runs when the dropdown is changed
function getiframe() {
	xmlHttp=GetXmlHttpObject();

	if (xmlHttp==null) {
		alert('Giving up :( Cannot create an XMLHTTP instance. Something is borked.');
		return;
	}

	// this gets the value of the iframe dropdown - sub1, sub2, or sub3
	var whichiframe = document.getElementById('iframe').value;

	// we pass that value to the getiframe.php
	var url = "getiframe.php?iframe=" + whichiframe;

	// this is what changes the contents of the iframe
	xmlHttp.onreadystatechange=  function() {
		// if the webbrowser is ready, change it
		if (xmlHttp.readyState==4) {
			// this line tells the script what div to put the contents of getiframe.php into
			document.getElementById('showiframe').innerHTML=xmlHttp.responseText;
		}
	}
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


// this is the extra crap that sets up the ajax object - it never needs to be edited.
function GetXmlHttpObject() {
	var xmlHttp=null;
	try {
		// Firefox, Opera 8.0+, Safari, IE7
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		// IE6 and under
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}




