<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,6 @@
-/* 
+/*
  * Original Copyright
- * 
+ *
  * Pushup
  * Copyright (c) 2008 Nick Stakenburg (www.nickstakenburg.com)
  *
@@ -9,142 +9,149 @@
  *
  */
 
-/* 
+/*
  * Modified for jQuery by Stuart Loxton (www.stuartloxton.com)
+ * Version: 1.0.1
+ *
+ * Heavily refactored  by Thomas Reynolds
 */
+(function($) {
+  var browsers = {
+    ie: {
+      link: 'http://www.microsoft.com/windows/downloads/ie/',
+      version: {
+        active:  $.browser.msie ? parseFloat($.browser.version) : false,
+        minimum: 7
+      }
+    },
+    firefox: {
+      link: 'http://www.getfirefox.com',
+      version: {
+        active:  (navigator.userAgent.indexOf('Firefox') &gt; -1) ? parseFloat(navigator.userAgent.match(/Firefox[\/\s](\d+)/)[1]) : false,
+        minimum: 2
+      }
+    },
+    safari: {
+      link: 'http://www.apple.com/safari/download/',
+      version: {
+        active:  $.browser.safari ? parseFloat($.browser.version) : false,
+        minimum: 3
+      }
+    },
+    opera: {
+      link: 'http://www.opera.com/download/',
+      version: {
+        active:  $.browser.opera ? parseFloat($.browser.version) : false,
+        minimum: 9
+      }
+    }
+  };
 
-jQuery.pushup = {
-	Version: '1.0.1',
-	options: {
-		appearDelay: 0.5,
-		fadeDelay: 6,
-		images: '../images/pushup/',
-		message: 'Important browser update available',
-		reminder: {
-			hours: 6,
-			message: 'Remind me again in #{hours}'
-		}
-	},
-	updateLinks: {
-		IE: 'http://www.microsoft.com/windows/downloads/ie/',
-		Firefox: 'http://www.getfirefox.com',
-		Safari: 'http://www.apple.com/safari/download/',
-		Opera: 'http://www.opera.com/download/'
-	},
-	browsVer: {
-		Firefox: (navigator.userAgent.indexOf('Firefox') &gt; -1) ? parseFloat(navigator.userAgent.match(/Firefox[\/\s](\d+)/)[1]) : false,
-		IE: (jQuery.browser.msie) ? parseFloat(jQuery.browser.version) : false,
-		Safari: (jQuery.browser.safari) ? parseFloat(jQuery.browser.version) : false,
-		Opera: (jQuery.browser.opera) ? parseFloat(jQuery.browser.version) : false
-	},
-	browsers: {
-		Firefox: 2,
-		IE: 7,
-		Opera: 9,
-		Safari: 3
-	},
-	init: function() {
-		jQuery.each(jQuery.pushup.browsVer, function(x, y) {
-			if(y &amp;&amp; y &lt; jQuery.pushup.browsers[x]) {
-				if (!jQuery.pushup.options.ignoreReminder &amp;&amp; jQuery.pushup.cookiesEnabled &amp;&amp; Cookie.get('_pushupBlocked')) { return; } else {
-					time = (jQuery.pushup.options.appearDelay != undefined) ? jQuery.pushup.options.appearDelay * 1000 : 0;
-					setTimeout('jQuery.pushup.show(jQuery.pushup.browserUsed)', time);
-				}
-			}
-		});
-	},
-	show: function() {
-		browser = typeof arguments[0] == 'string' ?
-		arguments[0] : jQuery.pushup.browserUsed || 'IE';
-		elm = document.createElement('div');
-		elm.style.display = 'none';
-		elm.id = 'pushup';
-		jQuery('body').prepend(elm);
-		icon = jQuery(document.createElement('div')).addClass('pushup_icon');
-		message = jQuery(document.createElement('span')).addClass('pushup_message');
-		messagelink = jQuery(document.createElement('a')).addClass('pushup_messageLink').attr('target', '_blank').append(icon).append(message);
-		jQuery('#pushup').append(messagelink);
-		jQuery('.pushup_message').html(jQuery.pushup.options.message);
-		
-		var hours = jQuery.pushup.options.reminder.hours;
-		if (hours &amp;&amp; jQuery.pushup.cookiesEnabled) {
-			var H = hours + ' hour' + (hours &gt; 1 ? 's' : ''),
-			message = jQuery.pushup.options.reminder.message.replace('#{hours}', H);
-			hourelem = jQuery(document.createElement('a')).attr('href', '#').addClass('pushup_reminder').html(message);
-			jQuery('#pushup').append(hourelem);
-			jQuery('.pushup_reminder').click(function() {
-				jQuery.pushup.setReminder(jQuery.pushup.options.reminder.hours);
-				jQuery.pushup.hide();
-				return false;
-			});
-		}
-		if(/^(https?:\/\/|\/)/.test(this.options.images)) {
-			imgSrc = jQuery.pushup.options.images;
-		} else {
-			jQuery('script[src]').each(function(x, y) {
-				if(/jquery\.pushup/.test(jQuery(y).attr('src'))) {
-					srcFol =  jQuery(y).attr('src').replace('jquery.pushup.js', '');
-					imgSrc = srcFol + jQuery.pushup.options.images;
-				}
-			});
-		}
-		styles = (jQuery.pushup.browsVer.IE &lt; 7 &amp;&amp; jQuery.pushup.browsVer.IE) ? {
-			filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' +
-		      imgSrc+browser.toLowerCase()  + '.png\'\', sizingMethod=\'crop\')'
-		} : {
-			background: 'url('+imgSrc+browser.toLowerCase()+'.png) no-repeat top left'
-		}
-		jQuery('.pushup_icon').css(styles);
-		jQuery('#pushup').fadeIn('slow');
-		if(jQuery.pushup.options.fadeDelay != undefined) {
-			time = jQuery.pushup.options.fadeDelay * 1000;
-			setTimeout('jQuery.pushup.hide()', time);
-		}
-	},
-	hide: function() { jQuery('#pushup').fadeOut('slow'); },
-	setReminder: function(hours) {
-		Cookie.set('_pushupBlocked', 'blocked', { duration: 1 / 24 * hours })
-	},
-	resetReminder: function() { Cookie.remove('_pushupBlocked') }
-	
-}
-jQuery.each(jQuery.pushup.browsVer, function(x,y) {
-	if(y) {
-		jQuery.pushup.browserUsed = x;
-	}
-})
+  // Determine the current browser and version
+  var browserUsed;
+  $.each(browsers, function(name, info) {
+    if (info.version.active !== false)
+      browserUsed = $.extend({ name: name }, info);
+  });
 
-// Based on the work of Peter-Paul Koch - http://www.quirksmode.org
-var Cookie = {
-  set: function(name, value) {
-    var expires = '', options = arguments[2] || {};
-    if (options.duration) {
-      var date = new Date();
-      date.setTime(date.getTime() + options.duration * 1000 * 60 * 60 * 24);
-      value += '; expires=' + date.toGMTString();
-    }
-    document.cookie = name + &quot;=&quot; + value + expires + &quot;; path=/&quot;;
-  },
+  $.pushup = {
+    options: {
+      appearDelay: 500,  // milliseconds
+      fadeDelay:   6000, // milliseconds
+      images:      'images/pushup/',
+      message:     'Important browser update available',
+      reminder: {
+        hours:   6,
+        message: 'Remind me again in 6 hours'
+      }
+    },
 
-  remove: function(name) { this.set(name, '', -1) },
+    show: function() {
+      if (!pushup_elem)
+        setup();
 
-  get: function(name) {
-    var cookies = document.cookie.split(';'), nameEQ = name + &quot;=&quot;;
-    for (var i = 0, l = cookies.length; i &lt; l; i++) {
-      var c = cookies[i];
-      while (c.charAt(0) == ' ')
-        c = c.substring(1,c.length);
-      if (c.indexOf(nameEQ) == 0)
-        return c.substring(nameEQ.length, c.length);
+      pushup_elem.fadeIn('slow');
+      
+      if ($.pushup.options.fadeDelay &gt; 0)
+        setTimeout($.pushup.hide, $.pushup.options.fadeDelay);
+    },
+
+    hide: function() {
+      pushup_elem.fadeOut('slow');
+    },
+    
+    resetReminder: function() {
+      Cookie.remove('_pushupBlocked');
     }
-    return null;
   }
-};
-jQuery.pushup.cookiesEnabled = (function(test) {
-  if (Cookie.get(test)) return true;
-  Cookie.set(test, 'test', { duration: 15 });
-  return Cookie.get(test);
-})('_pushupCookiesEnabled');
-jQuery(function() {
-	jQuery.pushup.init();
-});
+
+  var pushup_elem;
+  function setup() {
+    var messagelink = $('&lt;a class=&quot;pushup_messageLink&quot; target=&quot;_blank&quot; /&gt;')
+      .append($('&lt;div class=&quot;pushup_icon&quot;/&gt;'))
+      .append($('&lt;span class=&quot;pushup_message&quot; /&gt;').html($.pushup.options.message));
+    
+    $('body').prepend($('&lt;div id=&quot;pushup&quot; /&gt;').hide());
+    pushup_elem = $('#pushup').append(messagelink);
+    
+    if ($.browser.msie &amp;&amp; browsers.IE.version.active &lt; 7)
+      $('.pushup_icon').css({ filter: 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + $.pushup.options.images + browserUsed.name  + '.png\'\', sizingMethod=\'crop\')' });
+    else
+      $('.pushup_icon').css({ background: 'url(' + $.pushup.options.images + browserUsed.name + '.png) no-repeat top left' });
+
+    if (!cookiesEnabled)
+      return;
+      
+    // Setup reminder
+    var plural   = $.pushup.options.reminder.hours + ' hour' + ($.pushup.options.reminder.hours &gt; 1 ? 's' : ''),
+        message  = $.pushup.options.reminder.message.replace('#{hours}', plural);
+    pushup_elem.append($('&lt;a href=&quot;#&quot; class=&quot;pushup_reminder&quot; /&gt;').html(message));
+
+    $('.pushup_reminder').click(function() {
+      Cookie.set('_pushupBlocked', 'blocked', { duration: 1 / 24 * $.pushup.options.reminder.hours });
+      $.pushup.hide();
+      return false;
+    });
+  }
+
+  // Based on the work of Peter-Paul Koch - http://www.quirksmode.org
+  var Cookie = {
+    set: function(name, value) {
+      var expires = '', options = arguments[2] || {};
+      if (options.duration) {
+        var date = new Date();
+        date.setTime(date.getTime() + options.duration * 1000 * 60 * 60 * 24);
+        value += '; expires=' + date.toGMTString();
+      }
+      document.cookie = name + &quot;=&quot; + value + expires + &quot;; path=/&quot;;
+    },
+
+    remove: function(name) { this.set(name, '', -1) },
+
+    get: function(name) {
+      var cookies = document.cookie.split(';'), nameEQ = name + &quot;=&quot;;
+      for (var i = 0, l = cookies.length; i &lt; l; i++) {
+        var c = cookies[i];
+        while (c.charAt(0) == ' ')
+          c = c.substring(1,c.length);
+        if (c.indexOf(nameEQ) == 0)
+          return c.substring(nameEQ.length, c.length);
+      }
+      return null;
+    }
+  };
+
+  var cookiesEnabled = (function(test) {
+    if (Cookie.get(test)) return true;
+    Cookie.set(test, 'test', { duration: 15 });
+    return Cookie.get(test);
+  })('_pushupCookiesEnabled');
+
+  $(document).ready(function() {
+    if ((browserUsed.version.active &gt;= browserUsed.version.minimum) ||
+        (!$.pushup.options.ignoreReminder &amp;&amp; cookiesEnabled &amp;&amp; Cookie.get('_pushupBlocked')))
+      return;
+    
+    setTimeout($.pushup.show, $.pushup.options.appearDelay);
+  });
+})(jQuery);
\ No newline at end of file</diff>
      <filename>js/jquery.pushup.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>3fed6f27b0311e9805297612383913049d7ab48f</id>
    </parent>
  </parents>
  <author>
    <name>Thomas Reynolds</name>
    <email>tdreyno@gmail.com</email>
  </author>
  <url>http://github.com/tdreyno/jquery-pushup/commit/f48ba4f307ceb6459c408ba9000cf10a19cd6a8a</url>
  <id>f48ba4f307ceb6459c408ba9000cf10a19cd6a8a</id>
  <committed-date>2008-09-16T11:07:57-07:00</committed-date>
  <authored-date>2008-09-16T11:07:57-07:00</authored-date>
  <message>refactor for better use of jquery</message>
  <tree>b64de0fe6b7b9c53e7c246a5e6df67b1e6c206a4</tree>
  <committer>
    <name>Thomas Reynolds</name>
    <email>tdreyno@gmail.com</email>
  </committer>
</commit>
