function ajaxFunction(){var b;try{b=new XMLHttpRequest()}catch(c){try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(c){try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(c){alert("Your browser broke!");return false}}}return b}function getFormNum(b){formNum=-1;for(i=0;i<document.forms.length;i++){tempForm=document.forms[i].name;if(b==tempForm){formNum=i;correctForm=tempForm;break}}return formNum}function O(b,c){a[k]=new Option(b,c);k++}function getDataForSelect(ajaxRequest,file,formName,fieldWithValue,fieldToChange){if(ajaxRequest){ajaxRequest.onreadystatechange=function(){if(ajaxRequest.readyState==4){response=ajaxRequest.responseText;responseArray=response.split("|");k=1;a=new Array();for(var i=0;i<responseArray.length-1;i++){var1=responseArray[i];i++;var2=responseArray[i];O(var1,var2)}aln2=a.length;formNum=getFormNum(formName);if(formNum>=0){document.forms[formNum].elements[fieldToChange].options.length=0;with(document.forms[formNum].elements[fieldToChange]){for(var i=options.length-1;i>0;i--){options[i]=null}for(var i=1;i<aln2;i++){options[i]=a[i]}options[0].selected=true}}}};if(typeof formNum=="undefined"){getFormNum(formName)}value=document.forms[formNum].elements[fieldWithValue].value;ajaxRequest.open("GET",file+"/"+value,true);ajaxRequest.send(null)}};
