Index: www/macros/macro_googledocument.php
===================================================================
--- www/macros/macro_googledocument.php	(revision 958)
+++ www/macros/macro_googledocument.php	(working copy)
@@ -1,5 +1,4 @@
 <?php
-
 // This is a macro to embed a published google document
 // 
 // Arguments:
@@ -14,8 +13,8 @@
     $width = getattr($args, 'width', 1000);
     $height = getattr($args, 'height', 600);
 
-    if (is_null($doc_key)) {
-        macro_error('Expected document `id` (Google Document ID)');
+    if (!$doc_key) {
+        return macro_error('Expected document `id` (Google Document ID)');
     }
 
     if (!is_whole_number($width) || !(is_whole_number($height)) ||
Index: www/macros/macro_googlespreadsheet.php
===================================================================
--- www/macros/macro_googlespreadsheet.php	(revision 958)
+++ www/macros/macro_googlespreadsheet.php	(working copy)
@@ -14,8 +14,8 @@
     $width = getattr($args, 'width', 1000);
     $height = getattr($args, 'height', 600);
 
-    if (is_null($doc_key)) {
-        macro_error('Expected document `id` (Google Spreadsheet key)');
+    if (!$doc_key) {
+        return macro_error('Expected document `id` (Google Spreadsheet key)');
     }
 
     if (!is_whole_number($width) || !(is_whole_number($height)) ||
Index: www/macros/macro_googlevideo.php
===================================================================
--- www/macros/macro_googlevideo.php	(revision 958)
+++ www/macros/macro_googlevideo.php	(working copy)
@@ -15,9 +15,10 @@
     $width = getattr($args, 'width', 400);
     $height = getattr($args, 'height', 326);
 
-    if (is_null($doc_id)) {
+    if (!$doc_id) {
         return macro_error('Expecting argument `id` (Google Video docId)');
     }
+
     if (!is_whole_number($width) || !is_whole_number($height) || $width < 50
         || $width > 700 || $height < 50 || $height > 700) {
         return macro_error('Invalid `width` / `height` argument');
Index: www/macros/macro_triluliluvideo.php
===================================================================
--- www/macros/macro_triluliluvideo.php	(revision 0)
+++ www/macros/macro_triluliluvideo.php	(revision 0)
@@ -0,0 +1,45 @@
+<?php
+
+// Displays a trilulilu video widget (EMBED object).
+//
+// Arguments:
+//      user (required)             Trilulilu Video author username
+//      id (required)               Trilulilu Video document ID
+//      width (optional)            default 448px
+//      height (optional)           default 386px
+//
+// Examples:
+//      ==TriluliluVideo(id="UXT_voYw9FY")==
+
+function macro_triluliluvideo($args) {
+    $doc_user = html_escape(getattr($args, 'user'));
+    $doc_id = html_escape(getattr($args, 'id'));
+    $width = getattr($args, 'width', 448);
+    $height = getattr($args, 'height', 386);
+
+    if (!$doc_user) {
+        return macro_error('Expecting argument `user` (Trilulilu Video Author Username)');
+    }
+
+    if (!$doc_id) {
+        return macro_error('Expecting argument `id` (Trilulilu Video Id)');
+    }
+
+    if (!is_whole_number($width) || !is_whole_number($height) || $width < 50
+        || $width > 700 || $height < 50 || $height > 700) {
+        return macro_error('Invalid `width` / `height` argument');
+    }
+
+    $url = "http://www.trilulilu.ro/embed-video/{$doc_user}/{$doc_id}";
+
+    $html = "<script type=\"text/javascript\" language=\"javascript\" ".
+            "src=\"{$url}\">".
+            "</script>".
+            "<script type=\"text/javascript\" language=\"javascript\">".
+            "show_{$doc_id}({$width}, {$height});".
+            "</script>";
+
+    return $html;
+}
+
+?>
Index: www/macros/macro_youtubevideo.php
===================================================================
--- www/macros/macro_youtubevideo.php	(revision 958)
+++ www/macros/macro_youtubevideo.php	(working copy)
@@ -15,7 +15,7 @@
     $width = getattr($args, 'width', 425);
     $height = getattr($args, 'height', 344);
 
-    if (is_null($doc_id)) {
+    if (!$doc_id) {
         return macro_error('Expecting argument `id` (Youtube Video docId)');
     }
 
