function PopulateDepCat(objIntListBox,intPreviousID,intIntValue,StrFirstValue)
{
	clearDynaList(objIntListBox);
	var intSelectedValue	= 0;
	if (StrFirstValue != "") 
		objIntListBox.options[objIntListBox.length] = new Option(StrFirstValue,0);

	if ((intPreviousID > 0) || (objIntListBox.name == "cboInt"))
	{
		var intCount	= 1;
		for (var i = 0; i < aDepCatList.length; i++)
		{
			StrDepCatValue	= aDepCatList[i];
			aDepCatValue	= StrDepCatValue.split("|");

			if (aDepCatValue[2] == intPreviousID)
			{
				objIntListBox.options[objIntListBox.length] = new Option(aDepCatValue[1],aDepCatValue[0]);
				if (intIntValue != "")
				{
					if (aDepCatValue[0] == intIntValue)
					{
						intSelectedValue	= intCount;
					}
				}
				intCount++;
			}
		}
	}
	objIntListBox.selectedIndex	= intSelectedValue;
}

function clearDynaList(oList){
	for (var i = oList.options.length; i >= 0; i--){
		oList.options[i] = null;
	}
	oList.selectedIndex = -1;
}
 
function populateDynaList(oList, nIndex, aArray,strFrom,sDispTxt){

	if (strFrom == "All Users")
	{
		//if (sDispTxt != "")
			oList.options[oList.options.length] = new Option(sDispTxt,"ALL");
	}
	else{
		if (strFrom == "All Working Knowledge"){
			oList.options[oList.options.length] = new Option(sDispTxt,"ALLWOR");	
		}
		else
		{
			oList.options[oList.options.length] = new Option(sDispTxt,0);
		}
	}
	
	
	if (strFrom == "All Users")
	{
		for (var i = 0; i < aArray.length; i= i + 3)
		{
			if ((aArray[i] == nIndex) || (nIndex == "ALL"))
			{
				oList.options[oList.options.length] = new Option(aArray[i + 1], aArray[i + 2]);
			}
		}
	}
	else if (strFrom == "All Working Knowledge")
	{
		for (var i = 0; i < aArray.length; i= i + 3){
			if ((aArray[i] == nIndex) || (nIndex == "ALL"))
			{
				oList.options[oList.options.length] = new Option(aArray[i + 1], aArray[i + 2]);
			}
		}
	}
	else
	{
		for (var i = 0; i < aArray.length; i= i + 3){
			if (aArray[i] == nIndex)
			{
				oList.options[oList.options.length] = new Option(aArray[i + 1], aArray[i + 2]);
			}
		}
	}
	oList.selectedIndex = 0;
}

function populateStatus(oList, aArray1,aArray2,strFrom,strValue){
	//oList.options[oList.options.length] = new Option(strFrom,strValue);
	for (var i = 0; i < aArray1.length; i= i + 1){
		oList.options[oList.options.length] = new Option(aArray2[i],aArray1[i]);
	}
	oList.selectedIndex = 0;
}
