diff --git a/js/macro.js b/js/macro.js
index 5a2823d0c55a0e6b585035d351fbf1240cb0ca85..afca5f40e120c5343f932618a7ca3bc0de96fe65 100755
--- a/js/macro.js
+++ b/js/macro.js
@@ -1,44 +1,47 @@
 /* $Id$ */
 
-////////////////////////////////////////
-//           Macro widget             //
-////////////////////////////////////////
+/**
+ * @file
+ * GMap macro widget and macro compiler.
+ */
+
+/*global Drupal */
 
 /**
  * Widget handler.
  */
-Drupal.gmap.addHandler('macrotext', function(elem) {
+Drupal.gmap.addHandler('macrotext', function (elem) {
   var obj = this;
   obj.macrostorage = {};
 
-  obj.bind("widthchange", function(w){
+  obj.bind("widthchange", function (w) {
     obj.macrostorage.width = w;
   });
-  obj.bind("heightchange", function(h){
+  obj.bind("heightchange", function (h) {
     obj.macrostorage.height = h;
   });
 
   // Basic macros.
-  obj.bind('buildmacro',function(add) {
-    add.push('zoom='+obj.vars.zoom);
-    add.push('center='+obj.vars.latitude+','+obj.vars.longitude);
-    add.push('width='+obj.macrostorage.width);
-    add.push('height='+obj.macrostorage.height);
-    if (obj.vars.macro_mapid && obj.vars.macro_mapid != '') {
-      add.push('id='+obj.vars.macro_mapid);
+  obj.bind('buildmacro', function (add) {
+    add.push('zoom=' + obj.vars.zoom);
+    add.push('center=' + obj.vars.latitude + ',' + obj.vars.longitude);
+    add.push('width=' + obj.macrostorage.width);
+    add.push('height=' + obj.macrostorage.height);
+    if (obj.vars.macro_mapid && obj.vars.macro_mapid !== '') {
+      add.push('id=' + obj.vars.macro_mapid);
     }
-    add.push('control='+obj.vars.controltype);
+    add.push('control=' + obj.vars.controltype);
     // @@@ Use maptype instead, accept old and new.
-    add.push('type='+obj.vars.maptype);
+    add.push('type=' + obj.vars.maptype);
   });
 
 
   // Update macro every time something happens.
-  obj.bind('all',function(name){
-    if (name != 'buildmacro') {
+  obj.bind('all', function (name) {
+    if (name !== 'buildmacro') {
       var add = [];
       // Collect macro pieces.
-      obj.change('buildmacro',-1,add);
+      obj.change('buildmacro', -1, add);
       elem.value = '[gmap ' + add.join(' |') + ']';
     }
   });
@@ -47,9 +50,9 @@ Drupal.gmap.addHandler('macrotext', function(elem) {
 /**
  * Extensible macros @@@
  */
-Drupal.gmap.map.prototype.parse = function(m) {
+Drupal.gmap.map.prototype.parse = function (m) {
   // Trim off outside tag
-  if (m.substr(0,5)=='[gmap') {
-    m = m.slice(6,-1);
+  if (m.substr(0, 5) === '[gmap') {
+    m = m.slice(6, -1);
   }
 };