function addKey(listObj, itemObj, isList, limit) {
	var counter = listObj.length;
	var text = "";
	if (isList) {
		//alert("Using list format...");
		if (itemObj.selectedIndex > -1) {
			text = itemObj.options[itemObj.selectedIndex].text;
		} else {
			alert("No item selected!");
			return false;
		}
	} else {
		//alert("Using text format...");
		text = itemObj.value;
	}
	if (text > " ") {
		if (listObj.length < limit) {
			//keyname = "keyword" + document.forms[0].keywords.length;
			//alert(keyname);
			keyword = new Option(text, text, false, false);
			listObj.options[listObj.length] = keyword;
			itemObj.value = "";
			itemObj.focus();
		} else {
			alert(limit + "-item limit!");
		}
	} else {
		alert("Cannot enter blank items!");
	}
}

function subKey(listObj) {
	var counter = listObj.length;
	if (listObj.selectedIndex > -1) {
		if (counter > 0) {
			listObj.options[listObj.selectedIndex] = null;
		} else {
			alert("Cannot have less than 0 items!");
		}
	} else {
		alert("No item selected!");
	}
}

function selectKeys(listObj) {
	i = 0;
	for (i = 0; i < listObj.length; i++) {
		listObj.options[i].selected = true;
	}
	//return true;
}

function isEmpty(listObj) {
	i = 0, found = false;
	for (i = 0; i < listObj.length; i++) {
		if (listObj.options[i] != null && listObj.options[i].text > " ") {
			found = true;
			break;
		}
	}
	return !found;
}