if(typeof QFAMS==="undefined"||!QFAMS){var QFAMS={}}QFAMS.env=QFAMS.env||{persistantSelection:false,persistantMove:true};QFAMS.updateCounter=function(c,v){var i;var nodeText=null;if(c!==null){if(c.childNodes){for(i=0;i0&&target.options[0].value===""){target.removeAttribute("disabled");target.options[0]=null}for(i=(maxFrom-1);i>=0;i--){if(action==='all'||action==='none'||action==='toggle'||source.options[i].selected===true){if(source.options[i].disabled===false){if(isIE){option=source.options[i].removeNode(true);option.selected=QFAMS.env.persistantSelection;target.appendChild(option)}else{option=source.options[i].cloneNode(true);option.selected=QFAMS.env.persistantSelection;target.options[target.options.length]=option}}}}if(!isIE){for(i=(maxFrom-1);i>=0;i--){if(action==='all'||action==='none'||action==='toggle'||source.options[i].selected===true){if(source.options[i].disabled===false){source.options[i]=null}}}}if(action==='toggle'){for(i=(maxTo-1);i>=0;i--){if(target.options[i].disabled===false){if(isIE){option=target.options[i].removeNode(true);option.selected=QFAMS.env.persistantSelection;source.appendChild(option)}else{option=target.options[i].cloneNode(true);option.selected=QFAMS.env.persistantSelection;source.options[source.options.length]=option}}}if(!isIE){for(i=(maxTo-1);i>=0;i--){if(target.options[i].disabled===false){target.options[i]=null}}}}c=document.getElementById(qfamsName+'_unselected');s=document.getElementById(qfamsName+'-f');QFAMS.updateCounter(c,s.length);c=document.getElementById(qfamsName+'_selected');s=document.getElementById(qfamsName+'-t');QFAMS.updateCounter(c,s.length);if(arrange!=='none'){QFAMS.sortList(target,QFAMS.compareText,arrange)}QFAMS.updateHidden(selectHidden,selectRight)};QFAMS.sortList=function(list,compareFunction,arrange){var i;var options=new Array(list.options.length);for(i=0;i0){QFAMS.moveSwap(l,indice,indice-1);QFAMS.updateHidden(h,l)}};QFAMS.moveDown=function(l,h){var indice=l.selectedIndex;if(indice<0){return}if(indice0){QFAMS.moveSwap(l,indice,indice-1);QFAMS.updateHidden(h,l);indice--}};QFAMS.moveBottom=function(l,h){var indice=l.selectedIndex;if(indice<0){return}while(indicej){l.insertBefore(node,l.options[j].nextSibling)}else{l.insertBefore(node,l.options[i])}if(QFAMS.env.persistantMove){l.selectedIndex=j}else{l.selectedIndex=-1}};QFAMS.init=function(elm){var e,i;for(e=0;e