		function LoadMedium2Select(xmlDoc)
		{
			var ts = document.getElementById("medium2id");
			var x = xmlDoc.getElementsByTagName('option');
			for (i=0;i<x.length;i++)
			{
				var optionvalue = ""
				var optiontext = ""
				
				for (j=0;j<x[i].childNodes.length;j++)
				{
					if (x[i].childNodes[j].nodeType == 1)
					{
						if(x[i].childNodes[j].nodeName=="value") optionvalue=x[i].childNodes[j].firstChild.nodeValue;
						if(x[i].childNodes[j].nodeName=="text") optiontext=x[i].childNodes[j].firstChild.nodeValue;
					}
				}
				var newoption = document.createElement("option");
				newoption.text = optiontext;
				newoption.value = optionvalue;
				ts.options.add(newoption);
			}
		}
		
		function HandleMedium1SelectChange()
		{
			var Medium1Select = document.getElementById("medium1id"); 
			var ts = document.getElementById("medium2id"); 
			while (ts.options.length > 0) {
		        ts.remove(0);
		    }
			var newoption = document.createElement("option");
			newoption.text = "";
			newoption.value = "0";
			ts.options.add(newoption);

			if(Medium1Select.value>0)
			{
				importXML('/xml/optionfeeds/mediums.php?m='+Medium1Select.value, 'LoadMedium2Select', 1);
			}
		}

		function LoadMedium3Select(xmlDoc)
		{
			var ts = document.getElementById("medium3id");
			var x = xmlDoc.getElementsByTagName('option');
			for (i=0;i<x.length;i++)
			{
				var optionvalue = ""
				var optiontext = ""
				
				for (j=0;j<x[i].childNodes.length;j++)
				{
					if (x[i].childNodes[j].nodeType == 1)
					{
						if(x[i].childNodes[j].nodeName=="value") optionvalue=x[i].childNodes[j].firstChild.nodeValue;
						if(x[i].childNodes[j].nodeName=="text") optiontext=x[i].childNodes[j].firstChild.nodeValue;
					}
				}
				var newoption = document.createElement("option");
				newoption.text = optiontext;
				newoption.value = optionvalue;
				ts.options.add(newoption);
			}
		}
		
		function HandleMedium2SelectChange()
		{
			var Medium2Select = document.getElementById("medium2id"); 
			var ts = document.getElementById("medium3id"); 

			while (ts.options.length > 0) {
		        ts.remove(0);
		    }

			var newoption = document.createElement("option");
			newoption.text = "";
			newoption.value = "0";
			ts.options.add(newoption);

			if(Medium2Select.value>0)
			{
				importXML('/xml/optionfeeds/mediums.php?m='+Medium2Select.value, 'LoadMedium3Select', 1);
			}
		}
