
    $(function(){
      function wConsole(o, prop){
        if (!$("#consoleAct").is(':checked')) return;
        var p={};
        $.extend(p,prop);
        var txt = "<b>"+o.find(".n:first").html()+"::  </b>";
        for (var property in p)
        {
          var pr = p [property];
          txt+= "<br>" + property + " = " + pr ;
        }
        txt+="<br><hr>";
        $("#mb_console").append(txt);
      }

      //      $(".containerPlus").buildContainers({
      //        containment:"document",
      //        elementsPath:"elements/"
      //      });

      $(".containerPlus").buildContainers({
        containment:"document",
        elementsPath:"elements/",
        onResize:function(o){
          wConsole(o,{
            resized:true,
            width: o.outerWidth(),
            height: o.outerHeight()
          });
        },
        onClose:function(o){
          wConsole(o,{
            closed: o.mb_getState("closed")
          });
        },
        onCollapse:function(o){
          wConsole(o,{
            collapse: o.mb_getState("collapsed")
          });
        },
        onIconize:function(o){
          wConsole(o,{
            iconized: o.mb_getState("iconized")
          });
        },
        onDrag:function(o){
          wConsole(o,{
            top: o.offset().top,
            left: o.offset().left
          });
        }
      });
    });