function setChild(d,a,b,c){d=a.options[a.selectedIndex].value;b=document.getElementsByName(b)[0];for(a=b.length-1;0<=a;a--)b.options[a]=null;a=document.getElementsByName(c)[0];c=a.length;var e=a.options;for(a=0;a<c;a++){var f=e[a].value;var g=e[a].text;if(0==f.indexOf(d)){var h=b.length;b.options[h]=new Option(g,f)}}};
