| Lines 783-812
          for (i=1;i<=2;i++) {
      
      
        Link Here | 
        
          | 783 |  | 783 |  | 
        
          | 784 | //USED BY NEWORDEREMPTY.PL | 784 | //USED BY NEWORDEREMPTY.PL | 
        
          | 785 | function totalExceedsBudget(budgetId, total) { | 785 | function totalExceedsBudget(budgetId, total) { | 
          
            
              | 786 |  | 786 |     budgetTotal = 0; | 
            
              | 787 |     var xmlhttp = null; | 787 |     $.ajax({ | 
            
              | 788 |     xmlhttp = new XMLHttpRequest(); | 788 |         url: "../acqui/check_budget_total.pl", | 
            
              | 789 |     if ( typeof xmlhttp.overrideMimeType != 'undefined') { | 789 |         async:false, | 
            
              | 790 |         xmlhttp.overrideMimeType('text/xml'); | 790 |         method: "post", | 
            
              | 791 |     } | 791 |         data: {budget_id : budgetId, total : total}, | 
            
              | 792 |  | 792 |         success: function(actTotal) { | 
            
              | 793 |     var url = '../acqui/check_budget_total.pl?budget_id=' + budgetId + "&total=" + total; | 793 |             actTotal = Math.abs(actTotal); | 
            
              | 794 |     xmlhttp.open('GET', url, false); | 794 |             exceeds = (actTotal < Math.abs(total)); | 
            
              | 795 |     xmlhttp.send(null); | 795 |             if (exceeds) | 
            
              | 796 |  | 796 |                 budgetTotal = actTotal; | 
            
              | 797 |     xmlhttp.onreadystatechange = function() { | 797 |          } | 
            
              | 798 |         if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { | 798 |     }); | 
            
              | 799 |  | 799 |     return budgetTotal; | 
            
              | 800 |             actTotal = eval ( xmlhttp.responseText ); |  |  | 
            
              | 801 |  | 
            
              | 802 |             if (  Math.abs(actTotal) < Math.abs(total)  ) { | 
            
              | 803 |             // if budget is to low :( | 
            
              | 804 |                 return true ; | 
            
              | 805 |             } else { | 
            
              | 806 |                 return false; | 
            
              | 807 |             } | 
            
              | 808 |         } | 
            
              | 809 |     } | 
        
          | 810 | } | 800 | } | 
        
          | 811 |  | 801 |  | 
        
          | 812 |  | 802 |  |