               

function order_search() {
    set_ajaxloading('ordersearchbox');        
  
    submitform('searchorderform', 'service', {
        data: {           
           'update_orderslist': 1
        },                
        postComplete: function(json) {
            if (json.status=='ok') {                
                $('orderslistbox').set('html', json.update_orderslist);                                
            }                        
            set_ajaxloading('ordersearchbox', false);            
        }
    });
}

function order_resend(orderid) {
    set_ajaxloading('orderslistbox');        
  
    query('service', 'request', {
        data: {           
           'set_resendkey': orderid           
        },                
        postComplete: function(json) {
            if (json.status=='ok') {                
                if (json.set_resendkey == 'ok') {
                  show_info('The key was resent to the e-mail address you used during the purchase.');
                } else {
                  show_info('Unable to send a key to the e-mail address you used during the purchase.', SI_ERROR);
                }
            }
            set_ajaxloading('orderslistbox', false);            
        }
    });
}


function get_wordform(number, form1, form2, form3) {
      lastnum = number%100;
      if (lastnum>4 && lastnum<21) {
        return form3?form3:form2;
      } else {
        lastnum = number%10;
        if (lastnum == 1) return form1;
        if (lastnum>1 && lastnum<5)  return form2;
        return form3;
      }
   } 


