rem: returnElement.selectedIndex = i; 
add: callback = new Function('document.getElementById("' + id + '").selectedIndex = ' + i + ';'); 
context: function bsw_getValueElement(paramName, blockPref, block) {    var prefValue = blockPref.parameters[paramName];    var useDefault = (prefValue == null);    var defaultValue = block.parameters[paramName]['defaultValue'];    var elementType = block.parameters[paramName]['type'];    var returnElement;    if (elementType == 'boolean') {	returnElement = document.createElement("input");	returnElement.type = 'checkbox';	if (prefValue == 'true') {	    returnElement.checked = 'checked';	}	returnElement.onchange = function() { bsw_updatePrefValue(block.key, elementType, this); };    } else if (elementType == 'choice') {	returnElement = document.createElement("select");	var option;	i = 0;	for (var choice in block.parameters[paramName]['extra']) {	    option = document.createElement("option");	    option.appendChild(document.createTextNode(choice));	    option.value = choice;	    option.innerHTML = block.parameters[paramName]['extra'][choice];	    returnElement.appendChild(option);	    if (choice == prefValue) {		returnElement.selectedIndex = i;	    }	    i++;	}	returnElement.onchange = function() { bsw_updatePrefValue(block.key, elementType, this); };    }    returnElement.id = "prefValue_" + paramName;    returnElement.blockPref = blockPref;    return returnElement;}
meta: 3727	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3727/9d0f83bc83ce8cf4bb068548c4841c06ce5b7c10/BlockSelectWidget.js/clean/gallery2/lib/javascript/BlockSelectWidget.js