var ajax = new Array();

function getcompanytype(inp_val,ratetype){
    var rateterm = inp_val;
   document.getElementById('company_type').options.length = 0;   // Empty city select box
   var index = ajax.length;
   ajax[index] = new sack();

   ajax[index].requestFile = home_url+'get_company_type.php?rate_type='+ratetype+'&rate_term='+rateterm;   // Specifying which file to get
   //alert(ajax[index].requestFile);
   ajax[index].onCompletion = function(){ createcompanytype(index) };   // Specify function that will be executed after file has been found
   ajax[index].runAJAX();      // Execute AJAX function
}

function createcompanytype(index)
{
   var obj = document.getElementById('company_type');
   eval(ajax[index].response);   // Executing the response from Ajax as Javascript code
}


