+
+/*
+ * Called to get the arguments from a URL as a hash.
+ */
+function getStyle(el, property) {
+ var style;
+
+ if (el.currentStyle) {
+ style = el.currentStyle[property];
+ } else if( window.getComputedStyle ) {
+ style = document.defaultView.getComputedStyle(el,null).getPropertyValue(property);
+ } else {
+ style = el.style[property];
+ }
+
+ return style;
+}
+
+/*
+ * Called to interpolate JavaScript variables in strings using a
+ * similar syntax to rails I18n string interpolation - the only
+ * difference is that [[foo]] is the placeholder syntax instead
+ * of {{foo}} which allows the same string to be processed by both
+ * rails and then later by javascript.
+ */
+function i18n(string, keys) {
+ for (var key in keys) {
+ var re_key = '\\[\\[' + key + '\\]\\]';
+ var re = new RegExp(re_key, "g");
+
+ string = string.replace(re, keys[key]);
+ }
+
+ return string;
+}