Index: /trunk/expressoMail1_2/assetic.php
===================================================================
--- /trunk/expressoMail1_2/assetic.php	(revision 7585)
+++ /trunk/expressoMail1_2/assetic.php	(revision 7625)
@@ -5,4 +5,6 @@
 use Assetic\Asset\GlobAsset;
 use Assetic\Filter\Yui;
+use Assetic\FilterManager;
+use Assetic\Filter;
 use Assetic\Cache\FilesystemCache;
 
@@ -24,61 +26,70 @@
     }
 );
-$compressor = new Yui\JsCompressorFilter('../prototype/library/yuicompressor/yuicompressor.jar');
-    $plugins = new AssetCache(new AssetCollection(array(
-                new FileAsset('../prototype/plugins/json2/json2.js'),
-                new FileAsset('../prototype/plugins/ejs/ejs.js'),
-                new FileAsset('../prototype/plugins/scrollto/jquery.scrollTo.js'),
-                new FileAsset('../prototype/plugins/timepicker/jquery-ui-timepicker-addon.js'),
-                new FileAsset('../prototype/plugins/timepicker/localization/jquery-ui-timepicker-pt-BR.js'),
-                new FileAsset('../prototype/plugins/jquery/i18n/jquery.ui.datepicker-pt-BR.js'),
-                new FileAsset('../prototype/plugins/lazy/jquery.lazy.js'),
-                //new FileAsset('../prototype/plugins/datejs/date-pt-BR.js'),
-                new FileAsset('../prototype/plugins/datejs/sugarpak.js'),
-                new FileAsset('../prototype/plugins/datejs/parser.js'),
-                new FileAsset('../prototype/plugins/block/jquery.blockUI.js'),
-                new FileAsset('../prototype/plugins/jq-raty/js/jquery.raty.min.js'),
-                new FileAsset('../prototype/plugins/jquery.jrating/jRating.jquery.js'),
-                new FileAsset('../prototype/plugins/watermark/jquery.watermarkinput.js'),
-                new FileAsset('../prototype/plugins/fileupload/jquery.iframe-transport.js'),
-                new FileAsset('../prototype/modules/calendar/js/desktop.notification.js'),
-                new FileAsset('../prototype/plugins/qtip/jquery.qtip-1.0.0-rc3.min.js'),     
-                //new FileAsset('../prototype/modules/calendar/js/timezone.js'),
-                new FileAsset('../prototype/plugins/dateFormat/dateFormat.js'),
-                //new FileAsset('../prototype/modules/calendar/js/calendar.codecs.js'),
-                //new FileAsset('../prototype/modules/calendar/js/calendar.alarms.js'),
-                //new FileAsset('../prototype/modules/calendar/js/helpers.js'),
-                new FileAsset('../prototype/modules/calendar/js/calendar.date.js'),
-                new FileAsset('../prototype/plugins/treeview/jquery.treeview.js'),
-                new FileAsset('../prototype/plugins/treeview/lib/jquery.cookie.js'),    
-                new FileAsset('../prototype/plugins/scrollto/jquery.scrollTo.js'),
-                new FileAsset('../prototype/plugins/jqgrid/js/i18n/grid.locale-pt-br.js'),
-                new FileAsset('../prototype/plugins/jqgrid/js/jquery.jqGrid.min.js'),
-                new FileAsset('../prototype/modules/mail/js/foldertree.js'),
-                new FileAsset('../prototype/plugins/zebradialog/javascript/zebra_dialog.js'),
-                new FileAsset('../prototype/plugins/alphanumeric/jquery.alphanumeric.js'),
-                new FileAsset('../prototype/plugins/freeow/jquery.freeow.js')
-            ), array($compressor)
-        ),new FilesystemCache('/tmp')
-    );
-echo $plugins->dump();
 
-    $scripts = new AssetCache(new AssetCollection(array(
-                new FileAsset('js/modal/modal.js'),
-                new FileAsset('js/base64.js'),
-                new FileAsset('js/QuickCatalogSearch.js'),
-                new FileAsset('js/common_functions.js'),
-                new FileAsset('js/abas.js'),
-                new FileAsset('js/draw_api.js'),
-                new FileAsset('js/main.js'),
-                new FileAsset('../prototype/modules/mail/js/followupflag.js'),
-                new FileAsset('js/messages_controller.js'),
-                new FileAsset('js/doiMenuData.js'),
-                new FileAsset('js/rich_text_editor.js'),
-                new FileAsset('../prototype/modules/filters/filters.js'),
-                new FileAsset('../prototype/modules/mail/js/label.js'),
-                new FileAsset('js/init.js')
-            )
-        ),new FilesystemCache('/tmp')
-    );
-echo $scripts->dump();
+$javaVersion = shell_exec("java -version 2>&1");
+$filterManager = new FilterManager();
+
+$plugins = new AssetCollection(array(
+        new FileAsset('../prototype/plugins/json2/json2.js'),
+        new FileAsset('../prototype/plugins/ejs/ejs.js'),
+        new FileAsset('../prototype/plugins/scrollto/jquery.scrollTo.js'),
+        new FileAsset('../prototype/plugins/timepicker/jquery-ui-timepicker-addon.js'),
+        new FileAsset('../prototype/plugins/timepicker/localization/jquery-ui-timepicker-pt-BR.js'),
+        new FileAsset('../prototype/plugins/jquery/i18n/jquery.ui.datepicker-pt-BR.js'),
+        new FileAsset('../prototype/plugins/datejs/sugarpak.js'),
+        new FileAsset('../prototype/plugins/datejs/parser.js'),
+        new FileAsset('../prototype/plugins/block/jquery.blockUI.js'),
+        new FileAsset('../prototype/plugins/jq-raty/js/jquery.raty.min.js'),
+        new FileAsset('../prototype/plugins/jquery.jrating/jRating.jquery.js'),
+        new FileAsset('../prototype/plugins/watermark/jquery.watermarkinput.js'),
+        new FileAsset('../prototype/plugins/fileupload/jquery.iframe-transport.js'),
+        new FileAsset('../prototype/modules/calendar/js/desktop.notification.js'),
+        new FileAsset('../prototype/plugins/qtip/jquery.qtip-1.0.0-rc3.min.js'),     
+        new FileAsset('../prototype/plugins/dateFormat/dateFormat.js'),
+        new FileAsset('../prototype/modules/calendar/js/calendar.date.js'),
+        new FileAsset('../prototype/plugins/treeview/jquery.treeview.js'),
+        new FileAsset('../prototype/plugins/treeview/lib/jquery.cookie.js'),    
+        new FileAsset('../prototype/plugins/scrollto/jquery.scrollTo.js'),
+        new FileAsset('../prototype/plugins/jqgrid/js/i18n/grid.locale-pt-br.js'),
+        new FileAsset('../prototype/plugins/jqgrid/js/jquery.jqGrid.min.js'),
+        new FileAsset('../prototype/modules/mail/js/foldertree.js'),
+        new FileAsset('../prototype/plugins/zebradialog/javascript/zebra_dialog.js'),
+        new FileAsset('../prototype/plugins/alphanumeric/jquery.alphanumeric.js'),
+        new FileAsset('../prototype/plugins/freeow/jquery.freeow.js')
+    )
+);
+
+/*Se o servidor possuir a jvm entÃ£o minifique os arquivos*/
+if (strpos($javaVersion,"java version") !== false){
+    $filterManager->set('yui_js', new Yui\JsCompressorFilter('../prototype/library/yuicompressor/yuicompressor.jar'));    
+    $plugins->ensureFilter($filterManager->get('yui_js'));    
+}
+
+$pluginsCache = new AssetCache($plugins,new FilesystemCache('/tmp'));
+echo $pluginsCache->dump();
+
+$scripts = new AssetCollection(array(
+    new FileAsset('js/modal/modal.js'),
+    new FileAsset('js/base64.js'),
+    new FileAsset('js/QuickCatalogSearch.js'),
+    new FileAsset('js/common_functions.js'),
+    new FileAsset('js/abas.js'),
+    new FileAsset('js/draw_api.js'),
+    new FileAsset('js/main.js'),
+    new FileAsset('../prototype/modules/mail/js/followupflag.js'),
+    new FileAsset('js/messages_controller.js'),
+    new FileAsset('js/doiMenuData.js'),
+    new FileAsset('js/rich_text_editor.js'),
+    new FileAsset('../prototype/modules/filters/filters.js'),
+    new FileAsset('../prototype/modules/mail/js/label.js'),
+    new FileAsset('js/init.js')
+));
+
+if (strpos($javaVersion,"java version") !== false){
+    //$filterManager->set('yui_js', new Yui\JsCompressorFilter('../prototype/library/yuicompressor/yuicompressor.jar'));    
+    //$scripts->ensureFilter($filterManager->get('yui_js'));    
+}
+
+$scriptsCache = new AssetCache($scripts,new FilesystemCache('/tmp'));
+echo $scriptsCache->dump();
 ?>
Index: /trunk/expressoMail1_2/index.php
===================================================================
--- /trunk/expressoMail1_2/index.php	(revision 7587)
+++ /trunk/expressoMail1_2/index.php	(revision 7625)
@@ -56,4 +56,5 @@
 		<script type="text/javascript" src="../prototype/plugins/contextmenu/jquery.contextMenu.js"></script>
 		<script type="text/javascript" src="../prototype/plugins/mask/jquery.maskedinput.js"></script>
+		<script type="text/javascript" src="../prototype/plugins/lazy/jquery.lazy.js"></script>
 		';
 
