$(document).ready(function() {
  $('form#offer :input').blur(function() {
        if ($(this).is('.required')) {
          if (this.value == '') {
              $(this).addClass('highlight');
            } else {
              $(this).removeClass('highlight');
            };
          };
      });
});
function checkform() {
  ready = true;
  $('form :input').each( function() {
    if ($(this).is('.required')) {
      if (this.value == '') {
          $(this).addClass('highlight');
          $('form').focus();
          ready = false;
        };
      };
  });
  return ready;
} 
function calc_amount(price,num) {
  new_price = price * (num - old_num);
  amount = eval($('#amount').text()) + new_price;
  $('#amount').text(amount);
  old_num=num;
  if (amount == 0) {$('#submit_btn').attr({'disabled' : 'disable'});} else {$('#submit_btn').attr({'disabled' : ''});};
}
function unfold(num) {
  $('li.'+num).each(function() {
        $(this).slideToggle();
      });
}

  