      function fix_days(w) {
        var url = 'ajax_days.php';

        var day_select = document.getElementById(w.concat('_day'));

        var month = document.getElementById(w.concat('_month')).value;
        var year = document.getElementById(w.concat('_year')).value;
        var day = document.getElementById(w.concat('_day')).value;

        if(window.XMLHttpRequest) {        
          req = new XMLHttpRequest();
        } else if(window.ActiveXObject) {
          try {
            req = new ActiveXObject('Microsoft.XMLHTTP');
          } catch(e) {
            req = new ActiveXObject('Msxml2.XMLHTTP');
          }
        } else {
          alert('Your broswer does not support XMLHttpRequest!');
          return false;
        }
        
        url = url.concat('?month=',month,'&year=',year,'&day=',day);

        if(req) {        
          req.onreadystatechange = function () { day_change(req,w) };
          req.open('GET',url,true);
          req.send(null);
        }
        
        if(day_select.length > day) {
          day_select.selectedIndex = day-1;
        }
      }
      
      function day_change(req,w) {
        if(req.readyState==4) {
          if(req.status==200) {
          
            day_select = document.getElementById(w.concat('_day'));
            cur_selected = day_select.selectedIndex;
            
            if(!window.ActiveXObject) {
              document.getElementById(w.concat('_day')).innerHTML=req.responseText;
            } else {
              // lame IE hack, http://support.microsoft.com/kb/276228
              document.getElementById(w.concat('_daydiv')).innerHTML='<select name="rent_'.concat(w,'[day]" id="',w,'_day">',req.responseText,'</select>');
            }
            
            if(cur_selected >= day_select.length) {
              day_select.selectedIndex = day_select.length-1;
            }
          }
        }
      }
