function getSelectedText(ctrl) {
	if(ctrl == null) {
		return null;
	}
	
	var selectedIndex = ctrl.options.selectedIndex;
	return ctrl.options[selectedIndex].text;
}

function getSelectedValue(ctrl) {
	if(ctrl == null) {
		return null;
	}
	
	var selectedIndex = ctrl.options.selectedIndex;
	return ctrl.options[selectedIndex].value;
}
function setSelected(ctrl,index){
	if (ctrl==null){
		return null;
	}
	ctrl.options.selectedIndex=index;
}
function addSelect(ctrl, value, text) {
	if (ctrl==null){
		return null;
	}
		var option = new Option();
		option.value = value;
		option.text = text;
		ctrl.options[ctrl.length] = option;
}

function resetSelect(ctrl) {
		ctrl.length=0;
}