/*
  Bugs for Bugs checkout JavaScript source
*/

(function() {
    
  var minOrderValue = 25;    
  var currentTotal = function() {
                        return parseInt($$('.subtotal .numeric')[0].innerHTML.substring(1), 10);
                      },
      orderingAvailable = function() {
                        return (currentTotal() > minOrderValue) ? 1 : 0;
                      };
  
  
  

  
  var confirmationButtons =   $$('.confirm');
  var respondToClick = function(e) {
    if (!confirm('Are you sure?')) {
      Event.stop(e);
    }
  };
  
  for (var i = confirmationButtons.length - 1; i >= 0; i--){
    $(confirmationButtons[i]).observe('click', respondToClick);
  }
  
  
  // navigation dropdown
  $$('#header > ul > li').each(function(n, i) {
    n.observe('mouseover', function(evt) {
      n.addClassName('over');
    });
    
    n.observe('mouseout', function  (evt) {
      n.removeClassName('over');
    })
    
  });
  
})();

