


			
			function addListItem(dlID,lstID,hidID){
				var dl = document.getElementById(dlID);
				var lst = document.getElementById(lstID);
				if(lst != null){
					var val = dl.options[dl.selectedIndex].value;
					var txt = dl.options[dl.selectedIndex].text;
					var optionObject = new Option(txt,val) 

					var i = lst.options.length;
					

					lst.options[i] = optionObject;
					
				}
				updateHiddenField(lstID,hidID);
				return false;
			}

			function removeListItem(lstID,hidID){
				
				var lst = document.getElementById(lstID);
				if(lst != null){
					if(lst.selectedIndex != -1){
						lst.options[lst.selectedIndex] = null;
						
					}else{
						alert("Select an item in the list.");
					
					}				

					

					
				}
				updateHiddenField(lstID,hidID);
				return false;
			}

			function updateHiddenField(lstID,hidID){
				var lst = document.getElementById(lstID);
				var hid = document.getElementById(hidID);
				hid.value = "";

				for(var i=0;i<lst.length;i++){
					
					hid.value += lst.options[i].value;
					if(i < lst.length - 1){
						hid.value += "^";
					}
					
				}
				
				

			
			}
			function fieldCompleted(fieldID,fieldName){
				
				var field = document.getElementById(fieldID);
				if(field.value == ""){
					alert(fieldName + " cannot be empty");
					return false;
				}else{
					return true;
				}

			}

			/*
			function chkFilterOnSourceClick(){
				var div = document.getElementById("divSource");
				var chk = document.getElementById("chkFilterOnSource");
				if(chk.checked){
					div.style.display = "none";

				}else{
					div.style.display = "block";
				}
			}
			*/

