diff --git a/resources/library/interactivities/Contraste.wgt/css/basic.css b/resources/library/interactivities/Contraste.wgt/css/basic.css
index 451e6ce0f5d329776f8689b136640e40ec6f9ed5..64323d60355df332729a1208a89e334279404986 100644
--- a/resources/library/interactivities/Contraste.wgt/css/basic.css
+++ b/resources/library/interactivities/Contraste.wgt/css/basic.css
@@ -144,9 +144,13 @@ body{
     font-family: Verdana,Arial,Helvetica,sans-serif;
     font-weight: bold;
     font-size:24px;
+    word-wrap: break-word;
 }
 
 .editContainer{
+    min-width: 200px;
+    max-width: 240px;
+    height: auto;
     position: absolute;
     border: 5px solid #c7c7c7;
     -webkit-border-radius: 5px;
diff --git a/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js b/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js
index 7cfdea27daaf9b54d6f7dae1c08ec031faa9c185..34de0859ceeb2d9a5f1c5f9adb5b974e0c217c67 100644
--- a/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js
+++ b/resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js
@@ -81,16 +81,19 @@ function init(){
                 .css("top",importArray[i].top)
                 .css("left",importArray[i].left);                                
                 tmpReadyTask.appendTo("#data");
-            }  
-            $(document).disableTextSelect();
-        }        
+            }      
+        }
+        $(document).disableTextSelect();
     }
     
     /* ------------- BUTTONS -------------*/
     
-    if(sankore.preference("by_style","")){
-        changeStyle(sankore.preference("by_style",""));
-        $(".style_select").val(sankore.preference("by_style",""));
+    if(window.sankore){
+        if(sankore.preference("by_style","")){
+            changeStyle(sankore.preference("by_style",""));
+            $(".style_select").val(sankore.preference("by_style",""));
+        } else
+            changeStyle("3")
     } else
         changeStyle("3")
 
@@ -106,7 +109,7 @@ function init(){
                 mode = false;
                 $(".leftDiv, .rightDiv").animate({
                     "opacity":"1"
-                },"slow",function(){
+                },"fast",function(){
                     if(opacityChanged){
                         if($(".editContainer").size() != 0){
                             $(".editContainer").each(function(index, domElem){
@@ -139,14 +142,17 @@ function init(){
                 $(document).enableTextSelect(); 
                 $(".leftDiv, .rightDiv").animate({
                     "opacity":"0.4"
-                },"slow",function(){
+                },"fast",function(){
                     if(!opacityChanged){
                         if($(".readyTask").size() != 0){
+                            var tmp_arr = [];
+                            $(".readyTask").each(function(){
+                                tmp_arr.push($(this));
+                            })
+                            orderItems(tmp_arr);
                             $(".readyTask").each(function(index, domElem){     
                                 var editContent = $("<div class='editContainer'>").width($(domElem).width() + 10).height($(domElem) + 10).appendTo("#data");
                                 var closeItem = $("<div class='closeItem'>").appendTo(editContent);
-                                var rightResize = $("<div class='rightResize'>").appendTo(editContent);
-                                var bottomResize = $("<div class='bottomResize'>").appendTo(editContent);
                                 editContent.css("top", $(domElem).position().top).css("left", $(domElem).position().left);
                                 $(domElem).css("position","static")
                                 .width("100%")
@@ -161,7 +167,7 @@ function init(){
             }
         }
     });
-    
+
     $("#wgt_help").click(function(){
         var tmp = $(this);
         if($(this).hasClass("open")){
@@ -178,7 +184,7 @@ function init(){
     });
 
     $("#wgt_reload").click(function(){
-        window.location.reload();
+        reloadItems();
     });
     
     $("#wgt_add").click(function(){
@@ -188,10 +194,9 @@ function init(){
                 $("#data").show();
             });
         }
-        shadowDiv.show()
+        shadowDiv.show();
         shadowOver = true;
-        popupBack.show("slow");            
-
+        popupBack.show("slow");        
         $(document).disableTextSelect();
     });
     
@@ -241,7 +246,6 @@ function init(){
             shadowOver = false; 
             $(document).enableTextSelect();
         });        
-        
     });
     
     okButton.click(function(){
@@ -256,7 +260,6 @@ function init(){
                 $(document).enableTextSelect();
             })
         }
-        
     });
     
     /* -------------- THE END OF WORK WITH POPUP BUTTONS AND FIELDS ---------------*/    
@@ -271,42 +274,33 @@ function init(){
     });
                     
     $(".readyTask, .editContainer").live("mousedown",function(event){
-        if(!shadowOver){
-            dragElement = $(this);
-            coords.left = event.pageX - $(this).position().left;
-            coords.top = event.pageY - $(this).position().top;
-            resizeObj.width = $(this).width();
-            resizeObj.height = $(this).height();
-        }
-        if($("#wgt_display").hasClass("selected"))
+        if($("#wgt_display").hasClass("selected")){
+            if(!shadowOver){
+                dragElement = $(this);
+                coords.left = event.pageX - $(this).position().left;
+                coords.top = event.pageY - $(this).position().top;
+                resizeObj.width = $(this).width();
+                resizeObj.height = $(this).height();
+            }
             $(document).disableTextSelect();
-    });
-    
-    $(".rightResize").live("mousedown",function(event){
-        if(!shadowOver){
-            resizeObj.x = true;
-        }
-    });
-    
-    $(".bottomResize").live("mousedown",function(event){
-        if(!shadowOver){
-            resizeObj.y = true;
         }
     });
     
     $("body").mouseup(function(event){
-        if(!shadowOver){
-            if (dragElement) {
-                exportToSankore();
+        if($("#wgt_display").hasClass("selected")){
+            if(!shadowOver){
+                if (dragElement) {
+                    exportToSankore();
+                }
+                dragElement = null;
+                resizeObj.x = false;
+                resizeObj.y = false;
             }
-            dragElement = null;
-            resizeObj.x = false;
-            resizeObj.y = false;
         }
     });
     
     $("body").mousemove(function(event){
-        if(dragElement && !shadowOver){ 
+        if(dragElement && !shadowOver && $("#wgt_display").hasClass("selected")){ 
             var top = event.pageY - coords.top;
             var left = event.pageX - coords.left;
             var bottom = top + dragElement.height();
@@ -335,6 +329,36 @@ function init(){
         }
     });
     
+    $(".taskContainer").live("keyup", function(){
+        if($(".editContainer").size() > 1){            
+            var prev = $(".editContainer:first"),
+            prevBottom = prev.position().top + prev.height(),
+            prevLeft = prev.position().left;
+            recursionCall(prevBottom, prevLeft, prev.next());
+        }
+    })
+    
+    function recursionCall(prevBottom, prevLeft, curr){
+        var curTop = curr.position().top,
+        curHeight = curr.height(),
+        curLeft = curr.position().left;
+        if(prevLeft == curLeft){
+            if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
+                curr.css("top", prevBottom + 15 + "px");                        
+            else
+                curr.css("top", "60px").css("left", prevLeft + 255 + "px");            
+        } else {
+            if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
+                curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px");           
+            else
+                curr.css("top", "60px");            
+        }
+        prevBottom = curr.position().top + curr.height(),
+        prevLeft = curr.position().left;
+        if(curr.next().length)
+            recursionCall(prevBottom, prevLeft, curr.next());
+    }     
+    
     //$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height());
     popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
     popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
@@ -347,7 +371,7 @@ function init(){
     
     if (window.widget) {
         window.widget.onleave = function(){
-            //exportToSankore();
+            exportToSankore();
             sankore.setPreference("by_style", $(".style_select").find("option:selected").val());
         }
     }
@@ -397,7 +421,8 @@ function init(){
                 });
             }              
         }
-        sankore.setPreference("blackYellowData", JSON.stringify(arrayToExport));
+        if(window.sankore)
+            sankore.setPreference("blackYellowData", JSON.stringify(arrayToExport));
     }
 }
 
@@ -412,18 +437,70 @@ function checkEmptyFields(field){
     }
 }
 
+//reload
+function reloadItems(){
+    if($("#wgt_edit").hasClass("selected"))
+        $("#wgt_display").trigger("click");
+    else{
+        var tmp_array = [];
+        $(".readyTask").each(function(){
+            tmp_array.push($(this));
+        });
+        tmp_array = shuffle(tmp_array);
+        orderItems(tmp_array);
+    }    
+        
+}
+
+//order items
+function orderItems(items){
+    var bottom = 45,
+    lastItemLeft = 54; 
+    for (var i in items){
+        if((bottom + items[i].height()) < ($(window).height() - 54)){
+            items[i].css("top", bottom + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
+            bottom += items[i].height() + 15;
+        } else {
+            bottom = 60;
+            lastItemLeft += 255;
+            items[i].css("top", bottom + "px").css("left", lastItemLeft + "px").appendTo("#data");
+            bottom += items[i].height();
+        }
+    }        
+}
+
+//shuffles an array
+function shuffle( arr )
+{
+    var pos, tmp;	
+    for( var i = 0; i < arr.length; i++ )
+    {
+        pos = Math.round( Math.random() * ( arr.length - 1 ) );
+        tmp = arr[pos];
+        arr[pos] = arr[i];
+        arr[i] = tmp;
+    }
+    return arr;
+}
+
 //adding a new task to the page
 function addTask(expression, result){
     var lastItem = $(".editContainer:last"),
     lastItemPos = lastItem.length ? lastItem.position().top : 45,
-    lastItemHeight = lastItem.length ? lastItem.height() : 0;
-    var editContent = $("<div class='editContainer'>").width(240).height(70).css("top", lastItemPos + lastItemHeight + 15 + "px").appendTo("#data");
-    var closeItem = $("<div class='closeItem'>").appendTo(editContent);
-    var rightResize = $("<div class='rightResize'>").appendTo(editContent);
-    var bottomResize = $("<div class='bottomResize'>").appendTo(editContent);
+    lastItemHeight = lastItem.length ? lastItem.height() : 0,
+    lastItemLeft = lastItem.length ? lastItem.position().left : 54;
+    var bottom = lastItemPos + lastItemHeight + 85;
+    var editContent = $("<div class='editContainer'>");
+    $("<div class='closeItem'>").appendTo(editContent);
     var main = $("<div class='readyTask'>");
-    var exprContainer = $("<div class='taskContainer' style='color: yellow;' contenteditable='true'>" + expression + "</div>").appendTo(main);
-    var resContainer = $("<div class='taskContainer' style='color: black;' contenteditable='true'>"+ result + "</div>").appendTo(main);
+    $("<div class='taskContainer' style='color: yellow;' contenteditable='true'>" + expression + "</div>").appendTo(main);
+    $("<div class='taskContainer' style='color: black;' contenteditable='true'>"+ result + "</div>").appendTo(main);
+    if(bottom < ($(window).height() - 54)){
+        editContent.css("top", lastItemPos + lastItemHeight + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
+    } else {
+        lastItemPos = 45;
+        editContent.css("top", lastItemPos + 15 + "px").css("left", lastItemLeft + 255 + "px").appendTo("#data");
+    }    
     main.appendTo(editContent);
 }
 
diff --git a/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js b/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js
index ab7ad61a8bc3144caa407d8006a17dfefa5f24d2..fce0a9af5cbbb47d0875708b53a55f1554465bda 100644
--- a/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js
+++ b/resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js
@@ -88,9 +88,12 @@ function init(){
     
     /* ------------- BUTTONS -------------*/
     
-    if(sankore.preference("by_style","")){
-        changeStyle(sankore.preference("by_style",""));
-        $(".style_select").val(sankore.preference("by_style",""));
+    if(window.sankore){
+        if(sankore.preference("by_style","")){
+            changeStyle(sankore.preference("by_style",""));
+            $(".style_select").val(sankore.preference("by_style",""));
+        } else
+            changeStyle("3")
     } else
         changeStyle("3")
 
@@ -106,7 +109,7 @@ function init(){
                 mode = false;
                 $(".leftDiv, .rightDiv").animate({
                     "opacity":"1"
-                },"slow",function(){
+                },"fast",function(){
                     if(opacityChanged){
                         if($(".editContainer").size() != 0){
                             $(".editContainer").each(function(index, domElem){
@@ -139,14 +142,17 @@ function init(){
                 $(document).enableTextSelect(); 
                 $(".leftDiv, .rightDiv").animate({
                     "opacity":"0.4"
-                },"slow",function(){
+                },"fast",function(){
                     if(!opacityChanged){
                         if($(".readyTask").size() != 0){
+                            var tmp_arr = [];
+                            $(".readyTask").each(function(){
+                                tmp_arr.push($(this));
+                            })
+                            orderItems(tmp_arr);
                             $(".readyTask").each(function(index, domElem){     
                                 var editContent = $("<div class='editContainer'>").width($(domElem).width() + 10).height($(domElem) + 10).appendTo("#data");
                                 var closeItem = $("<div class='closeItem'>").appendTo(editContent);
-                                var rightResize = $("<div class='rightResize'>").appendTo(editContent);
-                                var bottomResize = $("<div class='bottomResize'>").appendTo(editContent);
                                 editContent.css("top", $(domElem).position().top).css("left", $(domElem).position().left);
                                 $(domElem).css("position","static")
                                 .width("100%")
@@ -161,7 +167,7 @@ function init(){
             }
         }
     });
-    
+
     $("#wgt_help").click(function(){
         var tmp = $(this);
         if($(this).hasClass("open")){
@@ -178,7 +184,7 @@ function init(){
     });
 
     $("#wgt_reload").click(function(){
-        window.location.reload();
+        reloadItems();
     });
     
     $("#wgt_add").click(function(){
@@ -188,10 +194,9 @@ function init(){
                 $("#data").show();
             });
         }
-        shadowDiv.show()
+        shadowDiv.show();
         shadowOver = true;
-        popupBack.show("slow");            
-
+        popupBack.show("slow");        
         $(document).disableTextSelect();
     });
     
@@ -241,7 +246,6 @@ function init(){
             shadowOver = false; 
             $(document).enableTextSelect();
         });        
-        
     });
     
     okButton.click(function(){
@@ -256,7 +260,6 @@ function init(){
                 $(document).enableTextSelect();
             })
         }
-        
     });
     
     /* -------------- THE END OF WORK WITH POPUP BUTTONS AND FIELDS ---------------*/    
@@ -271,42 +274,33 @@ function init(){
     });
                     
     $(".readyTask, .editContainer").live("mousedown",function(event){
-        if(!shadowOver){
-            dragElement = $(this);
-            coords.left = event.pageX - $(this).position().left;
-            coords.top = event.pageY - $(this).position().top;
-            resizeObj.width = $(this).width();
-            resizeObj.height = $(this).height();
-        }
-        if($("#wgt_display").hasClass("selected"))
+        if($("#wgt_display").hasClass("selected")){
+            if(!shadowOver){
+                dragElement = $(this);
+                coords.left = event.pageX - $(this).position().left;
+                coords.top = event.pageY - $(this).position().top;
+                resizeObj.width = $(this).width();
+                resizeObj.height = $(this).height();
+            }
             $(document).disableTextSelect();
-    });
-    
-    $(".rightResize").live("mousedown",function(event){
-        if(!shadowOver){
-            resizeObj.x = true;
-        }
-    });
-    
-    $(".bottomResize").live("mousedown",function(event){
-        if(!shadowOver){
-            resizeObj.y = true;
         }
     });
     
     $("body").mouseup(function(event){
-        if(!shadowOver){
-            if (dragElement) {
-                exportToSankore();
+        if($("#wgt_display").hasClass("selected")){
+            if(!shadowOver){
+                if (dragElement) {
+                    exportToSankore();
+                }
+                dragElement = null;
+                resizeObj.x = false;
+                resizeObj.y = false;
             }
-            dragElement = null;
-            resizeObj.x = false;
-            resizeObj.y = false;
         }
     });
     
     $("body").mousemove(function(event){
-        if(dragElement && !shadowOver){ 
+        if(dragElement && !shadowOver && $("#wgt_display").hasClass("selected")){ 
             var top = event.pageY - coords.top;
             var left = event.pageX - coords.left;
             var bottom = top + dragElement.height();
@@ -335,6 +329,36 @@ function init(){
         }
     });
     
+    $(".taskContainer").live("keyup", function(){
+        if($(".editContainer").size() > 1){            
+            var prev = $(".editContainer:first"),
+            prevBottom = prev.position().top + prev.height(),
+            prevLeft = prev.position().left;
+            recursionCall(prevBottom, prevLeft, prev.next());
+        }
+    })
+    
+    function recursionCall(prevBottom, prevLeft, curr){
+        var curTop = curr.position().top,
+        curHeight = curr.height(),
+        curLeft = curr.position().left;
+        if(prevLeft == curLeft){
+            if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
+                curr.css("top", prevBottom + 15 + "px");                        
+            else
+                curr.css("top", "60px").css("left", prevLeft + 255 + "px");            
+        } else {
+            if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
+                curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px");           
+            else
+                curr.css("top", "60px");            
+        }
+        prevBottom = curr.position().top + curr.height(),
+        prevLeft = curr.position().left;
+        if(curr.next().length)
+            recursionCall(prevBottom, prevLeft, curr.next());
+    }     
+    
     //$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height());
     popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
     popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
@@ -347,7 +371,7 @@ function init(){
     
     if (window.widget) {
         window.widget.onleave = function(){
-            //exportToSankore();
+            exportToSankore();
             sankore.setPreference("by_style", $(".style_select").find("option:selected").val());
         }
     }
@@ -397,7 +421,8 @@ function init(){
                 });
             }              
         }
-        sankore.setPreference("blackYellowData", JSON.stringify(arrayToExport));
+        if(window.sankore)
+            sankore.setPreference("blackYellowData", JSON.stringify(arrayToExport));
     }
 }
 
@@ -412,18 +437,70 @@ function checkEmptyFields(field){
     }
 }
 
+//reload
+function reloadItems(){
+    if($("#wgt_edit").hasClass("selected"))
+        $("#wgt_display").trigger("click");
+    else{
+        var tmp_array = [];
+        $(".readyTask").each(function(){
+            tmp_array.push($(this));
+        });
+        tmp_array = shuffle(tmp_array);
+        orderItems(tmp_array);
+    }    
+        
+}
+
+//order items
+function orderItems(items){
+    var bottom = 45,
+    lastItemLeft = 54; 
+    for (var i in items){
+        if((bottom + items[i].height()) < ($(window).height() - 54)){
+            items[i].css("top", bottom + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
+            bottom += items[i].height() + 15;
+        } else {
+            bottom = 60;
+            lastItemLeft += 255;
+            items[i].css("top", bottom + "px").css("left", lastItemLeft + "px").appendTo("#data");
+            bottom += items[i].height();
+        }
+    }        
+}
+
+//shuffles an array
+function shuffle( arr )
+{
+    var pos, tmp;	
+    for( var i = 0; i < arr.length; i++ )
+    {
+        pos = Math.round( Math.random() * ( arr.length - 1 ) );
+        tmp = arr[pos];
+        arr[pos] = arr[i];
+        arr[i] = tmp;
+    }
+    return arr;
+}
+
 //adding a new task to the page
 function addTask(expression, result){
     var lastItem = $(".editContainer:last"),
     lastItemPos = lastItem.length ? lastItem.position().top : 45,
-    lastItemHeight = lastItem.length ? lastItem.height() : 0;
-    var editContent = $("<div class='editContainer'>").width(240).height(70).css("top", lastItemPos + lastItemHeight + 15 + "px").appendTo("#data");
-    var closeItem = $("<div class='closeItem'>").appendTo(editContent);
-    var rightResize = $("<div class='rightResize'>").appendTo(editContent);
-    var bottomResize = $("<div class='bottomResize'>").appendTo(editContent);
+    lastItemHeight = lastItem.length ? lastItem.height() : 0,
+    lastItemLeft = lastItem.length ? lastItem.position().left : 54;
+    var bottom = lastItemPos + lastItemHeight + 85;
+    var editContent = $("<div class='editContainer'>");
+    $("<div class='closeItem'>").appendTo(editContent);
     var main = $("<div class='readyTask'>");
-    var exprContainer = $("<div class='taskContainer' style='color: yellow;' contenteditable='true'>" + expression + "</div>").appendTo(main);
-    var resContainer = $("<div class='taskContainer' style='color: black;' contenteditable='true'>"+ result + "</div>").appendTo(main);
+    $("<div class='taskContainer' style='color: yellow;' contenteditable='true'>" + expression + "</div>").appendTo(main);
+    $("<div class='taskContainer' style='color: black;' contenteditable='true'>"+ result + "</div>").appendTo(main);
+    if(bottom < ($(window).height() - 54)){
+        editContent.css("top", lastItemPos + lastItemHeight + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
+    } else {
+        lastItemPos = 45;
+        editContent.css("top", lastItemPos + 15 + "px").css("left", lastItemLeft + 255 + "px").appendTo("#data");
+    }    
     main.appendTo(editContent);
 }
 
diff --git a/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js b/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js
index 33687d4d99599d0f1250b9b851245f8b5d878875..27035aaf9c0d8c06e051e60f8090a5e1042f3459 100644
--- a/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js
+++ b/resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js
@@ -109,7 +109,7 @@ function init(){
                 mode = false;
                 $(".leftDiv, .rightDiv").animate({
                     "opacity":"1"
-                },"slow",function(){
+                },"fast",function(){
                     if(opacityChanged){
                         if($(".editContainer").size() != 0){
                             $(".editContainer").each(function(index, domElem){
@@ -142,14 +142,17 @@ function init(){
                 $(document).enableTextSelect(); 
                 $(".leftDiv, .rightDiv").animate({
                     "opacity":"0.4"
-                },"slow",function(){
+                },"fast",function(){
                     if(!opacityChanged){
                         if($(".readyTask").size() != 0){
+                            var tmp_arr = [];
+                            $(".readyTask").each(function(){
+                                tmp_arr.push($(this));
+                            })
+                            orderItems(tmp_arr);
                             $(".readyTask").each(function(index, domElem){     
                                 var editContent = $("<div class='editContainer'>").width($(domElem).width() + 10).height($(domElem) + 10).appendTo("#data");
                                 var closeItem = $("<div class='closeItem'>").appendTo(editContent);
-                                var rightResize = $("<div class='rightResize'>").appendTo(editContent);
-                                var bottomResize = $("<div class='bottomResize'>").appendTo(editContent);
                                 editContent.css("top", $(domElem).position().top).css("left", $(domElem).position().left);
                                 $(domElem).css("position","static")
                                 .width("100%")
@@ -181,7 +184,7 @@ function init(){
     });
 
     $("#wgt_reload").click(function(){
-        window.location.reload();
+        reloadItems();
     });
     
     $("#wgt_add").click(function(){
@@ -271,42 +274,33 @@ function init(){
     });
                     
     $(".readyTask, .editContainer").live("mousedown",function(event){
-        if(!shadowOver){
-            dragElement = $(this);
-            coords.left = event.pageX - $(this).position().left;
-            coords.top = event.pageY - $(this).position().top;
-            resizeObj.width = $(this).width();
-            resizeObj.height = $(this).height();
-        }
-        if($("#wgt_display").hasClass("selected"))
+        if($("#wgt_display").hasClass("selected")){
+            if(!shadowOver){
+                dragElement = $(this);
+                coords.left = event.pageX - $(this).position().left;
+                coords.top = event.pageY - $(this).position().top;
+                resizeObj.width = $(this).width();
+                resizeObj.height = $(this).height();
+            }
             $(document).disableTextSelect();
-    });
-    
-    $(".rightResize").live("mousedown",function(event){
-        if(!shadowOver){
-            resizeObj.x = true;
-        }
-    });
-    
-    $(".bottomResize").live("mousedown",function(event){
-        if(!shadowOver){
-            resizeObj.y = true;
         }
     });
     
     $("body").mouseup(function(event){
-        if(!shadowOver){
-            if (dragElement) {
-                exportToSankore();
+        if($("#wgt_display").hasClass("selected")){
+            if(!shadowOver){
+                if (dragElement) {
+                    exportToSankore();
+                }
+                dragElement = null;
+                resizeObj.x = false;
+                resizeObj.y = false;
             }
-            dragElement = null;
-            resizeObj.x = false;
-            resizeObj.y = false;
         }
     });
     
     $("body").mousemove(function(event){
-        if(dragElement && !shadowOver){ 
+        if(dragElement && !shadowOver && $("#wgt_display").hasClass("selected")){ 
             var top = event.pageY - coords.top;
             var left = event.pageX - coords.left;
             var bottom = top + dragElement.height();
@@ -335,6 +329,36 @@ function init(){
         }
     });
     
+    $(".taskContainer").live("keyup", function(){
+        if($(".editContainer").size() > 1){            
+            var prev = $(".editContainer:first"),
+            prevBottom = prev.position().top + prev.height(),
+            prevLeft = prev.position().left;
+            recursionCall(prevBottom, prevLeft, prev.next());
+        }
+    })
+    
+    function recursionCall(prevBottom, prevLeft, curr){
+        var curTop = curr.position().top,
+        curHeight = curr.height(),
+        curLeft = curr.position().left;
+        if(prevLeft == curLeft){
+            if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
+                curr.css("top", prevBottom + 15 + "px");                        
+            else
+                curr.css("top", "60px").css("left", prevLeft + 255 + "px");            
+        } else {
+            if((prevBottom + 15 + curHeight) < ($(window).height() - 54))
+                curr.css("top", prevBottom + 15 + "px").css("left", prevLeft + "px");           
+            else
+                curr.css("top", "60px");            
+        }
+        prevBottom = curr.position().top + curr.height(),
+        prevLeft = curr.position().left;
+        if(curr.next().length)
+            recursionCall(prevBottom, prevLeft, curr.next());
+    }     
+    
     //$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height());
     popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
     popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
@@ -347,7 +371,7 @@ function init(){
     
     if (window.widget) {
         window.widget.onleave = function(){
-            //exportToSankore();
+            exportToSankore();
             sankore.setPreference("by_style", $(".style_select").find("option:selected").val());
         }
     }
@@ -413,18 +437,70 @@ function checkEmptyFields(field){
     }
 }
 
+//reload
+function reloadItems(){
+    if($("#wgt_edit").hasClass("selected"))
+        $("#wgt_display").trigger("click");
+    else{
+        var tmp_array = [];
+        $(".readyTask").each(function(){
+            tmp_array.push($(this));
+        });
+        tmp_array = shuffle(tmp_array);
+        orderItems(tmp_array);
+    }    
+        
+}
+
+//order items
+function orderItems(items){
+    var bottom = 45,
+    lastItemLeft = 54; 
+    for (var i in items){
+        if((bottom + items[i].height()) < ($(window).height() - 54)){
+            items[i].css("top", bottom + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
+            bottom += items[i].height() + 15;
+        } else {
+            bottom = 60;
+            lastItemLeft += 255;
+            items[i].css("top", bottom + "px").css("left", lastItemLeft + "px").appendTo("#data");
+            bottom += items[i].height();
+        }
+    }        
+}
+
+//shuffles an array
+function shuffle( arr )
+{
+    var pos, tmp;	
+    for( var i = 0; i < arr.length; i++ )
+    {
+        pos = Math.round( Math.random() * ( arr.length - 1 ) );
+        tmp = arr[pos];
+        arr[pos] = arr[i];
+        arr[i] = tmp;
+    }
+    return arr;
+}
+
 //adding a new task to the page
 function addTask(expression, result){
     var lastItem = $(".editContainer:last"),
     lastItemPos = lastItem.length ? lastItem.position().top : 45,
-    lastItemHeight = lastItem.length ? lastItem.height() : 0;
-    var editContent = $("<div class='editContainer'>").width(240).height(70).css("top", lastItemPos + lastItemHeight + 15 + "px").appendTo("#data");
-    var closeItem = $("<div class='closeItem'>").appendTo(editContent);
-    var rightResize = $("<div class='rightResize'>").appendTo(editContent);
-    var bottomResize = $("<div class='bottomResize'>").appendTo(editContent);
+    lastItemHeight = lastItem.length ? lastItem.height() : 0,
+    lastItemLeft = lastItem.length ? lastItem.position().left : 54;
+    var bottom = lastItemPos + lastItemHeight + 85;
+    var editContent = $("<div class='editContainer'>");
+    $("<div class='closeItem'>").appendTo(editContent);
     var main = $("<div class='readyTask'>");
-    var exprContainer = $("<div class='taskContainer' style='color: yellow;' contenteditable='true'>" + expression + "</div>").appendTo(main);
-    var resContainer = $("<div class='taskContainer' style='color: black;' contenteditable='true'>"+ result + "</div>").appendTo(main);
+    $("<div class='taskContainer' style='color: yellow;' contenteditable='true'>" + expression + "</div>").appendTo(main);
+    $("<div class='taskContainer' style='color: black;' contenteditable='true'>"+ result + "</div>").appendTo(main);
+    if(bottom < ($(window).height() - 54)){
+        editContent.css("top", lastItemPos + lastItemHeight + 15 + "px").css("left", lastItemLeft + "px").appendTo("#data");
+    } else {
+        lastItemPos = 45;
+        editContent.css("top", lastItemPos + 15 + "px").css("left", lastItemLeft + 255 + "px").appendTo("#data");
+    }    
     main.appendTo(editContent);
 }
 
diff --git a/src/desktop/UBDesktopPalette.cpp b/src/desktop/UBDesktopPalette.cpp
index 2ac196f917cca816a5e2315f15947b0e5fa806e3..2b3902b21676b8033e4b1a6fc8a50e64ca3f0f57 100644
--- a/src/desktop/UBDesktopPalette.cpp
+++ b/src/desktop/UBDesktopPalette.cpp
@@ -57,9 +57,7 @@ UBDesktopPalette::UBDesktopPalette(QWidget *parent)
     mShowHideAction->setCheckable(true);
 
     connect(mShowHideAction, SIGNAL(triggered(bool)), this, SLOT(showHideClick(bool)));
-#ifndef Q_WS_X11
     actions << mShowHideAction;
-#endif
 
     setActions(actions);
     setButtonIconSize(QSize(42, 42));
diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp
index 962121a9ab340d6ed994578cea0abf1fa43d534a..e0cfcc33e7e0ba722b614226512f6c497d46fa1f 100644
--- a/src/domain/UBGraphicsItemDelegate.cpp
+++ b/src/domain/UBGraphicsItemDelegate.cpp
@@ -195,10 +195,10 @@ QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange ch
     if ((change == QGraphicsItem::ItemSelectedHasChanged
          || change == QGraphicsItem::ItemPositionHasChanged
          || change == QGraphicsItem::ItemTransformHasChanged)
-        && mDelegated->scene())
-        {
+            && mDelegated->scene()
+            && UBApplication::boardController)
+    {
         mAntiScaleRatio = 1 / (UBApplication::boardController->systemScaleFactor() * UBApplication::boardController->currentZoom());
-
         positionHandles();
     }
 
@@ -471,18 +471,18 @@ void UBGraphicsItemDelegate::lock(bool locked)
     mFrame->positionHandles();
 }
 
-
-void UBGraphicsItemDelegate::showHide(bool show)
+void UBGraphicsItemDelegate::showHideRecurs(const QVariant &pShow, QGraphicsItem *pItem)
 {
-    if (show)
-    {
-        mDelegated->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Object));
-    }
-    else
-    {
-        mDelegated->setData(UBGraphicsItemData::ItemLayerType, QVariant(UBItemLayerType::Control));
+    pItem->setData(UBGraphicsItemData::ItemLayerType, pShow);
+    foreach (QGraphicsItem *insideItem, pItem->childItems()) {
+        showHideRecurs(pShow, insideItem);
     }
+}
 
+void UBGraphicsItemDelegate::showHide(bool show)
+{
+    QVariant showFlag = QVariant(show ? UBItemLayerType::Object : UBItemLayerType::Control);
+    showHideRecurs(showFlag, mDelegated);
     mDelegated->update();
 
     emit showOnDisplayChanged(show);
diff --git a/src/domain/UBGraphicsItemDelegate.h b/src/domain/UBGraphicsItemDelegate.h
index fc5c460c9957bb6b092e521a6facab7220258e03..099dd06db12e5c1962cdcb9ca6dd6892a5f7d21b 100644
--- a/src/domain/UBGraphicsItemDelegate.h
+++ b/src/domain/UBGraphicsItemDelegate.h
@@ -297,6 +297,7 @@ protected slots:
 private:
         void updateFrame();
         void updateButtons(bool showUpdated = false);
+        inline void showHideRecurs(const QVariant &pShow, QGraphicsItem *pItem);
 
         QPointF mOffset;
         QTransform mPreviousTransform;
diff --git a/src/domain/UBGraphicsPolygonItem.cpp b/src/domain/UBGraphicsPolygonItem.cpp
index 256f8143b75165e57cacdd32becaf3331392ad9e..f00bf42b5da63a5cc7fe3bb4288b297bd9350827 100644
--- a/src/domain/UBGraphicsPolygonItem.cpp
+++ b/src/domain/UBGraphicsPolygonItem.cpp
@@ -154,7 +154,12 @@ UBItem* UBGraphicsPolygonItem::deepCopy() const
 
 UBGraphicsPolygonItem* UBGraphicsPolygonItem::deepCopy(const QPolygonF& pol) const
 {
-    UBGraphicsPolygonItem* copy = new UBGraphicsPolygonItem(pol);
+    QPolygonF p(pol);
+    if (parentItem()!=NULL)
+    {
+        p = mapToItem(parentItem(), p);
+    }
+    UBGraphicsPolygonItem* copy = new UBGraphicsPolygonItem(p, parentItem());
 
     copyItemParameters(copy);
 
diff --git a/src/domain/UBGraphicsPolygonItem.h b/src/domain/UBGraphicsPolygonItem.h
index 6ee1cc7e54f31574b352f890c7ae402763585078..1917e7318fb37b6102968b3fc1a60698cbe201f3 100644
--- a/src/domain/UBGraphicsPolygonItem.h
+++ b/src/domain/UBGraphicsPolygonItem.h
@@ -20,6 +20,7 @@
 #include "core/UB.h"
 #include "UBItem.h"
 #include "UBGraphicsStrokesGroup.h"
+#include "domain/UBGraphicsGroupContainerItem.h"
 
 class UBItem;
 class UBGraphicsScene;