Index: /trunk/prototype/plugins/jquery.autoscroll/jquery.aautoscroll.min.2.41.js
===================================================================
--- /trunk/prototype/plugins/jquery.autoscroll/jquery.aautoscroll.min.2.41.js	(revision 7751)
+++ /trunk/prototype/plugins/jquery.autoscroll/jquery.aautoscroll.min.2.41.js	(revision 7751)
@@ -0,0 +1,1 @@
+﻿(function (a) { var b = "$autoscroll", c = "$tAutoscroll", d = "$autoscrollInterval", e = "$edgeAutoscroll", f = "$lastEdgeAutoscroll", g = { up: 90, left: 180, right: 360, upleft: 135, upright: 45, downleft: 225, downright: 315, leftup: 135, rightup: 45, leftdown: 225, rightdown: 315, down: 270 }, h = { init: function (c) { return this.each(function () { if (k(this)) a(this).data(b, n(a.extend(k(this), c))); else { a(this).data(b, n(a.extend({ e: false, fr: false }, a.fn.autoscroll.defaults.settings, c))); a(this).hover(function () { var b = k(this); if (b) { if (b.scroll && b.pauseOnHover) { j(this); a(this).stop(true) } b.e = true } }, function () { var a = k(this); if (a && a.e) { if (a.scroll && a.pauseOnHover) i(this); a.e = false } }); i(this) } }) }, destroy: function () { return this.each(function () { if (k(this)) { j(this); a(this).stop(true).data(d, null).data(b, null).data(c, null) } }) }, delay: function (c) { return this.each(function () { var d = k(this); if (d && d.scroll) { a(this).autoscroll("pause"); a(this).oneTime(c || a.fn.autoscroll.defaults.delay, b, function () { a(this).autoscroll("resume") }) } }) }, fastforward: function (a) { return m(this, "f", a) }, rewind: function (a) { return m(this, "r", a) }, pause: function () { return this.each(function () { var b = k(this); if (b && b.scroll) { b.scroll = false; a(this).stop(true); j(this) } }) }, resume: function () { return this.each(function () { var a = k(this); if (a) { a.scroll = true; i(this) } }) }, reverse: function () { return this.each(function () { var b = k(this); if (b && (b.direction += 180) > 360) b.direction -= 360; a(this).stop(true) }) }, toggle: function () { return this.each(function () { var b = k(this); if (b) if (b.scroll) a(this).autoscroll("pause"); else a(this).autoscroll("resume") }) }, get: function () { return this.each(function () { if (k(this)) return k(this) }) }, addpausesource: function (b) { if (typeof b == "undefined") return this; if (!(b instanceof jQuery)) if ((b = a(b)).length == 0) return this; var c = this.selector; b.each(function () { a(this).hover(function () { a(c).each(function () { var b = k(this); if (b) { if (b.scroll && b.pauseOnHover) { j(this); a(this).stop(true) } b.e = true } }) }, function () { a(c).each(function () { var a = k(this); if (a && a.e) { if (a.scroll && a.pauseOnHover) i(this); a.e = false } }) }) }); return this } }, i = function (b) { a(b).data(d, setInterval(function () { var d, e = k(b); if (e) { if (typeof e.onEvaluate == "function") e.onEvaluate.apply(b); if (!r(b)) { if (e.scroll && !e.e && !e.fr) { if ((d = a(b).data(c)) && !l(d, e)) a(b).stop(true).animate(q(e.step, e.direction, b), 1e3, "linear"); else a(b).animate(q(e.step, e.direction), 1e3, "linear") } } a(b).data(c, a.extend(true, {}, e)) } }, 50)) }, j = function (b) { clearInterval(a(b).data(d)) }, k = function (c) { return a(c).data(b) }, l = function (a, b) { return a.step === b.step && a.direction === b.direction && a.scroll === b.scroll }, m = function (b, c, d) { var e = n(a.extend(a.fn.autoscroll.defaults.ffrw, d)); return b.each(function () { var b = k(this); if (b) { var d = b.scroll, f = b.direction; b.fr = true; if (c == "r" && (f += 180) > 360) f -= 360; if (b.scroll) j(this); a(this).stop(true).animate(q(e.step, f), e.speed, "swing", function () { k(this).fr = false; if (b.scroll) i(this) }) } }) }, n = function (b) { if (a.inArray(typeof b.scroll, ["undefined", "boolean"]) < 0) a.error("scroll is not a boolean"); if (a.inArray(typeof b.step, ["undefined", "number"]) < 0 && isNaN(b.step = Number(b.step))) a.error("step is not a valid number"); if (b.direction) b.direction = p(b.direction); return b }, o = function (a) { return a * Math.PI / 180 }, p = function (b) { if (typeof b === "string" && isNaN(Number(b))) if (g[b]) b = g[b]; else if (b.indexOf("rad") == b.length - 3 && !isNaN(b = Number(b.substring(0, b.length - 3)))) b = b * 180 / Math.PI; if (isNaN(b = Number(b))) a.error("Invalid direction on jQuery.autoscroll"); while (b < 0) b += 360; return b }, q = function (b, c) { var d = Math.round(b * Math.cos(c = o(c))), e = Math.round(b * Math.sin(c)) * -1, f = arguments[2]; return f && a(f).length > 0 ? { scrollTop: f.scrollTop + e, scrollLeft: f.scrollLeft + d} : { scrollTop: (e < 0 ? "-=" : "+=") + Math.abs(e), scrollLeft: (d < 0 ? "-=" : "+=") + Math.abs(d)} }, r = function (b) { var c = k(b); if (c && typeof c.onEdge == "function") { var d = a(b).data(e) || { x: null, y: null }, g = c.step, h = b.scrollLeft, i = o(c.direction), j = Math.round(g * Math.cos(i)), l = h + j, m = b.scrollTop, n = Math.round(g * Math.sin(i)) * -1; nt = m + n, _e = a(b).data(f); if (h > l && h == 0) { if (!d.x || d.x != "left") d.x = "left" } else if (h < l && h == b.scrollWidth - b.clientWidth) { if (!d.x || d.x != "right") d.x = "right" } else d.x = null; if (m > nt && m == 0) { if (!d.y || d.y != "top") d.y = "top" } else if (m < nt && m == b.scrollHeight - b.clientHeight) { if (!d.y || d.y != "bottom") d.y = "bottom" } else d.y = null; try { if (!_e || d.x && d.x != _e.x || d.y && d.y != _e.y) { c.onEdge.apply(b, [d]); return true } } catch (p) { throw p } finally { a(b).data(f, a.extend(true, {}, d)).data(e, d) } } return false }; a.fn.autoscroll = function (b, c) { if (h[b]) return h[b].apply(this, Array.prototype.slice.call(arguments, 1)); else if (typeof b === "object" || !b) return h.init.apply(this, arguments); else a.error("Method " + b + " does not exist on jQuery.autoscroll") }; a.fn.autoscroll.defaults = { settings: { step: 50, scroll: true, direction: "down", pauseOnHover: true }, delay: 5e3, ffrw: { speed: "fast", step: 100}} })(jQuery)
Index: /trunk/prototype/modules/mail/js/foldertree.js
===================================================================
--- /trunk/prototype/modules/mail/js/foldertree.js	(revision 7745)
+++ /trunk/prototype/modules/mail/js/foldertree.js	(revision 7751)
@@ -238,5 +238,33 @@
         search_emails("UNDELETED KEYWORD \"$Followupflagged\"");
     }).end().end();
-    
+
+    $('.upper').droppable({
+        over: function(event, ui){
+            $('#content_folders').autoscroll({
+                direction: 'up',
+                step: 150,
+                scroll: true
+            });
+        },
+        out: function(event, ui){
+            $('#content_folders').autoscroll('destroy');
+        }
+    });
+
+    $('.lower').droppable({
+        over: function(event, ui){
+            $('#content_folders').autoscroll({
+                direction: 'down',
+                step: 150,
+                scroll: true
+            });
+        },
+        out: function(event, ui){
+            $('#content_folders').autoscroll('destroy');
+        }
+    });
+
+
+
     folders_html.find('[id="'+selected+'"]').children().addClass("selected");
     $(".folder").not(".head_folder").not(".shared-folders").not(".shared-folders + ul .folder").parent().find(".folder").not(".head_folder,.inbox,.drafts,.sent,.spam,.trash").draggable({
@@ -244,7 +272,10 @@
         start : function(){
             $(this).css("color", "gray");
+            $('.upper, .lower').show();
+            $(".lower").css("top", ($("#content_folders").height()-18) + $("#content_folders").offset().top);
         },
         stop : function(){
             $(this).css("color", "");
+            $('.upper, .lower').hide();
         },
         revert: "invalid",
@@ -275,9 +306,9 @@
                                 over.prev().trigger("click");
                             }
-                        }, 1000);
+                        }, 500);
                         
                     }
             //FIM : SE A PASTA CONTER FILHAS EXPANDE           
-            $("#content_folders").stop().scrollTo($(this), {axis:'y', margin:true, offset:-50, duration:400});      
+            //$("#content_folders").stop().scrollTo($(this), {axis:'y', margin:true, offset:-50, duration:400});      
             //SETA BORDA EM VOLTA DA PASTA
             //
Index: /trunk/prototype/modules/mail/templates/detailedfoldertree.ejs
===================================================================
--- /trunk/prototype/modules/mail/templates/detailedfoldertree.ejs	(revision 7456)
+++ /trunk/prototype/modules/mail/templates/detailedfoldertree.ejs	(revision 7751)
@@ -43,28 +43,30 @@
 	}
 %>
-<ul class="filetree foldertree-skin-prognus mainfoldertree">
-  <li><span class="folder head_folder">Minhas Pastas</span>
-      <% recursive_forest(data.folders[0]); %>
-  </li>
-  <% if(data.folders[1].length > 0) { %>
-  <li><span class="folder shared-folders">Pastas compartilhadas</span>
-      <% recursive_forest(data.folders[1]); %>
-  </li> 
-  <%}%>
-  <% if(preferences.use_local_messages == 1) { %>
-     <% if(expresso_mail_archive.enabled && data.folders[2].length > 0) { /*MailArchive ativado*/ %>
-     	<li>
-    		<span class="folder local-folder head_folder" style="display: inline;">Pastas locais</span>
-    	 	<% recursive_forest(data.folders[2]); %>
-    	</li>
-    <%} else { /*MailArchive desativado*/ %>
-    	<li>
-    		<span class="folder local-folder head_folder" style="display: inline;" title="MailArchive Desconectado">Pastas locais</span>
-    		<span class="local-connect" onclick="services_retry();" title="Conectar ao MailArchive"></span>
-    	</li>
-	<%}%>
+<div class="upper"></div>
+	<ul class="filetree foldertree-skin-prognus mainfoldertree">
+	  <li><span class="folder head_folder">Minhas Pastas</span>
+	      <% recursive_forest(data.folders[0]); %>
+	  </li>
+	  <% if(data.folders[1].length > 0) { %>
+	  <li><span class="folder shared-folders">Pastas compartilhadas</span>
+	      <% recursive_forest(data.folders[1]); %>
+	  </li> 
+	  <%}%>
+	  <% if(preferences.use_local_messages == 1) { %>
+	     <% if(expresso_mail_archive.enabled && data.folders[2].length > 0) { /*MailArchive ativado*/ %>
+	     	<li>
+	    		<span class="folder local-folder head_folder" style="display: inline;">Pastas locais</span>
+	    	 	<% recursive_forest(data.folders[2]); %>
+	    	</li>
+	    <%} else { /*MailArchive desativado*/ %>
+	    	<li>
+	    		<span class="folder local-folder head_folder" style="display: inline;" title="MailArchive Desconectado">Pastas locais</span>
+	    		<span class="local-connect" onclick="services_retry();" title="Conectar ao MailArchive"></span>
+	    	</li>
+		<%}%>
 
-  <%}%>
-  <li><span class="folder head_folder all_accomp followup-messages">Para acompanhamento</span>
-  </li>
-</ul>
+	  <%}%>
+	  <li><span class="folder head_folder all_accomp followup-messages">Para acompanhamento</span>
+	  </li>
+	</ul>
+<div class="lower"></div>
Index: /trunk/expressoMail1_2/index.php
===================================================================
--- /trunk/expressoMail1_2/index.php	(revision 7724)
+++ /trunk/expressoMail1_2/index.php	(revision 7751)
@@ -58,5 +58,6 @@
 		<script type="text/javascript" src="../prototype/plugins/mask/jquery.maskedinput.js"></script>
 		<script type="text/javascript" src="../prototype/plugins/lazy/jquery.lazy.js"></script>
-		';
+		<script type="text/javascript" src="../prototype/plugins/jquery.autoscroll/jquery.aautoscroll.min.2.41.js"></script>
+		';	
 
 	echo "<script src='js/globals.js?".$update_version."' type='text/javascript'></script>";
Index: /trunk/expressoMail1_2/templates/default/main.css
===================================================================
--- /trunk/expressoMail1_2/templates/default/main.css	(revision 7743)
+++ /trunk/expressoMail1_2/templates/default/main.css	(revision 7751)
@@ -1627,2 +1627,16 @@
 	background-repeat : no-repeat;
 }
+
+.upper, .lower {
+	background-color: gray;
+	opacity:0.1;
+	filter:alpha(opacity=30);
+	height: 16px;
+	position: fixed;
+	width: 230px;
+	display: none;
+}
+
+.lower {
+	top: 585px;
+}		
Index: /trunk/expressoMail1_2/js/abas.js
===================================================================
--- /trunk/expressoMail1_2/js/abas.js	(revision 7746)
+++ /trunk/expressoMail1_2/js/abas.js	(revision 7751)
@@ -281,4 +281,6 @@
 		$(td).draggable({
 			start : function(){
+				$('.upper, .lower').show();
+        		$(".lower").css("top", ($("#content_folders").height()-18) + $("#content_folders").offset().top);
 				if($(".shared-folders").length){
 					$(".shared-folders").parent().find('.folder:not(".shared-folders")').droppable({
@@ -296,5 +298,5 @@
 										
 									}
-							$("#content_folders").stop().scrollTo($(this), {axis:'y', margin:true, offset:-50, duration:400});
+							//$("#content_folders").stop().scrollTo($(this), {axis:'y', margin:true, offset:-50, duration:400});
 						},
 						out : function(){
@@ -325,4 +327,5 @@
 			},
 			stop :function(){
+				$('.upper, .lower').hide();
 				$(".shared-folders").parent().find(".folder").droppable("destroy");
 			},
Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 7749)
+++ /trunk/expressoMail1_2/js/main.js	(revision 7751)
@@ -807,4 +807,6 @@
 					$(new_msg).draggable({
 						start : function(){
+		                    $('.upper, .lower').show();
+                    		$(".lower").css("top", ($("#content_folders").height()-18) + $("#content_folders").offset().top);
 							if($(".shared-folders").length){
 								$(".shared-folders").parent().find('.folder:not(".shared-folders")').droppable({
@@ -822,5 +824,4 @@
 													
 												}
-										$("#content_folders").stop().scrollTo($(this), {axis:'y', margin:true, offset:-50, duration:400});
 									},
 									out : function(){
@@ -850,4 +851,5 @@
 						},
 						stop :function(){
+							$('.upper, .lower').hide();
 							$(".shared-folders").parent().find(".folder").droppable("destroy");
 						},
Index: /trunk/expressoMail1_2/js/search.js
===================================================================
--- /trunk/expressoMail1_2/js/search.js	(revision 7727)
+++ /trunk/expressoMail1_2/js/search.js	(revision 7751)
@@ -823,13 +823,25 @@
 		$(tr).draggable({
 			start : function(){
+				$('.upper, .lower').show();
+        		$(".lower").css("top", ($("#content_folders").height()-18) + $("#content_folders").offset().top);
 				if($(".shared-folders").length){
 					$(".shared-folders").parent().find('.folder:not(".shared-folders")').droppable({
 						over : function(a, b){						
 							//SETA BORDA EM VOLTA DA PASTA
-							$(this).css("border", "1px solid black");
+							over = $(this);
+							$(this).addClass("folder-over");
+							if(($(this)[0] != $(this).parent().find(".head_folder")[0]))
+								if($(this).prev()[0])
+									if($(this).parent().find(".expandable-hitarea")[0] == $(this).prev()[0]){
+										setTimeout(function(){
+											if(over.hasClass("folder-over"))
+												over.prev().trigger("click");
+										}, 500);
+										
+									}
 						},
 						out : function(){
 							//RETIRA BORDA EM VOLTA DA PASTA
-							$(this).css("border", "");
+							$(this).removeClass("folder-over");
 						},
 						//accept: ".draggin_mail",
@@ -855,4 +867,5 @@
 			},
 			stop :function(){
+				$('.upper, .lower').hide();
 				$(".shared-folders").parent().find(".folder").droppable("destroy");
 			},
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 7745)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 7751)
@@ -1642,4 +1642,6 @@
 			$(tr_element).draggable({
 				start : function(){
+                    $('.upper, .lower').show();
+                    $(".lower").css("top", ($("#content_folders").height()-18) + $("#content_folders").offset().top);
 					if($(".shared-folders").length){
 						$(".shared-folders").parent().find('.folder:not(".shared-folders")').droppable({
@@ -1657,5 +1659,4 @@
 											
 										}
-                                $("#content_folders").stop().scrollTo($(this), {axis:'y', margin:true, offset:-50, duration:400});
 							},
 							out : function(){
@@ -1685,4 +1686,5 @@
 				},
 				stop :function(){
+                    $('.upper, .lower').hide();
 					$(".shared-folders").parent().find(".folder").droppable("destroy");
 				},
