/**
 * Implements W3C's Box Model on non-W3C's box model compliant browsers (IE for
 * example). IE doesn't implement the W3C's box model, so its behaviour is
 * different from FireFox and other (pseudo)-standard-compliant browsers. This
 * plugin autodetects if the user's browser needs a fix and, if needed, it fixes
 * all elements of selection.
 * 
 * @example $('div').fixBoxModel(); // note: this have to be the FIRST thing you
 *          have to do on $('document').ready
 * @example Note: next example is not correct because it creates problems at the
 *          images with border... $('*').fixBoxModel(); // Not correct, do not
 *          use it, use div in place of *
 * 
 * @license You can use it free of charge for private and commercial websites.
 *          You can't sell this code. You have to leave the
 * @license and the
 * @author name and website even in minified (or similar) js files Thanks.
 * @author Alessandro Coscia (php_staff [/\] ya hoo [-] it ||
 *         http://www.programmatorephp.it/jquery)
 */

(function($) {
  $.fn.fixBoxModel =
    function(options) {
      settings = jQuery.extend({
        force : false
      }, options);
      if (!jQuery.support.boxModel &&
        (settings.force || typeof (IE7) != 'object')) {
        return this.each(function() {
          widthDiff = $(this).outerWidth() - $(this).width();
          heightDiff = $(this).outerHeight() - $(this).height();
          $(this).width($(this).outerWidth() + widthDiff);
          $(this).height($(this).outerHeight() + heightDiff);
        });
      }
      return this;
    }
})(jQuery);

