diff --git a/Gruntfile.js b/Gruntfile.js
index 6667be562535dc3437ca277d4270d2b0acd6d474..bb0b8f5baaebeae8d1156156c49a1ae630abf152 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -33,7 +33,10 @@ module.exports = function (grunt) {
                 blank: 'app/design/frontend/Magento/blank',
                 luma: 'app/design/frontend/luma'
             },
-            doc: 'lib/web/css/docs'
+            doc: 'lib/web/css/docs',
+            uglify: {
+                legacy: 'lib/web/legacy-build.min.js'
+            }
         },
         doc: {
             styleName: 'docs'
@@ -110,7 +113,7 @@ module.exports = function (grunt) {
             },
             documentation: {
                 files: {
-                    '<%= config.path.doc %>/<%= config.doc.styleName %>.css': "<%= config.path.doc %>/source/<%= config.doc.styleName %>.less"
+                    '<%= config.path.doc %>/<%= config.doc.styleName %>.css': '<%= config.path.doc %>/source/<%= config.doc.styleName %>.less'
                 }
             }
         },
@@ -131,10 +134,34 @@ module.exports = function (grunt) {
                     '<%= config.path.doc %>': '<%= config.path.doc %>/source' // Todo UI: Check out JS for Styledocco
                 }
             }
-        }
+        },
 
+        uglify: {
+            legacy: {
+                files: {
+                    '<%= config.path.uglify.legacy %>': [
+                        'lib/web/prototype/window.js',
+                        'lib/web/scriptaculous/builder.js',
+                        'lib/web/scriptaculous/effects.js',
+                        'lib/web/lib/ccard.js',
+                        'lib/web/prototype/validation.js',
+                        'lib/web/varien/js.js',
+                        'lib/web/mage/adminhtml/varienLoader.js',
+                        'lib/web/mage/adminhtml/tools.js'
+                    ]
+                }
+            }
+        }
     });
 
+    /**
+     * Creates build of a legacy files.
+     * Mostly prototype dependant libraries.
+     */
+    grunt.registerTask('legacy-build', [
+        'uglify:legacy'
+    ]);
+
     // Default task
     // --------------------------------------
     grunt.registerTask('default', []); // ToDo UI: define default tasks
diff --git a/app/code/Magento/Backend/view/adminhtml/layout/default.xml b/app/code/Magento/Backend/view/adminhtml/layout/default.xml
index 5dc763555845c7153395bbb3a6dc3188867371e6..323133e5bdf9f0253892e3fa8ccdffbc1cba2559 100644
--- a/app/code/Magento/Backend/view/adminhtml/layout/default.xml
+++ b/app/code/Magento/Backend/view/adminhtml/layout/default.xml
@@ -8,20 +8,11 @@
     <head>
         <title>Magento Admin</title>
         <link src="prototype/prototype.js"/>
-        <link src="prototype/window.js"/>
-        <link src="scriptaculous/builder.js"/>
-        <link src="scriptaculous/effects.js"/>
-        <link src="lib/ccard.js"/>
-        <link src="prototype/validation.js"/>
-        <link src="varien/js.js"/>
-        <link src="mage/adminhtml/varienLoader.js"/>
-        <link src="mage/adminhtml/tools.js"/>
-        <link src="lib/ds-sleight.js" ie_condition="lt IE 7" defer="defer"/>
+        <link src="legacy-build.min.js"/>
         <css src="mage/calendar.css"/>
         <link src="requirejs/require.js"/>
         <link src="mage/requirejs/resolver.js"/>
         <link src="jquery/jquery.js"/>
-        <link src="mage/jquery-no-conflict.js"/>
         <css src="extjs/resources/css/ext-all.css"/>
         <css src="extjs/resources/css/ytheme-magento.css"/>
     </head>
diff --git a/app/code/Magento/Theme/view/adminhtml/requirejs-config.js b/app/code/Magento/Theme/view/adminhtml/requirejs-config.js
index 514168ccdeb1d5dd3f42e69c2bafe5cd4a15b800..1cb17466ccc47a6c453cc6ad6b9a5b243428354e 100644
--- a/app/code/Magento/Theme/view/adminhtml/requirejs-config.js
+++ b/app/code/Magento/Theme/view/adminhtml/requirejs-config.js
@@ -39,4 +39,8 @@ var config = {
     "paths": {
         "jquery/ui": "jquery/jquery-ui-1.9.2"
     }
-};
\ No newline at end of file
+};
+
+require(['jquery'], function(jQuery){
+    jQuery.noConflict();
+});
\ No newline at end of file
diff --git a/app/code/Magento/Theme/view/base/requirejs-config.js b/app/code/Magento/Theme/view/base/requirejs-config.js
index d9127c719be210cf5fc67fbd1eab4928960d5baf..cf73627b28cbfb1b72232038ed57364d0fc28d29 100644
--- a/app/code/Magento/Theme/view/base/requirejs-config.js
+++ b/app/code/Magento/Theme/view/base/requirejs-config.js
@@ -15,7 +15,6 @@ var config = {
         "mage/adminhtml/varienLoader": ["prototype"],
         "mage/captcha": ["prototype"],
         "mage/common": ["jquery"],
-        "mage/jquery-no-conflict": ["jquery"],
         "mage/requirejs/plugin/id-normalizer": ["jquery"],
         "mage/webapi": ["jquery"],
         "ko": {
diff --git a/app/code/Magento/User/view/adminhtml/templates/admin/forgotpassword.phtml b/app/code/Magento/User/view/adminhtml/templates/admin/forgotpassword.phtml
index cb2fd17c0c446a083ab9a8e774c23f1115b426aa..7d1825aa11deb3a1d8141f37834fe939726f19b9 100644
--- a/app/code/Magento/User/view/adminhtml/templates/admin/forgotpassword.phtml
+++ b/app/code/Magento/User/view/adminhtml/templates/admin/forgotpassword.phtml
@@ -25,7 +25,6 @@
 
     <script src="<?php echo $this->getViewFileUrl('requirejs/require.js') ?>"></script>
     <script src="<?php echo $this->getViewFileUrl('jquery/jquery.js') ?>"></script>
-    <script src="<?php echo $this->getViewFileUrl('mage/jquery-no-conflict.js') ?>"></script>
     <script src="<?php echo $this->getViewFileUrl('Magento_User::app-config.js') ?>"></script>
     <?php echo $this->getChildHtml('requirejs-config');?>
 
diff --git a/app/code/Magento/User/view/adminhtml/templates/admin/resetforgottenpassword.phtml b/app/code/Magento/User/view/adminhtml/templates/admin/resetforgottenpassword.phtml
index 6c8810ec7491860b2c6504e0ddefa459a01cc888..f7e67ddab5b3504c9fd5fcb93f12d794831005ec 100644
--- a/app/code/Magento/User/view/adminhtml/templates/admin/resetforgottenpassword.phtml
+++ b/app/code/Magento/User/view/adminhtml/templates/admin/resetforgottenpassword.phtml
@@ -24,7 +24,6 @@
 
     <script src="<?php echo $this->getViewFileUrl('requirejs/require.js') ?>"></script>
     <script src="<?php echo $this->getViewFileUrl('jquery/jquery.js') ?>"></script>
-    <script src="<?php echo $this->getViewFileUrl('mage/jquery-no-conflict.js') ?>"></script>
     <script src="<?php echo $this->getViewFileUrl('Magento_User::app-config.js') ?>"></script>
     <?php echo $this->getChildHtml('requirejs-config');?>
 
diff --git a/app/code/Magento/User/view/adminhtml/web/app-config.js b/app/code/Magento/User/view/adminhtml/web/app-config.js
index 08d5ebb79b51838c2e62c522718f5fcb7279fcdb..97d6d5326479c835a4304da1b6f45a3c1afbc6cb 100644
--- a/app/code/Magento/User/view/adminhtml/web/app-config.js
+++ b/app/code/Magento/User/view/adminhtml/web/app-config.js
@@ -14,7 +14,6 @@ require.config({
         "mage/adminhtml/varienLoader": ["prototype"],
         "mage/captcha": ["prototype"],
         "mage/common": ["jquery"],
-        "mage/jquery-no-conflict": ["jquery"],
         "mage/requirejs/plugin/id-normalizer": ["jquery"],
         "mage/webapi": ["jquery"],
         "ko": { exports: "ko" },
@@ -35,3 +34,7 @@ require.config({
         "ko": "ko/ko"
     }
 });
+
+require(['jquery'], function(jQuery){
+    jQuery.noConflict();
+});
diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt
index 33b5663b5752f3eb89c6994adcf3d97e9a6e9d39..4da60389a725c94dacd553e190a78ecd49b0054b 100644
--- a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt
+++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt
@@ -16,4 +16,3 @@ dev/tests/js/testsuite/mage/translate_inline_vde/translate-inline-vde-test.js
 dev/tests/js/framework/qunit
 lib/web/mage/adminhtml
 lib/web/mage/captcha.js
-lib/web/mage/jquery-no-conflict.js
diff --git a/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/_files/template_head.xml b/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/_files/template_head.xml
index dd5a32b78ed39efd2a11ec9f70c94b5739449d8a..472f9fcf873507879cfb53584299b794f173ce1b 100644
--- a/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/_files/template_head.xml
+++ b/dev/tests/unit/testsuite/Magento/Framework/View/Page/Config/_files/template_head.xml
@@ -9,7 +9,6 @@
         <title>Test title</title>
         <meta name="meta_name" content="meta_content"/>
         <css src="path/file.css" media="all" />
-        <link src="mage/jquery-no-conflict.js" ie_condition="lt IE 7" />
         <script src="path/file.js" defer="defer"/>
         <remove src="path/remove/file.css"/>
         <attribute name="head_attribute_name" value="head_attribute_value"/>
diff --git a/lib/web/dnd.js b/lib/web/dnd.js
deleted file mode 100644
index 1e1c5386cb0c8cc8d8c3bccf43d3caad95dc0401..0000000000000000000000000000000000000000
--- a/lib/web/dnd.js
+++ /dev/null
@@ -1,664 +0,0 @@
-// webkitdragdrop.js v1.0, Mon May 15 2010
-//
-// Copyright (c) 2010 Tommaso Buvoli (http://www.tommasobuvoli.com)
-// No Extra Libraries are required, simply download this file, add it to your pages!
-//
-// To See this library in action, grab an ipad and head over to http://www.gotproject.com
-// webkitdragdrop is freely distributable under the terms of an MIT-style license.
-
-
-//Description
-// Because this library was designed to run without requiring any other libraries, several basic helper functions were implemented
-// 6 helper functions in this webkit_tools class have been taked directly from Prototype 1.6.1 (http://prototypejs.org/) (c) 2005-2009 Sam Stephenson
-
-var webkit_tools =
-{
-    //$ function - simply a more robust getElementById
-
-    $:function(e)
-    {
-        if(typeof(e) == 'string')
-        {
-            return document.getElementById(e);
-        }
-        return e;
-    },
-
-    //extend function - copies the values of b into a (Shallow copy)
-
-    extend:function(a,b)
-    {
-        for (var key in b)
-        {
-            a[key] = b[key];
-        }
-        return a;
-    },
-
-    //empty function - used as defaut for events
-
-    empty:function()
-    {
-
-    },
-
-    //remove null values from an array
-
-    compact:function(a)
-    {
-        var b = []
-        var l = a.length;
-        for(var i = 0; i < l; i ++)
-        {
-            if(a[i] !== null)
-            {
-                b.push(a[i]);
-            }
-        }
-        return b;
-    },
-
-    //DESCRIPTION
-    //    This function was taken from the internet (http://robertnyman.com/2006/04/24/get-the-rendered-style-of-an-element/) and returns
-    //    the computed style of an element independently from the browser
-    //INPUT
-    //    oELM (DOM ELEMENT) element whose style should be extracted
-    //    strCssRule element
-
-    getCalculatedStyle:function(oElm, strCssRule)
-    {
-        var strValue = "";
-        if(document.defaultView && document.defaultView.getComputedStyle){
-            strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
-        }
-        else if(oElm.currentStyle){
-            strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
-                return p1.toUpperCase();
-            });
-            strValue = oElm.currentStyle[strCssRule];
-        }
-        return strValue;
-    },
-
-    //bindAsEventListener function - used to bind events
-
-    bindAsEventListener:function(f,object)
-    {
-        var __method = f;
-        return function(event) {
-            __method.call(object, event || window.event);
-        };
-    },
-
-    //cumulative offset - courtesy of Prototype (http://www.prototypejs.org)
-
-    cumulativeOffset:function(element)
-    {
-        var valueT = 0, valueL = 0;
-        do {
-          valueT += element.offsetTop  || 0;
-          valueL += element.offsetLeft || 0;
-          if (element.offsetParent == document.body)
-            if (element.style.position == 'absolute') break;
-
-          element = element.offsetParent;
-        } while (element);
-
-        return {left : valueL, top : valueT};
-      },
-
-      //getDimensions - courtesy of Prototype (http://www.prototypejs.org)
-
-    getDimensions: function(element)
-    {
-        var display = element.style.display;
-        if (display != 'none' && display != null) // Safari bug
-          return {width: element.offsetWidth, height: element.offsetHeight};
-
-        var els = element.style;
-        var originalVisibility = els.visibility;
-        var originalPosition = els.position;
-        var originalDisplay = els.display;
-        els.visibility = 'hidden';
-        if (originalPosition != 'fixed') // Switching fixed to absolute causes issues in Safari
-          els.position = 'absolute';
-        els.display = 'block';
-        var originalWidth = element.clientWidth;
-        var originalHeight = element.clientHeight;
-        els.display = originalDisplay;
-        els.position = originalPosition;
-        els.visibility = originalVisibility;
-        return {width: originalWidth, height: originalHeight};
-    },
-
-    //hasClassName - courtesy of Prototype (http://www.prototypejs.org)
-
-    hasClassName: function(element, className)
-    {
-        var elementClassName = element.className;
-        return (elementClassName.length > 0 && (elementClassName == className ||
-        new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
-      },
-
-    //addClassName - courtesy of Prototype (http://www.prototypejs.org)
-
-    addClassName: function(element, className)
-    {
-        if (!this.hasClassName(element, className))
-            element.className += (element.className ? ' ' : '') + className;
-        return element;
-    },
-
-    //removeClassName - courtesy of Prototype (http://www.prototypejs.org)
-
-    removeClassName: function(element, className)
-    {
-        element.className = this.strip(element.className.replace(new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' '));
-        return element;
-    },
-
-    //strip - courtesy of Prototype (http://www.prototypejs.org)
-
-    strip:function(s)
-    {
-        return s.replace(/^\s+/, '').replace(/\s+$/, '');
-    }
-
-}
-
-//Description
-// Droppable fire events when a draggable is dropped on them
-
-var webkit_droppables = function()
-{
-    this.initialize = function()
-    {
-        this.droppables = [];
-        this.droppableRegions = [];
-    }
-
-    this.add = function(root, instance_props)
-    {
-        root = webkit_tools.$(root);
-        var default_props = {accept : [], hoverClass : null, onDrop : webkit_tools.empty, onOver : webkit_tools.empty, onOut : webkit_tools.empty};
-        default_props = webkit_tools.extend(default_props, instance_props || {});
-        this.droppables.push({r : root, p : default_props});
-    }
-
-    this.remove = function(root)
-    {
-        root = webkit_tools.$(root);
-        var d = this.droppables;
-        var i = d.length;
-        while(i--)
-        {
-            if(d[i].r == root)
-            {
-                d[i] = null;
-                this.droppables = webkit_tools.compact(d);
-                return true;
-            }
-        }
-        return false;
-    }
-
-    //calculate position and size of all droppables
-
-    this.prepare = function()
-    {
-        var d = this.droppables;
-        var i = d.length;
-        var dR = [];
-        var r = null;
-
-        while(i--)
-        {
-            r = d[i].r;
-            if(r.style.display != 'none')
-            {
-                dR.push({i : i, size : webkit_tools.getDimensions(r), offset : webkit_tools.cumulativeOffset(r)})
-            }
-        }
-
-        this.droppableRegions = dR;
-    }
-
-    this.finalize = function(x,y,r,e)
-    {
-        var indices = this.isOver(x,y);
-        var index = this.maxZIndex(indices);
-        var over = this.process(index,r);
-        if(over)
-        {
-            this.drop(index, r,e);
-        }
-        this.process(-1,r);
-        return over;
-    }
-
-    this.check = function(x,y,r,e)
-    {
-        var indices = this.isOver(x,y);
-        var index = this.maxZIndex(indices);
-        return this.process(index,r, e);
-    }
-
-    this.isOver = function(x, y)
-    {
-        var dR = this.droppableRegions;
-        var i = dR.length;
-        var active = [];
-        var r = 0;
-        var maxX = 0;
-        var minX = 0;
-        var maxY = 0;
-        var minY = 0;
-
-        while(i--)
-        {
-            r = dR[i];
-
-            minY = r.offset.top;
-            maxY = minY + r.size.height;
-
-            if((y > minY) && (y < maxY))
-            {
-                minX = r.offset.left;
-                maxX = minX + r.size.width;
-
-                if((x > minX) && (x < maxX))
-                {
-                    active.push(r.i);
-                }
-            }
-        }
-
-        return active;
-    }
-
-    this.maxZIndex = function(indices)
-    {
-        var d = this.droppables;
-        var l = indices.length;
-        var index = -1;
-
-        var maxZ = -100000000;
-        var curZ = 0;
-
-        while(l--)
-        {
-            curZ = parseInt(d[indices[l]].r.style.zIndex || 0);
-            if(curZ > maxZ)
-            {
-                maxZ = curZ;
-                index = indices[l];
-            }
-        }
-
-        return index;
-    }
-
-    this.process = function(index, draggableRoot, e)
-    {
-        //only perform update if a change has occurred
-        if(this.lastIndex != index)
-        {
-            //remove previous
-            if(this.lastIndex != null)
-            {
-                var d = this.droppables[this.lastIndex]
-                var p = d.p;
-                var r = d.r;
-
-                if(p.hoverClass)
-                {
-                    webkit_tools.removeClassName(r,p.hoverClass);
-                }
-                p.onOut(draggableRoot, e);
-                this.lastIndex = null;
-                this.lastOutput = false;
-            }
-
-            //add new
-            if(index != -1)
-            {
-                var d = this.droppables[index]
-                var p = d.p;
-                var r = d.r;
-
-                if(this.hasClassNames(draggableRoot, p.accept))
-                {
-                    if(p.hoverClass)
-                    {
-                        webkit_tools.addClassName(r,p.hoverClass);
-                    }
-                    p.onOver(draggableRoot, e);
-                    this.lastIndex = index;
-                    this.lastOutput = true;
-                }
-            }
-        }
-        return this.lastOutput;
-    }
-
-    this.drop = function(index, r, e)
-    {
-        if(index != -1)
-        {
-            this.droppables[index].p.onDrop(r,e);
-        }
-    }
-
-    this.hasClassNames = function(r, names)
-    {
-        var l = names.length;
-        if(l == 0){return true}
-        while(l--)
-        {
-            if(webkit_tools.hasClassName(r,names[l]))
-            {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    this.initialize();
-}
-
-webkit_drop = new webkit_droppables();
-
-//Description
-//webkit draggable - allows users to drag elements with their hands
-
-var webkit_draggable = function(r, ip)
-{
-    this.ready = false;
-    this.timeout = undefined;
-    this.initialize = function(root, instance_props)
-    {
-        this.root = webkit_tools.$(root);
-        var default_props = {scroll : false, revert : false, handle : this.root, zIndex : 1000, onStart : webkit_tools.empty, onEnd : webkit_tools.empty};
-
-        this.p = webkit_tools.extend(default_props, instance_props || {});
-        default_props.handle = webkit_tools.$(default_props.handle);
-        this.prepare();
-        this.bindEvents();
-    }
-
-    this.prepare = function()
-    {
-        var rs = this.root.style;
-
-        //set position
-        if(webkit_tools.getCalculatedStyle(this.root,'position') != 'absolute')
-        {
-            rs.position = 'relative';
-        }
-
-        //set top, right, bottom, left
-        rs.top = rs.top || '0px';
-        rs.left = rs.left || '0px';
-        rs.right = "";
-        rs.bottom = "";
-
-        //set zindex;
-        rs.zIndex = rs.zIndex || '0';
-    }
-
-    this.bindEvents = function()
-    {
-        var handle = this.p.handle;
-
-        this.ts = webkit_tools.bindAsEventListener(this.touchStart, this);
-        this.tm = webkit_tools.bindAsEventListener(this.touchMove, this);
-        this.te = webkit_tools.bindAsEventListener(this.touchEnd, this);
-
-        handle.addEventListener("touchstart", this.ts, false);
-        handle.addEventListener("touchmove", this.tm, false);
-        handle.addEventListener("touchend", this.te, false);
-    }
-
-    this.destroy = function()
-    {
-        var handle = this.p.handle;
-
-        handle.removeEventListener("touchstart", this.ts);
-        handle.removeEventListener("touchmove", this.tm);
-        handle.removeEventListener("touchend", this.te);
-    }
-
-    this.set = function(key, value)
-    {
-        this.p[key] = value;
-    }
-
-    this.touchStart = function(event)
-    {
-        this.timeout = setTimeout(function () {
-            //prepare needed variables
-            var p = this.p;
-            var r = this.root;
-            var rs = r.style;
-            var t = event.targetTouches[0];
-
-            //get position of touch
-            touchX = t.pageX;
-            touchY = t.pageY;
-
-            //set base values for position of root
-            rs.top = this.root.style.top || '0px';
-            rs.left = this.root.style.left || '0px';
-            rs.bottom = null;
-            rs.right = null;
-
-            var rootP = webkit_tools.cumulativeOffset(r);
-            var cp = this.getPosition();
-
-            //save event properties
-            p.rx = cp.x;
-            p.ry = cp.y;
-            p.tx = touchX;
-            p.ty = touchY;
-            p.z = parseInt(this.root.style.zIndex);
-
-            //boost zIndex
-            rs.zIndex = p.zIndex;
-            webkit_drop.prepare();
-            p.onStart(r, event);
-            
-            this.ready = true;
-            
-        }.bind(this), 500);
-    }
-
-    this.touchMove = function(event)
-    {
-        if ( this.ready ) {
-            event.preventDefault();
-            event.stopPropagation();
-
-            //prepare needed variables
-            var p = this.p;
-            var r = this.root;
-            var rs = r.style;
-            var t = event.targetTouches[0];
-            if(t == null){return}
-
-            var curX = t.pageX;
-            var curY = t.pageY;
-
-            var delX = curX - p.tx;
-            var delY = curY - p.ty;
-
-            rs.webkitTransform = 'translate3d(' + (p.rx + delX) + 'px,' + (p.ry + delY) + 'px, 1px)';
-
-            //scroll window
-            if(p.scroll)
-            {
-                s = this.getScroll(curX, curY);
-                if((s[0] != 0) || (s[1] != 0))
-                {
-                    window.scrollTo(window.scrollX + s[0], window.scrollY + s[1]);
-                }
-            }
-
-            //check droppables
-            webkit_drop.check(curX, curY, r, event);
-
-            //save position for touchEnd
-            this.lastCurX = curX;
-            this.lastCurY = curY;
-        }
-    }
-
-    this.touchEnd = function(event)
-    {
-        clearTimeout(this.timeout);
-        if ( this.ready ) {
-            event.preventSwipe = true;
-            var r = this.root;
-            var p = this.p;
-            var dropped = webkit_drop.finalize(this.lastCurX, this.lastCurY, r, event);
-
-            if(((p.revert) && (!dropped)) || (p.revert === 'always'))
-            {
-                //revert root
-                var rs = r.style;
-                rs.webkitTransform = 'translate3d(' + p.rx + 'px,' + p.ry + 'px, 1px)';
-                //rs.top = (p.ry + 'px');
-                //rs.left = (p.rx + 'px');
-            }
-
-            r.style.zIndex = this.p.z;
-            this.p.onEnd(r, event);
-            this.ready = false;
-        }
-    }
-
-    this.getPosition = function()
-    {
-        var rs = this.root.style;
-        return {x : parseInt(rs.left || 0), y : parseInt(rs.top  || 0)}
-    }
-
-    this.getScroll = function(pX, pY)
-    {
-        //read window variables
-        var sX = window.scrollX;
-        var sY = window.scrollY;
-
-        var wX = window.innerWidth;
-        var wY = window.innerHeight;
-
-        //set contants
-        var scroll_amount = 10; //how many pixels to scroll
-        var scroll_sensitivity = 100; //how many pixels from border to start scrolling from.
-
-        var delX = 0;
-        var delY = 0;
-
-        //process vertical y scroll
-        if(pY - sY < scroll_sensitivity)
-        {
-            delY = -scroll_amount;
-        }
-        else
-        if((sY + wY) - pY < scroll_sensitivity)
-        {
-            delY = scroll_amount;
-        }
-
-        //process horizontal x scroll
-        if(pX - sX < scroll_sensitivity)
-        {
-            delX = -scroll_amount;
-        }
-        else
-        if((sX + wX) - pX < scroll_sensitivity)
-        {
-            delX = scroll_amount;
-        }
-
-        return [delX, delY]
-    }
-
-    //contructor
-    this.initialize(r, ip);
-}
-
-//Description
-//webkit_click class. manages click events for draggables
-
-var webkit_click = function(r, ip)
-{
-    this.initialize = function(root, instance_props)
-    {
-        var default_props = {onClick : webkit_tools.empty};
-
-        this.root = webkit_tools.$(root);
-        this.p = webkit_tools.extend(default_props, instance_props || {});
-        this.bindEvents();
-    }
-
-    this.bindEvents = function()
-    {
-        var root = this.root;
-
-        //bind events to local scope
-        this.ts = webkit_tools.bindAsEventListener(this.touchStart,this);
-        this.tm = webkit_tools.bindAsEventListener(this.touchMove,this);
-        this.te = webkit_tools.bindAsEventListener(this.touchEnd,this);
-
-        //add Listeners
-        root.addEventListener("touchstart", this.ts, false);
-        root.addEventListener("touchmove", this.tm, false);
-        root.addEventListener("touchend", this.te, false);
-
-        this.bound = true;
-    }
-
-    this.touchStart = function()
-    {
-        this.moved = false;
-        if(this.bound == false)
-        {
-            this.root.addEventListener("touchmove", this.tm, false);
-            this.bound = true;
-        }
-    }
-
-    this.touchMove = function()
-    {
-        this.moved = true;
-        this.root.removeEventListener("touchmove", this.tm);
-        this.bound = false;
-    }
-
-    this.touchEnd = function()
-    {e.preventSwipe = true;
-        if(this.moved == false)
-        {
-            this.p.onClick();
-        }
-    }
-
-    this.setEvent = function(f)
-    {
-        if(typeof(f) == 'function')
-        {
-            this.p.onClick = f;
-        }
-    }
-
-    this.unbind = function()
-    {
-        var root = this.root;
-        root.removeEventListener("touchstart", this.ts);
-        root.removeEventListener("touchmove", this.tm);
-        root.removeEventListener("touchend", this.te);
-    }
-
-    //call constructor
-    this.initialize(r, ip);
-}
\ No newline at end of file
diff --git a/lib/web/legacy-build.min.js b/lib/web/legacy-build.min.js
new file mode 100644
index 0000000000000000000000000000000000000000..7c49cad038f11267d16773765380f5248eb82f35
--- /dev/null
+++ b/lib/web/legacy-build.min.js
@@ -0,0 +1,4 @@
+function validateCreditCard(b){var d="0123456789",e="";for(i=0;i<b.length;i++)x=b.charAt(i),-1!=d.indexOf(x,0)&&(e+=x);for(j=e.length/2,k=Math.floor(j),m=Math.ceil(j)-k,c=0,i=0;i<k;i++)a=2*e.charAt(2*i+m),c+=a>9?Math.floor(a/10+a%10):a;for(i=0;i<k+m;i++)c+=1*e.charAt(2*i+1-m);return c%10==0}function removeDelimiters(a){return a=a.replace(/\s/g,""),a=a.replace(/\-/g,"")}function parseNumber(a){if("string"!=typeof a)return parseFloat(a);var b=a.indexOf("."),c=a.indexOf(",");return-1!=b&&-1!=c?a=c>b?a.replace(".","").replace(",","."):a.replace(",",""):-1!=c&&(a=a.replace(",",".")),parseFloat(a)}function popWin(a,b,c){var b=window.open(a,b,c);b.focus()}function setLocation(a){window.location.href=a}function setPLocation(a,b){b&&window.opener.focus(),window.opener.location.href=a}function setLanguageCode(a,b){var c,d=window.location.href,e="";if((c=d.match(/\#(.*)$/))&&(d=d.replace(/\#(.*)$/,""),e=c[0]),d.match(/[?]/)){var f=/([?&]store=)[a-z0-9_]*/;d.match(f)?d=d.replace(f,"$1"+a):d+="&store="+a;var f=/([?&]from_store=)[a-z0-9_]*/;d.match(f)&&(d=d.replace(f,""))}else d+="?store="+a;"undefined"!=typeof b&&(d+="&from_store="+b),d+=e,setLocation(d)}function decorateGeneric(a,b){var c=["odd","even","first","last"],d={},e=a.length;if(e){if("undefined"==typeof b&&(b=c),!b.length)return;for(var f in c)d[c[f]]=!1;for(var f in b)d[b[f]]=!0;d.first&&Element.addClassName(a[0],"first"),d.last&&Element.addClassName(a[e-1],"last");for(var g=0;e>g;g++)(g+1)%2==0?d.even&&Element.addClassName(a[g],"even"):d.odd&&Element.addClassName(a[g],"odd")}}function decorateTable(a,b){var a=$(a);if(a){var c={tbody:!1,"tbody tr":["odd","even","first","last"],"thead tr":["first","last"],"tfoot tr":["first","last"],"tr td":["last"]};if("undefined"!=typeof b)for(var d in b)c[d]=b[d];if(c.tbody&&decorateGeneric(a.select("tbody"),c.tbody),c["tbody tr"]&&decorateGeneric(a.select("tbody tr"),c["tbody tr"]),c["thead tr"]&&decorateGeneric(a.select("thead tr"),c["thead tr"]),c["tfoot tr"]&&decorateGeneric(a.select("tfoot tr"),c["tfoot tr"]),c["tr td"]){var e=a.select("tr");if(e.length)for(var f=0;f<e.length;f++)decorateGeneric(e[f].getElementsByTagName("TD"),c["tr td"])}}}function decorateList(a,b){if($(a)){if("undefined"==typeof b)var c=$(a).select("li");else var c=$(a).childElements();decorateGeneric(c,["odd","even","last"])}}function decorateDataList(a){a=$(a),a&&(decorateGeneric(a.select("dt"),["odd","even","last"]),decorateGeneric(a.select("dd"),["odd","even","last"]))}function parseSidUrl(a,b){var c=a.indexOf("/?SID="),d="";return b=void 0!=b?b:"",c>-1&&(d="?"+a.substring(c+2),a=a.substring(0,c+1)),a+b+d}function formatCurrency(a,b,c){var d=isNaN(b.precision=Math.abs(b.precision))?2:b.precision,e=isNaN(b.requiredPrecision=Math.abs(b.requiredPrecision))?2:b.requiredPrecision;d=e;var f=isNaN(b.integerRequired=Math.abs(b.integerRequired))?1:b.integerRequired,g=void 0==b.decimalSymbol?",":b.decimalSymbol,h=void 0==b.groupSymbol?".":b.groupSymbol,i=void 0==b.groupLength?3:b.groupLength,k="";void 0==c||1==c?k=0>a?"-":c?"+":"":0==c&&(k="");for(var l=parseInt(a=Math.abs(+a||0).toFixed(d))+"",m=l.length<f?f-l.length:0;m;)l="0"+l,m--;j=(j=l.length)>i?j%i:0,re=new RegExp("(\\d{"+i+"})(?=\\d)","g");var n=(j?l.substr(0,j)+h:"")+l.substr(j).replace(re,"$1"+h)+(d?g+Math.abs(a-l).toFixed(d).replace(/-/,0).slice(2):""),o="";return o=-1==b.pattern.indexOf("{sign}")?k+b.pattern:b.pattern.replace("{sign}",k),o.replace("%s",n).replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function expandDetails(a,b){Element.hasClassName(a,"show-details")?($$(b).each(function(a){a.hide()}),Element.removeClassName(a,"show-details")):($$(b).each(function(a){a.show()}),Element.addClassName(a,"show-details"))}function fireEvent(a,b){if(document.createEvent){var c=document.createEvent("HTMLEvents");return c.initEvent(b,!0,!0),a.dispatchEvent(c)}var c=document.createEventObject();return a.fireEvent("on"+b,c)}function modulo(a,b){var c=b/1e4,d=a%b;return(Math.abs(d-b)<c||Math.abs(d)<c)&&(d=0),d}function setLoaderPosition(){var a=$("loading_mask_loader");if(a&&Prototype.Browser.IE){var b=a.getDimensions(),c=document.viewport.getDimensions(),d=document.viewport.getScrollOffsets();a.style.left=Math.floor(c.width/2+d.left-b.width/2)+"px",a.style.top=Math.floor(c.height/2+d.top-b.height/2)+"px",a.style.position="absolute"}}function toggleSelectsUnderBlock(a,b){if(Prototype.Browser.IE)for(var c=document.getElementsByTagName("select"),d=0;d<c.length;d++)b?c[d].needShowOnSuccess&&(c[d].needShowOnSuccess=!1,c[d].style.visibility=""):Element.visible(c[d])&&(c[d].style.visibility="hidden",c[d].needShowOnSuccess=!0)}function setLocation(a){window.location.href=a}function confirmSetLocation(a,b){return confirm(a)&&setLocation(b),!1}function deleteConfirm(a,b){confirmSetLocation(a,b)}function setElementDisable(a,b){$(a)&&($(a).disabled=b)}function toggleParentVis(a){a=$(a).parentNode,a.style.display="none"==a.style.display?"":"none"}function toggleFieldsetVis(a){id=a,a=$(a),a.style.display="none"==a.style.display?"":"none",a=a.parentNode.childElements();for(var b=0;b<a.length;b++)void 0!=a[b].id&&a[b].id==id&&"entry-edit-head"==a[b-1].classNames()&&(a[b-1].style.display="none"==a[b-1].style.display?"":"none")}function toggleVis(a){a=$(a),a.style.display="none"==a.style.display?"":"none"}function imagePreview(a){if($(a)){var b=window.open("","preview","width=400,height=400,resizable=1,scrollbars=1");b.document.open(),b.document.write('<body style="padding:0;margin:0"><img src="'+$(a).src+'" id="image_preview"/></body>'),b.document.close(),Event.observe(b,"load",function(){var a=b.document.getElementById("image_preview");b.resizeTo(a.width+40,a.height+80)})}}function checkByProductPriceType(a){return"price_type"==a.id?(this.productPriceType=a.value,!1):"price"==a.id&&0==this.productPriceType?!1:!0}function toggleSeveralValueElements(a,b,c,d){"use strict";b&&a&&("[object Array]"!=Object.prototype.toString.call(b)&&(b=[b]),b.each(function(b){toggleValueElements(a,b,c,d)}))}function toggleValueElements(a,b,c,d){if(b&&a){var e=[a];if("undefined"!=typeof c){"[object Array]"!=Object.prototype.toString.call(c)&&(c=[c]);for(var f=0;f<c.length;f++)e.push(c[f])}var g=Element.select(b,["select","input","textarea","button","img"]).filter(function(a){return"hidden"!=a.readAttribute("type")}),h=void 0!=d?d:a.checked;g.each(function(a){if(checkByProductPriceType(a)){for(var b=e.length;b--&&a!=e[b];);if(-1!=b)return;a.disabled=h,h?a.addClassName("disabled"):a.removeClassName("disabled"),"img"==a.nodeName.toLowerCase()&&(h?a.hide():a.show())}})}}function submitAndReloadArea(a,b){if($(a)){var c=$(a).select("input","select","textarea"),d=Form.serializeElements(c,!0);b+=b.match(new RegExp("\\?"))?"&isAjax=true":"?isAjax=true",new Ajax.Request(b,{parameters:$H(d),loaderArea:a,onSuccess:function(b){try{if(b.responseText.isJSON()){var c=b.responseText.evalJSON();c.error&&alert(c.message),c.ajaxExpired&&c.ajaxRedirect&&setLocation(c.ajaxRedirect)}else $(a).update(b.responseText)}catch(d){$(a).update(b.responseText)}}})}}function syncOnchangeValue(a,b){var c={baseElem:a,distElem:b};Event.observe(a,"change",function(){$(this.baseElem)&&$(this.distElem)&&($(this.distElem).value=$(this.baseElem).value)}.bind(c))}function updateElementAtCursor(a,b,c){if(void 0==c&&(c=window.self),document.selection)a.focus(),sel=c.document.selection.createRange(),sel.text=b;else if(a.selectionStart||"0"==a.selectionStart){var d=a.selectionStart,e=a.selectionEnd;a.value=a.value.substring(0,d)+b+a.value.substring(e,a.value.length)}else a.value+=b}function firebugEnabled(){return window.console&&window.console.firebug?!0:!1}function disableElement(a){a.disabled=!0,a.addClassName("disabled")}function enableElement(a){a.disabled=!1,a.removeClassName("disabled")}function disableElements(a){$$("."+a).each(disableElement)}function enableElements(a){$$("."+a).each(enableElement)}function sortNumeric(a,b){return a-b}var Window=Class.create();Window.keepMultiModalWindow=!1,Window.hasEffectLib="undefined"!=typeof Effect,Window.resizeEffectDuration=.4,Window.prototype={initialize:function(){var a,b=0;if(arguments.length>0&&("string"==typeof arguments[0]?(a=arguments[0],b=1):a=arguments[0]?arguments[0].id:null),a||(a="window_"+(new Date).getTime()),$(a)&&alert("Window "+a+" is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor"),this.options=Object.extend({className:"dialog",windowClassName:null,blurClassName:null,minWidth:100,minHeight:20,resizable:!0,closable:!0,minimizable:!0,maximizable:!0,draggable:!0,userData:null,showEffect:Window.hasEffectLib?Effect.Appear:Element.show,hideEffect:Window.hasEffectLib?Effect.Fade:Element.hide,showEffectOptions:{},hideEffectOptions:{},effectOptions:null,parent:document.body,title:"&nbsp;",url:null,onload:Prototype.emptyFunction,width:200,height:300,opacity:1,recenterAuto:!0,wiredDrag:!1,closeOnEsc:!0,closeCallback:null,destroyOnClose:!1,gridX:1,gridY:1},arguments[b]||{}),this.options.blurClassName&&(this.options.focusClassName=this.options.className),"undefined"==typeof this.options.top&&"undefined"==typeof this.options.bottom&&(this.options.top=this._round(500*Math.random(),this.options.gridY)),"undefined"==typeof this.options.left&&"undefined"==typeof this.options.right&&(this.options.left=this._round(500*Math.random(),this.options.gridX)),this.options.effectOptions&&(Object.extend(this.options.hideEffectOptions,this.options.effectOptions),Object.extend(this.options.showEffectOptions,this.options.effectOptions),this.options.showEffect==Element.Appear&&(this.options.showEffectOptions.to=this.options.opacity)),Window.hasEffectLib&&(this.options.showEffect==Effect.Appear&&(this.options.showEffectOptions.to=this.options.opacity),this.options.hideEffect==Effect.Fade&&(this.options.hideEffectOptions.from=this.options.opacity)),this.options.hideEffect==Element.hide&&(this.options.hideEffect=function(){Element.hide(this.element),this.options.destroyOnClose&&this.destroy()}.bind(this)),this.options.parent!=document.body&&(this.options.parent=$(this.options.parent)),this.element=this._createWindow(a),this.element.win=this,this.eventMouseDown=this._initDrag.bindAsEventListener(this),this.eventMouseUp=this._endDrag.bindAsEventListener(this),this.eventMouseMove=this._updateDrag.bindAsEventListener(this),this.eventOnLoad=this._getWindowBorderSize.bindAsEventListener(this),this.eventMouseDownContent=this.toFront.bindAsEventListener(this),this.eventResize=this._recenter.bindAsEventListener(this),this.eventKeyUp=this._keyUp.bindAsEventListener(this),this.topbar=$(this.element.id+"_top"),this.bottombar=$(this.element.id+"_bottom"),this.content=$(this.element.id+"_content"),Event.observe(this.topbar,"mousedown",this.eventMouseDown),Event.observe(this.bottombar,"mousedown",this.eventMouseDown),Event.observe(this.content,"mousedown",this.eventMouseDownContent),Event.observe(window,"load",this.eventOnLoad),Event.observe(window,"resize",this.eventResize),Event.observe(window,"scroll",this.eventResize),Event.observe(document,"keyup",this.eventKeyUp),Event.observe(this.options.parent,"scroll",this.eventResize),this.options.draggable){var c=this;[this.topbar,this.topbar.up().previous(),this.topbar.up().next()].each(function(a){a.observe("mousedown",c.eventMouseDown),a.addClassName("top_draggable")}),[this.bottombar.up(),this.bottombar.up().previous(),this.bottombar.up().next()].each(function(a){a.observe("mousedown",c.eventMouseDown),a.addClassName("bottom_draggable")})}this.options.resizable&&(this.sizer=$(this.element.id+"_sizer"),Event.observe(this.sizer,"mousedown",this.eventMouseDown)),this.useLeft=null,this.useTop=null,"undefined"!=typeof this.options.left?(this.element.setStyle({left:parseFloat(this.options.left)+"px"}),this.useLeft=!0):(this.element.setStyle({right:parseFloat(this.options.right)+"px"}),this.useLeft=!1),"undefined"!=typeof this.options.top?(this.element.setStyle({top:parseFloat(this.options.top)+"px"}),this.useTop=!0):(this.element.setStyle({bottom:parseFloat(this.options.bottom)+"px"}),this.useTop=!1),this.storedLocation=null,this.setOpacity(this.options.opacity),this.setZIndex(this.options.zIndex?this.options.zIndex:this.getMaxZIndex()),this.options.destroyOnClose&&this.setDestroyOnClose(!0),this._getWindowBorderSize(),this.width=this.options.width,this.height=this.options.height,this.visible=!1,this.constraint=!1,this.constraintPad={top:0,left:0,bottom:0,right:0},this.width&&this.height&&this.setSize(this.options.width,this.options.height),this.setTitle(this.options.title),Windows.register(this)},getMaxZIndex:function(){var a,b=0,c=document.body.childNodes;for(a=0;a<c.length;a++){var d=c[a],e=1==d.nodeType?parseInt(d.style.zIndex,10)||0:0;1e4>e&&(b=Math.max(b,e))}return b+10},destroy:function(){if(this._notify("onDestroy"),Event.stopObserving(this.topbar,"mousedown",this.eventMouseDown),Event.stopObserving(this.bottombar,"mousedown",this.eventMouseDown),Event.stopObserving(this.content,"mousedown",this.eventMouseDownContent),Event.stopObserving(window,"load",this.eventOnLoad),Event.stopObserving(window,"resize",this.eventResize),Event.stopObserving(window,"scroll",this.eventResize),Event.stopObserving(this.content,"load",this.options.onload),Event.stopObserving(document,"keyup",this.eventKeyUp),this._oldParent){for(var a=this.getContent(),b=null,c=0;c<a.childNodes.length&&(b=a.childNodes[c],1!=b.nodeType);c++)b=null;b&&this._oldParent.appendChild(b),this._oldParent=null}this.sizer&&Event.stopObserving(this.sizer,"mousedown",this.eventMouseDown),this.options.url&&(this.content.src=null),this.iefix&&Element.remove(this.iefix),Element.remove(this.element),Windows.unregister(this)},setCloseCallback:function(a){this.options.closeCallback=a},getContent:function(){return this.content},setContent:function(a,b,c){var d=$(a);if(null==d)throw"Unable to find element '"+a+"' in DOM";this._oldParent=d.parentNode;var e=null,f=null;b&&(e=Element.getDimensions(d)),c&&(f=Position.cumulativeOffset(d));var g=this.getContent();this.setHTMLContent(""),g=this.getContent(),g.appendChild(d),d.show(),b&&this.setSize(e.width,e.height),c&&this.setLocation(f[1]-this.heightN,f[0]-this.widthW)},setHTMLContent:function(a){if(this.options.url){this.content.src=null,this.options.url=null;var b='<div id="'+this.getId()+'_content" class="'+this.options.className+'_content"> </div>';$(this.getId()+"_table_content").innerHTML=b,this.content=$(this.element.id+"_content")}this.getContent().innerHTML=a},setAjaxContent:function(a,b,c,d){this.showFunction=c?"showCenter":"show",this.showModal=d||!1,b=b||{},this.setHTMLContent(""),this.onComplete=b.onComplete,this._onCompleteHandler||(this._onCompleteHandler=this._setAjaxContent.bind(this)),b.onComplete=this._onCompleteHandler,new Ajax.Request(a,b),b.onComplete=this.onComplete},_setAjaxContent:function(a){Element.update(this.getContent(),a.responseText),this.onComplete&&this.onComplete(a),this.onComplete=null,this[this.showFunction](this.showModal)},setURL:function(a){this.options.url&&(this.content.src=null),this.options.url=a;var b="<iframe frameborder='0' name='"+this.getId()+"_content'  id='"+this.getId()+"_content' src='"+a+"' width='"+this.width+"' height='"+this.height+"'> </iframe>";$(this.getId()+"_table_content").innerHTML=b,this.content=$(this.element.id+"_content")},getURL:function(){return this.options.url?this.options.url:null},refresh:function(){this.options.url&&($(this.element.getAttribute("id")+"_content").src=this.options.url)},setCookie:function(a,b,c,d,e){a=a||this.element.id,this.cookie=[a,b,c,d,e];var f=WindowUtilities.getCookie(a);if(f){var g=f.split(","),h=g[0].split(":"),i=g[1].split(":"),j=parseFloat(g[2]),k=parseFloat(g[3]),l=g[4],m=g[5];this.setSize(j,k),"true"==l?this.doMinimize=!0:"true"==m&&(this.doMaximize=!0),this.useLeft="l"==h[0],this.useTop="t"==i[0],this.element.setStyle(this.useLeft?{left:h[1]}:{right:h[1]}),this.element.setStyle(this.useTop?{top:i[1]}:{bottom:i[1]})}},getId:function(){return this.element.id},setDestroyOnClose:function(){this.options.destroyOnClose=!0},setConstraint:function(a,b){this.constraint=a,this.constraintPad=Object.extend(this.constraintPad,b||{}),this.useTop&&this.useLeft&&this.setLocation(parseFloat(this.element.style.top),parseFloat(this.element.style.left))},_initDrag:function(a){if(!(Event.element(a)==this.sizer&&this.isMinimized()||Event.element(a)!=this.sizer&&this.isMaximized())){if(Prototype.Browser.IE&&0==this.heightN&&this._getWindowBorderSize(),this.pointer=[this._round(Event.pointerX(a),this.options.gridX),this._round(Event.pointerY(a),this.options.gridY)],this.currentDrag=this.options.wiredDrag?this._createWiredElement():this.element,Event.element(a)==this.sizer)this.doResize=!0,this.widthOrg=this.width,this.heightOrg=this.height,this.bottomOrg=parseFloat(this.element.getStyle("bottom")),this.rightOrg=parseFloat(this.element.getStyle("right")),this._notify("onStartResize");else{this.doResize=!1;var b=$(this.getId()+"_close");if(b&&Position.within(b,this.pointer[0],this.pointer[1]))return void(this.currentDrag=null);if(this.toFront(),!this.options.draggable)return;this._notify("onStartMove")}Event.observe(document,"mouseup",this.eventMouseUp,!1),Event.observe(document,"mousemove",this.eventMouseMove,!1),WindowUtilities.disableScreen("__invisible__","__invisible__",this.overlayOpacity),document.body.ondrag=function(){return!1},document.body.onselectstart=function(){return!1},this.currentDrag.show(),Event.stop(a)}},_round:function(a,b){return 1==b?a:a=Math.floor(a/b)*b},_updateDrag:function(a){var b=[this._round(Event.pointerX(a),this.options.gridX),this._round(Event.pointerY(a),this.options.gridY)],c=b[0]-this.pointer[0],d=b[1]-this.pointer[1];if(this.doResize){var e=this.widthOrg+c,f=this.heightOrg+d;c=this.width-this.widthOrg,d=this.height-this.heightOrg,this.useLeft?e=this._updateWidthConstraint(e):this.currentDrag.setStyle({right:this.rightOrg-c+"px"}),this.useTop?f=this._updateHeightConstraint(f):this.currentDrag.setStyle({bottom:this.bottomOrg-d+"px"}),this.setSize(e,f),this._notify("onResize")}else{if(this.pointer=b,this.useLeft){var g=parseFloat(this.currentDrag.getStyle("left"))+c,h=this._updateLeftConstraint(g);this.pointer[0]+=h-g,this.currentDrag.setStyle({left:h+"px"})}else this.currentDrag.setStyle({right:parseFloat(this.currentDrag.getStyle("right"))-c+"px"});if(this.useTop){var i=parseFloat(this.currentDrag.getStyle("top"))+d,j=this._updateTopConstraint(i);this.pointer[1]+=j-i,this.currentDrag.setStyle({top:j+"px"})}else this.currentDrag.setStyle({bottom:parseFloat(this.currentDrag.getStyle("bottom"))-d+"px"});this._notify("onMove")}this.iefix&&this._fixIEOverlapping(),this._removeStoreLocation(),Event.stop(a)},_endDrag:function(a){WindowUtilities.enableScreen("__invisible__"),this._notify(this.doResize?"onEndResize":"onEndMove"),Event.stopObserving(document,"mouseup",this.eventMouseUp,!1),Event.stopObserving(document,"mousemove",this.eventMouseMove,!1),Event.stop(a),this._hideWiredElement(),this._saveCookie(),document.body.ondrag=null,document.body.onselectstart=null},_updateLeftConstraint:function(a){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width;a<this.constraintPad.left&&(a=this.constraintPad.left),a+this.width+this.widthE+this.widthW>b-this.constraintPad.right&&(a=b-this.constraintPad.right-this.width-this.widthE-this.widthW)}return a},_updateTopConstraint:function(a){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height,c=this.height+this.heightN+this.heightS;a<this.constraintPad.top&&(a=this.constraintPad.top),a+c>b-this.constraintPad.bottom&&(a=b-this.constraintPad.bottom-c)}return a},_updateWidthConstraint:function(a){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowWidth:this.options.parent.getDimensions().width,c=parseFloat(this.element.getStyle("left"));c+a+this.widthE+this.widthW>b-this.constraintPad.right&&(a=b-this.constraintPad.right-c-this.widthE-this.widthW)}return a},_updateHeightConstraint:function(a){if(this.constraint&&this.useLeft&&this.useTop){var b=this.options.parent==document.body?WindowUtilities.getPageSize().windowHeight:this.options.parent.getDimensions().height,c=parseFloat(this.element.getStyle("top"));c+a+this.heightN+this.heightS>b-this.constraintPad.bottom&&(a=b-this.constraintPad.bottom-c-this.heightN-this.heightS)}return a},_createWindow:function(a){var b=this.options.className,c=document.createElement("div");c.setAttribute("id",a),c.className="dialog",this.options.windowClassName&&(c.className+=" "+this.options.windowClassName);var d;d=this.options.url?'<iframe frameborder="0" name="'+a+'_content"  id="'+a+'_content" src="'+this.options.url+'"> </iframe>':'<div id="'+a+'_content" class="'+b+'_content"> </div>';var e=this.options.closable?"<div class='"+b+"_close' id='"+a+"_close' onclick='Windows.close(\""+a+"\", event)'> </div>":"",f=this.options.minimizable?"<div class='"+b+"_minimize' id='"+a+"_minimize' onclick='Windows.minimize(\""+a+"\", event)'> </div>":"",g=this.options.maximizable?"<div class='"+b+"_maximize' id='"+a+"_maximize' onclick='Windows.maximize(\""+a+"\", event)'> </div>":"",h=this.options.resizable?"class='"+b+"_sizer' id='"+a+"_sizer'":"class='"+b+"_se'";return c.innerHTML=e+f+g+"      <a href='#' id='"+a+"_focus_anchor'><!-- --></a>      <table id='"+a+"_row1' class=\"top table_window\">        <tr>          <td class='"+b+"_nw'></td>          <td class='"+b+"_n'><div id='"+a+"_top' class='"+b+"_title title_window'>"+this.options.title+"</div></td>          <td class='"+b+"_ne'></td>        </tr>      </table>      <table id='"+a+"_row2' class=\"mid table_window\">        <tr>          <td class='"+b+"_w'></td>            <td id='"+a+"_table_content' class='"+b+"_content' valign='top'>"+d+"</td>          <td class='"+b+"_e'></td>        </tr>      </table>        <table id='"+a+"_row3' class=\"bot table_window\">        <tr>          <td class='"+b+"_sw'></td>            <td class='"+b+"_s'><div id='"+a+"_bottom' class='status_bar'><span style='float:left; width:1px; height:1px'></span></div></td>            <td "+h+"></td>        </tr>      </table>    ",Element.hide(c),this.options.parent.insertBefore(c,this.options.parent.firstChild),Event.observe($(a+"_content"),"load",this.options.onload),c},changeClassName:function(a){var b=this.options.className,c=this.getId();$A(["_close","_minimize","_maximize","_sizer","_content"]).each(function(d){this._toggleClassName($(c+d),b+d,a+d)}.bind(this)),this._toggleClassName($(c+"_top"),b+"_title",a+"_title"),$$("#"+c+" td").each(function(c){c.className=c.className.sub(b,a)}),this.options.className=a},_toggleClassName:function(a,b,c){a&&(a.removeClassName(b),a.addClassName(c))},setLocation:function(a,b){a=this._updateTopConstraint(a),b=this._updateLeftConstraint(b);var c=this.currentDrag||this.element;c.setStyle({top:a+"px"}),c.setStyle({left:b+"px"}),this.useLeft=!0,this.useTop=!0},getLocation:function(){var a={};return a=this.useTop?Object.extend(a,{top:this.element.getStyle("top")}):Object.extend(a,{bottom:this.element.getStyle("bottom")}),a=this.useLeft?Object.extend(a,{left:this.element.getStyle("left")}):Object.extend(a,{right:this.element.getStyle("right")})},getSize:function(){return{width:this.width,height:this.height}},setSize:function(a,b,c){if(a=parseFloat(a),b=parseFloat(b),!this.minimized&&a<this.options.minWidth&&(a=this.options.minWidth),!this.minimized&&b<this.options.minHeight&&(b=this.options.minHeight),this.options.maxHeight&&b>this.options.maxHeight&&(b=this.options.maxHeight),this.options.maxWidth&&a>this.options.maxWidth&&(a=this.options.maxWidth),this.useTop&&this.useLeft&&Window.hasEffectLib&&Effect.ResizeWindow&&c)new Effect.ResizeWindow(this,null,null,a,b,{duration:Window.resizeEffectDuration});else{this.width=a,this.height=b;var d=this.currentDrag?this.currentDrag:this.element;if(d.setStyle({width:a+this.widthW+this.widthE+"px"}),d.setStyle({height:b+this.heightN+this.heightS+"px"}),!this.currentDrag||this.currentDrag==this.element){var e=$(this.element.id+"_content");e.setStyle({height:b+"px"}),e.setStyle({width:a+"px"})}}},updateHeight:function(){this.setSize(this.width,this.content.scrollHeight,!0)},updateWidth:function(){this.setSize(this.content.scrollWidth,this.height,!0)},toFront:function(){this.element.style.zIndex<Windows.maxZIndex&&this.setZIndex(Windows.maxZIndex+1),this.iefix&&this._fixIEOverlapping()},getBounds:function(a){this.width&&this.height&&this.visible||this.computeBounds();var b=this.width,c=this.height;a||(b+=this.widthW+this.widthE,c+=this.heightN+this.heightS);var d=Object.extend(this.getLocation(),{width:b+"px",height:c+"px"});return d},computeBounds:function(){if(!this.width||!this.height){var a=WindowUtilities._computeSize(this.content.innerHTML,this.content.id,this.width,this.height,0,this.options.className);this.height?this.width=a+5:this.height=a+5}this.setSize(this.width,this.height),this.centered&&this._center(this.centerTop,this.centerLeft)},show:function(a){if(this.visible=!0,a){if("undefined"==typeof this.overlayOpacity){var b=this;return void setTimeout(function(){b.show(a)},10)}Windows.addModalWindow(this),this.modal=!0,this.setZIndex(Windows.maxZIndex+1),Windows.unsetOverflow(this)}else this.element.style.zIndex||this.setZIndex(Windows.maxZIndex+1);this.oldStyle&&this.getContent().setStyle({overflow:this.oldStyle}),this.computeBounds(),this._notify("onBeforeShow"),this.options.showEffect!=Element.show&&this.options.showEffectOptions?this.options.showEffect(this.element,this.options.showEffectOptions):this.options.showEffect(this.element),this._checkIEOverlapping(),WindowUtilities.focusedWindow=this,this._notify("onShow"),$(this.element.id+"_focus_anchor").focus()},showCenter:function(a,b,c){this.centered=!0,this.centerTop=b,this.centerLeft=c,this.show(a)},isVisible:function(){return this.visible},_center:function(a,b){var c=WindowUtilities.getWindowScroll(this.options.parent),d=WindowUtilities.getPageSize(this.options.parent);"undefined"==typeof a&&(a=(d.windowHeight-(this.height+this.heightN+this.heightS))/2),a+=c.top,"undefined"==typeof b&&(b=(d.windowWidth-(this.width+this.widthW+this.widthE))/2),b+=c.left,this.setLocation(a,b),this.toFront()},_recenter:function(){if(this.centered){var a=WindowUtilities.getPageSize(this.options.parent),b=WindowUtilities.getWindowScroll(this.options.parent);if(this.pageSize&&this.pageSize.windowWidth==a.windowWidth&&this.pageSize.windowHeight==a.windowHeight&&this.windowScroll.left==b.left&&this.windowScroll.top==b.top)return;this.pageSize=a,this.windowScroll=b,$("overlay_modal")&&$("overlay_modal").setStyle({height:a.pageHeight+"px"}),this.options.recenterAuto&&this._center(this.centerTop,this.centerLeft)}},hide:function(){this.visible=!1,this.modal&&(Windows.removeModalWindow(this),Windows.resetOverflow()),this.oldStyle=this.getContent().getStyle("overflow")||"auto",this.getContent().setStyle({overflow:"hidden"}),this.options.hideEffect(this.element,this.options.hideEffectOptions),this.iefix&&this.iefix.hide(),this.doNotNotifyHide||this._notify("onHide")},close:function(){if(this.visible){if(this.options.closeCallback&&!this.options.closeCallback(this))return;if(this.options.destroyOnClose){var a=this.destroy.bind(this);if(this.options.hideEffectOptions.afterFinish){var b=this.options.hideEffectOptions.afterFinish;this.options.hideEffectOptions.afterFinish=function(){b(),a()}}else this.options.hideEffectOptions.afterFinish=function(){a()}}Windows.updateFocusedWindow(),this.doNotNotifyHide=!0,this.hide(),this.doNotNotifyHide=!1,this._notify("onClose")}},minimize:function(){if(!this.resizing){var a=$(this.getId()+"_row2");if(this.minimized){this.minimized=!1;var b=this.r2Height;if(this.r2Height=null,this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow)new Effect.ResizeWindow(this,null,null,null,this.height+b,{duration:Window.resizeEffectDuration});else{var c=this.element.getHeight()+b;this.height+=b,this.element.setStyle({height:c+"px"}),a.show()}if(!this.useTop){var d=parseFloat(this.element.getStyle("bottom"));this.element.setStyle({bottom:d-b+"px"})}this.toFront()}else{this.minimized=!0;var b=a.getDimensions().height;this.r2Height=b;var c=this.element.getHeight()-b;if(this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow?new Effect.ResizeWindow(this,null,null,null,this.height-b,{duration:Window.resizeEffectDuration}):(this.height-=b,this.element.setStyle({height:c+"px"}),a.hide()),!this.useTop){var d=parseFloat(this.element.getStyle("bottom"));this.element.setStyle({bottom:d+b+"px"})}}this._notify("onMinimize"),this._saveCookie()}},maximize:function(){if(!this.isMinimized()&&!this.resizing){if(Prototype.Browser.IE&&0==this.heightN&&this._getWindowBorderSize(),null!=this.storedLocation)this._restoreLocation(),this.iefix&&this.iefix.hide();else{this._storeLocation(),Windows.unsetOverflow(this);var a=WindowUtilities.getWindowScroll(this.options.parent),b=WindowUtilities.getPageSize(this.options.parent),c=a.left,d=a.top;if(this.options.parent!=document.body){a={top:0,left:0,bottom:0,right:0};var e=this.options.parent.getDimensions();b.windowWidth=e.width,b.windowHeight=e.height,d=0,c=0}this.constraint&&(b.windowWidth-=Math.max(0,this.constraintPad.left)+Math.max(0,this.constraintPad.right),b.windowHeight-=Math.max(0,this.constraintPad.top)+Math.max(0,this.constraintPad.bottom),c+=Math.max(0,this.constraintPad.left),d+=Math.max(0,this.constraintPad.top));var f=b.windowWidth-this.widthW-this.widthE,g=b.windowHeight-this.heightN-this.heightS;this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow?new Effect.ResizeWindow(this,d,c,f,g,{duration:Window.resizeEffectDuration}):(this.setSize(f,g),this.element.setStyle(this.useLeft?{left:c}:{right:c}),this.element.setStyle(this.useTop?{top:d}:{bottom:d})),this.toFront(),this.iefix&&this._fixIEOverlapping()}this._notify("onMaximize"),this._saveCookie()}},isMinimized:function(){return this.minimized},isMaximized:function(){return null!=this.storedLocation},setOpacity:function(a){Element.setOpacity&&Element.setOpacity(this.element,a)},setZIndex:function(a){this.element.setStyle({zIndex:a}),Windows.updateZindex(a,this)},setTitle:function(a){a&&""!=a||(a="&nbsp;"),Element.update(this.element.id+"_top",a)},getTitle:function(){return $(this.element.id+"_top").innerHTML},setStatusBar:function(a){$(this.getId()+"_bottom");"object"==typeof a?this.bottombar.firstChild?this.bottombar.replaceChild(a,this.bottombar.firstChild):this.bottombar.appendChild(a):this.bottombar.innerHTML=a},_checkIEOverlapping:function(){!this.iefix&&navigator.appVersion.indexOf("MSIE")>0&&navigator.userAgent.indexOf("Opera")<0&&"absolute"==this.element.getStyle("position")&&(new Insertion.After(this.element.id,'<iframe id="'+this.element.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>'),this.iefix=$(this.element.id+"_iefix")),this.iefix&&setTimeout(this._fixIEOverlapping.bind(this),50)},_fixIEOverlapping:function(){Position.clone(this.element,this.iefix),this.iefix.style.zIndex=this.element.style.zIndex-1,this.iefix.show()},_keyUp:function(a){27==a.keyCode&&this.options.closeOnEsc&&this.close()},_getWindowBorderSize:function(){var a=this._createHiddenDiv(this.options.className+"_n");this.heightN=Element.getDimensions(a).height,a.parentNode.removeChild(a);var a=this._createHiddenDiv(this.options.className+"_s");this.heightS=Element.getDimensions(a).height,a.parentNode.removeChild(a);var a=this._createHiddenDiv(this.options.className+"_e");this.widthE=Element.getDimensions(a).width,a.parentNode.removeChild(a);var a=this._createHiddenDiv(this.options.className+"_w");
+this.widthW=Element.getDimensions(a).width,a.parentNode.removeChild(a);var a=document.createElement("div");a.className="overlay_"+this.options.className,document.body.appendChild(a);var b=this;setTimeout(function(){b.overlayOpacity=$(a).getStyle("opacity"),a.parentNode.removeChild(a)},10),Prototype.Browser.IE&&(this.heightS=$(this.getId()+"_row3").getDimensions().height,this.heightN=$(this.getId()+"_row1").getDimensions().height),Prototype.Browser.WebKit&&Prototype.Browser.WebKitVersion<420&&this.setSize(this.width,this.height),this.doMaximize&&this.maximize(),this.doMinimize&&this.minimize()},_createHiddenDiv:function(a){var b=document.body,c=document.createElement("div");return c.setAttribute("id",this.element.id+"_tmp"),c.className=a,c.style.display="none",c.innerHTML="",b.insertBefore(c,b.firstChild),c},_storeLocation:function(){null==this.storedLocation&&(this.storedLocation={useTop:this.useTop,useLeft:this.useLeft,top:this.element.getStyle("top"),bottom:this.element.getStyle("bottom"),left:this.element.getStyle("left"),right:this.element.getStyle("right"),width:this.width,height:this.height})},_restoreLocation:function(){null!=this.storedLocation&&(this.useLeft=this.storedLocation.useLeft,this.useTop=this.storedLocation.useTop,this.useLeft&&this.useTop&&Window.hasEffectLib&&Effect.ResizeWindow?new Effect.ResizeWindow(this,this.storedLocation.top,this.storedLocation.left,this.storedLocation.width,this.storedLocation.height,{duration:Window.resizeEffectDuration}):(this.element.setStyle(this.useLeft?{left:this.storedLocation.left}:{right:this.storedLocation.right}),this.element.setStyle(this.useTop?{top:this.storedLocation.top}:{bottom:this.storedLocation.bottom}),this.setSize(this.storedLocation.width,this.storedLocation.height)),Windows.resetOverflow(),this._removeStoreLocation())},_removeStoreLocation:function(){this.storedLocation=null},_saveCookie:function(){if(this.cookie){var a="";a+=this.useLeft?"l:"+(this.storedLocation?this.storedLocation.left:this.element.getStyle("left")):"r:"+(this.storedLocation?this.storedLocation.right:this.element.getStyle("right")),a+=this.useTop?",t:"+(this.storedLocation?this.storedLocation.top:this.element.getStyle("top")):",b:"+(this.storedLocation?this.storedLocation.bottom:this.element.getStyle("bottom")),a+=","+(this.storedLocation?this.storedLocation.width:this.width),a+=","+(this.storedLocation?this.storedLocation.height:this.height),a+=","+this.isMinimized(),a+=","+this.isMaximized(),WindowUtilities.setCookie(a,this.cookie)}},_createWiredElement:function(){if(!this.wiredElement){Prototype.Browser.IE&&this._getWindowBorderSize();var a=document.createElement("div");a.className="wired_frame "+this.options.className+"_wired_frame",a.style.position="absolute",this.options.parent.insertBefore(a,this.options.parent.firstChild),this.wiredElement=$(a)}this.wiredElement.setStyle(this.useLeft?{left:this.element.getStyle("left")}:{right:this.element.getStyle("right")}),this.wiredElement.setStyle(this.useTop?{top:this.element.getStyle("top")}:{bottom:this.element.getStyle("bottom")});var b=this.element.getDimensions();return this.wiredElement.setStyle({width:b.width+"px",height:b.height+"px"}),this.wiredElement.setStyle({zIndex:Windows.maxZIndex+30}),this.wiredElement},_hideWiredElement:function(){this.wiredElement&&this.currentDrag&&(this.currentDrag==this.element?this.currentDrag=null:(this.element.setStyle(this.useLeft?{left:this.currentDrag.getStyle("left")}:{right:this.currentDrag.getStyle("right")}),this.element.setStyle(this.useTop?{top:this.currentDrag.getStyle("top")}:{bottom:this.currentDrag.getStyle("bottom")}),this.currentDrag.hide(),this.currentDrag=null,this.doResize&&this.setSize(this.width,this.height)))},_notify:function(a){this.options[a]?this.options[a](this):Windows.notify(a,this)}};var Windows={windows:[],modalWindows:[],observers:[],focusedWindow:null,maxZIndex:0,overlayShowEffectOptions:{duration:.5},overlayHideEffectOptions:{duration:.5},addObserver:function(a){this.removeObserver(a),this.observers.push(a)},removeObserver:function(a){this.observers=this.observers.reject(function(b){return b==a})},notify:function(a,b){this.observers.each(function(c){c[a]&&c[a](a,b)})},getWindow:function(a){return this.windows.detect(function(b){return b.getId()==a})},getFocusedWindow:function(){return this.focusedWindow},updateFocusedWindow:function(){this.focusedWindow=this.windows.length>=2?this.windows[this.windows.length-2]:null},register:function(a){this.windows.push(a)},addModalWindow:function(a){0==this.modalWindows.length?WindowUtilities.disableScreen(a.options.className,"overlay_modal",a.overlayOpacity,a.getId(),a.options.parent):(Window.keepMultiModalWindow?($("overlay_modal").style.zIndex=Windows.maxZIndex+1,Windows.maxZIndex+=1,WindowUtilities._hideSelect(this.modalWindows.last().getId())):this.modalWindows.last().element.hide(),WindowUtilities._showSelect(a.getId())),this.modalWindows.push(a)},removeModalWindow:function(){this.modalWindows.pop(),0==this.modalWindows.length?WindowUtilities.enableScreen():Window.keepMultiModalWindow?(this.modalWindows.last().toFront(),WindowUtilities._showSelect(this.modalWindows.last().getId())):this.modalWindows.last().element.show()},register:function(a){this.windows.push(a)},unregister:function(a){this.windows=this.windows.reject(function(b){return b==a})},closeAll:function(){this.windows.each(function(a){Windows.close(a.getId())})},closeAllModalWindows:function(){WindowUtilities.enableScreen(),this.modalWindows.each(function(a){a&&a.close()})},minimize:function(a,b){var c=this.getWindow(a);c&&c.visible&&c.minimize(),Event.stop(b)},maximize:function(a,b){var c=this.getWindow(a);c&&c.visible&&c.maximize(),Event.stop(b)},close:function(a,b){var c=this.getWindow(a);c&&c.close(),b&&Event.stop(b)},blur:function(a){var b=this.getWindow(a);b&&(b.options.blurClassName&&b.changeClassName(b.options.blurClassName),this.focusedWindow==b&&(this.focusedWindow=null),b._notify("onBlur"))},focus:function(a){var b=this.getWindow(a);b&&(this.focusedWindow&&this.blur(this.focusedWindow.getId()),b.options.focusClassName&&b.changeClassName(b.options.focusClassName),this.focusedWindow=b,b._notify("onFocus"))},unsetOverflow:function(a){this.windows.each(function(a){a.oldOverflow=a.getContent().getStyle("overflow")||"auto",a.getContent().setStyle({overflow:"hidden"})}),a&&a.oldOverflow&&a.getContent().setStyle({overflow:a.oldOverflow})},resetOverflow:function(){this.windows.each(function(a){a.oldOverflow&&a.getContent().setStyle({overflow:a.oldOverflow})})},updateZindex:function(a,b){a>this.maxZIndex&&(this.maxZIndex=a,this.focusedWindow&&this.blur(this.focusedWindow.getId())),this.focusedWindow=b,this.focusedWindow&&this.focus(this.focusedWindow.getId())}},Dialog={dialogId:null,onCompleteFunc:null,callFunc:null,parameters:null,confirm:function(a,b){if(a&&"string"!=typeof a)return void Dialog._runAjaxRequest(a,b,Dialog.confirm);a=a||"",b=b||{};var c=b.okLabel?b.okLabel:"Ok",d=b.cancelLabel?b.cancelLabel:"Cancel";b=Object.extend(b,b.windowParameters||{}),b.windowParameters=b.windowParameters||{},b.className=b.className||"alert";var e="class ='"+(b.buttonClass?b.buttonClass+" ":"")+" ok_button'",f="class ='"+(b.buttonClass?b.buttonClass+" ":"")+" cancel_button'",a="      <div class='"+b.className+"_message'>"+a+"</div>        <div class='"+b.className+"_buttons'>          <button type='button' title='"+c+"' onclick='Dialog.okCallback()' "+e+"><span><span><span>"+c+"</span></span></span></button>          <button type='button' title='"+d+"' onclick='Dialog.cancelCallback()' "+f+"><span><span><span>"+d+"</span></span></span></button>        </div>    ";return this._openDialog(a,b)},alert:function(a,b){if(a&&"string"!=typeof a)return void Dialog._runAjaxRequest(a,b,Dialog.alert);a=a||"",b=b||{};var c=b.okLabel?b.okLabel:"Ok";b=Object.extend(b,b.windowParameters||{}),b.windowParameters=b.windowParameters||{},b.className=b.className||"alert";var d="class ='"+(b.buttonClass?b.buttonClass+" ":"")+" ok_button'",a="      <div class='"+b.className+"_message'>"+a+"</div>        <div class='"+b.className+"_buttons'>          <button type='button' title='"+c+"' onclick='Dialog.okCallback()' "+d+"><span><span><span>"+c+"</span></span></span></button>        </div>";return this._openDialog(a,b)},info:function(a,b){if(a&&"string"!=typeof a)return void Dialog._runAjaxRequest(a,b,Dialog.info);a=a||"",b=b||{},b=Object.extend(b,b.windowParameters||{}),b.windowParameters=b.windowParameters||{},b.className=b.className||"alert";var a="<div id='modal_dialog_message' class='"+b.className+"_message'>"+a+"</div>";return b.showProgress&&(a+="<div id='modal_dialog_progress' class='"+b.className+"_progress'>  </div>"),b.ok=null,b.cancel=null,this._openDialog(a,b)},setInfoMessage:function(a){$("modal_dialog_message").update(a)},closeInfo:function(){Windows.close(this.dialogId)},_openDialog:function(a,b){var c=b.className;if(b.height||b.width||(b.width=WindowUtilities.getPageSize(b.options.parent||document.body).pageWidth/2),b.id)this.dialogId=b.id;else{var d=new Date;this.dialogId="modal_dialog_"+d.getTime(),b.id=this.dialogId}if(!b.height||!b.width){var e=WindowUtilities._computeSize(a,this.dialogId,b.width,b.height,5,c);b.height?b.width=e+5:b.height=e+5}b.effectOptions=b.effectOptions,b.resizable=b.resizable||!1,b.minimizable=b.minimizable||!1,b.maximizable=b.maximizable||!1,b.draggable=b.draggable||!1,b.closable=b.closable||!1;var f=new Window(b);return f.getContent().innerHTML=a,f.showCenter(!0,b.top,b.left),f.setDestroyOnClose(),f.cancelCallback=b.onCancel||b.cancel,f.okCallback=b.onOk||b.ok,f},_getAjaxContent:function(a){Dialog.callFunc(a.responseText,Dialog.parameters)},_runAjaxRequest:function(a,b,c){null==a.options&&(a.options={}),Dialog.onCompleteFunc=a.options.onComplete,Dialog.parameters=b,Dialog.callFunc=c,a.options.onComplete=Dialog._getAjaxContent,new Ajax.Request(a.url,a.options)},okCallback:function(){var a=Windows.focusedWindow;(!a.okCallback||a.okCallback(a))&&($$("#"+a.getId()+" input").each(function(a){a.onclick=null}),a.close())},cancelCallback:function(){var a=Windows.focusedWindow;$$("#"+a.getId()+" input").each(function(a){a.onclick=null}),a.close(),a.cancelCallback&&a.cancelCallback(a)}};if(Prototype.Browser.WebKit){var array=navigator.userAgent.match(new RegExp(/AppleWebKit\/([\d\.\+]*)/));Prototype.Browser.WebKitVersion=parseFloat(array[1])}var WindowUtilities={getWindowScroll:function(parent){var T,L,W,H;if(parent=parent||document.body,parent!=document.body)T=parent.scrollTop,L=parent.scrollLeft,W=parent.scrollWidth,H=parent.scrollHeight;else{var w=window;with(w.document)w.document.documentElement&&documentElement.scrollTop?(T=documentElement.scrollTop,L=documentElement.scrollLeft):w.document.body&&(T=body.scrollTop,L=body.scrollLeft),w.innerWidth?(W=w.innerWidth,H=w.innerHeight):w.document.documentElement&&documentElement.clientWidth?(W=documentElement.clientWidth,H=documentElement.clientHeight):(W=body.offsetWidth,H=body.offsetHeight)}return{top:T,left:L,width:W,height:H}},getPageSize:function(a){a=a||document.body;var b,c,d,e;if(a!=document.body)b=a.getWidth(),c=a.getHeight(),e=a.scrollWidth,d=a.scrollHeight;else{var f,g;window.innerHeight&&window.scrollMaxY?(f=document.body.scrollWidth,g=window.innerHeight+window.scrollMaxY):document.body.scrollHeight>document.body.offsetHeight?(f=document.body.scrollWidth,g=document.body.scrollHeight):(f=document.body.offsetWidth,g=document.body.offsetHeight),self.innerHeight?(b=document.documentElement.clientWidth,c=self.innerHeight):document.documentElement&&document.documentElement.clientHeight?(b=document.documentElement.clientWidth,c=document.documentElement.clientHeight):document.body&&(b=document.body.clientWidth,c=document.body.clientHeight),d=c>g?c:g,e=b>f?b:f}return{pageWidth:e,pageHeight:d,windowWidth:b,windowHeight:c}},disableScreen:function(a,b,c,d,e){WindowUtilities.initLightbox(b,a,function(){this._disableScreen(a,b,c,d)}.bind(this),e||document.body)},_disableScreen:function(a,b,c,d){var e=$(b),f=WindowUtilities.getPageSize(e.parentNode);d&&Prototype.Browser.IE&&(WindowUtilities._hideSelect(),WindowUtilities._showSelect(d)),e.style.height=f.pageHeight+"px",e.style.display="none","overlay_modal"==b&&Window.hasEffectLib&&Windows.overlayShowEffectOptions?(e.overlayOpacity=c,new Effect.Appear(e,Object.extend({from:0,to:c},Windows.overlayShowEffectOptions))):e.style.display="block"},enableScreen:function(a){a=a||"overlay_modal";var b=$(a);b&&("overlay_modal"==a&&Window.hasEffectLib&&Windows.overlayHideEffectOptions?new Effect.Fade(b,Object.extend({from:b.overlayOpacity,to:0},Windows.overlayHideEffectOptions)):(b.style.display="none",b.parentNode.removeChild(b)),"__invisible__"!=a&&WindowUtilities._showSelect())},_hideSelect:function(a){Prototype.Browser.IE&&(a=null==a?"":"#"+a+" ",$$(a+"select").each(function(a){WindowUtilities.isDefined(a.oldVisibility)||(a.oldVisibility=a.style.visibility?a.style.visibility:"visible",a.style.visibility="hidden")}))},_showSelect:function(a){Prototype.Browser.IE&&(a=null==a?"":"#"+a+" ",$$(a+"select").each(function(a){if(WindowUtilities.isDefined(a.oldVisibility)){try{a.style.visibility=a.oldVisibility}catch(b){a.style.visibility="visible"}a.oldVisibility=null}else a.style.visibility&&(a.style.visibility="visible")}))},isDefined:function(a){return"undefined"!=typeof a&&null!=a},initLightbox:function(a,b,c,d){if($(a))Element.setStyle(a,{zIndex:Windows.maxZIndex+1}),Windows.maxZIndex++,c();else{var e=document.createElement("div");e.setAttribute("id",a),e.className="overlay_"+b,e.style.display="none",e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.zIndex=Windows.maxZIndex+1,Windows.maxZIndex++,e.style.width="100%",d.insertBefore(e,d.firstChild),Prototype.Browser.WebKit&&"overlay_modal"==a?setTimeout(function(){c()},10):c()}},setCookie:function(a,b){document.cookie=b[0]+"="+escape(a)+(b[1]?"; expires="+b[1].toGMTString():"")+(b[2]?"; path="+b[2]:"")+(b[3]?"; domain="+b[3]:"")+(b[4]?"; secure":"")},getCookie:function(a){var b=document.cookie,c=a+"=",d=b.indexOf("; "+c);if(-1==d){if(d=b.indexOf(c),0!=d)return null}else d+=2;var e=document.cookie.indexOf(";",d);return-1==e&&(e=b.length),unescape(b.substring(d+c.length,e))},_computeSize:function(a,b,c,d,e,f){var g=document.body,h=document.createElement("div");h.setAttribute("id",b),h.className=f+"_content",d?h.style.height=d+"px":h.style.width=c+"px",h.style.position="absolute",h.style.top="0",h.style.left="0",h.style.display="none",h.innerHTML=a,g.insertBefore(h,g.firstChild);var i;return i=d?$(h).getDimensions().width+e:$(h).getDimensions().height+e,g.removeChild(h),i}},Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(a){a=a.toUpperCase();var b=this.NODEMAP[a]||"div",c=document.createElement(b);try{c.innerHTML="<"+a+"></"+a+">"}catch(d){}var e=c.firstChild||null;if(e&&e.tagName.toUpperCase()!=a&&(e=e.getElementsByTagName(a)[0]),e||(e=document.createElement(a)),e){if(arguments[1])if(this._isStringOrNumber(arguments[1])||arguments[1]instanceof Array||arguments[1].tagName)this._children(e,arguments[1]);else{var f=this._attributes(arguments[1]);if(f.length){try{c.innerHTML="<"+a+" "+f+"></"+a+">"}catch(d){}if(e=c.firstChild||null,!e){e=document.createElement(a);for(attr in arguments[1])e["class"==attr?"className":attr]=arguments[1][attr]}e.tagName.toUpperCase()!=a&&(e=c.getElementsByTagName(a)[0])}}return arguments[2]&&this._children(e,arguments[2]),$(e)}},_text:function(a){return document.createTextNode(a)},ATTR_MAP:{className:"class",htmlFor:"for"},_attributes:function(a){var b=[];for(attribute in a)b.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+'="'+a[attribute].toString().escapeHTML().gsub(/"/,"&quot;")+'"');return b.join(" ")},_children:function(a,b){return b.tagName?void a.appendChild(b):void("object"==typeof b?b.flatten().each(function(b){"object"==typeof b?a.appendChild(b):Builder._isStringOrNumber(b)&&a.appendChild(Builder._text(b))}):Builder._isStringOrNumber(b)&&a.appendChild(Builder._text(b)))},_isStringOrNumber:function(a){return"string"==typeof a||"number"==typeof a},build:function(a){var b=this.node("div");return $(b).update(a.strip()),b.down()},dump:function(a){"object"!=typeof a&&"function"!=typeof a&&(a=window);var b="A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR".split(/\s+/);b.each(function(b){a[b]=function(){return Builder.node.apply(Builder,[b].concat($A(arguments)))}})}};String.prototype.parseColor=function(){var a="#";if("rgb("==this.slice(0,4)){var b=this.slice(4,this.length-1).split(","),c=0;do a+=parseInt(b[c]).toColorPart();while(++c<3)}else if("#"==this.slice(0,1)){if(4==this.length)for(var c=1;4>c;c++)a+=(this.charAt(c)+this.charAt(c)).toLowerCase();7==this.length&&(a=this.toLowerCase())}return 7==a.length?a:arguments[0]||this},Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(a){return 3==a.nodeType?a.nodeValue:a.hasChildNodes()?Element.collectTextNodes(a):""}).flatten().join("")},Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(a){return 3==a.nodeType?a.nodeValue:a.hasChildNodes()&&!Element.hasClassName(a,b)?Element.collectTextNodesIgnoreClass(a,b):""}).flatten().join("")},Element.setContentZoom=function(a,b){return a=$(a),a.setStyle({fontSize:b/100+"em"}),Prototype.Browser.WebKit&&window.scrollBy(0,0),a},Element.getInlineOpacity=function(a){return $(a).style.opacity||""},Element.forceRerendering=function(a){try{a=$(a);var b=document.createTextNode(" ");a.appendChild(b),a.removeChild(b)}catch(c){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return-Math.cos(a*Math.PI)/2+.5},reverse:function(a){return 1-a},flicker:function(a){var a=-Math.cos(a*Math.PI)/4+.75+Math.random()/4;return a>1?1:a},wobble:function(a){return-Math.cos(a*Math.PI*9*a)/2+.5},pulse:function(a,b){return-Math.cos(a*((b||5)-.5)*2*Math.PI)/2+.5},spring:function(a){return 1-Math.cos(4.5*a*Math.PI)*Math.exp(6*-a)},none:function(){return 0},full:function(){return 1}},DefaultOptions:{duration:1,fps:100,sync:!1,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";Prototype.Browser.IE&&(b+=";zoom:1"),a=$(a),$A(a.childNodes).each(function(c){3==c.nodeType&&(c.nodeValue.toArray().each(function(d){a.insertBefore(new Element("span",{style:b}).update(" "==d?String.fromCharCode(160):d),c)}),Element.remove(c))})},multiple:function(a,b){var c;c=("object"==typeof a||Object.isFunction(a))&&a.length?a:$(a).childNodes;var d=Object.extend({speed:.1,delay:0},arguments[2]||{}),e=d.delay;$A(c).each(function(a,c){new b(a,Object.extend(d,{delay:c*d.speed+e}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(a,b){a=$(a),b=(b||"appear").toLowerCase();var c=Object.extend({queue:{position:"end",scope:a.id||"global",limit:1}},arguments[2]||{});Effect[a.visible()?Effect.PAIRS[b][1]:Effect.PAIRS[b][0]](a,c)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal,Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[],this.interval=null},_each:function(a){this.effects._each(a)},add:function(a){var b=(new Date).getTime(),c=Object.isString(a.options.queue)?a.options.queue:a.options.queue.position;switch(c){case"front":this.effects.findAll(function(a){return"idle"==a.state}).each(function(b){b.startOn+=a.finishOn,b.finishOn+=a.finishOn});break;case"with-last":b=this.effects.pluck("startOn").max()||b;break;case"end":b=this.effects.pluck("finishOn").max()||b}a.startOn+=b,a.finishOn+=b,(!a.options.queue.limit||this.effects.length<a.options.queue.limit)&&this.effects.push(a),this.interval||(this.interval=setInterval(this.loop.bind(this),15))},remove:function(a){this.effects=this.effects.reject(function(b){return b==a}),0==this.effects.length&&(clearInterval(this.interval),this.interval=null)},loop:function(){for(var a=(new Date).getTime(),b=0,c=this.effects.length;c>b;b++)this.effects[b]&&this.effects[b].loop(a)}}),Effect.Queues={instances:$H(),get:function(a){return Object.isString(a)?this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue):a}},Effect.Queue=Effect.Queues.get("global"),Effect.Base=Class.create({position:null,start:function(a){a&&a.transition===!1&&(a.transition=Effect.Transitions.linear),this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{}),this.currentFrame=0,this.state="idle",this.startOn=1e3*this.options.delay,this.finishOn=this.startOn+1e3*this.options.duration,this.fromToDelta=this.options.to-this.options.from,this.totalTime=this.finishOn-this.startOn,this.totalFrames=this.options.fps*this.options.duration,this.render=function(){function a(a,b){a.options[b+"Internal"]&&a.options[b+"Internal"](a),a.options[b]&&a.options[b](a)}return function(b){"idle"===this.state&&(this.state="running",a(this,"beforeSetup"),this.setup&&this.setup(),a(this,"afterSetup")),"running"===this.state&&(b=this.options.transition(b)*this.fromToDelta+this.options.from,this.position=b,a(this,"beforeUpdate"),this.update&&this.update(b),a(this,"afterUpdate"))}}(),this.event("beforeStart"),this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)},loop:function(a){if(a>=this.startOn){if(a>=this.finishOn)return this.render(1),this.cancel(),this.event("beforeFinish"),this.finish&&this.finish(),void this.event("afterFinish");var b=(a-this.startOn)/this.totalTime,c=(b*this.totalFrames).round();c>this.currentFrame&&(this.render(b),this.currentFrame=c)}},cancel:function(){this.options.sync||Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this),this.state="finished"},event:function(a){this.options[a+"Internal"]&&this.options[a+"Internal"](this),this.options[a]&&this.options[a](this)},inspect:function(){var a=$H();for(property in this)Object.isFunction(this[property])||a.set(property,this[property]);return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}}),Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[],this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1),b.cancel(),b.event("beforeFinish"),b.finish&&b.finish(a),b.event("afterFinish")})}}),Effect.Tween=Class.create(Effect.Base,{initialize:function(a,b,c){a=Object.isString(a)?$(a):a;var d=$A(arguments),e=d.last(),f=5==d.length?d[3]:null;this.method=Object.isFunction(e)?e.bind(a):Object.isFunction(a[e])?a[e].bind(a):function(b){a[e]=b},this.start(Object.extend({from:b,to:c},f||{}))},update:function(a){this.method(a)}}),Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction}),Effect.Opacity=Class.create(Effect.Base,{initialize:function(a){if(this.element=$(a),!this.element)throw Effect._elementDoesNotExistError;Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1});var b=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(b)},update:function(a){this.element.setOpacity(a)}}),Effect.Move=Class.create(Effect.Base,{initialize:function(a){if(this.element=$(a),!this.element)throw Effect._elementDoesNotExistError;var b=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(b)},setup:function(){this.element.makePositioned(),this.originalLeft=parseFloat(this.element.getStyle("left")||"0"),this.originalTop=parseFloat(this.element.getStyle("top")||"0"),"absolute"==this.options.mode&&(this.options.x=this.options.x-this.originalLeft,this.options.y=this.options.y-this.originalTop)},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}}),Effect.MoveBy=function(a,b,c){return new Effect.Move(a,Object.extend({x:c,y:b},arguments[3]||{}))},Effect.Scale=Class.create(Effect.Base,{initialize:function(a,b){if(this.element=$(a),!this.element)throw Effect._elementDoesNotExistError;var c=Object.extend({scaleX:!0,scaleY:!0,scaleContent:!0,scaleFromCenter:!1,scaleMode:"box",scaleFrom:100,scaleTo:b},arguments[2]||{});this.start(c)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||!1,this.elementPositioning=this.element.getStyle("position"),this.originalStyle={},["top","left","width","height","fontSize"].each(function(a){this.originalStyle[a]=this.element.style[a]}.bind(this)),this.originalTop=this.element.offsetTop,this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){a.indexOf(b)>0&&(this.fontSize=parseFloat(a),this.fontSizeType=b)}.bind(this)),this.factor=(this.options.scaleTo-this.options.scaleFrom)/100,this.dims=null,"box"==this.options.scaleMode&&(this.dims=[this.element.offsetHeight,this.element.offsetWidth]),/^content/.test(this.options.scaleMode)&&(this.dims=[this.element.scrollHeight,this.element.scrollWidth]),this.dims||(this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth])},update:function(a){var b=this.options.scaleFrom/100+this.factor*a;this.options.scaleContent&&this.fontSize&&this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType}),this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(){this.restoreAfterFinish&&this.element.setStyle(this.originalStyle)},setDimensions:function(a,b){var c={};if(this.options.scaleX&&(c.width=b.round()+"px"),this.options.scaleY&&(c.height=a.round()+"px"),this.options.scaleFromCenter){var d=(a-this.dims[0])/2,e=(b-this.dims[1])/2;"absolute"==this.elementPositioning?(this.options.scaleY&&(c.top=this.originalTop-d+"px"),this.options.scaleX&&(c.left=this.originalLeft-e+"px")):(this.options.scaleY&&(c.top=-d+"px"),this.options.scaleX&&(c.left=-e+"px"))}this.element.setStyle(c)}}),Effect.Highlight=Class.create(Effect.Base,{initialize:function(a){if(this.element=$(a),!this.element)throw Effect._elementDoesNotExistError;var b=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(b)},setup:function(){return"none"==this.element.getStyle("display")?void this.cancel():(this.oldStyle={},this.options.keepBackgroundImage||(this.oldStyle.backgroundImage=this.element.getStyle("background-image"),this.element.setStyle({backgroundImage:"none"})),this.options.endcolor||(this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")),this.options.restorecolor||(this.options.restorecolor=this.element.getStyle("background-color")),this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(2*a+1,2*a+3),16)}.bind(this)),void(this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(2*a+1,2*a+3),16)-this._base[a]}.bind(this))))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+(this._base[d]+this._delta[d]*a).round().toColorPart()}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}}),Effect.ScrollTo=function(a){var b=arguments[1]||{},c=document.viewport.getScrollOffsets(),d=$(a).cumulativeOffset();return b.offset&&(d[1]+=b.offset),new Effect.Tween(null,c.top,d[1],b,function(a){scrollTo(c.left,a.round())})},Effect.Fade=function(a){a=$(a);var b=a.getInlineOpacity(),c=Object.extend({from:a.getOpacity()||1,to:0,afterFinishInternal:function(a){0==a.options.to&&a.element.hide().setStyle({opacity:b})}},arguments[1]||{});return new Effect.Opacity(a,c)},Effect.Appear=function(a){a=$(a);var b=Object.extend({from:"none"==a.getStyle("display")?0:a.getOpacity()||0,to:1,afterFinishInternal:function(a){a.element.forceRerendering()},beforeSetup:function(a){a.element.setOpacity(a.options.from).show()}},arguments[1]||{});return new Effect.Opacity(a,b)},Effect.Puff=function(a){a=$(a);var b={opacity:a.getInlineOpacity(),position:a.getStyle("position"),top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};return new Effect.Parallel([new Effect.Scale(a,200,{sync:!0,scaleFromCenter:!0,scaleContent:!0,restoreAfterFinish:!0}),new Effect.Opacity(a,{sync:!0,to:0})],Object.extend({duration:1,beforeSetupInternal:function(a){Position.absolutize(a.effects[0].element)},afterFinishInternal:function(a){a.effects[0].element.hide().setStyle(b)}},arguments[1]||{}))},Effect.BlindUp=function(a){return a=$(a),a.makeClipping(),new Effect.Scale(a,0,Object.extend({scaleContent:!1,scaleX:!1,restoreAfterFinish:!0,afterFinishInternal:function(a){a.element.hide().undoClipping()}},arguments[1]||{}))},Effect.BlindDown=function(a){a=$(a);var b=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:!1,scaleX:!1,scaleFrom:0,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:!0,afterSetup:function(a){a.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(a){a.element.undoClipping()}},arguments[1]||{}))},Effect.SwitchOff=function(a){a=$(a);var b=a.getInlineOpacity();return new Effect.Appear(a,Object.extend({duration:.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(a){new Effect.Scale(a.element,1,{duration:.3,scaleFromCenter:!0,scaleX:!1,scaleContent:!1,restoreAfterFinish:!0,beforeSetup:function(a){a.element.makePositioned().makeClipping()},afterFinishInternal:function(a){a.element.hide().undoClipping().undoPositioned().setStyle({opacity:b})}})}},arguments[1]||{}))},Effect.DropOut=function(a){a=$(a);var b={top:a.getStyle("top"),left:a.getStyle("left"),opacity:a.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(a,{x:0,y:100,sync:!0}),new Effect.Opacity(a,{sync:!0,to:0})],Object.extend({duration:.5,beforeSetup:function(a){a.effects[0].element.makePositioned()},afterFinishInternal:function(a){a.effects[0].element.hide().undoPositioned().setStyle(b)}},arguments[1]||{}))},Effect.Shake=function(a){a=$(a);var b=Object.extend({distance:20,duration:.5},arguments[1]||{}),c=parseFloat(b.distance),d=parseFloat(b.duration)/10,e={top:a.getStyle("top"),left:a.getStyle("left")};return new Effect.Move(a,{x:c,y:0,duration:d,afterFinishInternal:function(a){new Effect.Move(a.element,{x:2*-c,y:0,duration:2*d,afterFinishInternal:function(a){new Effect.Move(a.element,{x:2*c,y:0,duration:2*d,afterFinishInternal:function(a){new Effect.Move(a.element,{x:2*-c,y:0,duration:2*d,afterFinishInternal:function(a){new Effect.Move(a.element,{x:2*c,y:0,duration:2*d,afterFinishInternal:function(a){new Effect.Move(a.element,{x:-c,y:0,duration:d,afterFinishInternal:function(a){a.element.undoPositioned().setStyle(e)}})}})}})}})}})}})},Effect.SlideDown=function(a){a=$(a).cleanWhitespace();var b=a.down().getStyle("bottom"),c=a.getDimensions();return new Effect.Scale(a,100,Object.extend({scaleContent:!1,scaleX:!1,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:!0,afterSetup:function(a){a.element.makePositioned(),a.element.down().makePositioned(),window.opera&&a.element.setStyle({top:""}),a.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(a){a.element.down().setStyle({bottom:a.dims[0]-a.element.clientHeight+"px"})
+},afterFinishInternal:function(a){a.element.undoClipping().undoPositioned(),a.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))},Effect.SlideUp=function(a){a=$(a).cleanWhitespace();var b=a.down().getStyle("bottom"),c=a.getDimensions();return new Effect.Scale(a,window.opera?0:1,Object.extend({scaleContent:!1,scaleX:!1,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:!0,afterSetup:function(a){a.element.makePositioned(),a.element.down().makePositioned(),window.opera&&a.element.setStyle({top:""}),a.element.makeClipping().show()},afterUpdateInternal:function(a){a.element.down().setStyle({bottom:a.dims[0]-a.element.clientHeight+"px"})},afterFinishInternal:function(a){a.element.hide().undoClipping().undoPositioned(),a.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))},Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:!0,beforeSetup:function(a){a.element.makeClipping()},afterFinishInternal:function(a){a.element.hide().undoClipping()}})},Effect.Grow=function(a){a=$(a);var b,c,d,e,f=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{}),g={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:a.getInlineOpacity()},h=a.getDimensions();switch(f.direction){case"top-left":b=c=d=e=0;break;case"top-right":b=h.width,c=e=0,d=-h.width;break;case"bottom-left":b=d=0,c=h.height,e=-h.height;break;case"bottom-right":b=h.width,c=h.height,d=-h.width,e=-h.height;break;case"center":b=h.width/2,c=h.height/2,d=-h.width/2,e=-h.height/2}return new Effect.Move(a,{x:b,y:c,duration:.01,beforeSetup:function(a){a.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(a){new Effect.Parallel([new Effect.Opacity(a.element,{sync:!0,to:1,from:0,transition:f.opacityTransition}),new Effect.Move(a.element,{x:d,y:e,sync:!0,transition:f.moveTransition}),new Effect.Scale(a.element,100,{scaleMode:{originalHeight:h.height,originalWidth:h.width},sync:!0,scaleFrom:window.opera?1:0,transition:f.scaleTransition,restoreAfterFinish:!0})],Object.extend({beforeSetup:function(a){a.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(a){a.effects[0].element.undoClipping().undoPositioned().setStyle(g)}},f))}})},Effect.Shrink=function(a){a=$(a);var b,c,d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{}),e={top:a.style.top,left:a.style.left,height:a.style.height,width:a.style.width,opacity:a.getInlineOpacity()},f=a.getDimensions();switch(d.direction){case"top-left":b=c=0;break;case"top-right":b=f.width,c=0;break;case"bottom-left":b=0,c=f.height;break;case"bottom-right":b=f.width,c=f.height;break;case"center":b=f.width/2,c=f.height/2}return new Effect.Parallel([new Effect.Opacity(a,{sync:!0,to:0,from:1,transition:d.opacityTransition}),new Effect.Scale(a,window.opera?1:0,{sync:!0,transition:d.scaleTransition,restoreAfterFinish:!0}),new Effect.Move(a,{x:b,y:c,sync:!0,transition:d.moveTransition})],Object.extend({beforeStartInternal:function(a){a.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(a){a.effects[0].element.hide().undoClipping().undoPositioned().setStyle(e)}},d))},Effect.Pulsate=function(a){a=$(a);var b=arguments[1]||{},c=a.getInlineOpacity(),d=b.transition||Effect.Transitions.linear,e=function(a){return 1-d(-Math.cos(a*(b.pulses||5)*2*Math.PI)/2+.5)};return new Effect.Opacity(a,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(a){a.element.setStyle({opacity:c})}},b),{transition:e}))},Effect.Fold=function(a){a=$(a);var b={top:a.style.top,left:a.style.left,width:a.style.width,height:a.style.height};return a.makeClipping(),new Effect.Scale(a,5,Object.extend({scaleContent:!1,scaleX:!1,afterFinishInternal:function(){new Effect.Scale(a,1,{scaleContent:!1,scaleY:!1,afterFinishInternal:function(a){a.element.hide().undoClipping().setStyle(b)}})}},arguments[1]||{}))},Effect.Morph=Class.create(Effect.Base,{initialize:function(a){if(this.element=$(a),!this.element)throw Effect._elementDoesNotExistError;var b=Object.extend({style:{}},arguments[1]||{});if(Object.isString(b.style))if(b.style.include(":"))this.style=b.style.parseStyle();else{this.element.addClassName(b.style),this.style=$H(this.element.getStyles()),this.element.removeClassName(b.style);var c=this.element.getStyles();this.style=this.style.reject(function(a){return a.value==c[a.key]}),b.afterFinishInternal=function(a){a.element.addClassName(a.options.style),a.transforms.each(function(b){a.element.style[b.style]=""})}}else this.style=$H(b.style);this.start(b)},setup:function(){function a(a){return(!a||["rgba(0, 0, 0, 0)","transparent"].include(a))&&(a="#ffffff"),a=a.parseColor(),$R(0,2).map(function(b){return parseInt(a.slice(2*b+1,2*b+3),16)})}this.transforms=this.style.map(function(b){var c=b[0],d=b[1],e=null;if("#zzzzzz"!=d.parseColor("#zzzzzz"))d=d.parseColor(),e="color";else if("opacity"==c)d=parseFloat(d),Prototype.Browser.IE&&!this.element.currentStyle.hasLayout&&this.element.setStyle({zoom:1});else if(Element.CSS_LENGTH.test(d)){var f=d.match(/^([\+\-]?[0-9\.]+)(.*)$/);d=parseFloat(f[1]),e=3==f.length?f[2]:null}var g=this.element.getStyle(c);return{style:c.camelize(),originalValue:"color"==e?a(g):parseFloat(g||0),targetValue:"color"==e?a(d):d,unit:e}}.bind(this)).reject(function(a){return a.originalValue==a.targetValue||"color"!=a.unit&&(isNaN(a.originalValue)||isNaN(a.targetValue))})},update:function(a){for(var b,c={},d=this.transforms.length;d--;)c[(b=this.transforms[d]).style]="color"==b.unit?"#"+Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a).toColorPart()+Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a).toColorPart()+Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(null===b.unit?"":b.unit);this.element.setStyle(c,!0)}}),Effect.Transform=Class.create({initialize:function(a){this.tracks=[],this.options=arguments[1]||{},this.addTracks(a)},addTracks:function(a){return a.each(function(a){a=$H(a);var b=a.values().first();this.tracks.push($H({ids:a.keys().first(),effect:Effect.Morph,options:{style:b}}))}.bind(this)),this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var b=a.get("ids"),c=a.get("effect"),d=a.get("options"),e=[$(b)||$$(b)].flatten();return e.map(function(a){return new c(a,Object.extend({sync:!0},d))})}).flatten(),this.options)}}),Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex"),Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/,String.__parseStyleElement=document.createElement("div"),String.prototype.parseStyle=function(){var a,b=$H();return Prototype.Browser.WebKit?a=new Element("div",{style:this}).style:(String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>',a=String.__parseStyleElement.childNodes[0].style),Element.CSS_PROPERTIES.each(function(c){a[c]&&b.set(c,a[c])}),Prototype.Browser.IE&&this.include("opacity")&&b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]),b},Element.getStyles=document.defaultView&&document.defaultView.getComputedStyle?function(a){var b=document.defaultView.getComputedStyle($(a),null);return Element.CSS_PROPERTIES.inject({},function(a,c){return a[c]=b[c],a})}:function(a){a=$(a);var b,c=a.currentStyle;return b=Element.CSS_PROPERTIES.inject({},function(a,b){return a[b]=c[b],a}),b.opacity||(b.opacity=a.getOpacity()),b},Effect.Methods={morph:function(a,b){return a=$(a),new Effect.Morph(a,Object.extend({style:b},arguments[2]||{})),a},visualEffect:function(a,b,c){a=$(a);var d=b.dasherize().camelize(),e=d.charAt(0).toUpperCase()+d.substring(1);return new Effect[e](a,c),a},highlight:function(a,b){return a=$(a),new Effect.Highlight(a,b),a}},$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(b,c){return b=$(b),Effect[a.charAt(0).toUpperCase()+a.substring(1)](b,c),b}}),$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]}),Element.addMethods(Effect.Methods);var Validator=Class.create();Validator.prototype={initialize:function(a,b,c,d){"function"==typeof c?(this.options=$H(d),this._test=c):(this.options=$H(c),this._test=function(){return!0}),this.error=b||"Validation failed.",this.className=a},test:function(a,b){return this._test(a,b)&&this.options.all(function(c){return Validator.methods[c.key]?Validator.methods[c.key](a,b,c.value):!0})}},Validator.methods={pattern:function(a,b,c){return Validation.get("IsEmpty").test(a)||c.test(a)},minLength:function(a,b,c){return a.length>=c},maxLength:function(a,b,c){return a.length<=c},min:function(a,b,c){return a>=parseFloat(c)},max:function(a,b,c){return a<=parseFloat(c)},notOneOf:function(a,b,c){return $A(c).all(function(b){return a!=b})},oneOf:function(a,b,c){return $A(c).any(function(b){return a==b})},is:function(a,b,c){return a==c},isNot:function(a,b,c){return a!=c},equalToField:function(a,b,c){return a==$F(c)},notEqualToField:function(a,b,c){return a!=$F(c)},include:function(a,b,c){return $A(c).all(function(c){return Validation.get(c).test(a,b)})}};var Validation=Class.create();Validation.defaultOptions={onSubmit:!0,stopOnFirst:!1,immediate:!1,focusOnError:!0,useTitles:!1,addClassNameToContainer:!1,containerClassName:".input-box",onFormValidate:function(){},onElementValidate:function(){}},Validation.prototype={initialize:function(a,b){this.form=$(a),this.form&&(this.options=Object.extend({onSubmit:Validation.defaultOptions.onSubmit,stopOnFirst:Validation.defaultOptions.stopOnFirst,immediate:Validation.defaultOptions.immediate,focusOnError:Validation.defaultOptions.focusOnError,useTitles:Validation.defaultOptions.useTitles,onFormValidate:Validation.defaultOptions.onFormValidate,onElementValidate:Validation.defaultOptions.onElementValidate},b||{}),this.options.onSubmit&&Event.observe(this.form,"submit",this.onSubmit.bind(this),!1),this.options.immediate&&Form.getElements(this.form).each(function(a){"select"==a.tagName.toLowerCase()&&Event.observe(a,"blur",this.onChange.bindAsEventListener(this)),"radio"==a.type.toLowerCase()||"checkbox"==a.type.toLowerCase()?Event.observe(a,"click",this.onChange.bindAsEventListener(this)):Event.observe(a,"change",this.onChange.bindAsEventListener(this))},this))},onChange:function(a){Validation.isOnChange=!0,Validation.validate(Event.element(a),{useTitle:this.options.useTitles,onElementValidate:this.options.onElementValidate}),Validation.isOnChange=!1},onSubmit:function(a){this.validate()||Event.stop(a)},validate:function(){var a=!1,b=this.options.useTitles,c=this.options.onElementValidate;try{a=this.options.stopOnFirst?Form.getElements(this.form).all(function(a){return a.hasClassName("local-validation")&&!this.isElementInForm(a,this.form)?!0:Validation.validate(a,{useTitle:b,onElementValidate:c})},this):Form.getElements(this.form).collect(function(a){return a.hasClassName("local-validation")&&!this.isElementInForm(a,this.form)?!0:a.hasClassName("validation-disabled")?!0:Validation.validate(a,{useTitle:b,onElementValidate:c})},this).all()}catch(d){}if(!a&&this.options.focusOnError)try{Form.getElements(this.form).findAll(function(a){return $(a).hasClassName("validation-failed")}).first().focus()}catch(d){}return this.options.onFormValidate(a,this.form),a},reset:function(){Form.getElements(this.form).each(Validation.reset)},isElementInForm:function(a,b){var c=a.up("form");return c==b?!0:!1}},Object.extend(Validation,{validate:function(a,b){b=Object.extend({useTitle:!1,onElementValidate:function(){}},b||{}),a=$(a);var c=$w(a.className);return result=c.all(function(c){var d=Validation.test(c,a,b.useTitle);return b.onElementValidate(d,a),d})},insertAdvice:function(a,b){var c=$(a).up(".field-row");if(c)Element.insert(c,{after:b});else if(a.up("td.value"))a.up("td.value").insert({bottom:b});else if(a.advaiceContainer&&$(a.advaiceContainer))$(a.advaiceContainer).update(b);else switch(a.type.toLowerCase()){case"checkbox":case"radio":var d=a.parentNode;d?Element.insert(d,{bottom:b}):Element.insert(a,{after:b});break;default:Element.insert(a,{after:b})}},showAdvice:function(a,b,c){a.advices?a.advices.each(function(c){b&&c.value.id==b.id||this.hideAdvice(a,c.value)}.bind(this)):a.advices=new Hash,a.advices.set(c,b),"undefined"==typeof Effect?b.style.display="block":b._adviceAbsolutize?(Position.absolutize(b),b.show(),b.setStyle({top:b._adviceTop,left:b._adviceLeft,width:b._adviceWidth,"z-index":1e3}),b.addClassName("advice-absolute")):new Effect.Appear(b,{duration:1})},hideAdvice:function(a,b){null!=b&&new Effect.Fade(b,{duration:1,afterFinishInternal:function(){b.hide()}})},updateCallback:function(elm,status){"undefined"!=typeof elm.callbackFunction&&eval(elm.callbackFunction+"('"+elm.id+"','"+status+"')")},ajaxError:function(a,b){var c="validate-ajax",d=Validation.getAdvice(c,a);if(null==d&&(d=this.createAdvice(c,a,!1,b)),this.showAdvice(a,d,"validate-ajax"),this.updateCallback(a,"failed"),a.addClassName("validation-failed"),a.addClassName("validate-ajax"),Validation.defaultOptions.addClassNameToContainer&&""!=Validation.defaultOptions.containerClassName){var e=a.up(Validation.defaultOptions.containerClassName);e&&this.allowContainerClassName(a)&&(e.removeClassName("validation-passed"),e.addClassName("validation-error"))}},allowContainerClassName:function(a){return"radio"==a.type||"checkbox"==a.type?a.hasClassName("change-container-classname"):!0},test:function(a,b,c){var d=Validation.get(a),e="__advice"+a.camelize();try{if(Validation.isVisible(b)&&!d.test($F(b),b)){var f=Validation.getAdvice(a,b);if(null==f&&(f=this.createAdvice(a,b,c)),this.showAdvice(b,f,a),this.updateCallback(b,"failed"),b[e]=1,b.advaiceContainer||(b.removeClassName("validation-passed"),b.addClassName("validation-failed")),Validation.defaultOptions.addClassNameToContainer&&""!=Validation.defaultOptions.containerClassName){var g=b.up(Validation.defaultOptions.containerClassName);g&&this.allowContainerClassName(b)&&(g.removeClassName("validation-passed"),g.addClassName("validation-error"))}return!1}var f=Validation.getAdvice(a,b);if(this.hideAdvice(b,f),this.updateCallback(b,"passed"),b[e]="",b.removeClassName("validation-failed"),b.addClassName("validation-passed"),Validation.defaultOptions.addClassNameToContainer&&""!=Validation.defaultOptions.containerClassName){var g=b.up(Validation.defaultOptions.containerClassName);g&&!g.down(".validation-failed")&&this.allowContainerClassName(b)&&(Validation.get("IsEmpty").test(b.value)&&this.isVisible(b)?g.removeClassName("validation-passed"):g.addClassName("validation-passed"),g.removeClassName("validation-error"))}return!0}catch(h){throw h}},isVisible:function(a){for(;"BODY"!=a.tagName;){if(!$(a).visible())return!1;a=a.parentNode}return!0},getAdvice:function(a,b){return $("advice-"+a+"-"+Validation.getElmID(b))||$("advice-"+Validation.getElmID(b))},createAdvice:function(a,b,c,d){var e=Validation.get(a),f=c&&b&&b.title?b.title:e.error;if(d&&(f=d),jQuery.mage.__&&(f=jQuery.mage.__(f)),advice='<div class="validation-advice" id="advice-'+a+"-"+Validation.getElmID(b)+'" style="display:none">'+f+"</div>",Validation.insertAdvice(b,advice),advice=Validation.getAdvice(a,b),$(b).hasClassName("absolute-advice")){var g=$(b).getDimensions(),h=Position.cumulativeOffset(b);advice._adviceTop=h[1]+g.height+"px",advice._adviceLeft=h[0]+"px",advice._adviceWidth=g.width+"px",advice._adviceAbsolutize=!0}return advice},getElmID:function(a){return a.id?a.id:a.name},reset:function(a){a=$(a);var b=$w(a.className);b.each(function(b){var c="__advice"+b.camelize();if(a[c]){var d=Validation.getAdvice(b,a);d&&d.hide(),a[c]=""}if(a.removeClassName("validation-failed"),a.removeClassName("validation-passed"),Validation.defaultOptions.addClassNameToContainer&&""!=Validation.defaultOptions.containerClassName){var e=a.up(Validation.defaultOptions.containerClassName);e&&(e.removeClassName("validation-passed"),e.removeClassName("validation-error"))}})},add:function(a,b,c,d){var e={};e[a]=new Validator(a,b,c,d),Object.extend(Validation.methods,e)},addAllThese:function(a){var b={};$A(a).each(function(a){b[a[0]]=new Validator(a[0],a[1],a[2],a.length>3?a[3]:{})}),Object.extend(Validation.methods,b)},get:function(a){return Validation.methods[a]?Validation.methods[a]:Validation.methods._LikeNoIDIEverSaw_},methods:{_LikeNoIDIEverSaw_:new Validator("_LikeNoIDIEverSaw_","",{})}}),Validation.add("IsEmpty","",function(a){return""==a||null==a||0==a.length||/^\s+$/.test(a)}),Validation.addAllThese([["validate-no-html-tags","HTML tags are not allowed",function(a){return!/<(\/)?\w+/.test(a)}],["validate-select","Please select an option.",function(a){return"none"!=a&&null!=a&&0!=a.length}],["required-entry","This is a required field.",function(a){return!Validation.get("IsEmpty").test(a)}],["validate-number","Please enter a valid number in this field.",function(a){return Validation.get("IsEmpty").test(a)||!isNaN(parseNumber(a))&&/^\s*-?\d*(\.\d*)?\s*$/.test(a)}],["validate-number-range","The value is not within the specified range.",function(a,b){if(Validation.get("IsEmpty").test(a))return!0;var c=parseNumber(a);if(isNaN(c))return!1;var d=/^number-range-(-?[\d.,]+)?-(-?[\d.,]+)?$/,e=!0;return $w(b.className).each(function(a){var b=d.exec(a);b&&(e=e&&(null==b[1]||""==b[1]||c>=parseNumber(b[1]))&&(null==b[2]||""==b[2]||c<=parseNumber(b[2])))}),e}],["validate-digits","Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.",function(a){return Validation.get("IsEmpty").test(a)||!/[^\d]/.test(a)}],["validate-digits-range","The value is not within the specified range.",function(a,b){if(Validation.get("IsEmpty").test(a))return!0;var c=parseNumber(a);if(isNaN(c))return!1;var d=/^digits-range-(-?\d+)?-(-?\d+)?$/,e=!0;return $w(b.className).each(function(a){var b=d.exec(a);b&&(e=e&&(null==b[1]||""==b[1]||c>=parseNumber(b[1]))&&(null==b[2]||""==b[2]||c<=parseNumber(b[2])))}),e}],["validate-range","The value is not within the specified range.",function(a,b){var c,d;if(Validation.get("IsEmpty").test(a))return!0;if(Validation.get("validate-digits").test(a))c=d=parseNumber(a);else{var e=/^(-?\d+)?-(-?\d+)?$/.exec(a);if(!e)return!1;if(c=parseNumber(e[1]),d=parseNumber(e[2]),c>d)return!1}var f=/^range-(-?\d+)?-(-?\d+)?$/,g=!0;return $w(b.className).each(function(a){var b=f.exec(a);if(b){var e=parseNumber(b[1]),h=parseNumber(b[2]);g=g&&(isNaN(e)||c>=e)&&(isNaN(h)||h>=d)}}),g}],["validate-alpha","Please use letters only (a-z or A-Z) in this field.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z]+$/.test(a)}],["validate-code","Please use only letters (a-z), numbers (0-9) or underscore(_) in this field, first character should be a letter.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-z]+[a-z0-9_]+$/.test(a)}],["validate-alphanum","Please use only letters (a-z or A-Z) or numbers (0-9) only in this field. No spaces or other characters are allowed.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z0-9]+$/.test(a)}],["validate-alphanum-with-spaces","Please use only letters (a-z or A-Z), numbers (0-9) or spaces only in this field.",function(a){return Validation.get("IsEmpty").test(a)||/^[a-zA-Z0-9 ]+$/.test(a)}],["validate-street","Please use only letters (a-z or A-Z) or numbers (0-9) or spaces and # only in this field.",function(a){return Validation.get("IsEmpty").test(a)||/^[ \w]{3,}([A-Za-z]\.)?([ \w]*\#\d+)?(\r\n| )[ \w]{3,}/.test(a)}],["validate-phoneStrict","Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.",function(a){return Validation.get("IsEmpty").test(a)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(a)}],["validate-phoneLax","Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.",function(a){return Validation.get("IsEmpty").test(a)||/^((\d[-. ]?)?((\(\d{3}\))|\d{3}))?[-. ]?\d{3}[-. ]?\d{4}$/.test(a)}],["validate-fax","Please enter a valid fax number. For example (123) 456-7890 or 123-456-7890.",function(a){return Validation.get("IsEmpty").test(a)||/^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(a)}],["validate-date","Please enter a valid date.",function(a){var b=new Date(a);return Validation.get("IsEmpty").test(a)||!isNaN(b)}],["validate-date-range","The From Date value should be less than or equal to the To Date value.",function(a,b){var c=/\bdate-range-(\w+)-(\w+)\b/.exec(b.className);if(!c||"to"==c[2]||Validation.get("IsEmpty").test(a))return!0;var d=(new Date).getFullYear()+"",e=function(a){return a=a.split(/[.\/]/),a[2]&&a[2].length<4&&(a[2]=d.substr(0,a[2].length)+a[2]),new Date(a.join("/")).getTime()},f=Element.select(b.form,".validate-date-range.date-range-"+c[1]+"-to");return!f.length||Validation.get("IsEmpty").test(f[0].value)||e(a)<=e(f[0].value)}],["validate-email","Please enter a valid email address. For example johndoe@domain.com.",function(a){return Validation.get("IsEmpty").test(a)||/^([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*@([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z0-9-]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*\.(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,})$/i.test(a)}],["validate-emailSender","Please use only visible characters and spaces.",function(a){return Validation.get("IsEmpty").test(a)||/^[\S ]+$/.test(a)}],["validate-password","Please enter 6 or more characters. Leading or trailing spaces will be ignored.",function(a){var b=a.strip();return!(b.length>0&&b.length<6)}],["validate-admin-password","Please enter 7 or more characters. Password should contain both numeric and alphabetic characters.",function(a){var b=a.strip();return 0==b.length?!0:/[a-z]/i.test(a)&&/[0-9]/.test(a)?!(b.length<7):!1}],["validate-cpassword","Please make sure your passwords match.",function(){var a=$("confirmation")?$("confirmation"):$$(".validate-cpassword")[0],b=!1;$("password")&&(b=$("password"));for(var c=$$(".validate-password"),d=0;d<c.size();d++){var e=c[d];e.up("form").id==a.up("form").id&&(b=e)}return $$(".validate-admin-password").size()&&(b=$$(".validate-admin-password")[0]),b.value==a.value}],["validate-both-passwords","Please make sure your passwords match.",function(a,b){var c=$(b.form["password"==b.name?"confirmation":"password"]),d=b.value==c.value;return d&&c.hasClassName("validation-failed")&&Validation.test(this.className,c),""==c.value||d}],["validate-url","Please enter a valid URL. Protocol is required (http://, https:// or ftp://)",function(a){return a=(a||"").replace(/^\s+/,"").replace(/\s+$/,""),Validation.get("IsEmpty").test(a)||/^(http|https|ftp):\/\/(([A-Z0-9]([A-Z0-9_-]*[A-Z0-9]|))(\.[A-Z0-9]([A-Z0-9_-]*[A-Z0-9]|))*)(:(\d+))?(\/[A-Z0-9~](([A-Z0-9_~-]|\.)*[A-Z0-9~]|))*\/?(.*)?$/i.test(a)}],["validate-clean-url","Please enter a valid URL. For example http://www.example.com or www.example.com",function(a){return Validation.get("IsEmpty").test(a)||/^(http|https|ftp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i.test(a)||/^(www)((\.[A-Z0-9][A-Z0-9_-]*)+.(com|org|net|dk|at|us|tv|info|uk|co.uk|biz|se)$)(:(\d+))?\/?/i.test(a)}],["validate-identifier",'Please enter a valid URL Key. For example "example-page", "example-page.html" or "anotherlevel/example-page".',function(a){return Validation.get("IsEmpty").test(a)||/^[a-z0-9][a-z0-9_\/-]+(\.[a-z0-9_-]+)?$/.test(a)}],["validate-xml-identifier","Please enter a valid XML-identifier. For example something_1, block5, id-4.",function(a){return Validation.get("IsEmpty").test(a)||/^[A-Z][A-Z0-9_\/-]*$/i.test(a)}],["validate-ssn","Please enter a valid social security number. For example 123-45-6789.",function(a){return Validation.get("IsEmpty").test(a)||/^\d{3}-?\d{2}-?\d{4}$/.test(a)}],["validate-zip-us","Please enter a valid zip code. For example 90602 or 90602-1234.",function(a){return Validation.get("IsEmpty").test(a)||/(^\d{5}$)|(^\d{5}-\d{4}$)/.test(a)}],["validate-zip-international","Please enter a valid zip code.",function(){return!0}],["validate-date-au","Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.",function(a){if(Validation.get("IsEmpty").test(a))return!0;var b=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!b.test(a))return!1;var c=new Date(a.replace(b,"$2/$1/$3"));return parseInt(RegExp.$2,10)==1+c.getMonth()&&parseInt(RegExp.$1,10)==c.getDate()&&parseInt(RegExp.$3,10)==c.getFullYear()}],["validate-currency-dollar","Please enter a valid $ amount. For example $100.00.",function(a){return Validation.get("IsEmpty").test(a)||/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(a)}],["validate-one-required","Please select one of the above options.",function(a,b){var c=b.parentNode,d=c.getElementsByTagName("INPUT");return $A(d).any(function(a){return $F(a)})}],["validate-one-required-by-name","Please select one of the options.",function(a,b){for(var c=$$('input[name="'+b.name.replace(/([\\"])/g,"\\$1")+'"]'),d=1,e=0;e<c.length;e++)"checkbox"!=c[e].type&&"radio"!=c[e].type||1!=c[e].checked||(d=0),!Validation.isOnChange||"checkbox"!=c[e].type&&"radio"!=c[e].type||Validation.reset(c[e]);return 0==d?!0:!1}],["validate-not-negative-number","Please enter a number 0 or greater in this field.",function(a){return Validation.get("IsEmpty").test(a)?!0:(a=parseNumber(a),!isNaN(a)&&a>=0)}],["validate-zero-or-greater","Please enter a number 0 or greater in this field.",function(a){return Validation.get("validate-not-negative-number").test(a)}],["validate-greater-than-zero","Please enter a number greater than 0 in this field.",function(a){return Validation.get("IsEmpty").test(a)?!0:(a=parseNumber(a),!isNaN(a)&&a>0)}],["validate-state","Please select State/Province.",function(a){return 0!=a||""==a}],["validate-new-password","Please enter 6 or more characters. Leading or trailing spaces will be ignored.",function(a){return Validation.get("validate-password").test(a)?Validation.get("IsEmpty").test(a)&&""!=a?!1:!0:!1}],["validate-cc-number","Please enter a valid credit card number.",function(a,b){var c=$(b.id.substr(0,b.id.indexOf("_cc_number"))+"_cc_type");return c&&"undefined"!=typeof Validation.creditCartTypes.get(c.value)&&0==Validation.creditCartTypes.get(c.value)[2]?!Validation.get("IsEmpty").test(a)&&Validation.get("validate-digits").test(a)?!0:!1:validateCreditCard(a)}],["validate-cc-type","Credit card number does not match credit card type.",function(a,b){b.value=removeDelimiters(b.value),a=removeDelimiters(a);var c=$(b.id.substr(0,b.id.indexOf("_cc_number"))+"_cc_type");if(!c)return!0;var d=c.value;if("undefined"==typeof Validation.creditCartTypes.get(d))return!1;if(0==Validation.creditCartTypes.get(d)[0])return!0;var e="";return Validation.creditCartTypes.each(function(b){if(b.value[0]&&a.match(b.value[0]))throw e=b.key,$break}),e!=d?!1:(c.hasClassName("validation-failed")&&Validation.isOnChange&&Validation.validate(c),!0)}],["validate-cc-type-select","Card type does not match credit card number.",function(a,b){var c=$(b.id.substr(0,b.id.indexOf("_cc_type"))+"_cc_number");return Validation.isOnChange&&Validation.get("IsEmpty").test(c.value)?!0:(Validation.get("validate-cc-type").test(c.value,c)&&Validation.validate(c),Validation.get("validate-cc-type").test(c.value,c))}],["validate-cc-exp","Incorrect credit card expiration date.",function(a,b){var c=a,d=$(b.id.substr(0,b.id.indexOf("_expiration"))+"_expiration_yr").value,e=new Date,f=e.getMonth()+1,g=e.getFullYear();return f>c&&d==g?!1:!0}],["validate-cc-cvn","Please enter a valid credit card verification number.",function(a,b){var c=$(b.id.substr(0,b.id.indexOf("_cc_cid"))+"_cc_type");if(!c)return!0;var d=c.value;if("undefined"==typeof Validation.creditCartTypes.get(d))return!1;var e=Validation.creditCartTypes.get(d)[1];return a.match(e)?!0:!1}],["validate-ajax","",function(){return!0}],["validate-data","Please use only letters (a-z or A-Z), numbers (0-9) or underscore(_) in this field, first character should be a letter.",function(a){return""!=a&&a?/^[A-Za-z]+[A-Za-z0-9_]+$/.test(a):!0}],["validate-css-length","Please input a valid CSS-length. For example 100px or 77pt or 20em or .5ex or 50%.",function(a){return""!=a&&a?/^[0-9\.]+(px|pt|em|ex|%)?$/.test(a)&&!/\..*\./.test(a)&&!/\.$/.test(a):!0}],["validate-length","Text length does not satisfy specified text range.",function(a,b){var c=new RegExp(/^maximum-length-[0-9]+$/),d=new RegExp(/^minimum-length-[0-9]+$/),e=!0;return $w(b.className).each(function(b){if(b.match(c)&&e){var f=b.split("-")[2];e=a.length<=f}if(b.match(d)&&e&&!Validation.get("IsEmpty").test(a)){var f=b.split("-")[2];e=a.length>=f}}),e}],["validate-percents","Please enter a number lower than 100.",{max:100}],["required-file","Please select a file",function(a,b){var c=!Validation.get("IsEmpty").test(a);return c===!1&&(ovId=b.id+"_value",$(ovId)&&(c=!Validation.get("IsEmpty").test($(ovId).value))),c}],["validate-cc-ukss","Please enter issue number or start date for switch/solo card type.",function(a,b){var c;c=b.id.indexOf(b.id.match(/(.)+_cc_issue$/)?"_cc_issue":b.id.match(/(.)+_start_month$/)?"_start_month":"_start_year");var d=b.id.substr(0,c),e=$(d+"_cc_type");if(!e)return!0;var f=e.value;if(-1==["SS","SM","SO"].indexOf(f))return!0;$(d+"_cc_issue").advaiceContainer=$(d+"_start_month").advaiceContainer=$(d+"_start_year").advaiceContainer=$(d+"_cc_type_ss_div").down(".adv-container");var g=$(d+"_cc_issue").value,h=$(d+"_start_month").value,i=$(d+"_start_year").value,j=h&&i?!0:!1;return j||g?!0:!1}]]),Validation.creditCartTypes=$H({SO:[new RegExp("^(6334[5-9]([0-9]{11}|[0-9]{13,14}))|(6767([0-9]{12}|[0-9]{14,15}))$"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),!0],SM:[new RegExp("(^(5[0678])[0-9]{11,18}$)|(^(6[^05])[0-9]{11,18}$)|(^(601)[^1][0-9]{9,16}$)|(^(6011)[0-9]{9,11}$)|(^(6011)[0-9]{13,16}$)|(^(65)[0-9]{11,13}$)|(^(65)[0-9]{15,18}$)|(^(49030)[2-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49033)[5-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49110)[1-2]([0-9]{10}$|[0-9]{12,13}$))|(^(49117)[4-9]([0-9]{10}$|[0-9]{12,13}$))|(^(49118)[0-2]([0-9]{10}$|[0-9]{12,13}$))|(^(4936)([0-9]{12}$|[0-9]{14,15}$))"),new RegExp("^([0-9]{3}|[0-9]{4})?$"),!0],VI:[new RegExp("^4[0-9]{12}([0-9]{3})?$"),new RegExp("^[0-9]{3}$"),!0],MC:[new RegExp("^5[1-5][0-9]{14}$"),new RegExp("^[0-9]{3}$"),!0],AE:[new RegExp("^3[47][0-9]{13}$"),new RegExp("^[0-9]{4}$"),!0],DI:[new RegExp("^6(011|4[4-9][0-9]|5[0-9]{2})[0-9]{12}$"),new RegExp("^[0-9]{3}$"),!0],JCB:[new RegExp("^(3[0-9]{15}|(2131|1800)[0-9]{11})$"),new RegExp("^[0-9]{3,4}$"),!0],OT:[!1,new RegExp("^([0-9]{3}|[0-9]{4})?$"),!1]});var isIE="MSIE"==navigator.appVersion.match(/MSIE/);if(!window.Varien)var Varien=new Object;Varien.showLoading=function(){var a=$("loading-process");a&&a.show()},Varien.hideLoading=function(){var a=$("loading-process");a&&a.hide()},Varien.GlobalHandlers={onCreate:function(){Varien.showLoading()},onComplete:function(){0==Ajax.activeRequestCount&&Varien.hideLoading()
+}},Ajax.Responders.register(Varien.GlobalHandlers),Varien.searchForm=Class.create(),Varien.searchForm.prototype={initialize:function(a,b,c){this.form=$(a),this.field=$(b),this.emptyText=c,Event.observe(this.form,"submit",this.submit.bind(this)),Event.observe(this.field,"focus",this.focus.bind(this)),Event.observe(this.field,"blur",this.blur.bind(this)),this.blur()},submit:function(a){return this.field.value==this.emptyText||""==this.field.value?(Event.stop(a),!1):!0},focus:function(){this.field.value==this.emptyText&&(this.field.value="")},blur:function(){""==this.field.value&&(this.field.value=this.emptyText)}},Varien.DateElement=Class.create(),Varien.DateElement.prototype={initialize:function(a,b,c,d){if("id"==a)this.day=$(b+"day"),this.month=$(b+"month"),this.year=$(b+"year"),this.full=$(b+"full"),this.advice=$(b+"date-advice");else{if("container"!=a)return;this.day=b.day,this.month=b.month,this.year=b.year,this.full=b.full,this.advice=b.advice}this.required=c,this.format=d,this.day.addClassName("validate-custom"),this.day.validate=this.validate.bind(this),this.month.addClassName("validate-custom"),this.month.validate=this.validate.bind(this),this.year.addClassName("validate-custom"),this.year.validate=this.validate.bind(this),this.setDateRange(!1,!1),this.year.setAttribute("autocomplete","off"),this.advice.hide()},validate:function(){var a=!1,b=parseInt(this.day.value,10)||0,c=parseInt(this.month.value,10)||0,d=parseInt(this.year.value,10)||0;if(this.day.value.strip().empty()&&this.month.value.strip().empty()&&this.year.value.strip().empty())this.required?a="This date is a required value.":this.full.value="";else if(b&&c&&d){var e=new Date,f=0,g=null;if(e.setYear(d),e.setMonth(c-1),e.setDate(32),f=32-e.getDate(),(!f||f>31)&&(f=31),1>b||b>f)g="day",a="Please enter a valid day (1-%1).";else if(1>c||c>12)g="month",a="Please enter a valid month (1-12).";else{b%10==b&&(this.day.value="0"+b),c%10==c&&(this.month.value="0"+c),this.full.value=this.format.replace(/%[mb]/i,this.month.value).replace(/%[de]/i,this.day.value).replace(/%y/i,this.year.value);var h=this.month.value+"/"+this.day.value+"/"+this.year.value,i=new Date(h);isNaN(i)?a="Please enter a valid date.":this.setFullDate(i)}var j=!1;a||this.validateData()||(g=this.validateDataErrorType,j=this.validateDataErrorText,a=j)}else a="Please enter a valid full date.";return a!==!1?(jQuery.mage.__&&(a=jQuery.mage.__(a)),this.advice.innerHTML=j?this.errorTextModifier(a):a.replace("%1",f),this.advice.show(),!1):(this.day.removeClassName("validation-failed"),this.month.removeClassName("validation-failed"),this.year.removeClassName("validation-failed"),this.advice.hide(),!0)},validateData:function(){var a=this.fullDate.getFullYear(),b=new Date;return this.curyear=b.getFullYear(),a>=1900&&a<=this.curyear},validateDataErrorType:"year",validateDataErrorText:"Please enter a valid year (1900-%1).",errorTextModifier:function(a){return a.replace("%1",this.curyear)},setDateRange:function(a,b){this.minDate=a,this.maxDate=b},setFullDate:function(a){this.fullDate=a}},Varien.DOB=Class.create(),Varien.DOB.prototype={initialize:function(a,b,c){var d=$$(a)[0],e={};e.day=Element.select(d,".dob-day input")[0],e.month=Element.select(d,".dob-month input")[0],e.year=Element.select(d,".dob-year input")[0],e.full=Element.select(d,".dob-full input")[0],e.advice=Element.select(d,".validation-advice")[0],new Varien.DateElement("container",e,b,c)}},Varien.dateRangeDate=Class.create(),Varien.dateRangeDate.prototype=Object.extend(new Varien.DateElement,{validateData:function(){var a=!0;return(this.minDate||this.maxValue)&&(this.minDate&&(this.minDate=new Date(this.minDate),this.minDate.setHours(0),isNaN(this.minDate)&&(this.minDate=new Date("1/1/1900")),a=a&&this.fullDate>=this.minDate),this.maxDate&&(this.maxDate=new Date(this.maxDate),this.minDate.setHours(0),isNaN(this.maxDate)&&(this.maxDate=new Date),a=a&&this.fullDate<=this.maxDate),this.validateDataErrorText=this.maxDate&&this.minDate?"Please enter a valid date between %s and %s":this.maxDate?"Please enter a valid date less than or equal to %s":this.minDate?"Please enter a valid date equal to or greater than %s":""),a},validateDataErrorText:"Date should be between %s and %s",errorTextModifier:function(a){return this.minDate&&(a=a.sub("%s",this.dateFormat(this.minDate))),this.maxDate&&(a=a.sub("%s",this.dateFormat(this.maxDate))),a},dateFormat:function(a){return a.getMonth()+1+"/"+a.getDate()+"/"+a.getFullYear()}}),Varien.FileElement=Class.create(),Varien.FileElement.prototype={initialize:function(a){this.fileElement=$(a),this.hiddenElement=$(a+"_value"),this.fileElement.observe("change",this.selectFile.bind(this))},selectFile:function(){this.hiddenElement.value=this.fileElement.getValue()}},Validation.addAllThese([["validate-custom"," ",function(a,b){return b.validate()}]]),Element.addMethods({getInnerText:function(a){return a=$(a),a.innerText&&!Prototype.Browser.Opera?a.innerText:a.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g," ").strip()}}),"undefined"==typeof Range||Range.prototype.createContextualFragment||(Range.prototype.createContextualFragment=function(a){var b=document.createDocumentFragment(),c=document.createElement("div");return b.appendChild(c),c.outerHTML=a,b});var byteConvert=function(a){if(isNaN(a))return"";var b=["bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],c=Math.floor(Math.log(a)/Math.log(2));1>c&&(c=0);var d=Math.floor(c/10);return a/=Math.pow(2,10*d),a.toString().length>a.toFixed(2).toString().length&&(a=a.toFixed(2)),a+" "+b[d]},SessionError=Class.create();SessionError.prototype={initialize:function(a){this.errorText=a},toString:function(){return"Session Error:"+this.errorText}},Ajax.Request.addMethods({initialize:function(a,b,c){a(c),this.transport=Ajax.getTransport(),b.match(new RegExp("[?&]isAjax=true",""))||(b=b.match(new RegExp("\\?","g"))?b+"&isAjax=true":b+"?isAjax=true"),Object.isString(this.options.parameters)&&-1==this.options.parameters.indexOf("form_key=")?this.options.parameters+="&"+Object.toQueryString({form_key:FORM_KEY}):(this.options.parameters||(this.options.parameters={form_key:FORM_KEY}),this.options.parameters.form_key||(this.options.parameters.form_key=FORM_KEY)),this.request(b)},respondToReadyState:function(a){var b=Ajax.Request.Events[a],c=new Ajax.Response(this);if("Complete"==b){try{if(this._complete=!0,c.responseText.isJSON()){var d=c.responseText.evalJSON();if(d.ajaxExpired&&d.ajaxRedirect)throw window.location.replace(d.ajaxRedirect),new SessionError("session expired")}(this.options["on"+c.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(c,c.headerJSON)}catch(e){if(this.dispatchException(e),e instanceof SessionError)return}var f=c.getHeader("Content-type");("force"==this.options.evalJS||this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))&&this.evalResponse()}try{(this.options["on"+b]||Prototype.emptyFunction)(c,c.headerJSON),Ajax.Responders.dispatch("on"+b,this,c,c.headerJSON)}catch(e){this.dispatchException(e)}"Complete"==b&&(this.transport.onreadystatechange=Prototype.emptyFunction)}}),Ajax.Updater.respondToReadyState=Ajax.Request.respondToReadyState;var varienLoader=new Class.create;if(varienLoader.prototype={initialize:function(a){this.callback=!1,this.cache=$H(),this.caching=a||!1,this.url=!1},getCache:function(a){return this.cache.get(a)?this.cache.get(a):!1},load:function(a,b,c){if(this.url=a,this.callback=c,this.caching){var d=this.getCache(a);if(d)return void this.processResult(d)}"undefined"!=typeof b.updaterId?new varienUpdater(b.updaterId,a,{evalScripts:!0,onComplete:this.processResult.bind(this),onFailure:this._processFailure.bind(this)}):new Ajax.Request(a,{method:"post",parameters:b||{},onComplete:this.processResult.bind(this),onFailure:this._processFailure.bind(this)})},_processFailure:function(){location.href=BASE_URL},processResult:function(a){this.caching&&this.cache.set(this.url,a),this.callback&&this.callback(a.responseText)}},!window.varienLoaderHandler)var varienLoaderHandler=new Object;varienLoaderHandler.handler={onCreate:function(a){a.options.loaderArea!==!1&&jQuery("body").trigger("processStart")},onException:function(){jQuery("body").trigger("processStop")},onComplete:function(){jQuery("body").trigger("processStop")}},Ajax.Responders.register(varienLoaderHandler.handler);var varienUpdater=Class.create(Ajax.Updater,{updateContent:function(a,b){if(b.isJSON()){var c=b.evalJSON();c.ajaxExpired&&c.ajaxRedirect&&window.location.replace(c.ajaxRedirect)}else a(b)}});Event.observe(window,"load",function(){$("price_default")&&$("price_default").checked&&($("price").disabled="disabled")});var Cookie={all:function(){var a=document.cookie.split(";"),b={};return a.each(function(a){var c=a.strip().split("=");b[unescape(c[0])]=unescape(c[1])}),b},read:function(a){var b=this.all();return b[a]?b[a]:null},write:function(a,b,c){var d="";if(c){var e=new Date;e.setTime(e.getTime()+1e3*c),d="; expires="+e.toGMTString()}var f="/"+BASE_URL.split("/").slice(3).join("/");document.cookie=escape(a)+"="+escape(b)+d+"; path="+f},clear:function(a){this.write(a,"",-1)}},Fieldset={cookiePrefix:"fh-",applyCollapse:function(a){collapsed=$(a+"-state")?1==$(a+"-state").value?0:1:$(a+"-head").collapsed,1==collapsed||void 0===collapsed?($(a+"-head").removeClassName("open"),$(a+"-head").up(".section-config")&&$(a+"-head").up(".section-config").removeClassName("active"),$(a).hide()):($(a+"-head").addClassName("open"),$(a+"-head").up(".section-config")&&$(a+"-head").up(".section-config").addClassName("active"),$(a).show())},toggleCollapse:function(a,b){collapsed=$(a+"-state")?1==$(a+"-state").value?0:1:$(a+"-head").collapsed,1==collapsed||void 0===collapsed?($(a+"-state")&&($(a+"-state").value=1),$(a+"-head").collapsed=0):($(a+"-state")&&($(a+"-state").value=0),$(a+"-head").collapsed=1),this.applyCollapse(a),"undefined"!=typeof b&&this.saveState(b,{container:a,value:$(a+"-state").value})},addToPrefix:function(a){this.cookiePrefix+=a+"-"},saveState:function(a,b){new Ajax.Request(a,{method:"get",parameters:Object.toQueryString(b),loaderArea:!1})}},Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(a){var b,c,d,e,f,g,h,i="",j=0;if("function"==typeof window.btoa)return window.btoa(a);for(a=Base64._utf8_encode(a);j<a.length;)b=a.charCodeAt(j++),c=a.charCodeAt(j++),d=a.charCodeAt(j++),e=b>>2,f=(3&b)<<4|c>>4,g=(15&c)<<2|d>>6,h=63&d,isNaN(c)?g=h=64:isNaN(d)&&(h=64),i=i+this._keyStr.charAt(e)+this._keyStr.charAt(f)+this._keyStr.charAt(g)+this._keyStr.charAt(h);return i},decode:function(a){var b,c,d,e,f,g,h,i="",j=0;if("function"==typeof window.atob)return window.atob(a);for(a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");j<a.length;)e=this._keyStr.indexOf(a.charAt(j++)),f=this._keyStr.indexOf(a.charAt(j++)),g=this._keyStr.indexOf(a.charAt(j++)),h=this._keyStr.indexOf(a.charAt(j++)),b=e<<2|f>>4,c=(15&f)<<4|g>>2,d=(3&g)<<6|h,i+=String.fromCharCode(b),64!=g&&(i+=String.fromCharCode(c)),64!=h&&(i+=String.fromCharCode(d));return i=Base64._utf8_decode(i)},mageEncode:function(a){return this.encode(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,",")},mageDecode:function(a){return a=a.replace(/\-/g,"+").replace(/_/g,"/").replace(/,/g,"="),this.decode(a)},idEncode:function(a){return this.encode(a).replace(/\+/g,":").replace(/\//g,"_").replace(/=/g,"-")},idDecode:function(a){return a=a.replace(/\-/g,"=").replace(/_/g,"/").replace(/\:/g,"+"),this.decode(a)},_utf8_encode:function(a){a=a.replace(/\r\n/g,"\n");for(var b="",c=0;c<a.length;c++){var d=a.charCodeAt(c);128>d?b+=String.fromCharCode(d):d>127&&2048>d?(b+=String.fromCharCode(d>>6|192),b+=String.fromCharCode(63&d|128)):(b+=String.fromCharCode(d>>12|224),b+=String.fromCharCode(d>>6&63|128),b+=String.fromCharCode(63&d|128))}return b},_utf8_decode:function(a){for(var b="",c=0,d=c1=c2=0;c<a.length;)d=a.charCodeAt(c),128>d?(b+=String.fromCharCode(d),c++):d>191&&224>d?(c2=a.charCodeAt(c+1),b+=String.fromCharCode((31&d)<<6|63&c2),c+=2):(c2=a.charCodeAt(c+1),c3=a.charCodeAt(c+2),b+=String.fromCharCode((15&d)<<12|(63&c2)<<6|63&c3),c+=3);return b}};
\ No newline at end of file
diff --git a/lib/web/lib/boxover.js b/lib/web/lib/boxover.js
deleted file mode 100644
index b9cb869a95f7dbfc844ddb4519802c22f0a270ba..0000000000000000000000000000000000000000
--- a/lib/web/lib/boxover.js
+++ /dev/null
@@ -1,372 +0,0 @@
-/* --- BoxOver ---
-/* --- v 2.1 17th June 2006
-By Oliver Bryant with help of Matthew Tagg
-http://boxover.swazz.org */
-
-if (typeof document.attachEvent!='undefined') {
-   window.attachEvent('onload',init);
-   document.attachEvent('onmousemove',moveMouse);
-   document.attachEvent('onclick',checkMove); }
-else {
-   window.addEventListener('load',init,false);
-   document.addEventListener('mousemove',moveMouse,false);
-   document.addEventListener('click',checkMove,false);
-}
-
-var oDv=document.createElement("div");
-var dvHdr=document.createElement("div");
-var dvBdy=document.createElement("div");
-var windowlock,boxMove,fixposx,fixposy,lockX,lockY,fixx,fixy,ox,oy,boxLeft,boxRight,boxTop,boxBottom,evt,mouseX,mouseY,boxOpen,totalScrollTop,totalScrollLeft;
-boxOpen=false;
-ox=10;
-oy=10;
-lockX=0;
-lockY=0;
-
-function init() {
-	oDv.appendChild(dvHdr);
-	oDv.appendChild(dvBdy);
-	oDv.style.position="absolute";
-	oDv.style.visibility='hidden';
-	document.body.appendChild(oDv);	
-}
-
-function defHdrStyle() {
-	dvHdr.innerHTML='<img  style="vertical-align:middle"  src="info.gif">&nbsp;&nbsp;'+dvHdr.innerHTML;
-	dvHdr.style.fontWeight='bold';
-	dvHdr.style.width='150px';
-	dvHdr.style.fontFamily='arial';
-	dvHdr.style.border='1px solid #A5CFE9';
-	dvHdr.style.padding='3';
-	dvHdr.style.fontSize='11';
-	dvHdr.style.color='#4B7A98';
-	dvHdr.style.background='#D5EBF9';
-	dvHdr.style.filter='alpha(opacity=85)'; // IE
-	dvHdr.style.opacity='0.85'; // FF
-}
-
-function defBdyStyle() {
-	dvBdy.style.borderBottom='1px solid #A5CFE9';
-	dvBdy.style.borderLeft='1px solid #A5CFE9';
-	dvBdy.style.borderRight='1px solid #A5CFE9';
-	dvBdy.style.width='150px';
-	dvBdy.style.fontFamily='arial';
-	dvBdy.style.fontSize='11';
-	dvBdy.style.padding='3';
-	dvBdy.style.color='#1B4966';
-	dvBdy.style.background='#FFFFFF';
-	dvBdy.style.filter='alpha(opacity=85)'; // IE
-	dvBdy.style.opacity='0.85'; // FF
-}
-
-function checkElemBO(txt) {
-if (!txt || typeof(txt) != 'string') return false;
-if ((txt.indexOf('header')>-1)&&(txt.indexOf('body')>-1)&&(txt.indexOf('[')>-1)&&(txt.indexOf('[')>-1)) 
-   return true;
-else
-   return false;
-}
-
-function scanBO(curNode) {
-	  if (checkElemBO(curNode.title)) {
-         curNode.boHDR=getParam('header',curNode.title);
-         curNode.boBDY=getParam('body',curNode.title);
-			curNode.boCSSBDY=getParam('cssbody',curNode.title);			
-			curNode.boCSSHDR=getParam('cssheader',curNode.title);
-			curNode.IEbugfix=(getParam('hideselects',curNode.title)=='on')?true:false;
-			curNode.fixX=parseInt(getParam('fixedrelx',curNode.title));
-			curNode.fixY=parseInt(getParam('fixedrely',curNode.title));
-			curNode.absX=parseInt(getParam('fixedabsx',curNode.title));
-			curNode.absY=parseInt(getParam('fixedabsy',curNode.title));
-			curNode.offY=(getParam('offsety',curNode.title)!='')?parseInt(getParam('offsety',curNode.title)):10;
-			curNode.offX=(getParam('offsetx',curNode.title)!='')?parseInt(getParam('offsetx',curNode.title)):10;
-			curNode.fade=(getParam('fade',curNode.title)=='on')?true:false;
-			curNode.fadespeed=(getParam('fadespeed',curNode.title)!='')?getParam('fadespeed',curNode.title):0.04;
-			curNode.delay=(getParam('delay',curNode.title)!='')?parseInt(getParam('delay',curNode.title)):0;
-			if (getParam('requireclick',curNode.title)=='on') {
-				curNode.requireclick=true;
-				document.all?curNode.attachEvent('onclick',showHideBox):curNode.addEventListener('click',showHideBox,false);
-				document.all?curNode.attachEvent('onmouseover',hideBox):curNode.addEventListener('mouseover',hideBox,false);
-			}
-			else {// Note : if requireclick is on the stop clicks are ignored   			
-   			if (getParam('doubleclickstop',curNode.title)!='off') {
-   				document.all?curNode.attachEvent('ondblclick',pauseBox):curNode.addEventListener('dblclick',pauseBox,false);
-   			}	
-   			if (getParam('singleclickstop',curNode.title)=='on') {
-   				document.all?curNode.attachEvent('onclick',pauseBox):curNode.addEventListener('click',pauseBox,false);
-   			}
-   		}
-			curNode.windowLock=getParam('windowlock',curNode.title).toLowerCase()=='off'?false:true;
-			curNode.title='';
-			curNode.hasbox=1;
-	   }
-	   else
-	      curNode.hasbox=2;   
-}
-
-
-function getParam(param,list) {
-	var reg = new RegExp('([^a-zA-Z]' + param + '|^' + param + ')\\s*=\\s*\\[\\s*(((\\[\\[)|(\\]\\])|([^\\]\\[]))*)\\s*\\]');
-	var res = reg.exec(list);
-	var returnvar;
-	if(res)
-		return res[2].replace('[[','[').replace(']]',']');
-	else
-		return '';
-}
-
-function Left(elem){	
-	var x=0;
-	if (elem.calcLeft)
-		return elem.calcLeft;
-	var oElem=elem;
-	while(elem){
-		 if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderLeftWidth)))&&(x!=0))
-		 	x+=parseInt(elem.currentStyle.borderLeftWidth);
-		 x+=elem.offsetLeft;
-		 elem=elem.offsetParent;
-	  } 
-	oElem.calcLeft=x;
-	return x;
-	}
-
-function Top(elem){
-	 var x=0;
-	 if (elem.calcTop)
-	 	return elem.calcTop;
-	 var oElem=elem;
-	 while(elem){		
-	 	 if ((elem.currentStyle)&& (!isNaN(parseInt(elem.currentStyle.borderTopWidth)))&&(x!=0))
-		 	x+=parseInt(elem.currentStyle.borderTopWidth); 
-		 x+=elem.offsetTop;
-	         elem=elem.offsetParent;
- 	 } 
- 	 oElem.calcTop=x;
- 	 return x;
- 	 
-}
-
-var ah,ab;
-function applyStyles() {
-	if(ab)
-		oDv.removeChild(dvBdy);
-	if (ah)
-		oDv.removeChild(dvHdr);
-	dvHdr=document.createElement("div");
-	dvBdy=document.createElement("div");
-	CBE.boCSSBDY?dvBdy.className=CBE.boCSSBDY:defBdyStyle();
-	CBE.boCSSHDR?dvHdr.className=CBE.boCSSHDR:defHdrStyle();
-	dvHdr.innerHTML=CBE.boHDR;
-	dvBdy.innerHTML=CBE.boBDY;
-	ah=false;
-	ab=false;
-	if (CBE.boHDR!='') {		
-		oDv.appendChild(dvHdr);
-		ah=true;
-	}	
-	if (CBE.boBDY!=''){
-		oDv.appendChild(dvBdy);
-		ab=true;
-	}	
-}
-
-var CSE,iterElem,LSE,CBE,LBE, totalScrollLeft, totalScrollTop, width, height ;
-var ini=false;
-
-// Customised function for inner window dimension
-function SHW() {
-   if (document.body && (document.body.clientWidth !=0)) {
-      width=document.body.clientWidth;
-      height=document.body.clientHeight;
-   }
-   if (document.documentElement && (document.documentElement.clientWidth!=0) && (document.body.clientWidth + 20 >= document.documentElement.clientWidth)) {
-      width=document.documentElement.clientWidth;   
-      height=document.documentElement.clientHeight;   
-   }   
-   return [width,height];
-}
-
-
-var ID=null;
-function moveMouse(e) {
-   //boxMove=true;
-	e?evt=e:evt=event;
-	
-	CSE=evt.target?evt.target:evt.srcElement;
-	
-	if (!CSE.hasbox) {
-	   // Note we need to scan up DOM here, some elements like TR don't get triggered as srcElement
-	   iElem=CSE;
-	   while ((iElem.parentNode) && (!iElem.hasbox)) {
-	      scanBO(iElem);
-	      iElem=iElem.parentNode;
-	   }	   
-	}
-	
-	if ((CSE!=LSE)&&(!isChild(CSE,dvHdr))&&(!isChild(CSE,dvBdy))){		
-	   if (!CSE.boxItem) {
-			iterElem=CSE;
-			while ((iterElem.hasbox==2)&&(iterElem.parentNode))
-					iterElem=iterElem.parentNode; 
-			CSE.boxItem=iterElem;
-			}
-		iterElem=CSE.boxItem;
-		if (CSE.boxItem&&(CSE.boxItem.hasbox==1))  {
-			LBE=CBE;
-			CBE=iterElem;
-			if (CBE!=LBE) {
-				applyStyles();
-				if (!CBE.requireclick)
-					if (CBE.fade) {
-						if (ID!=null)
-							clearTimeout(ID);
-						ID=setTimeout("fadeIn("+CBE.fadespeed+")",CBE.delay);
-					}
-					else {
-						if (ID!=null)
-							clearTimeout(ID);
-						COL=1;
-						ID=setTimeout("oDv.style.visibility='visible';ID=null;",CBE.delay);						
-					}
-				if (CBE.IEbugfix) {hideSelects();} 
-				fixposx=!isNaN(CBE.fixX)?Left(CBE)+CBE.fixX:CBE.absX;
-				fixposy=!isNaN(CBE.fixY)?Top(CBE)+CBE.fixY:CBE.absY;			
-				lockX=0;
-				lockY=0;
-				boxMove=true;
-				ox=CBE.offX?CBE.offX:10;
-				oy=CBE.offY?CBE.offY:10;
-			}
-		}
-		else if (!isChild(CSE,dvHdr) && !isChild(CSE,dvBdy) && (boxMove))	{
-			// The conditional here fixes flickering between tables cells.
-			if ((!isChild(CBE,CSE)) || (CSE.tagName!='TABLE')) {   			
-   			CBE=null;
-   			if (ID!=null)
-  					clearTimeout(ID);
-   			fadeOut();
-   			showSelects();
-			}
-		}
-		LSE=CSE;
-	}
-	else if (((isChild(CSE,dvHdr) || isChild(CSE,dvBdy))&&(boxMove))) {
-		totalScrollLeft=0;
-		totalScrollTop=0;
-		
-		iterElem=CSE;
-		while(iterElem) {
-			if(!isNaN(parseInt(iterElem.scrollTop)))
-				totalScrollTop+=parseInt(iterElem.scrollTop);
-			if(!isNaN(parseInt(iterElem.scrollLeft)))
-				totalScrollLeft+=parseInt(iterElem.scrollLeft);
-			iterElem=iterElem.parentNode;			
-		}
-		if (CBE!=null) {
-			boxLeft=Left(CBE)-totalScrollLeft;
-			boxRight=parseInt(Left(CBE)+CBE.offsetWidth)-totalScrollLeft;
-			boxTop=Top(CBE)-totalScrollTop;
-			boxBottom=parseInt(Top(CBE)+CBE.offsetHeight)-totalScrollTop;
-			doCheck();
-		}
-	}
-	
-	if (boxMove&&CBE) {
-		// This added to alleviate bug in IE6 w.r.t DOCTYPE
-		bodyScrollTop=document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;
-		bodyScrollLet=document.documentElement&&document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;
-		mouseX=evt.pageX?evt.pageX-bodyScrollLet:evt.clientX-document.body.clientLeft;
-		mouseY=evt.pageY?evt.pageY-bodyScrollTop:evt.clientY-document.body.clientTop;
-		if ((CBE)&&(CBE.windowLock)) {
-			mouseY < -oy?lockY=-mouseY-oy:lockY=0;
-			mouseX < -ox?lockX=-mouseX-ox:lockX=0;
-			mouseY > (SHW()[1]-oDv.offsetHeight-oy)?lockY=-mouseY+SHW()[1]-oDv.offsetHeight-oy:lockY=lockY;
-			mouseX > (SHW()[0]-dvBdy.offsetWidth-ox)?lockX=-mouseX-ox+SHW()[0]-dvBdy.offsetWidth:lockX=lockX;			
-		}
-		oDv.style.left=((fixposx)||(fixposx==0))?fixposx:bodyScrollLet+mouseX+ox+lockX+"px";
-		oDv.style.top=((fixposy)||(fixposy==0))?fixposy:bodyScrollTop+mouseY+oy+lockY+"px";		
-		
-	}
-}
-
-function doCheck() {	
-	if (   (mouseX < boxLeft)    ||     (mouseX >boxRight)     || (mouseY < boxTop) || (mouseY > boxBottom)) {
-		if (!CBE.requireclick)
-			fadeOut();
-		if (CBE.IEbugfix) {showSelects();}
-		CBE=null;
-	}
-}
-
-function pauseBox(e) {
-   e?evt=e:evt=event;
-	boxMove=false;
-	evt.cancelBubble=true;
-}
-
-function showHideBox(e) {
-	oDv.style.visibility=(oDv.style.visibility!='visible')?'visible':'hidden';
-}
-
-function hideBox(e) {
-	oDv.style.visibility='hidden';
-}
-
-var COL=0;
-var stopfade=false;
-function fadeIn(fs) {
-		ID=null;
-		COL=0;
-		oDv.style.visibility='visible';
-		fadeIn2(fs);
-}
-
-function fadeIn2(fs) {
-		COL=COL+fs;
-		COL=(COL>1)?1:COL;
-		oDv.style.filter='alpha(opacity='+parseInt(100*COL)+')';
-		oDv.style.opacity=COL;
-		if (COL<1)
-		 setTimeout("fadeIn2("+fs+")",20);		
-}
-
-
-function fadeOut() {
-	oDv.style.visibility='hidden';
-	
-}
-
-function isChild(s,d) {
-	while(s) {
-		if (s==d) 
-			return true;
-		s=s.parentNode;
-	}
-	return false;
-}
-
-var cSrc;
-function checkMove(e) {
-	e?evt=e:evt=event;
-	cSrc=evt.target?evt.target:evt.srcElement;
-	if ((!boxMove)&&(!isChild(cSrc,oDv))) {
-		fadeOut();
-		if (CBE&&CBE.IEbugfix) {showSelects();}
-		boxMove=true;
-		CBE=null;
-	}
-}
-
-function showSelects(){
-   var elements = document.getElementsByTagName("select");
-   for (i=0;i< elements.length;i++){
-      elements[i].style.visibility='visible';
-   }
-}
-
-function hideSelects(){
-   var elements = document.getElementsByTagName("select");
-   for (i=0;i< elements.length;i++){
-   elements[i].style.visibility='hidden';
-   }
-}
\ No newline at end of file
diff --git a/lib/web/lib/ds-sleight.js b/lib/web/lib/ds-sleight.js
deleted file mode 100644
index b43be15eddca2917ba7be92e0ed763af9e041819..0000000000000000000000000000000000000000
--- a/lib/web/lib/ds-sleight.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Universal transparent-PNG enabler for MSIE/Win 5.5+
-// http://dsandler.org
-// From original code: http://www.youngpup.net/?request=/snippets/sleight.xml
-// and background-image code: http://www.allinthehead.com/retro/69
-// also:
-//  * use sizingMethod=crop to avoid scaling PNGs (who would do such a thing?)
-//  * only do this once, to make it compatible with CSS rollovers
-
-if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
-	window.attachEvent("onload", enableAlphaImages);
-}
-
-function enableAlphaImages(){
-	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
-	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
-	if (itsAllGood) {
-		for (var i=0; i<document.all.length; i++){
-			var obj = document.all[i];
-			var bg = obj.currentStyle.backgroundImage;
-			var img = document.images[i];
-			if (bg && bg.match(/\.png/i) != null) {
-				var img = bg.substring(5,bg.length-2);
-				var offset = obj.style["background-position"];
-				obj.style.filter =
-				"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+img+"', sizingMethod='crop')";
-				obj.style.backgroundImage = "url('"+BLANK_IMG+"')";
-				obj.style["background-position"] = offset; // reapply
-			} else if (img && img.src.match(/\.png$/i) != null) {
-				var src = img.src;
-				img.style.width = img.width + "px";
-				img.style.height = img.height + "px";
-				img.style.filter =
-				"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='crop')"
-				img.src = BLANK_IMG;
-			}
-		}
-	}
-}
\ No newline at end of file
diff --git a/lib/web/mage/jquery-no-conflict.js b/lib/web/mage/jquery-no-conflict.js
deleted file mode 100644
index 779aeb8c41b70bf50f21d4be1cab967edd3fd10d..0000000000000000000000000000000000000000
--- a/lib/web/mage/jquery-no-conflict.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/**
- * @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
- */
-
-jQuery.noConflict();
diff --git a/lib/web/prototype/debug.js b/lib/web/prototype/debug.js
deleted file mode 100644
index 3d8f338836ec6730ff75f25ce4ae86954f22ed46..0000000000000000000000000000000000000000
--- a/lib/web/prototype/debug.js
+++ /dev/null
@@ -1,137 +0,0 @@
-var debugWindow = null;
-function debug(text, reverse) {
-	if (debugWindow == null)
- 		return;
-
-	time = "-"; //new Date();
-	if (reverse) {
-		$('debug').innerHTML = time + " " + text + "<br>"+ 	$('debug').innerHTML;
-		debugWindow.getContent().scrollTop=0;
-	}
-	else {
-		$('debug').innerHTML +=  time + " " + text + "<br>";
-		debugWindow.getContent().scrollTop=10000; // Far away 
-	}
-}
-
-function hideDebug() {
-	if (debugWindow) {
-		debugWindow.destroy();
-		debugWindow = null;
-	}
-}
-
-function showDebug(bShow) {
- if (debugWindow == null) {
-  debugWindow = new Window('debug_window', {className: 'dialog',width:250, height:100, right:4, bottom:42, zIndex:1000, opacity:1, showEffect: Element.show, resizable: true, title: "Debug"})
-  debugWindow.getContent().innerHTML = "<style>#debug_window .dialog_content {background:#000;}</style> <div id='debug'></div>";
-  date=new Date;
-    date.setMonth(date.getMonth()+3);
-    
-  //debugWindow.setCookie(null, date);
- }
- if( typeof bShow == 'undefined' || bShow)debugWindow.show()
-}
-
-
-function clearDebug() {
-	if (debugWindow == null)
- 		return;
-	$('debug').innerHTML = "";
-}
-
-/**
- * document.createElement convenience wrapper
- *
- * The data parameter is an object that must have the "tag" key, containing
- * a string with the tagname of the element to create.  It can optionally have
- * a "children" key which can be: a string, "data" object, or an array of "data"
- * objects to append to this element as children.  Any other key is taken as an
- * attribute to be applied to this tag.
- *
- * Available under an MIT license:
- * http://www.opensource.org/licenses/mit-license.php
- *
- * @param {Object} data The data representing the element to create
- * @return {Element} The element created.
- */
-function $E(data) {
-  var el;
-  if ('string'==typeof data) {
-      el=document.createTextNode(data);
-  } else {
-    //create the element
-    el=document.createElement(data.tag);
-    delete(data.tag);
-
-    //append the children
-    if ('undefined'!=typeof data.children) {
-      if ('string'==typeof data.children ||'undefined'==typeof data.children.length) {
-        //strings and single elements
-        el.appendChild($E(data.children));
-      } else {
-        //arrays of elements
-        for (var i=0, child=null; 'undefined'!=typeof (child=data.children[i]); i++) {
-            el.appendChild($E(child));
-        }
-      }
-      delete(data.children);
-    }
-
-    //any other data is attributes
-    for (attr in data) {
-      el[attr]=data[attr];
-    }
-  }
-
-  return el;
-}
-
-// FROM Nick Hemsley
-var Debug = {
-	inspectOutput: function (container, within) {
-		within = within || debugWindow.getContent()
-		
-		if (debugWindow == null)
- 			return;
-
-		within.appendChild(container)
-	},
-	
-	inspect: function(object) {
-		var cont = $E({tag: "div", className: "inspector"})
-		Debug.inspectObj(object, cont)
-		debugWindow.getContent().appendChild(cont)
-	},
-	
-	inspectObj: function (object, container) {
-		for (prop in object) {
-			Debug.inspectOutput(Debug.inspectable(object, prop), container)
-		}
-	},
-	
-	inspectable: function(object, prop) {
-		cont = $E({tag: 'div', className: 'inspectable', children: [prop + " value: " + object[prop] ]})
-		cont.toInspect = object[prop]
-		Event.observe(cont, 'click', Debug.inspectClicked, false)
-		return cont
-	},
-	
-	inspectClicked: function(e) {
-		Debug.inspectContained(Event.element(e))
-		Event.stop(e)
-	},
-	
-	inspectContained: function(container) {
-		if (container.opened) {
-			container.parentNode.removeChild(container.opened)
-			delete(container.opened)
-		} else {
-			sibling = container.parentNode.insertBefore($E({tag: "div", className: "child"}), container.nextSibling)
-			if (container.toInspect)
-				Debug.inspectObj(container.toInspect, sibling)
-			container.opened = sibling
-		}
-	}
-}
-var inspect = Debug.inspect;
diff --git a/lib/web/prototype/effects.js b/lib/web/prototype/effects.js
deleted file mode 100644
index 8a4a4f9f67ecdc0047af5e7f4f4acad3ec49c856..0000000000000000000000000000000000000000
--- a/lib/web/prototype/effects.js
+++ /dev/null
@@ -1,1094 +0,0 @@
-// script.aculo.us effects.js v1.7.1_beta1, Mon Mar 12 14:40:50 +0100 2007
-
-// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-// Contributors:
-//  Justin Palmer (http://encytemedia.com/)
-//  Mark Pilgrim (http://diveintomark.org/)
-//  Martin Bialasinki
-// 
-// script.aculo.us is freely distributable under the terms of an MIT-style license.
-// For details, see the script.aculo.us web site: http://script.aculo.us/ 
-
-// converts rgb() and #xxx to #xxxxxx format,  
-// returns self (or first argument) if not convertable  
-String.prototype.parseColor = function() {  
-  var color = '#';
-  if(this.slice(0,4) == 'rgb(') {  
-    var cols = this.slice(4,this.length-1).split(',');  
-    var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);  
-  } else {  
-    if(this.slice(0,1) == '#') {  
-      if(this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();  
-      if(this.length==7) color = this.toLowerCase();  
-    }  
-  }  
-  return(color.length==7 ? color : (arguments[0] || this));  
-}
-
-/*--------------------------------------------------------------------------*/
-
-Element.collectTextNodes = function(element) {  
-  return $A($(element).childNodes).collect( function(node) {
-    return (node.nodeType==3 ? node.nodeValue : 
-      (node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
-  }).flatten().join('');
-}
-
-Element.collectTextNodesIgnoreClass = function(element, className) {  
-  return $A($(element).childNodes).collect( function(node) {
-    return (node.nodeType==3 ? node.nodeValue : 
-      ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? 
-        Element.collectTextNodesIgnoreClass(node, className) : ''));
-  }).flatten().join('');
-}
-
-Element.setContentZoom = function(element, percent) {
-  element = $(element);  
-  element.setStyle({fontSize: (percent/100) + 'em'});   
-  if(Prototype.Browser.WebKit) window.scrollBy(0,0);
-  return element;
-}
-
-Element.getInlineOpacity = function(element){
-  return $(element).style.opacity || '';
-}
-
-Element.forceRerendering = function(element) {
-  try {
-    element = $(element);
-    var n = document.createTextNode(' ');
-    element.appendChild(n);
-    element.removeChild(n);
-  } catch(e) { }
-};
-
-/*--------------------------------------------------------------------------*/
-
-Array.prototype.call = function() {
-  var args = arguments;
-  this.each(function(f){ f.apply(this, args) });
-}
-
-/*--------------------------------------------------------------------------*/
-
-var Effect = {
-  _elementDoesNotExistError: {
-    name: 'ElementDoesNotExistError',
-    message: 'The specified DOM element does not exist, but is required for this effect to operate'
-  },
-  tagifyText: function(element) {
-    if(typeof Builder == 'undefined')
-      throw("Effect.tagifyText requires including script.aculo.us' builder.js library");
-      
-    var tagifyStyle = 'position:relative';
-    if(Prototype.Browser.IE) tagifyStyle += ';zoom:1';
-    
-    element = $(element);
-    $A(element.childNodes).each( function(child) {
-      if(child.nodeType==3) {
-        child.nodeValue.toArray().each( function(character) {
-          element.insertBefore(
-            Builder.node('span',{style: tagifyStyle},
-              character == ' ' ? String.fromCharCode(160) : character), 
-              child);
-        });
-        Element.remove(child);
-      }
-    });
-  },
-  multiple: function(element, effect) {
-    var elements;
-    if(((typeof element == 'object') || 
-        (typeof element == 'function')) && 
-       (element.length))
-      elements = element;
-    else
-      elements = $(element).childNodes;
-      
-    var options = Object.extend({
-      speed: 0.1,
-      delay: 0.0
-    }, arguments[2] || {});
-    var masterDelay = options.delay;
-
-    $A(elements).each( function(element, index) {
-      new effect(element, Object.extend(options, { delay: index * options.speed + masterDelay }));
-    });
-  },
-  PAIRS: {
-    'slide':  ['SlideDown','SlideUp'],
-    'blind':  ['BlindDown','BlindUp'],
-    'appear': ['Appear','Fade']
-  },
-  toggle: function(element, effect) {
-    element = $(element);
-    effect = (effect || 'appear').toLowerCase();
-    var options = Object.extend({
-      queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
-    }, arguments[2] || {});
-    Effect[element.visible() ? 
-      Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
-  }
-};
-
-var Effect2 = Effect; // deprecated
-
-/* ------------- transitions ------------- */
-
-Effect.Transitions = {
-  linear: Prototype.K,
-  sinoidal: function(pos) {
-    return (-Math.cos(pos*Math.PI)/2) + 0.5;
-  },
-  reverse: function(pos) {
-    return 1-pos;
-  },
-  flicker: function(pos) {
-    var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
-    return (pos > 1 ? 1 : pos);
-  },
-  wobble: function(pos) {
-    return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
-  },
-  pulse: function(pos, pulses) { 
-    pulses = pulses || 5; 
-    return (
-      Math.round((pos % (1/pulses)) * pulses) == 0 ? 
-            ((pos * pulses * 2) - Math.floor(pos * pulses * 2)) : 
-        1 - ((pos * pulses * 2) - Math.floor(pos * pulses * 2))
-      );
-  },
-  none: function(pos) {
-    return 0;
-  },
-  full: function(pos) {
-    return 1;
-  }
-};
-
-/* ------------- core effects ------------- */
-
-Effect.ScopedQueue = Class.create();
-Object.extend(Object.extend(Effect.ScopedQueue.prototype, Enumerable), {
-  initialize: function() {
-    this.effects  = [];
-    this.interval = null;    
-  },
-  _each: function(iterator) {
-    this.effects._each(iterator);
-  },
-  add: function(effect) {
-    var timestamp = new Date().getTime();
-    
-    var position = (typeof effect.options.queue == 'string') ? 
-      effect.options.queue : effect.options.queue.position;
-    
-    switch(position) {
-      case 'front':
-        // move unstarted effects after this effect  
-        this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
-            e.startOn  += effect.finishOn;
-            e.finishOn += effect.finishOn;
-          });
-        break;
-      case 'with-last':
-        timestamp = this.effects.pluck('startOn').max() || timestamp;
-        break;
-      case 'end':
-        // start effect after last queued effect has finished
-        timestamp = this.effects.pluck('finishOn').max() || timestamp;
-        break;
-    }
-    
-    effect.startOn  += timestamp;
-    effect.finishOn += timestamp;
-
-    if(!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
-      this.effects.push(effect);
-    
-    if(!this.interval)
-      this.interval = setInterval(this.loop.bind(this), 15);
-  },
-  remove: function(effect) {
-    this.effects = this.effects.reject(function(e) { return e==effect });
-    if(this.effects.length == 0) {
-      clearInterval(this.interval);
-      this.interval = null;
-    }
-  },
-  loop: function() {
-    var timePos = new Date().getTime();
-    for(var i=0, len=this.effects.length;i<len;i++) 
-      this.effects[i] && this.effects[i].loop(timePos);
-  }
-});
-
-Effect.Queues = {
-  instances: $H(),
-  get: function(queueName) {
-    if(typeof queueName != 'string') return queueName;
-    
-    if(!this.instances[queueName])
-      this.instances[queueName] = new Effect.ScopedQueue();
-      
-    return this.instances[queueName];
-  }
-}
-Effect.Queue = Effect.Queues.get('global');
-
-Effect.DefaultOptions = {
-  transition: Effect.Transitions.sinoidal,
-  duration:   1.0,   // seconds
-  fps:        100,   // 100= assume 66fps max.
-  sync:       false, // true for combining
-  from:       0.0,
-  to:         1.0,
-  delay:      0.0,
-  queue:      'parallel'
-}
-
-Effect.Base = function() {};
-Effect.Base.prototype = {
-  position: null,
-  start: function(options) {
-    function codeForEvent(options,eventName){
-      return (
-        (options[eventName+'Internal'] ? 'this.options.'+eventName+'Internal(this);' : '') +
-        (options[eventName] ? 'this.options.'+eventName+'(this);' : '')
-      );
-    }
-    if(options.transition === false) options.transition = Effect.Transitions.linear;
-    this.options      = Object.extend(Object.extend({},Effect.DefaultOptions), options || {});
-    this.currentFrame = 0;
-    this.state        = 'idle';
-    this.startOn      = this.options.delay*1000;
-    this.finishOn     = this.startOn+(this.options.duration*1000);
-    this.fromToDelta  = this.options.to-this.options.from;
-    this.totalTime    = this.finishOn-this.startOn;
-    this.totalFrames  = this.options.fps*this.options.duration;
-    
-    eval('this.render = function(pos){ '+
-      'if(this.state=="idle"){this.state="running";'+
-      codeForEvent(options,'beforeSetup')+
-      (this.setup ? 'this.setup();':'')+ 
-      codeForEvent(options,'afterSetup')+
-      '};if(this.state=="running"){'+
-      'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+
-      'this.position=pos;'+
-      codeForEvent(options,'beforeUpdate')+
-      (this.update ? 'this.update(pos);':'')+
-      codeForEvent(options,'afterUpdate')+
-      '}}');
-    
-    this.event('beforeStart');
-    if(!this.options.sync)
-      Effect.Queues.get(typeof this.options.queue == 'string' ? 
-        'global' : this.options.queue.scope).add(this);
-  },
-  loop: function(timePos) {
-    if(timePos >= this.startOn) {
-      if(timePos >= this.finishOn) {
-        this.render(1.0);
-        this.cancel();
-        this.event('beforeFinish');
-        if(this.finish) this.finish(); 
-        this.event('afterFinish');
-        return;  
-      }
-      var pos   = (timePos - this.startOn) / this.totalTime,
-          frame = Math.round(pos * this.totalFrames);
-      if(frame > this.currentFrame) {
-        this.render(pos);
-        this.currentFrame = frame;
-      }
-    }
-  },
-  cancel: function() {
-    if(!this.options.sync)
-      Effect.Queues.get(typeof this.options.queue == 'string' ? 
-        'global' : this.options.queue.scope).remove(this);
-    this.state = 'finished';
-  },
-  event: function(eventName) {
-    if(this.options[eventName + 'Internal']) this.options[eventName + 'Internal'](this);
-    if(this.options[eventName]) this.options[eventName](this);
-  },
-  inspect: function() {
-    var data = $H();
-    for(property in this)
-      if(typeof this[property] != 'function') data[property] = this[property];
-    return '#<Effect:' + data.inspect() + ',options:' + $H(this.options).inspect() + '>';
-  }
-}
-
-Effect.Parallel = Class.create();
-Object.extend(Object.extend(Effect.Parallel.prototype, Effect.Base.prototype), {
-  initialize: function(effects) {
-    this.effects = effects || [];
-    this.start(arguments[1]);
-  },
-  update: function(position) {
-    this.effects.invoke('render', position);
-  },
-  finish: function(position) {
-    this.effects.each( function(effect) {
-      effect.render(1.0);
-      effect.cancel();
-      effect.event('beforeFinish');
-      if(effect.finish) effect.finish(position);
-      effect.event('afterFinish');
-    });
-  }
-});
-
-Effect.Event = Class.create();
-Object.extend(Object.extend(Effect.Event.prototype, Effect.Base.prototype), {
-  initialize: function() {
-    var options = Object.extend({
-      duration: 0
-    }, arguments[0] || {});
-    this.start(options);
-  },
-  update: Prototype.emptyFunction
-});
-
-Effect.Opacity = Class.create();
-Object.extend(Object.extend(Effect.Opacity.prototype, Effect.Base.prototype), {
-  initialize: function(element) {
-    this.element = $(element);
-    if(!this.element) throw(Effect._elementDoesNotExistError);
-    // make this work on IE on elements without 'layout'
-    if(Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
-      this.element.setStyle({zoom: 1});
-    var options = Object.extend({
-      from: this.element.getOpacity() || 0.0,
-      to:   1.0
-    }, arguments[1] || {});
-    this.start(options);
-  },
-  update: function(position) {
-    this.element.setOpacity(position);
-  }
-});
-
-Effect.Move = Class.create();
-Object.extend(Object.extend(Effect.Move.prototype, Effect.Base.prototype), {
-  initialize: function(element) {
-    this.element = $(element);
-    if(!this.element) throw(Effect._elementDoesNotExistError);
-    var options = Object.extend({
-      x:    0,
-      y:    0,
-      mode: 'relative'
-    }, arguments[1] || {});
-    this.start(options);
-  },
-  setup: function() {
-    // Bug in Opera: Opera returns the "real" position of a static element or
-    // relative element that does not have top/left explicitly set.
-    // ==> Always set top and left for position relative elements in your stylesheets 
-    // (to 0 if you do not need them) 
-    this.element.makePositioned();
-    this.originalLeft = parseFloat(this.element.getStyle('left') || '0');
-    this.originalTop  = parseFloat(this.element.getStyle('top')  || '0');
-    if(this.options.mode == 'absolute') {
-      // absolute movement, so we need to calc deltaX and deltaY
-      this.options.x = this.options.x - this.originalLeft;
-      this.options.y = this.options.y - this.originalTop;
-    }
-  },
-  update: function(position) {
-    this.element.setStyle({
-      left: Math.round(this.options.x  * position + this.originalLeft) + 'px',
-      top:  Math.round(this.options.y  * position + this.originalTop)  + 'px'
-    });
-  }
-});
-
-// for backwards compatibility
-Effect.MoveBy = function(element, toTop, toLeft) {
-  return new Effect.Move(element, 
-    Object.extend({ x: toLeft, y: toTop }, arguments[3] || {}));
-};
-
-Effect.Scale = Class.create();
-Object.extend(Object.extend(Effect.Scale.prototype, Effect.Base.prototype), {
-  initialize: function(element, percent) {
-    this.element = $(element);
-    if(!this.element) throw(Effect._elementDoesNotExistError);
-    var options = Object.extend({
-      scaleX: true,
-      scaleY: true,
-      scaleContent: true,
-      scaleFromCenter: false,
-      scaleMode: 'box',        // 'box' or 'contents' or {} with provided values
-      scaleFrom: 100.0,
-      scaleTo:   percent
-    }, arguments[2] || {});
-    this.start(options);
-  },
-  setup: function() {
-    this.restoreAfterFinish = this.options.restoreAfterFinish || false;
-    this.elementPositioning = this.element.getStyle('position');
-    
-    this.originalStyle = {};
-    ['top','left','width','height','fontSize'].each( function(k) {
-      this.originalStyle[k] = this.element.style[k];
-    }.bind(this));
-      
-    this.originalTop  = this.element.offsetTop;
-    this.originalLeft = this.element.offsetLeft;
-    
-    var fontSize = this.element.getStyle('font-size') || '100%';
-    ['em','px','%','pt'].each( function(fontSizeType) {
-      if(fontSize.indexOf(fontSizeType)>0) {
-        this.fontSize     = parseFloat(fontSize);
-        this.fontSizeType = fontSizeType;
-      }
-    }.bind(this));
-    
-    this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
-    
-    this.dims = null;
-    if(this.options.scaleMode=='box')
-      this.dims = [this.element.offsetHeight, this.element.offsetWidth];
-    if(/^content/.test(this.options.scaleMode))
-      this.dims = [this.element.scrollHeight, this.element.scrollWidth];
-    if(!this.dims)
-      this.dims = [this.options.scaleMode.originalHeight,
-                   this.options.scaleMode.originalWidth];
-  },
-  update: function(position) {
-    var currentScale = (this.options.scaleFrom/100.0) + (this.factor * position);
-    if(this.options.scaleContent && this.fontSize)
-      this.element.setStyle({fontSize: this.fontSize * currentScale + this.fontSizeType });
-    this.setDimensions(this.dims[0] * currentScale, this.dims[1] * currentScale);
-  },
-  finish: function(position) {
-    if(this.restoreAfterFinish) this.element.setStyle(this.originalStyle);
-  },
-  setDimensions: function(height, width) {
-    var d = {};
-    if(this.options.scaleX) d.width = Math.round(width) + 'px';
-    if(this.options.scaleY) d.height = Math.round(height) + 'px';
-    if(this.options.scaleFromCenter) {
-      var topd  = (height - this.dims[0])/2;
-      var leftd = (width  - this.dims[1])/2;
-      if(this.elementPositioning == 'absolute') {
-        if(this.options.scaleY) d.top = this.originalTop-topd + 'px';
-        if(this.options.scaleX) d.left = this.originalLeft-leftd + 'px';
-      } else {
-        if(this.options.scaleY) d.top = -topd + 'px';
-        if(this.options.scaleX) d.left = -leftd + 'px';
-      }
-    }
-    this.element.setStyle(d);
-  }
-});
-
-Effect.Highlight = Class.create();
-Object.extend(Object.extend(Effect.Highlight.prototype, Effect.Base.prototype), {
-  initialize: function(element) {
-    this.element = $(element);
-    if(!this.element) throw(Effect._elementDoesNotExistError);
-    var options = Object.extend({ startcolor: '#ffff99' }, arguments[1] || {});
-    this.start(options);
-  },
-  setup: function() {
-    // Prevent executing on elements not in the layout flow
-    if(this.element.getStyle('display')=='none') { this.cancel(); return; }
-    // Disable background image during the effect
-    this.oldStyle = {};
-    if (!this.options.keepBackgroundImage) {
-      this.oldStyle.backgroundImage = this.element.getStyle('background-image');
-      this.element.setStyle({backgroundImage: 'none'});
-    }
-    if(!this.options.endcolor)
-      this.options.endcolor = this.element.getStyle('background-color').parseColor('#ffffff');
-    if(!this.options.restorecolor)
-      this.options.restorecolor = this.element.getStyle('background-color');
-    // init color calculations
-    this._base  = $R(0,2).map(function(i){ return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16) }.bind(this));
-    this._delta = $R(0,2).map(function(i){ return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i] }.bind(this));
-  },
-  update: function(position) {
-    this.element.setStyle({backgroundColor: $R(0,2).inject('#',function(m,v,i){
-      return m+(Math.round(this._base[i]+(this._delta[i]*position)).toColorPart()); }.bind(this)) });
-  },
-  finish: function() {
-    this.element.setStyle(Object.extend(this.oldStyle, {
-      backgroundColor: this.options.restorecolor
-    }));
-  }
-});
-
-Effect.ScrollTo = Class.create();
-Object.extend(Object.extend(Effect.ScrollTo.prototype, Effect.Base.prototype), {
-  initialize: function(element) {
-    this.element = $(element);
-    this.start(arguments[1] || {});
-  },
-  setup: function() {
-    Position.prepare();
-    var offsets = Position.cumulativeOffset(this.element);
-    if(this.options.offset) offsets[1] += this.options.offset;
-    var max = window.innerHeight ? 
-      window.height - window.innerHeight :
-      document.body.scrollHeight - 
-        (document.documentElement.clientHeight ? 
-          document.documentElement.clientHeight : document.body.clientHeight);
-    this.scrollStart = Position.deltaY;
-    this.delta = (offsets[1] > max ? max : offsets[1]) - this.scrollStart;
-  },
-  update: function(position) {
-    Position.prepare();
-    window.scrollTo(Position.deltaX, 
-      this.scrollStart + (position*this.delta));
-  }
-});
-
-/* ------------- combination effects ------------- */
-
-Effect.Fade = function(element) {
-  element = $(element);
-  var oldOpacity = element.getInlineOpacity();
-  var options = Object.extend({
-  from: element.getOpacity() || 1.0,
-  to:   0.0,
-  afterFinishInternal: function(effect) { 
-    if(effect.options.to!=0) return;
-    effect.element.hide().setStyle({opacity: oldOpacity}); 
-  }}, arguments[1] || {});
-  return new Effect.Opacity(element,options);
-}
-
-Effect.Appear = function(element) {
-  element = $(element);
-  var options = Object.extend({
-  from: (element.getStyle('display') == 'none' ? 0.0 : element.getOpacity() || 0.0),
-  to:   1.0,
-  // force Safari to render floated elements properly
-  afterFinishInternal: function(effect) {
-    effect.element.forceRerendering();
-  },
-  beforeSetup: function(effect) {
-    effect.element.setOpacity(effect.options.from).show(); 
-  }}, arguments[1] || {});
-  return new Effect.Opacity(element,options);
-}
-
-Effect.Puff = function(element) {
-  element = $(element);
-  var oldStyle = { 
-    opacity: element.getInlineOpacity(), 
-    position: element.getStyle('position'),
-    top:  element.style.top,
-    left: element.style.left,
-    width: element.style.width,
-    height: element.style.height
-  };
-  return new Effect.Parallel(
-   [ new Effect.Scale(element, 200, 
-      { sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }), 
-     new Effect.Opacity(element, { sync: true, to: 0.0 } ) ], 
-     Object.extend({ duration: 1.0, 
-      beforeSetupInternal: function(effect) {
-        Position.absolutize(effect.effects[0].element)
-      },
-      afterFinishInternal: function(effect) {
-         effect.effects[0].element.hide().setStyle(oldStyle); }
-     }, arguments[1] || {})
-   );
-}
-
-Effect.BlindUp = function(element) {
-  element = $(element);
-  element.makeClipping();
-  return new Effect.Scale(element, 0,
-    Object.extend({ scaleContent: false, 
-      scaleX: false, 
-      restoreAfterFinish: true,
-      afterFinishInternal: function(effect) {
-        effect.element.hide().undoClipping();
-      } 
-    }, arguments[1] || {})
-  );
-}
-
-Effect.BlindDown = function(element) {
-  element = $(element);
-  var elementDimensions = element.getDimensions();
-  return new Effect.Scale(element, 100, Object.extend({ 
-    scaleContent: false, 
-    scaleX: false,
-    scaleFrom: 0,
-    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
-    restoreAfterFinish: true,
-    afterSetup: function(effect) {
-      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
-    },  
-    afterFinishInternal: function(effect) {
-      effect.element.undoClipping();
-    }
-  }, arguments[1] || {}));
-}
-
-Effect.SwitchOff = function(element) {
-  element = $(element);
-  var oldOpacity = element.getInlineOpacity();
-  return new Effect.Appear(element, Object.extend({
-    duration: 0.4,
-    from: 0,
-    transition: Effect.Transitions.flicker,
-    afterFinishInternal: function(effect) {
-      new Effect.Scale(effect.element, 1, { 
-        duration: 0.3, scaleFromCenter: true,
-        scaleX: false, scaleContent: false, restoreAfterFinish: true,
-        beforeSetup: function(effect) { 
-          effect.element.makePositioned().makeClipping();
-        },
-        afterFinishInternal: function(effect) {
-          effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
-        }
-      })
-    }
-  }, arguments[1] || {}));
-}
-
-Effect.DropOut = function(element) {
-  element = $(element);
-  var oldStyle = {
-    top: element.getStyle('top'),
-    left: element.getStyle('left'),
-    opacity: element.getInlineOpacity() };
-  return new Effect.Parallel(
-    [ new Effect.Move(element, {x: 0, y: 100, sync: true }), 
-      new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
-    Object.extend(
-      { duration: 0.5,
-        beforeSetup: function(effect) {
-          effect.effects[0].element.makePositioned(); 
-        },
-        afterFinishInternal: function(effect) {
-          effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
-        } 
-      }, arguments[1] || {}));
-}
-
-Effect.Shake = function(element) {
-  element = $(element);
-  var oldStyle = {
-    top: element.getStyle('top'),
-    left: element.getStyle('left') };
-    return new Effect.Move(element, 
-      { x:  20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
-    new Effect.Move(effect.element,
-      { x: -40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
-    new Effect.Move(effect.element,
-      { x:  40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
-    new Effect.Move(effect.element,
-      { x: -40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
-    new Effect.Move(effect.element,
-      { x:  40, y: 0, duration: 0.1,  afterFinishInternal: function(effect) {
-    new Effect.Move(effect.element,
-      { x: -20, y: 0, duration: 0.05, afterFinishInternal: function(effect) {
-        effect.element.undoPositioned().setStyle(oldStyle);
-  }}) }}) }}) }}) }}) }});
-}
-
-Effect.SlideDown = function(element) {
-  element = $(element).cleanWhitespace();
-  // SlideDown need to have the content of the element wrapped in a container element with fixed height!
-  var oldInnerBottom = element.down().getStyle('bottom');
-  var elementDimensions = element.getDimensions();
-  return new Effect.Scale(element, 100, Object.extend({ 
-    scaleContent: false, 
-    scaleX: false, 
-    scaleFrom: window.opera ? 0 : 1,
-    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
-    restoreAfterFinish: true,
-    afterSetup: function(effect) {
-      effect.element.makePositioned();
-      effect.element.down().makePositioned();
-      if(window.opera) effect.element.setStyle({top: ''});
-      effect.element.makeClipping().setStyle({height: '0px'}).show(); 
-    },
-    afterUpdateInternal: function(effect) {
-      effect.element.down().setStyle({bottom:
-        (effect.dims[0] - effect.element.clientHeight) + 'px' }); 
-    },
-    afterFinishInternal: function(effect) {
-      effect.element.undoClipping().undoPositioned();
-      effect.element.down().undoPositioned().setStyle({bottom: oldInnerBottom}); }
-    }, arguments[1] || {})
-  );
-}
-
-Effect.SlideUp = function(element) {
-  element = $(element).cleanWhitespace();
-  var oldInnerBottom = element.down().getStyle('bottom');
-  return new Effect.Scale(element, window.opera ? 0 : 1,
-   Object.extend({ scaleContent: false, 
-    scaleX: false, 
-    scaleMode: 'box',
-    scaleFrom: 100,
-    restoreAfterFinish: true,
-    beforeStartInternal: function(effect) {
-      effect.element.makePositioned();
-      effect.element.down().makePositioned();
-      if(window.opera) effect.element.setStyle({top: ''});
-      effect.element.makeClipping().show();
-    },  
-    afterUpdateInternal: function(effect) {
-      effect.element.down().setStyle({bottom:
-        (effect.dims[0] - effect.element.clientHeight) + 'px' });
-    },
-    afterFinishInternal: function(effect) {
-      effect.element.hide().undoClipping().undoPositioned().setStyle({bottom: oldInnerBottom});
-      effect.element.down().undoPositioned();
-    }
-   }, arguments[1] || {})
-  );
-}
-
-// Bug in opera makes the TD containing this element expand for a instance after finish 
-Effect.Squish = function(element) {
-  return new Effect.Scale(element, window.opera ? 1 : 0, { 
-    restoreAfterFinish: true,
-    beforeSetup: function(effect) {
-      effect.element.makeClipping(); 
-    },  
-    afterFinishInternal: function(effect) {
-      effect.element.hide().undoClipping(); 
-    }
-  });
-}
-
-Effect.Grow = function(element) {
-  element = $(element);
-  var options = Object.extend({
-    direction: 'center',
-    moveTransition: Effect.Transitions.sinoidal,
-    scaleTransition: Effect.Transitions.sinoidal,
-    opacityTransition: Effect.Transitions.full
-  }, arguments[1] || {});
-  var oldStyle = {
-    top: element.style.top,
-    left: element.style.left,
-    height: element.style.height,
-    width: element.style.width,
-    opacity: element.getInlineOpacity() };
-
-  var dims = element.getDimensions();    
-  var initialMoveX, initialMoveY;
-  var moveX, moveY;
-  
-  switch (options.direction) {
-    case 'top-left':
-      initialMoveX = initialMoveY = moveX = moveY = 0; 
-      break;
-    case 'top-right':
-      initialMoveX = dims.width;
-      initialMoveY = moveY = 0;
-      moveX = -dims.width;
-      break;
-    case 'bottom-left':
-      initialMoveX = moveX = 0;
-      initialMoveY = dims.height;
-      moveY = -dims.height;
-      break;
-    case 'bottom-right':
-      initialMoveX = dims.width;
-      initialMoveY = dims.height;
-      moveX = -dims.width;
-      moveY = -dims.height;
-      break;
-    case 'center':
-      initialMoveX = dims.width / 2;
-      initialMoveY = dims.height / 2;
-      moveX = -dims.width / 2;
-      moveY = -dims.height / 2;
-      break;
-  }
-  
-  return new Effect.Move(element, {
-    x: initialMoveX,
-    y: initialMoveY,
-    duration: 0.01, 
-    beforeSetup: function(effect) {
-      effect.element.hide().makeClipping().makePositioned();
-    },
-    afterFinishInternal: function(effect) {
-      new Effect.Parallel(
-        [ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
-          new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
-          new Effect.Scale(effect.element, 100, {
-            scaleMode: { originalHeight: dims.height, originalWidth: dims.width }, 
-            sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
-        ], Object.extend({
-             beforeSetup: function(effect) {
-               effect.effects[0].element.setStyle({height: '0px'}).show(); 
-             },
-             afterFinishInternal: function(effect) {
-               effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); 
-             }
-           }, options)
-      )
-    }
-  });
-}
-
-Effect.Shrink = function(element) {
-  element = $(element);
-  var options = Object.extend({
-    direction: 'center',
-    moveTransition: Effect.Transitions.sinoidal,
-    scaleTransition: Effect.Transitions.sinoidal,
-    opacityTransition: Effect.Transitions.none
-  }, arguments[1] || {});
-  var oldStyle = {
-    top: element.style.top,
-    left: element.style.left,
-    height: element.style.height,
-    width: element.style.width,
-    opacity: element.getInlineOpacity() };
-
-  var dims = element.getDimensions();
-  var moveX, moveY;
-  
-  switch (options.direction) {
-    case 'top-left':
-      moveX = moveY = 0;
-      break;
-    case 'top-right':
-      moveX = dims.width;
-      moveY = 0;
-      break;
-    case 'bottom-left':
-      moveX = 0;
-      moveY = dims.height;
-      break;
-    case 'bottom-right':
-      moveX = dims.width;
-      moveY = dims.height;
-      break;
-    case 'center':  
-      moveX = dims.width / 2;
-      moveY = dims.height / 2;
-      break;
-  }
-  
-  return new Effect.Parallel(
-    [ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
-      new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
-      new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
-    ], Object.extend({            
-         beforeStartInternal: function(effect) {
-           effect.effects[0].element.makePositioned().makeClipping(); 
-         },
-         afterFinishInternal: function(effect) {
-           effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
-       }, options)
-  );
-}
-
-Effect.Pulsate = function(element) {
-  element = $(element);
-  var options    = arguments[1] || {};
-  var oldOpacity = element.getInlineOpacity();
-  var transition = options.transition || Effect.Transitions.sinoidal;
-  var reverser   = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) };
-  reverser.bind(transition);
-  return new Effect.Opacity(element, 
-    Object.extend(Object.extend({  duration: 2.0, from: 0,
-      afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
-    }, options), {transition: reverser}));
-}
-
-Effect.Fold = function(element) {
-  element = $(element);
-  var oldStyle = {
-    top: element.style.top,
-    left: element.style.left,
-    width: element.style.width,
-    height: element.style.height };
-  element.makeClipping();
-  return new Effect.Scale(element, 5, Object.extend({   
-    scaleContent: false,
-    scaleX: false,
-    afterFinishInternal: function(effect) {
-    new Effect.Scale(element, 1, { 
-      scaleContent: false, 
-      scaleY: false,
-      afterFinishInternal: function(effect) {
-        effect.element.hide().undoClipping().setStyle(oldStyle);
-      } });
-  }}, arguments[1] || {}));
-};
-
-Effect.Morph = Class.create();
-Object.extend(Object.extend(Effect.Morph.prototype, Effect.Base.prototype), {
-  initialize: function(element) {
-    this.element = $(element);
-    if(!this.element) throw(Effect._elementDoesNotExistError);
-    var options = Object.extend({
-      style: {}
-    }, arguments[1] || {});
-    if (typeof options.style == 'string') {
-      if(options.style.indexOf(':') == -1) {
-        var cssText = '', selector = '.' + options.style;
-        $A(document.styleSheets).reverse().each(function(styleSheet) {
-          if (styleSheet.cssRules) cssRules = styleSheet.cssRules;
-          else if (styleSheet.rules) cssRules = styleSheet.rules;
-          $A(cssRules).reverse().each(function(rule) {
-            if (selector == rule.selectorText) {
-              cssText = rule.style.cssText;
-              throw $break;
-            }
-          });
-          if (cssText) throw $break;
-        });
-        this.style = cssText.parseStyle();
-        options.afterFinishInternal = function(effect){
-          effect.element.addClassName(effect.options.style);
-          effect.transforms.each(function(transform) {
-            if(transform.style != 'opacity')
-              effect.element.style[transform.style] = '';
-          });
-        }
-      } else this.style = options.style.parseStyle();
-    } else this.style = $H(options.style)
-    this.start(options);
-  },
-  setup: function(){
-    function parseColor(color){
-      if(!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
-      color = color.parseColor();
-      return $R(0,2).map(function(i){
-        return parseInt( color.slice(i*2+1,i*2+3), 16 ) 
-      });
-    }
-    this.transforms = this.style.map(function(pair){
-      var property = pair[0], value = pair[1], unit = null;
-
-      if(value.parseColor('#zzzzzz') != '#zzzzzz') {
-        value = value.parseColor();
-        unit  = 'color';
-      } else if(property == 'opacity') {
-        value = parseFloat(value);
-        if(Prototype.Browser.IE && (!this.element.currentStyle.hasLayout))
-          this.element.setStyle({zoom: 1});
-      } else if(Element.CSS_LENGTH.test(value)) {
-          var components = value.match(/^([\+\-]?[0-9\.]+)(.*)$/);
-          value = parseFloat(components[1]);
-          unit = (components.length == 3) ? components[2] : null;
-      }
-
-      var originalValue = this.element.getStyle(property);
-      return { 
-        style: property.camelize(), 
-        originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0), 
-        targetValue: unit=='color' ? parseColor(value) : value,
-        unit: unit
-      };
-    }.bind(this)).reject(function(transform){
-      return (
-        (transform.originalValue == transform.targetValue) ||
-        (
-          transform.unit != 'color' &&
-          (isNaN(transform.originalValue) || isNaN(transform.targetValue))
-        )
-      )
-    });
-  },
-  update: function(position) {
-    var style = {}, transform, i = this.transforms.length;
-    while(i--)
-      style[(transform = this.transforms[i]).style] = 
-        transform.unit=='color' ? '#'+
-          (Math.round(transform.originalValue[0]+
-            (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
-          (Math.round(transform.originalValue[1]+
-            (transform.targetValue[1]-transform.originalValue[1])*position)).toColorPart() +
-          (Math.round(transform.originalValue[2]+
-            (transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() :
-        transform.originalValue + Math.round(
-          ((transform.targetValue - transform.originalValue) * position) * 1000)/1000 + transform.unit;
-    this.element.setStyle(style, true);
-  }
-});
-
-Effect.Transform = Class.create();
-Object.extend(Effect.Transform.prototype, {
-  initialize: function(tracks){
-    this.tracks  = [];
-    this.options = arguments[1] || {};
-    this.addTracks(tracks);
-  },
-  addTracks: function(tracks){
-    tracks.each(function(track){
-      var data = $H(track).values().first();
-      this.tracks.push($H({
-        ids:     $H(track).keys().first(),
-        effect:  Effect.Morph,
-        options: { style: data }
-      }));
-    }.bind(this));
-    return this;
-  },
-  play: function(){
-    return new Effect.Parallel(
-      this.tracks.map(function(track){
-        var elements = [$(track.ids) || $$(track.ids)].flatten();
-        return elements.map(function(e){ return new track.effect(e, Object.extend({ sync:true }, track.options)) });
-      }).flatten(),
-      this.options
-    );
-  }
-});
-
-Element.CSS_PROPERTIES = $w(
-  'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' + 
-  'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
-  'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
-  'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
-  'fontSize fontWeight height left letterSpacing lineHeight ' +
-  'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+
-  'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
-  'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
-  'right textIndent top width wordSpacing zIndex');
-  
-Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
-
-String.prototype.parseStyle = function(){
-  var element = document.createElement('div');
-  element.innerHTML = '<div style="' + this + '"></div>';
-  var style = element.childNodes[0].style, styleRules = $H();
-  
-  Element.CSS_PROPERTIES.each(function(property){
-    if(style[property]) styleRules[property] = style[property]; 
-  });
-  if(Prototype.Browser.IE && this.indexOf('opacity') > -1) {
-    styleRules.opacity = this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1];
-  }
-  return styleRules;
-};
-
-Element.morph = function(element, style) {
-  new Effect.Morph(element, Object.extend({ style: style }, arguments[2] || {}));
-  return element;
-};
-
-['getInlineOpacity','forceRerendering','setContentZoom',
- 'collectTextNodes','collectTextNodesIgnoreClass','morph'].each( 
-  function(f) { Element.Methods[f] = Element[f]; }
-);
-
-Element.Methods.visualEffect = function(element, effect, options) {
-  s = effect.dasherize().camelize();
-  effect_class = s.charAt(0).toUpperCase() + s.substring(1);
-  new Effect[effect_class](element, options);
-  return $(element);
-};
-
-Element.addMethods();
\ No newline at end of file
diff --git a/lib/web/prototype/extended_debug.js b/lib/web/prototype/extended_debug.js
deleted file mode 100644
index 2b935b1b7dda57ff3203eb4673961fff1466304b..0000000000000000000000000000000000000000
--- a/lib/web/prototype/extended_debug.js
+++ /dev/null
@@ -1,113 +0,0 @@
-var commandHistory;
-var historyIndex;
-
-function showExtendedDebug() {
-	if (debugWindow != null) {
-	  hideDebug();
-  }
-  
-	if (debugWindow == null) {
-	 	commandHistory = new Array();
-	 	historyIndex = 0;
-		
-		debugWindow = new Window('debug_window', {className: 'dialog',width:250, height:100, right:4, minWidth:250, bottom:42, zIndex:1000, opacity:1, showEffect: Element.show, resizable: true, title: "Debug"})
-		debugWindow.getContent().innerHTML = "<style>#debug_window .dialog_content {background:#000;}</style> <div font='monaco' id='debug' style='padding:3px;color:#0F0;font-family:monaco'></div>";
-
-		//create hourglass icon and attach events to it.
-		var cont = "<div id=\"debug_window_inspect\" style=\"width: 15px; height: 15px; background: transparent url(themes/default/inspect.gif) no-repeat 0 0; position:absolute; top:5px; left:70px; cursor:pointer; z-index:3000;\"></div>";
-
-		new Insertion.After('debug_window_maximize', cont);
-		Event.observe('debug_window_inspect', 'click', enterInspectionMode, false);
-
-		//create command text box
-		cont = "Eval:<input id=\"debug_window_command\" type=\"textbox\" style=\"width:150px; height: 12px; color: black;\">"
-		debugWindow.setStatusBar(cont);
-
-		Event.observe('debug_window_command', 'mousedown', donothing);
-		Event.observe('debug_window_command', 'keypress', evalJS, false);
-	}
-	debugWindow.show();		
-}
-
-function donothing(evt){
-		Field.activate('debug_window_command');
-		return false;
-}
-
-function evalJS(evt){
-	if(evt.keyCode == Event.KEY_RETURN){
-		var js = $F('debug_window_command');
-		try{
-			var ret = eval(js);
-			if(ret != null)
-				debug(ret);
-		}catch(e){
-			debug(e);
-		}
-		$('debug_window_command').value = '';
-
-		Field.activate('debug_window_command');
-		commandHistory.push(js);
-		historyIndex = 0;
-	}
-
-	if(evt.keyCode == Event.KEY_UP){
-		if(commandHistory.length > historyIndex){
-			historyIndex++;
-			var js = commandHistory[commandHistory.length-historyIndex];
-			$('debug_window_command').value = js;
-			Event.stop(evt);
-			Field.activate('debug_window_command');
-		}
-	}
-
-	if(evt.keyCode == Event.KEY_DOWN){
-		if(commandHistory.length >= historyIndex && historyIndex > 1){
-			historyIndex--;
-			var js = commandHistory[commandHistory.length-historyIndex];
-			$('debug_window_command').value = js;
-			Event.stop(evt);
-			Field.activate('debug_window_command');
-		}
-	}	
-}
-
-function enterInspectionMode(evt){
-	//stop observing magnifying glass
-	Event.stopObserving('debug_window_inspect', 'click', enterInspectionMode, false);
-	//change pointer
-	document.body.style.cursor='help';
-	//start observing mouse clicks
-	Event.observe(window, 'click', inspectItem, false);		
-}
-
-function inspectItem(evt){
-	// the element that triggered the event
-	var element = Event.element(evt);
-	if(element.id!="debug_window_inspect"){
-		clearDebug()
-		//change pointer
-		document.body.style.cursor='default';
-		debug(element.id);
-		inspect(element);
-		//stop observing mouse clicks
-		Event.stopObserving(window, 'click', inspectItem, false);
-		//alert('doing something');
-		//start observing mag
-		Event.observe('debug_window_inspect', 'click', enterInspectionMode, false);
-	}
-}
-
-function clearDebug() {
-	var win = $('debug');
-	if (win == null)
-		return;
-		
-	win.innerHTML=" ";
-	//clear inspections too
-	var divs = document.getElementsByClassName('inspector');
-	divs.each(function(div){
-		Element.remove(div);
-	});
-}
-
diff --git a/lib/web/prototype/window_effects.js b/lib/web/prototype/window_effects.js
deleted file mode 100644
index 6ad73cc052e80ee383e45226f8135da959bc0a54..0000000000000000000000000000000000000000
--- a/lib/web/prototype/window_effects.js
+++ /dev/null
@@ -1,157 +0,0 @@
-Effect.ResizeWindow = Class.create();
-Object.extend(Object.extend(Effect.ResizeWindow.prototype, Effect.Base.prototype), {
-  initialize: function(win, top, left, width, height) {
-    this.window = win;
-    this.window.resizing = true;
-    
-    var size = win.getSize();
-    this.initWidth    = parseFloat(size.width);
-    this.initHeight   = parseFloat(size.height);
-
-    var location = win.getLocation();
-    this.initTop    = parseFloat(location.top);
-    this.initLeft   = parseFloat(location.left);
-
-    this.width    = width != null  ? parseFloat(width)  : this.initWidth;
-    this.height   = height != null ? parseFloat(height) : this.initHeight;
-    this.top      = top != null    ? parseFloat(top)    : this.initTop;
-    this.left     = left != null   ? parseFloat(left)   : this.initLeft;
-
-    this.dx     = this.left   - this.initLeft;
-    this.dy     = this.top    - this.initTop;
-    this.dw     = this.width  - this.initWidth;
-    this.dh     = this.height - this.initHeight;
-    
-    this.r2      = $(this.window.getId() + "_row2");
-    this.content = $(this.window.getId() + "_content");
-        
-    this.contentOverflow = this.content.getStyle("overflow") || "auto";
-    this.content.setStyle({overflow: "hidden"});
-    
-    // Wired mode
-    if (this.window.options.wiredDrag) {
-      this.window.currentDrag = win._createWiredElement();
-      this.window.currentDrag.show();
-      this.window.element.hide();
-    }
-
-    this.start(arguments[5]);
-  },
-  
-  update: function(position) {
-    var width  = Math.floor(this.initWidth  + this.dw * position);
-    var height = Math.floor(this.initHeight + this.dh * position);
-    var top    = Math.floor(this.initTop    + this.dy * position);
-    var left   = Math.floor(this.initLeft   + this.dx * position);
-
-    if (window.ie) {
-      if (Math.floor(height) == 0)  
-        this.r2.hide();
-      else if (Math.floor(height) >1)  
-        this.r2.show();
-    }      
-    this.r2.setStyle({height: height});
-    this.window.setSize(width, height);
-    this.window.setLocation(top, left);
-  },
-  
-  finish: function(position) {
-    // Wired mode
-    if (this.window.options.wiredDrag) {
-      this.window._hideWiredElement();
-      this.window.element.show();
-    }
-
-    this.window.setSize(this.width, this.height);
-    this.window.setLocation(this.top, this.left);
-    this.r2.setStyle({height: null});
-    
-    this.content.setStyle({overflow: this.contentOverflow});
-      
-    this.window.resizing = false;
-  }
-});
-
-Effect.ModalSlideDown = function(element) {
-  var windowScroll = WindowUtilities.getWindowScroll();    
-  var height = element.getStyle("height");  
-  element.setStyle({top: - (parseFloat(height) - windowScroll.top) + "px"});
-  
-  element.show();
-  return new Effect.Move(element, Object.extend({ x: 0, y: parseFloat(height) }, arguments[1] || {}));
-};
-
-
-Effect.ModalSlideUp = function(element) {
-  var height = element.getStyle("height");
-  return new Effect.Move(element, Object.extend({ x: 0, y: -parseFloat(height) }, arguments[1] || {}));
-};
-
-PopupEffect = Class.create();
-PopupEffect.prototype = {    
-  initialize: function(htmlElement) {
-    this.html = $(htmlElement);      
-    this.options = Object.extend({className: "popup_effect", duration: 0.4}, arguments[1] || {});
-    
-  },
-  show: function(element, options) { 
-    var position = Position.cumulativeOffset(this.html);      
-    var size = this.html.getDimensions();
-    var bounds = element.win.getBounds();
-    this.window =  element.win;      
-    // Create a div
-    if (!this.div) {
-      this.div = document.createElement("div");
-      this.div.className = this.options.className;
-      this.div.style.height = size.height + "px";
-      this.div.style.width  = size.width  + "px";
-      this.div.style.top    = position[1] + "px";
-      this.div.style.left   = position[0] + "px";   
-      this.div.style.position = "absolute"
-      document.body.appendChild(this.div);
-    }                                                   
-    if (this.options.fromOpacity)
-      this.div.setStyle({opacity: this.options.fromOpacity})
-    this.div.show();          
-    var style = "top:" + bounds.top + ";left:" +bounds.left + ";width:" + bounds.width +";height:" + bounds.height;
-    if (this.options.toOpacity)
-      style += ";opacity:" + this.options.toOpacity;
-    
-    new Effect.Morph(this.div ,{style: style, duration: this.options.duration, afterFinish: this._showWindow.bind(this)});    
-  },
-
-  hide: function(element, options) {     
-    var position = Position.cumulativeOffset(this.html);      
-    var size = this.html.getDimensions();    
-    this.window.visible = true; 
-    var bounds = this.window.getBounds();
-    this.window.visible = false; 
-
-    this.window.element.hide();
-
-    this.div.style.height = bounds.height;
-    this.div.style.width  = bounds.width;
-    this.div.style.top    = bounds.top;
-    this.div.style.left   = bounds.left;
-    
-    if (this.options.toOpacity)
-      this.div.setStyle({opacity: this.options.toOpacity})
-
-    this.div.show();                                 
-    var style = "top:" + position[1] + "px;left:" + position[0] + "px;width:" + size.width +"px;height:" + size.height + "px";
-
-    if (this.options.fromOpacity)
-      style += ";opacity:" + this.options.fromOpacity;
-    new Effect.Morph(this.div ,{style: style, duration: this.options.duration, afterFinish: this._hideDiv.bind(this)});    
-  },
-  
-  _showWindow: function() {
-    this.div.hide();
-    this.window.element.show(); 
-  },
-  
-  _hideDiv: function() {
-    this.div.hide();
-  }
-}
-
diff --git a/lib/web/prototype/window_ext.js b/lib/web/prototype/window_ext.js
deleted file mode 100644
index 60efac61b4b733b04e090c5479c5d8e6e0692d77..0000000000000000000000000000000000000000
--- a/lib/web/prototype/window_ext.js
+++ /dev/null
@@ -1,115 +0,0 @@
-// Copyright (c) 2006 Sébastien Gruhier (http://xilinus.com, http://itseb.com)
-// YOU MUST INCLUDE window.js BEFORE
-//
-// Object to store hide/show windows status in a cookie
-// Just add at the end of your HTML file this javascript line: WindowStore.init()
-WindowStore = {
-  doSetCookie: false,
-  cookieName:  "__window_store__",
-  expired:     null,
-  
-  // Init function with two optional parameters
-  // - cookieName (default = __window_store__)
-  // - expiration date (default 3 years from now)
-  init: function(cookieName, expired) {
-    WindowStore.cookieName = cookieName || WindowStore.cookieName
-
-    if (! expired) {
-      var today = new Date();
-      today.setYear(today.getYear()+1903);
-      WindowStore.expired = today;
-    }
-    else
-      WindowStore.expired = expired;
-
-    Windows.windows.each(function(win) {
-      win.setCookie(win.getId(), WindowStore.expired);
-    });
-
-    // Create observer on show/hide events
-    var myObserver = {
-    	onShow: function(eventName, win) {
-    	  WindowStore._saveCookie();
-    	},
-    	
-    	onClose: function(eventName, win) {
-    	  WindowStore._saveCookie();
-  	  },
-  	  
-    	onHide: function(eventName, win) {
-    	  WindowStore._saveCookie();
-    	}
-    }
-    Windows.addObserver(myObserver);
-
-    WindowStore._restoreWindows();
-    WindowStore._saveCookie();
-  },
-  
-  show: function(win) {
-    eval("var cookie = " + WindowUtilities.getCookie(WindowStore.cookieName));
-    if (cookie != null) {
-      if (cookie[win.getId()])
-        win.show();
-    }
-    else
-      win.show();
-  },
-
-  // Function to store windows show/hide status in a cookie 
-  _saveCookie: function() {
-    if (!doSetCookie)
-      return;
-    
-    var cookieValue = "{";
-    Windows.windows.each(function(win) {
-      if (cookieValue != "{")
-        cookieValue += ","
-      cookieValue += win.getId() + ": " + win.isVisible();
-    });
-    cookieValue += "}"
-  
-    WindowUtilities.setCookie(cookieValue, [WindowStore.cookieName, WindowStore.expired]);  
-  },
-
-  // Function to restore windows show/hide status from a cookie if exists
-  _restoreWindows: function() {
-    eval("var cookie = " + WindowUtilities.getCookie(WindowStore.cookieName));
-    if (cookie != null) {
-      doSetCookie = false;
-      Windows.windows.each(function(win) {
-        if (cookie[win.getId()])
-          win.show();
-      });
-    }
-    doSetCookie = true;
-  }
-}
-
-// Object to set a close key an all windows
-WindowCloseKey = {
-  keyCode: Event.KEY_ESC,
-  
-  init: function(keyCode) {
-    if (keyCode)
-      WindowCloseKey.keyCode = keyCode;      
-      
-    Event.observe(document, 'keydown', this._closeCurrentWindow.bindAsEventListener(this));   
-  },
-  
-  _closeCurrentWindow: function(event) {
-    var e = event || window.event
-  	var characterCode = e.which || e.keyCode;
-  	
-  	// Check if there is a top window (it means it's an URL content)
-  	var win = top.Windows.focusedWindow;
-    if (characterCode == WindowCloseKey.keyCode && win) {
-      if (win.cancelCallback) 
-        top.Dialog.cancelCallback();      
-      else if (win.okCallback) 
-        top.Dialog.okCallback();
-      else
-        top.Windows.close(top.Windows.focusedWindow.getId());
-    }
-  }
-}
\ No newline at end of file
diff --git a/lib/web/scriptaculous/scriptaculous.js b/lib/web/scriptaculous/scriptaculous.js
deleted file mode 100644
index 3e5543bd01f62c4c0f60d493f5ed869443567eb5..0000000000000000000000000000000000000000
--- a/lib/web/scriptaculous/scriptaculous.js
+++ /dev/null
@@ -1,60 +0,0 @@
-// script.aculo.us scriptaculous.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
-
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-// For details, see the script.aculo.us web site: http://script.aculo.us/
-
-var Scriptaculous = {
-  Version: '1.8.2',
-  require: function(libraryName) {
-    // inserting via DOM fails in Safari 2.0, so brute force approach
-    document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
-  },
-  REQUIRED_PROTOTYPE: '1.6.0.3',
-  load: function() {
-    function convertVersionString(versionString) {
-      var v = versionString.replace(/_.*|\./g, '');
-      v = parseInt(v + '0'.times(4-v.length));
-      return versionString.indexOf('_') > -1 ? v-1 : v;
-    }
-
-    if((typeof Prototype=='undefined') ||
-       (typeof Element == 'undefined') ||
-       (typeof Element.Methods=='undefined') ||
-       (convertVersionString(Prototype.Version) <
-        convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
-       throw("script.aculo.us requires the Prototype JavaScript framework >= " +
-        Scriptaculous.REQUIRED_PROTOTYPE);
-
-    var js = /scriptaculous\.js(\?.*)?$/;
-    $$('head script[src]').findAll(function(s) {
-      return s.src.match(js);
-    }).each(function(s) {
-      var path = s.src.replace(js, ''),
-      includes = s.src.match(/\?.*load=([a-z,]*)/);
-      (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each(
-       function(include) { Scriptaculous.require(path+include+'.js') });
-    });
-  }
-};
-
-Scriptaculous.load();
\ No newline at end of file
diff --git a/lib/web/scriptaculous/unittest.js b/lib/web/scriptaculous/unittest.js
deleted file mode 100644
index 446097ec51696b715c0717022228f7c7ceb4ba7b..0000000000000000000000000000000000000000
--- a/lib/web/scriptaculous/unittest.js
+++ /dev/null
@@ -1,568 +0,0 @@
-// script.aculo.us unittest.js v1.8.2, Tue Nov 18 18:30:58 +0100 2008
-
-// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
-//           (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
-//           (c) 2005-2008 Michael Schuerig (http://www.schuerig.de/michael/)
-//
-// script.aculo.us is freely distributable under the terms of an MIT-style license.
-// For details, see the script.aculo.us web site: http://script.aculo.us/
-
-// experimental, Firefox-only
-Event.simulateMouse = function(element, eventName) {
-  var options = Object.extend({
-    pointerX: 0,
-    pointerY: 0,
-    buttons:  0,
-    ctrlKey:  false,
-    altKey:   false,
-    shiftKey: false,
-    metaKey:  false
-  }, arguments[2] || {});
-  var oEvent = document.createEvent("MouseEvents");
-  oEvent.initMouseEvent(eventName, true, true, document.defaultView, 
-    options.buttons, options.pointerX, options.pointerY, options.pointerX, options.pointerY, 
-    options.ctrlKey, options.altKey, options.shiftKey, options.metaKey, 0, $(element));
-  
-  if(this.mark) Element.remove(this.mark);
-  this.mark = document.createElement('div');
-  this.mark.appendChild(document.createTextNode(" "));
-  document.body.appendChild(this.mark);
-  this.mark.style.position = 'absolute';
-  this.mark.style.top = options.pointerY + "px";
-  this.mark.style.left = options.pointerX + "px";
-  this.mark.style.width = "5px";
-  this.mark.style.height = "5px;";
-  this.mark.style.borderTop = "1px solid red;";
-  this.mark.style.borderLeft = "1px solid red;";
-  
-  if(this.step)
-    alert('['+new Date().getTime().toString()+'] '+eventName+'/'+Test.Unit.inspect(options));
-  
-  $(element).dispatchEvent(oEvent);
-};
-
-// Note: Due to a fix in Firefox 1.0.5/6 that probably fixed "too much", this doesn't work in 1.0.6 or DP2.
-// You need to downgrade to 1.0.4 for now to get this working
-// See https://bugzilla.mozilla.org/show_bug.cgi?id=289940 for the fix that fixed too much
-Event.simulateKey = function(element, eventName) {
-  var options = Object.extend({
-    ctrlKey: false,
-    altKey: false,
-    shiftKey: false,
-    metaKey: false,
-    keyCode: 0,
-    charCode: 0
-  }, arguments[2] || {});
-
-  var oEvent = document.createEvent("KeyEvents");
-  oEvent.initKeyEvent(eventName, true, true, window, 
-    options.ctrlKey, options.altKey, options.shiftKey, options.metaKey,
-    options.keyCode, options.charCode );
-  $(element).dispatchEvent(oEvent);
-};
-
-Event.simulateKeys = function(element, command) {
-  for(var i=0; i<command.length; i++) {
-    Event.simulateKey(element,'keypress',{charCode:command.charCodeAt(i)});
-  }
-};
-
-var Test = {};
-Test.Unit = {};
-
-// security exception workaround
-Test.Unit.inspect = Object.inspect;
-
-Test.Unit.Logger = Class.create();
-Test.Unit.Logger.prototype = {
-  initialize: function(log) {
-    this.log = $(log);
-    if (this.log) {
-      this._createLogTable();
-    }
-  },
-  start: function(testName) {
-    if (!this.log) return;
-    this.testName = testName;
-    this.lastLogLine = document.createElement('tr');
-    this.statusCell = document.createElement('td');
-    this.nameCell = document.createElement('td');
-    this.nameCell.className = "nameCell";
-    this.nameCell.appendChild(document.createTextNode(testName));
-    this.messageCell = document.createElement('td');
-    this.lastLogLine.appendChild(this.statusCell);
-    this.lastLogLine.appendChild(this.nameCell);
-    this.lastLogLine.appendChild(this.messageCell);
-    this.loglines.appendChild(this.lastLogLine);
-  },
-  finish: function(status, summary) {
-    if (!this.log) return;
-    this.lastLogLine.className = status;
-    this.statusCell.innerHTML = status;
-    this.messageCell.innerHTML = this._toHTML(summary);
-    this.addLinksToResults();
-  },
-  message: function(message) {
-    if (!this.log) return;
-    this.messageCell.innerHTML = this._toHTML(message);
-  },
-  summary: function(summary) {
-    if (!this.log) return;
-    this.logsummary.innerHTML = this._toHTML(summary);
-  },
-  _createLogTable: function() {
-    this.log.innerHTML =
-    '<div id="logsummary"></div>' +
-    '<table id="logtable">' +
-    '<thead><tr><th>Status</th><th>Test</th><th>Message</th></tr></thead>' +
-    '<tbody id="loglines"></tbody>' +
-    '</table>';
-    this.logsummary = $('logsummary');
-    this.loglines = $('loglines');
-  },
-  _toHTML: function(txt) {
-    return txt.escapeHTML().replace(/\n/g,"<br/>");
-  },
-  addLinksToResults: function(){ 
-    $$("tr.failed .nameCell").each( function(td){ // todo: limit to children of this.log
-      td.title = "Run only this test";
-      Event.observe(td, 'click', function(){ window.location.search = "?tests=" + td.innerHTML;});
-    });
-    $$("tr.passed .nameCell").each( function(td){ // todo: limit to children of this.log
-      td.title = "Run all tests";
-      Event.observe(td, 'click', function(){ window.location.search = "";});
-    });
-  }
-};
-
-Test.Unit.Runner = Class.create();
-Test.Unit.Runner.prototype = {
-  initialize: function(testcases) {
-    this.options = Object.extend({
-      testLog: 'testlog'
-    }, arguments[1] || {});
-    this.options.resultsURL = this.parseResultsURLQueryParameter();
-    this.options.tests      = this.parseTestsQueryParameter();
-    if (this.options.testLog) {
-      this.options.testLog = $(this.options.testLog) || null;
-    }
-    if(this.options.tests) {
-      this.tests = [];
-      for(var i = 0; i < this.options.tests.length; i++) {
-        if(/^test/.test(this.options.tests[i])) {
-          this.tests.push(new Test.Unit.Testcase(this.options.tests[i], testcases[this.options.tests[i]], testcases["setup"], testcases["teardown"]));
-        }
-      }
-    } else {
-      if (this.options.test) {
-        this.tests = [new Test.Unit.Testcase(this.options.test, testcases[this.options.test], testcases["setup"], testcases["teardown"])];
-      } else {
-        this.tests = [];
-        for(var testcase in testcases) {
-          if(/^test/.test(testcase)) {
-            this.tests.push(
-               new Test.Unit.Testcase(
-                 this.options.context ? ' -> ' + this.options.titles[testcase] : testcase, 
-                 testcases[testcase], testcases["setup"], testcases["teardown"]
-               ));
-          }
-        }
-      }
-    }
-    this.currentTest = 0;
-    this.logger = new Test.Unit.Logger(this.options.testLog);
-    setTimeout(this.runTests.bind(this), 1000);
-  },
-  parseResultsURLQueryParameter: function() {
-    return window.location.search.parseQuery()["resultsURL"];
-  },
-  parseTestsQueryParameter: function(){
-    if (window.location.search.parseQuery()["tests"]){
-        return window.location.search.parseQuery()["tests"].split(',');
-    };
-  },
-  // Returns:
-  //  "ERROR" if there was an error,
-  //  "FAILURE" if there was a failure, or
-  //  "SUCCESS" if there was neither
-  getResult: function() {
-    var hasFailure = false;
-    for(var i=0;i<this.tests.length;i++) {
-      if (this.tests[i].errors > 0) {
-        return "ERROR";
-      }
-      if (this.tests[i].failures > 0) {
-        hasFailure = true;
-      }
-    }
-    if (hasFailure) {
-      return "FAILURE";
-    } else {
-      return "SUCCESS";
-    }
-  },
-  postResults: function() {
-    if (this.options.resultsURL) {
-      new Ajax.Request(this.options.resultsURL, 
-        { method: 'get', parameters: 'result=' + this.getResult(), asynchronous: false });
-    }
-  },
-  runTests: function() {
-    var test = this.tests[this.currentTest];
-    if (!test) {
-      // finished!
-      this.postResults();
-      this.logger.summary(this.summary());
-      return;
-    }
-    if(!test.isWaiting) {
-      this.logger.start(test.name);
-    }
-    test.run();
-    if(test.isWaiting) {
-      this.logger.message("Waiting for " + test.timeToWait + "ms");
-      setTimeout(this.runTests.bind(this), test.timeToWait || 1000);
-    } else {
-      this.logger.finish(test.status(), test.summary());
-      this.currentTest++;
-      // tail recursive, hopefully the browser will skip the stackframe
-      this.runTests();
-    }
-  },
-  summary: function() {
-    var assertions = 0;
-    var failures = 0;
-    var errors = 0;
-    var messages = [];
-    for(var i=0;i<this.tests.length;i++) {
-      assertions +=   this.tests[i].assertions;
-      failures   +=   this.tests[i].failures;
-      errors     +=   this.tests[i].errors;
-    }
-    return (
-      (this.options.context ? this.options.context + ': ': '') + 
-      this.tests.length + " tests, " + 
-      assertions + " assertions, " + 
-      failures   + " failures, " +
-      errors     + " errors");
-  }
-};
-
-Test.Unit.Assertions = Class.create();
-Test.Unit.Assertions.prototype = {
-  initialize: function() {
-    this.assertions = 0;
-    this.failures   = 0;
-    this.errors     = 0;
-    this.messages   = [];
-  },
-  summary: function() {
-    return (
-      this.assertions + " assertions, " + 
-      this.failures   + " failures, " +
-      this.errors     + " errors" + "\n" +
-      this.messages.join("\n"));
-  },
-  pass: function() {
-    this.assertions++;
-  },
-  fail: function(message) {
-    this.failures++;
-    this.messages.push("Failure: " + message);
-  },
-  info: function(message) {
-    this.messages.push("Info: " + message);
-  },
-  error: function(error) {
-    this.errors++;
-    this.messages.push(error.name + ": "+ error.message + "(" + Test.Unit.inspect(error) +")");
-  },
-  status: function() {
-    if (this.failures > 0) return 'failed';
-    if (this.errors > 0) return 'error';
-    return 'passed';
-  },
-  assert: function(expression) {
-    var message = arguments[1] || 'assert: got "' + Test.Unit.inspect(expression) + '"';
-    try { expression ? this.pass() : 
-      this.fail(message); }
-    catch(e) { this.error(e); }
-  },
-  assertEqual: function(expected, actual) {
-    var message = arguments[2] || "assertEqual";
-    try { (expected == actual) ? this.pass() :
-      this.fail(message + ': expected "' + Test.Unit.inspect(expected) + 
-        '", actual "' + Test.Unit.inspect(actual) + '"'); }
-    catch(e) { this.error(e); }
-  },
-  assertInspect: function(expected, actual) {
-    var message = arguments[2] || "assertInspect";
-    try { (expected == actual.inspect()) ? this.pass() :
-      this.fail(message + ': expected "' + Test.Unit.inspect(expected) + 
-        '", actual "' + Test.Unit.inspect(actual) + '"'); }
-    catch(e) { this.error(e); }
-  },
-  assertEnumEqual: function(expected, actual) {
-    var message = arguments[2] || "assertEnumEqual";
-    try { $A(expected).length == $A(actual).length && 
-      expected.zip(actual).all(function(pair) { return pair[0] == pair[1] }) ?
-        this.pass() : this.fail(message + ': expected ' + Test.Unit.inspect(expected) + 
-          ', actual ' + Test.Unit.inspect(actual)); }
-    catch(e) { this.error(e); }
-  },
-  assertNotEqual: function(expected, actual) {
-    var message = arguments[2] || "assertNotEqual";
-    try { (expected != actual) ? this.pass() : 
-      this.fail(message + ': got "' + Test.Unit.inspect(actual) + '"'); }
-    catch(e) { this.error(e); }
-  },
-  assertIdentical: function(expected, actual) { 
-    var message = arguments[2] || "assertIdentical"; 
-    try { (expected === actual) ? this.pass() : 
-      this.fail(message + ': expected "' + Test.Unit.inspect(expected) +  
-        '", actual "' + Test.Unit.inspect(actual) + '"'); } 
-    catch(e) { this.error(e); } 
-  },
-  assertNotIdentical: function(expected, actual) { 
-    var message = arguments[2] || "assertNotIdentical"; 
-    try { !(expected === actual) ? this.pass() : 
-      this.fail(message + ': expected "' + Test.Unit.inspect(expected) +  
-        '", actual "' + Test.Unit.inspect(actual) + '"'); } 
-    catch(e) { this.error(e); } 
-  },
-  assertNull: function(obj) {
-    var message = arguments[1] || 'assertNull';
-    try { (obj==null) ? this.pass() : 
-      this.fail(message + ': got "' + Test.Unit.inspect(obj) + '"'); }
-    catch(e) { this.error(e); }
-  },
-  assertMatch: function(expected, actual) {
-    var message = arguments[2] || 'assertMatch';
-    var regex = new RegExp(expected);
-    try { (regex.exec(actual)) ? this.pass() :
-      this.fail(message + ' : regex: "' +  Test.Unit.inspect(expected) + ' did not match: ' + Test.Unit.inspect(actual) + '"'); }
-    catch(e) { this.error(e); }
-  },
-  assertHidden: function(element) {
-    var message = arguments[1] || 'assertHidden';
-    this.assertEqual("none", element.style.display, message);
-  },
-  assertNotNull: function(object) {
-    var message = arguments[1] || 'assertNotNull';
-    this.assert(object != null, message);
-  },
-  assertType: function(expected, actual) {
-    var message = arguments[2] || 'assertType';
-    try { 
-      (actual.constructor == expected) ? this.pass() : 
-      this.fail(message + ': expected "' + Test.Unit.inspect(expected) +  
-        '", actual "' + (actual.constructor) + '"'); }
-    catch(e) { this.error(e); }
-  },
-  assertNotOfType: function(expected, actual) {
-    var message = arguments[2] || 'assertNotOfType';
-    try { 
-      (actual.constructor != expected) ? this.pass() : 
-      this.fail(message + ': expected "' + Test.Unit.inspect(expected) +  
-        '", actual "' + (actual.constructor) + '"'); }
-    catch(e) { this.error(e); }
-  },
-  assertInstanceOf: function(expected, actual) {
-    var message = arguments[2] || 'assertInstanceOf';
-    try { 
-      (actual instanceof expected) ? this.pass() : 
-      this.fail(message + ": object was not an instance of the expected type"); }
-    catch(e) { this.error(e); } 
-  },
-  assertNotInstanceOf: function(expected, actual) {
-    var message = arguments[2] || 'assertNotInstanceOf';
-    try { 
-      !(actual instanceof expected) ? this.pass() : 
-      this.fail(message + ": object was an instance of the not expected type"); }
-    catch(e) { this.error(e); } 
-  },
-  assertRespondsTo: function(method, obj) {
-    var message = arguments[2] || 'assertRespondsTo';
-    try {
-      (obj[method] && typeof obj[method] == 'function') ? this.pass() : 
-      this.fail(message + ": object doesn't respond to [" + method + "]"); }
-    catch(e) { this.error(e); }
-  },
-  assertReturnsTrue: function(method, obj) {
-    var message = arguments[2] || 'assertReturnsTrue';
-    try {
-      var m = obj[method];
-      if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)];
-      m() ? this.pass() : 
-      this.fail(message + ": method returned false"); }
-    catch(e) { this.error(e); }
-  },
-  assertReturnsFalse: function(method, obj) {
-    var message = arguments[2] || 'assertReturnsFalse';
-    try {
-      var m = obj[method];
-      if(!m) m = obj['is'+method.charAt(0).toUpperCase()+method.slice(1)];
-      !m() ? this.pass() : 
-      this.fail(message + ": method returned true"); }
-    catch(e) { this.error(e); }
-  },
-  assertRaise: function(exceptionName, method) {
-    var message = arguments[2] || 'assertRaise';
-    try { 
-      method();
-      this.fail(message + ": exception expected but none was raised"); }
-    catch(e) {
-      ((exceptionName == null) || (e.name==exceptionName)) ? this.pass() : this.error(e); 
-    }
-  },
-  assertElementsMatch: function() {
-    var expressions = $A(arguments), elements = $A(expressions.shift());
-    if (elements.length != expressions.length) {
-      this.fail('assertElementsMatch: size mismatch: ' + elements.length + ' elements, ' + expressions.length + ' expressions');
-      return false;
-    }
-    elements.zip(expressions).all(function(pair, index) {
-      var element = $(pair.first()), expression = pair.last();
-      if (element.match(expression)) return true;
-      this.fail('assertElementsMatch: (in index ' + index + ') expected ' + expression.inspect() + ' but got ' + element.inspect());
-    }.bind(this)) && this.pass();
-  },
-  assertElementMatches: function(element, expression) {
-    this.assertElementsMatch([element], expression);
-  },
-  benchmark: function(operation, iterations) {
-    var startAt = new Date();
-    (iterations || 1).times(operation);
-    var timeTaken = ((new Date())-startAt);
-    this.info((arguments[2] || 'Operation') + ' finished ' + 
-       iterations + ' iterations in ' + (timeTaken/1000)+'s' );
-    return timeTaken;
-  },
-  _isVisible: function(element) {
-    element = $(element);
-    if(!element.parentNode) return true;
-    this.assertNotNull(element);
-    if(element.style && Element.getStyle(element, 'display') == 'none')
-      return false;
-    
-    return this._isVisible(element.parentNode);
-  },
-  assertNotVisible: function(element) {
-    this.assert(!this._isVisible(element), Test.Unit.inspect(element) + " was not hidden and didn't have a hidden parent either. " + ("" || arguments[1]));
-  },
-  assertVisible: function(element) {
-    this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1]));
-  },
-  benchmark: function(operation, iterations) {
-    var startAt = new Date();
-    (iterations || 1).times(operation);
-    var timeTaken = ((new Date())-startAt);
-    this.info((arguments[2] || 'Operation') + ' finished ' + 
-       iterations + ' iterations in ' + (timeTaken/1000)+'s' );
-    return timeTaken;
-  }
-};
-
-Test.Unit.Testcase = Class.create();
-Object.extend(Object.extend(Test.Unit.Testcase.prototype, Test.Unit.Assertions.prototype), {
-  initialize: function(name, test, setup, teardown) {
-    Test.Unit.Assertions.prototype.initialize.bind(this)();
-    this.name           = name;
-    
-    if(typeof test == 'string') {
-      test = test.gsub(/(\.should[^\(]+\()/,'#{0}this,');
-      test = test.gsub(/(\.should[^\(]+)\(this,\)/,'#{1}(this)');
-      this.test = function() {
-        eval('with(this){'+test+'}');
-      }
-    } else {
-      this.test = test || function() {};
-    }
-    
-    this.setup          = setup || function() {};
-    this.teardown       = teardown || function() {};
-    this.isWaiting      = false;
-    this.timeToWait     = 1000;
-  },
-  wait: function(time, nextPart) {
-    this.isWaiting = true;
-    this.test = nextPart;
-    this.timeToWait = time;
-  },
-  run: function() {
-    try {
-      try {
-        if (!this.isWaiting) this.setup.bind(this)();
-        this.isWaiting = false;
-        this.test.bind(this)();
-      } finally {
-        if(!this.isWaiting) {
-          this.teardown.bind(this)();
-        }
-      }
-    }
-    catch(e) { this.error(e); }
-  }
-});
-
-// *EXPERIMENTAL* BDD-style testing to please non-technical folk
-// This draws many ideas from RSpec http://rspec.rubyforge.org/
-
-Test.setupBDDExtensionMethods = function(){
-  var METHODMAP = {
-    shouldEqual:     'assertEqual',
-    shouldNotEqual:  'assertNotEqual',
-    shouldEqualEnum: 'assertEnumEqual',
-    shouldBeA:       'assertType',
-    shouldNotBeA:    'assertNotOfType',
-    shouldBeAn:      'assertType',
-    shouldNotBeAn:   'assertNotOfType',
-    shouldBeNull:    'assertNull',
-    shouldNotBeNull: 'assertNotNull',
-    
-    shouldBe:        'assertReturnsTrue',
-    shouldNotBe:     'assertReturnsFalse',
-    shouldRespondTo: 'assertRespondsTo'
-  };
-  var makeAssertion = function(assertion, args, object) { 
-   	this[assertion].apply(this,(args || []).concat([object]));
-  };
-  
-  Test.BDDMethods = {};   
-  $H(METHODMAP).each(function(pair) { 
-    Test.BDDMethods[pair.key] = function() { 
-       var args = $A(arguments); 
-       var scope = args.shift(); 
-       makeAssertion.apply(scope, [pair.value, args, this]); }; 
-  });
-  
-  [Array.prototype, String.prototype, Number.prototype, Boolean.prototype].each(
-    function(p){ Object.extend(p, Test.BDDMethods) }
-  );
-};
-
-Test.context = function(name, spec, log){
-  Test.setupBDDExtensionMethods();
-  
-  var compiledSpec = {};
-  var titles = {};
-  for(specName in spec) {
-    switch(specName){
-      case "setup":
-      case "teardown":
-        compiledSpec[specName] = spec[specName];
-        break;
-      default:
-        var testName = 'test'+specName.gsub(/\s+/,'-').camelize();
-        var body = spec[specName].toString().split('\n').slice(1);
-        if(/^\{/.test(body[0])) body = body.slice(1);
-        body.pop();
-        body = body.map(function(statement){ 
-          return statement.strip()
-        });
-        compiledSpec[testName] = body.join('\n');
-        titles[testName] = specName;
-    }
-  }
-  new Test.Unit.Runner(compiledSpec, { titles: titles, testLog: log || 'testlog', context: name });
-};
\ No newline at end of file
diff --git a/package.json b/package.json
index 5708ba3d703521f3e977769af40b039179ac10b1..726d04cd8c3d10f77aa1e5f3e22695eeaa8aaf17 100644
--- a/package.json
+++ b/package.json
@@ -6,6 +6,7 @@
     "grunt-contrib-clean": "^0.6.0",
     "grunt-contrib-less": "^0.12.0",
     "grunt-contrib-watch": "^0.6.1",
+    "grunt-contrib-uglify": "^0.7.0",
     "grunt-styledocco": "^0.1.4",
     "load-grunt-tasks": "^1.0.0",
     "time-grunt": "^1.0.0"