	var ListLinkManager = new Object();
	ListLinkManager["empty"] = new Array("-1", "None");
		
	function ListLink_Init() {
		for( var i = 0; i < ListLinks.length; i++ ) {
			var listRelation = ListLinks[i].split(";");
			if ( listRelation.length != 2 ) { return; }
			var parentControl = ListLink_FindList( listRelation[0] );
			var childControl = ListLink_FindList( listRelation[1] );
			if ( parentControl != null ) {
				ListLink_Load( parentControl, childControl );
			}
		}
	}
	function ListLink_SetDefaults() {
		for( var i = 0; i < ListLinks.length; i++ ) {
			var listRelation = ListLinks[i].split(";");
			if ( listRelation.length != 2 ) { return; }
			var parentControl = ListLink_FindList( listRelation[0] );
			if ( parentControl != null ) {
				parentControl.RepopulateChild();
			}
		}
	}
	function ListLink_FindList( name ) {
		for( var i = 0; i < document.forms.length; i++ ) {
			var theForm = document.forms[i];
			var theList = theForm[name];
			if ( theList != null ) {
				return theList;
			}
		}
		return null;
	}
	function ListLink_Load( parent, child ) {
		parent.ChildList = child;
		parent.RepopulateChild = ListLink_RepopulateChild;
		parent.GetParentValueKey = ListLink_GetParentValueKey;
		parent.onchange = function(e) { this.RepopulateChild(); };
	}
	function ListLink_RepopulateChild() {
		ListLink_ClearList(this.ChildList);
		ListLink_FillList(this.ChildList, this.GetParentValueKey());
	}
	function ListLink_ClearList(list){
		if ( typeof(list.ChildList) != "undefined" ) {
			ListLink_ClearList( list.ChildList );
		}
		if ( list.selectedIndex >= 0 ) {
			list.originalSelectedValue = list.options[list.selectedIndex].value;
		} else {
			list.originalSelectedValue = "";
		}
		var lastIndex = list.options.length - 1;
		for (var i = lastIndex; i >= 0; i--){
			list.options[i] = null;
		}
		list.selectedIndex = -1;
	}
	function ListLink_GetParentValueKey() {
		if ( this.selectedIndex != -1 ) {
			return this.name + "=" + this.options[this.selectedIndex].value;
		} else {
			return "";
		}
	}
	function ListLink_FillList(list, parentValue){
		var doAddEmpty = true;
		if (parentValue != "" && ListLinkManager[parentValue]){
			var newChildItems = ListLinkManager[parentValue];
			if ( newChildItems.length > 0 ) {
				for (var i = 0; i < newChildItems.length; i = i + 2){
					list.options[list.options.length] = new Option(newChildItems[i + 1], newChildItems[i]);
					if ( list.options[list.options.length-1].value == list.originalSelectedValue ) {
						list.options[list.options.length-1].selected = true;
					}
				}
				var doAddEmpty = false;
			}
		}
		if ( doAddEmpty ) {
			var emptyItem = ListLinkManager["empty"];
			list.options[0] = new Option(emptyItem[1], emptyItem[0]);
		}
		if ( typeof( list.ChildList ) != "undefined" ) {
			ListLink_FillList(list.ChildList, list.GetParentValueKey());
		}
	}
