
function addOptionsFromArray(selectBoxElement,optionValuesArray,labelFieldName,valueFieldName)
{for(var i=0;i<optionValuesArray.length;++i)
{var newOption=document.createElement("option");newOption.value=optionValuesArray[i][valueFieldName];newOption.text=optionValuesArray[i][labelFieldName];try
{selectBoxElement.add(newOption,selectBoxElement.options[null]);}catch(e)
{selectBoxElement.add(newOption,null);}}
if(selectBoxElement.options.length>0)
{selectBoxElement.selectedIndex=0;}}
function getUrlParameter(name)
{name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(window.location.href);if(results==null)
return"";else
return results[1];}
function selectOptionIfAvailable(selectBoxElement,optionValue)
{if(optionValue&&optionValue!=""&&selectBoxElement&&selectBoxElement.options&&selectBoxElement.options.length>0)
{for(var i=0;i<selectBoxElement.options.length;++i)
{if(selectBoxElement.options[i]&&selectBoxElement.options[i].value==optionValue)
{selectBoxElement.selectedIndex=i;break;}}}}
function addOptionsFromArrayLegacy(selectBoxElement,optionValuesArray,labelFieldName,valueFieldName)
{for(var i=0;i<optionValuesArray.length;++i)
{var newOption=new Option();newOption.value=optionValuesArray[i][valueFieldName];newOption.text=optionValuesArray[i][labelFieldName];try
{selectBoxElement.add(newOption,selectBoxElement.options[null]);}catch(e)
{selectBoxElement.add(newOption,null);}}
if(selectBoxElement.options.length>0)
{selectBoxElement.selectedIndex=0;}}
