var MAJ_SELECT_NoClear=1;function MajSelect(A,K,F,L,J,D){if(K.length==0){return }F=Nvn(F);var C=-1;var M;var E=document.getElementsByTagName("select");for(var I=E.length-1;I>=0;I--){if(E[I].name==A){M=E[I];break}}if((F&MAJ_SELECT_NoClear)==0){SelectRemoveAll(M)}var B=0;var N=K.length;for(var I=0;I<N;I++){var O=K[I];if(O[0]==J){C=B;if(D!=null&&O[0]==J){O[1]=D}}else{if(L!=null){if(typeof (L)=="object"){var G=0;for(var H=L.length-1;H>=0;H--){if(L[H]==null){continue}if(O[H+2]!=L[H]){G=1;break}}if(G){continue}}else{if(O[2]!=L){continue}}}}SelectAddItem(M,O[0],O[1]);B++}M.selectedIndex=C}function SelectAddItem(A,C,E,B){if(B==null){B=A.options.length}var D=document.createElement("OPTION");D.value=C;D.text=E;if(A.options.length>B){if(navigator.appName=="Microsoft Internet Explorer"){A.add(D,B)}else{A.insertBefore(D,A.options[B])}}else{A.options[A.options.length]=D}}function SelectRemoveItem(A,B){A.remove(B)}function SelectRemoveAll(A){for(var B=(A.options.length-1);B>=0;B--){A.remove(A.options[B].id)}}function SelectGetIndex(A,F,E){var B=-1;var C;for(C=0;C<A.options.length;C++){var D=A.options[C];if((F!=null&&D.value==F)||(F==null&&D.text==E)){B=C;break}}return(B)}function GetIdLienFromTSelect(C,A,D){if(D==null){D=1}D+=1;for(var B=C.length-1;B>=0;B--){if(C[B][0]==A){return(C[B][D])}}return(-1)}function InsertElementInTSelect(D,G,F,E,C,B){var H=D[0].length;if(B&1){for(var A=D.length-1;A>=0;A--){if(F.toUpperCase()>D[A][1].toUpperCase()||A==0){if(A==0&&F.toUpperCase()<D[A][1].toUpperCase()){A--}if(H==4){D.splice(A+1,0,[G,F,E,C])}else{if(H==3){D.splice(A+1,0,[G,F,E])}else{D.splice(A+1,0,[G,F])}}break}}}return(A+1)}function UpdateElementInTSelect(C,H,F,E,D,A){var I=0;if(A&16){I=3}if(A&32){I=4}var G=C[0].length;for(var B=C.length-1;B>=0;B--){if(H==C[B][0]){if(G==4){C.splice(B,1,[H,F,E,D])}else{if(G==3){C.splice(B,1,[H,F,E])}else{C.splice(B,1,[H,F])}}break}}if(A&1){C=Tbl2DTriByCol(C,1,0)}return(B)}function DeleteElementInTSelect(C,D,B){var E=C[0].length;for(var A=C.length-1;A>=0;A--){if(D==C[A][0]){C.splice(A,1);break}}};
