chrome.runtime.sendMessage({method: "getLocal"}, function(response) {
	var working_wage = response.wage;
	if(isNaN(working_wage)) {
		working_wage = 7.50;
	}
	$("body *").replaceText(/^(\s*)?\$[0-9]+(\W[0-9]{0,3})*?(\.[0-9][0-9])?$/, convert);

	function convert(str) {
		new_str = str.trim();
		new_str = new_str.replace(/[^\d.]/g, '');
		var time = parseFloat(new_str) / working_wage;
		if(isNaN(time)) { return str; }
		var hours = Math.floor(time);
		var minutes = Math.ceil(60 * (time - hours));

		if(hours == 0) {
			msg = "";
		} else if(hours == 1) {
			msg = hours.toString() + " hr";
		} else {
			msg = hours.toString() + " hrs";
		}
		if(minutes == 1) {
			msg = str + " (" + msg + " " + minutes + " min)";
		} else if(minutes == 0) {
			msg = str + " (" + msg + ")";
		} else {
			msg = str + " (" + msg + " " + minutes + " mins)";
		}
		return msg;
	}

});

// replaceText jQuery function
(function($){$.fn.replaceText=function(b,a,c){return this.each(function(){var f=this.firstChild,g,e,d=[];if(f){do{if(f.nodeType===3){g=f.nodeValue;e=g.replace(b,a);if(e!==g){if(!c&&/</.test(e)){$(f).before(e);d.push(f)}else{f.nodeValue=e}}}}while(f=f.nextSibling)}d.length&&$(d).remove()})}})(jQuery);
@@ -148,10 +148,10 @@
 = 7.
+2
 5
-0
 ;%0A%09%7D
@@ -493,16 +493,33 @@
 hours));
+%0A%09%09var msg = str;
 %0A%0A%09%09if(h
@@ -542,11 +542,14 @@
 msg 
++
 = %22
+ (
 %22;%0A%09
@@ -572,33 +572,41 @@
  == 1) %7B%0A%09%09%09msg 
-=
++= %22 (%22 +
  hours.toString(
@@ -613,16 +613,17 @@
 ) + %22 hr
+ 
 %22;%0A%09%09%7D e
@@ -635,17 +635,25 @@
 %0A%09%09%09msg 
-=
++= %22 (%22 +
  hours.t
@@ -669,16 +669,17 @@
  + %22 hrs
+ 
 %22;%0A%09%09%7D%0A%09
@@ -709,34 +709,10 @@
 msg 
-= str + %22 (%22 + msg + %22 %22 
 +
+=
  min
@@ -740,104 +740,19 @@
 lse 
-if(minutes == 0) %7B%0A%09%09%09msg = str + %22 (%22 + msg + %22)%22;%0A%09%09%7D else %7B%0A%09%09%09msg = str + %22 (%22 + msg + %22 %22 +
+%7B%0A%09%09%09msg +=
  min

fix minutes spacing