// JavaScript Document
(function (a) {
   a.extend(a.fx.step, {
      backgroundPosition: function (d) {
         if (d.state === 0 && typeof d.end == "string") {
            var f = a.curCSS(d.elem, "backgroundPosition");
            f = c(f);
            d.start = [f[0], f[2]];
            var b = c(d.end);
            d.end = [b[0], b[2]];
            d.unit = [b[1], b[3]]
         }
         var e = [];
         e[0] = ((d.end[0] - d.start[0]) * d.pos) + d.start[0] + d.unit[0];
         e[1] = ((d.end[1] - d.start[1]) * d.pos) + d.start[1] + d.unit[1];
         d.elem.style.backgroundPosition = e[0] + " " + e[1];

         function c(h) {
            h = h.replace(/left|top/g, "0px");
            h = h.replace(/right|bottom/g, "100%");
            h = h.replace(/([0-9\.]+)(\s|\)|$)/g, "$1px$2");
            var g = h.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);
            return [parseFloat(g[1], 10), g[2], parseFloat(g[3], 10), g[4]]
         }
      }
   })
})(jQuery);
jQuery(function () {
   jQuery("ul#nav li a").css({
      backgroundPosition: "0 0"
   }).mouseover(function () {
      jQuery(this).stop().animate({
         backgroundPosition: "(0 -48px)"
      }, {
         duration: 300
      })
   }).mouseout(function () {
      jQuery(this).stop().animate({
         backgroundPosition: "(0 0)"
      }, {
         duration: 200,
         complete: function () {
            jQuery(this).css({
               backgroundPosition: "0 0"
            })
         }
      })
   });
   jQuery("body#foodselect a#food").css({
      backgroundPosition: "0 -48px"
   }).mouseover(function () {
      jQuery(this).stop().animate({
         backgroundPosition: "(0 -48px)"
      }, {
         duration: 300
      })
   }).mouseout(function () {
      jQuery(this).stop().animate({
         backgroundPosition: "(0 -48px)"
      }, {
         duration: 200,
         complete: function () {
            jQuery(this).css({
               backgroundPosition: "0 -48px"
            })
         }
      })
   });
   jQuery("ul#nav li a.selected").css({
      backgroundPosition: "0 -48px"
   }).mouseover(function () {
      jQuery(this).stop().animate({
         backgroundPosition: "(0 -48px)"
      }, {
         duration: 300
      })
   }).mouseout(function () {
      jQuery(this).stop().animate({
         backgroundPosition: "(0 -48px)"
      }, {
         duration: 200,
         complete: function () {
            jQuery(this).css({
               backgroundPosition: "0 -48px"
            })
         }
      })
   });
   jQuery("ul#nav li a.static").css({
      backgroundPosition: "0 -48px"
   }).mouseover(function () {
      jQuery(this).stop().animate({
         backgroundPosition: "(0 -48px)"
      }, {
         duration: 0
      })
   }).mouseout(function () {
      jQuery(this).stop().animate({
         backgroundPosition: "(0 -48px)"
      }, {
         duration: 0,
         complete: function () {
            jQuery(this).css({
               backgroundPosition: "0 -48px"
            })
         }
      })
   })
});
(function (a) {
   jQuery.fn.clearField = function (b) {
      b = jQuery.extend({
         blurClass: "clearFieldBlurred",
         activeClass: "clearFieldActive"
      }, b);
      jQuery(this).each(function () {
         var c = jQuery(this);
         if (c.attr("rel") == undefined) {
            c.attr("rel", c.val()).addClass(b.blurClass)
         }
         c.focus(function () {
            if (c.val() == c.attr("rel")) {
               c.val("").removeClass(b.blurClass).addClass(b.activeClass)
            }
         });
         c.blur(function () {
            if (c.val() == "") {
               c.val(c.attr("rel")).removeClass(b.activeClass).addClass(b.blurClass)
            }
         })
      });
      return jQuery
   }
})(jQuery);
