i have a code , is working with two drowdowns on sales and other currency
when i change sales i want it to change currency to what it corresponds
HTP.P('<td class="reqlabel1">Sales Center:</td>');
HTP.P('<td class="tablelabel">');
HTP.P(Get_Sc_Dd(PVNAME=>'pnSalesCenterID', PVORAID=> VUSERNAME, PVDEFVAL => NSALESCENTERID, PVEVENT=>'class="reqinput1" onChange="javascript:currencychange();" style="width:260px"'));
********************************
Code:
  CURRDEF := get_criteria_rec('PROCURR_DEF',dml_p_oracle_user.get_rec(VUSERNAME).global_region).include_list;
    
       
    HTP.P( '<script> 
 function makeRequest(){
            ajaxReq = (window.XMLHttpRequest)? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP")
         
            ajaxReq.open("GET","contr_entry_pkg.select_sales_center?&pnSalesCenterID="document.getElementById("pnSalesCenterID")+ "&pvCurrCd="document.getElementById("'||CURRDEF||'"),true);
            ajaxReq.onreadystatechange =currencychange; 
            document.getElementById("updateLabel").innerHTML = ""
            ajaxReq.send()         
        } 
        function currencychange(){

            if(ajaxReq.readyState == 4){
                if(ajaxReq.status == 200){
                 //var resultsJSON = eval(''('' + ajaxReq.responseText + '')'');
                    document.getElementById("updatelabel").innerHTML = ajaxReq.responseText               
                }
           
            }
        }');
     HTP.P( '</script>');         
       --
        HTP.P('<td class="reqlabel1">Currency:</td>');
        HTP.P('<td class="tablelabel">');

         HTP.P(Get_currencyCode_Dd(PVNAME=>'pvCurrCd', 
         PVDEFVAL =>NULL,    
         PVEVENT=>'class="reqinput1"onBlur="currencychange();" style="width:200px"'));
       HTP.P('</td>');
************
im not sure if im doing it right , since is my first time, but is not working.using firebug i get
currencychange is not defined, i do not know if ajaxReq.open is correct

the way it suppose to work if when i choose a sales center form pnsalescenterid, it should give me a
currency change, by default currency is null. any help will be appreciated