// Begin jQuery colorbutton plugin

// Color all buttons: jQuery(":submit").colorbutton();
// Color only "order" buttons: jQuery(".order").colorbutton();
// Custom CSS: jQuery(".order").colorButton({hoverCSS : { backgroundColor:"blue" }})
jQuery.fn.colorbutton = function(options) {

   var opts = jQuery.extend({}, jQuery.fn.colorbutton.defaults, options);

   jQuery(this)
      .each(function() {
         if (jQuery(this).hasClass("exclude")) { return; }

         jQuery(this)
            .css({cursor:"pointer"})
            .css({cursor:"hand"})
            .wrap('<table><tr><td class="colorButton"></td></tr></table>')
         ;
   });

   jQuery(".colorButton")
      .css(opts.unhoverCSS)
      .mouseover(function() { jQuery(this).css(opts.hoverCSS); })
      .mouseout(function() { jQuery(this).css(opts.unhoverCSS); })
   ;

   return this;
};

jQuery.fn.colorbutton.defaults = {
   hoverCSS : { backgroundColor:"green", padding:"5px" },
   unhoverCSS : { backgroundColor:"#cc0000", padding:"5px" }
};
// End colorbutton plugin

// Begin jQuery popbutton plugin

// Color all buttons: jQuery(":submit").colorbutton();
// Color only "order" buttons: jQuery(".order").colorbutton();
// Custom size: jQuery(".order").popbutton({ newSize: "72px" });
jQuery.fn.popbutton = function(options) {

   var opts = jQuery.extend({}, jQuery.fn.popbutton.defaults, options);
   var oldSize = jQuery(this).css("fontSize");

   return jQuery(this)
      .mouseover(function() { jQuery(this).stop().animate({ fontSize: opts.newSize }, 500, "easeOutBounce"); })
      .mouseout(function() { jQuery(this).stop().animate({ fontSize:oldSize }, 500, "easeOutBounce"); })
   ;
};

jQuery.fn.popbutton.defaults = {
   newSize : "42px"
};
// End popbutton plugin

jQuery.noConflict();

jQuery(function() {   

   jQuery(":submit").colorbutton();
   //jQuery(":submit").colorbutton({hoverCSS : {backgroundColor:"blue"}});

   jQuery(".order").popbutton();

   //jQuery(".order").popbutton({ newSize: "72px" });
});