function genGetListboxCtrlBySmartLookUp(c){var a=c.name;var b=a.substring(3,a.length);var d=document.getElementById(b);return d}function genGetHiddenCountCtrlBySmartLookUp(d){var b=d.name;var c="count"+b;var a=document.getElementById(c);return a}function genRecalcListBySmartLookUpByNextCount(d){var e=TEMPmbsgenGetElementByName(d);if(e==null){return}var c=document.getElementById("countslu"+d);if(c==null){return}var b=document.getElementById("slu"+d);if(b==null){return}var a=parseInt(c.value);a++;if(!genFilterListbox(e,b.value,a)){a=0}c.value=a}function genRecalcListBySmartLookUp(b,a){var c=genGetListboxCtrlBySmartLookUp(b);if(c==null){return}genFilterListbox(c,b.value,a)}function genFilterListbox(l,a,h){var j=0;var g=99999;var m=false;for(var f=0;f<l.length;f++){var k=l.options[f].text;k=k.toLowerCase();a=a.toLowerCase();var d=false;if(a.indexOf("+")!=-1){var e=a.split("+");var o=true;for(var c=0;c<e.length;c++){var b=e[c];if(k.indexOf(b)==-1){o=false;break}}d=o}else{if(k.indexOf(a)!=-1){d=true}}if(d){if(j==h){m=true;l.options[f].selected=true;break}if(j==0){g=f}j++}else{l.options[f].selected=false}}if(!m&&g!=99999){l.options[g].selected=true;return false}return true};
