<%@ Page language="c#" Codebehind="TreeDropDownList.aspx.cs" AutoEventWireup="false" Inherits="TowDropDownList.TowDropDownList" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>TreeDropDownList</title>
		<meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<script language="javascript">

		var Wantcount;
		var Groupcount;

		Groupcount=0;

		Group = new Array();
		<asp:Literal id="Want" runat="server"></asp:Literal>

		function changelocation1(locationid)
		{
			document.submit.DirectionList1.length = 0;
			document.submit.WantList1.length = 0;
			var locationid=locationid;
			var i;
			var flag;
			var j;
			for (i=0;i<Groupcount; i++)
			{
				if (Group[i][0] == locationid)
				{
					flag = true;
					for (j =0;j<document.submit.DirectionList1.length;j++)
						if (document.submit.DirectionList1[j].value == Group[i][1])
							{
								flag = false;
								break;
							}
					if (flag)
						document.submit.DirectionList1.options[document.submit.DirectionList1.length]
						= new Option(Group[i][1], Group[i][1]);
				}
			}
		}


		function changelocation11(locationid, direction)
		{
			document.submit.WantList1.length = 0;
			var locationid=locationid;
			var i;
			var flag;
			var j;
			for (i=0;i<Groupcount;i++)
			{
				if (Group[i][0] == locationid && Group[i][1] == direction)
				{
		    
					flag = true;
					for (j=0;j<document.submit.WantList1.length;j++)
						if (document.submit.WantList1[j].value == Group[i][2])
						{
							flag = false;
							break;
						}
					if (flag)
						document.submit.WantList1.options[document.submit.WantList1.length]
						= new Option(Group[i][2], Group[i][2]);
				}
			}
		}

		</script>
	</HEAD>
	<BODY ms_positioning="GridLayout">
		<form id="submit" method="post" runat="server">
			<TABLE style="Z-INDEX: 101; LEFT: 184px; POSITION: absolute; TOP: 144px">
				<TR>
					<TD style="WIDTH: 115px; HEIGHT: 17px" align="middle">ÇóÖ°ÒâÏò£º</TD>
					<TD style="HEIGHT: 17px"><asp:dropdownlist id="SourceList1" runat="server" DataTextField="v_source" DataValueField="v_source" onchange="changelocation1(document.submit.SourceList1.options[document.submit.SourceList1.selectedIndex].value);changelocation11(document.submit.SourceList1.options[document.submit.SourceList1.selectedIndex].value,document.submit.DirectionList1.options[document.submit.DirectionList1.selectedIndex].value)" Width="100px"></asp:dropdownlist><asp:dropdownlist id="DirectionList1" runat="server" DataValueField="v_GroupName" onchange="changelocation11(document.submit.SourceList1.options[document.submit.SourceList1.selectedIndex].value,document.submit.DirectionList1.options[document.submit.DirectionList1.selectedIndex].value)" Width="100px"></asp:dropdownlist><asp:dropdownlist id="WantList1" runat="server" DataValueField="v_title" Width="100px"></asp:dropdownlist></TD>
				</TR>
			</TABLE>
		</form>
		<script language="javascript">
			changelocation1(document.submit.SourceList1.options[document.submit.SourceList1.selectedIndex].value);
			changelocation11(document.submit.SourceList1.options[document.submit.SourceList1.selectedIndex].value,document.submit.DirectionList1.options[document.submit.DirectionList1.selectedIndex].value)
		</script>
	</BODY>
</HTML>
