function populateList(listobj,indx,strKeys,strNames){
  //alert(strKeys + '////' + strNames);  
  arrSubCatAllKeys = createArrayFromString('@',strKeys);
  
  arrSubCatAllNames = createArrayFromString('@',strNames);
  arrSubCatSelectedKeys = createArrayFromString(';',arrSubCatAllKeys[indx]);  
  arrSubCatSelectedNames = createArrayFromString(';',arrSubCatAllNames[indx]);
  
	resetListBox(listobj);
	for (j=0; j<arrSubCatSelectedKeys.length-1; j++) {
			//alert(arrSubCatSelectedKeys[j] + '-' + arrSubCatSelectedNames[j]);
			addListElement(listobj,arrSubCatSelectedKeys[j],arrSubCatSelectedNames[j]);
		} 	
	
}

function getSelectedIndex(listobj){
		
	for (i=0; i<listobj.options.length; i++) {
		if (listobj.options[i].selected) {
			return i;
		}
	}
}

function createArrayFromString(separator,arrString){
	
	stringObj = new String(arrString);
	
	return stringObj.split(separator);
}

function addListElement(listobj,value,text){

	var oOption = document.createElement("OPTION");	
	oOption.text= text;
	oOption.value= value;
	listobj.add(oOption);
}

function resetListBox(listobj){

	// Delete them from original
	for (var i=(listobj.options.length-1); i>=0; i--) {
			var o = listobj.options[i];		
			listobj.options[i] = null;		
	}
}
