function addOptionsToSelectFromArrays(objSelect, arrValues, arrTexts, iStart, iEnd, strSelectedValue) {
	addOptionToSelect(objSelect, "-1", " - - - - Seleccione - - - - ");

	for (var i = iStart - 1; i < iEnd; i++) {
		addOptionToSelect(objSelect, arrValues[i], arrTexts[i]);
	}
	
	var iPosicion = -1;

	for (var j = 0; j <= (iEnd - iStart + 1); j++) {
		if (objSelect.options[j].value == strSelectedValue) {
			iPosicion = j;
		}
	}
	if (iPosicion != -1) {
		objSelect.options[iPosicion].selected = true;
	}
	objSelect.length = iEnd - iStart + 2; //Uno mas por el seleccione
}

function addOptionToSelect(objSelect, strValue, strText) {
	var objOption = null;
	objOption = document.createElement("option");
	objOption.value = strValue;
	objOption.text = strText;

	try {
		objSelect.add(objOption, null);
	} catch(ex) {
		objSelect.add(objOption); 
	}
}

function objSelectRemoveElements(objSelect){
	for (var i=objSelect.length - 1; i>=0; i--) {
		objSelect.remove(objSelect.options[i]);
	}
}