 function init() {
 if ($$('input["radio"]')) {
 $$('input["radio"]').each(function (el) {
    el.observe('click',function(evt) {
    var element = evt.element(); 
    var id = element.value;
    //console.log(element.value); 
  //  var jar = new CookieJar({expires:3600,path: '/' });
    //var inputdata = $H();
    //inputdata.set('rental-type', element.value);
//    jar.put('vacation-type',element.value);
   updateRentalCats(id);
    });
  });
 }
 if ($('rental-type') ) {
 $('rental-type').observe('change',updateCities);
 } 
 }
  function updateRentalCats(val) 
  {  
  var vacation_type = parseInt(val);
  var params = 'action=get-prop-types&vacation-type='+vacation_type;
  $('rental-type').update((lang == 'es' ? 'Actualizando...' : 'Updating...'));
  var myAjax = new Ajax.Request(url,{method:'post',parameters:params,onComplete:updatePropType});
  }

  
  function updatePropType(resp)
  {
  var pieces = resp.responseText.split(',');
  if (pieces[0].indexOf('success') != -1) {
  $('rental-type').update(pieces[1]);
  }
  }

  function updateCities(evt) 
  {
  var id = evt.element();  
  var params = 'action=get-cities&type='+id.value;
  $('city').update((lang == 'es' ? 'Actualizando...' : 'Updating...'));
  var myAjax = new Ajax.Request(url,{method:'post',parameters:params,onComplete:cities});
  }

  function cities(resp) 
  {
  var pieces = resp.responseText.split(',');
  if (pieces[0].indexOf('success') != -1) {
    $('city').update(pieces[1]);
  }
  }