var ios=0;var aos=0;function insertSelect(theSel,newText,newValue)
{if(theSel.length==0){var newOpt1=new Option(newText,newValue);theSel.options[0]=newOpt1;theSel.selectedIndex=0;}else if(theSel.selectedIndex!=-1){var selText=new Array();var selValues=new Array();var selIsSel=new Array();var newCount=-1;var newSelected=-1;var i;for(i=0;i<theSel.length;i++)
{newCount++;if(newCount==theSel.selectedIndex){selText[newCount]=newText;selValues[newCount]=newValue;selIsSel[newCount]=false;newCount++;newSelected=newCount;}
selText[newCount]=theSel.options[i].text;selValues[newCount]=theSel.options[i].value;selIsSel[newCount]=theSel.options[i].selected;}
for(i=0;i<=newCount;i++)
{var newOpt=new Option(selText[i],selValues[i]);theSel.options[i]=newOpt;}}}
function TrasformaSelect(ulId,firstoption){if(document.getElementById(ulId)){var ul=document.getElementById(ulId);var parent=ul.parentNode;ul.style.display="none";var theSel=document.createElement("SELECT");theSel.id="select_"+ulId;theSel.onchange=function(){if(this.value!="")window.location.href=this.value;}
for(var i=(ul.getElementsByTagName("LI").length-1);i>=0;i--){var a=ul.getElementsByTagName("LI")[i].getElementsByTagName("A")[0];var text=a.innerHTML;var value=a.href;insertSelect(theSel,"--> "+text,value);}
if(firstoption!="")insertSelect(theSel,firstoption,"");parent.appendChild(theSel);}}