Index: other-projects/nz-flag-design/trunk/main-form/js/liteaccordion-with-resize.jquery.js
===================================================================
--- other-projects/nz-flag-design/trunk/main-form/js/liteaccordion-with-resize.jquery.js	(revision 29617)
+++ other-projects/nz-flag-design/trunk/main-form/js/liteaccordion-with-resize.jquery.js	(revision 29617)
@@ -0,0 +1,434 @@
+/*************************************************!
+*
+*   project:    liteAccordion - a horizontal accordion plugin for jQuery
+*   author:     Nicola Hibbert
+*   url:        http://nicolahibbert.com/liteaccordion-v2/
+*   demo:       http://www.nicolahibbert.com/demo/liteAccordion/
+*
+*   Version:    2.2.0
+*   Copyright:  (c) 2010-2013 Nicola Hibbert
+*   Licence:    MIT
+*
+**************************************************/
+
+;(function($) {
+
+    var LiteAccordion = function(elem, options) {
+
+        var defaults = {
+            containerWidth : 960,                   // fixed (px)
+            containerHeight : 320,                  // fixed (px)
+            headerWidth : 48,                       // fixed (px)
+
+            activateOn : 'click',                   // click or mouseover
+            firstSlide : 1,                         // displays slide (n) on page load
+            slideSpeed : 800,                       // slide animation speed
+            onTriggerSlide : function(e) {},        // callback on slide activate
+            onSlideAnimComplete : function() {},    // callback on slide anim complete
+
+            autoPlay : false,                       // automatically cycle through slides
+            pauseOnHover : false,                   // pause on hover
+            cycleSpeed : 6000,                      // time between slide cycles
+            easing : 'swing',                       // custom easing function
+
+            theme : 'basic',                        // basic, dark, light, or stitch
+            rounded : false,                        // square or rounded corners
+            enumerateSlides : false,                // put numbers on slides
+            linkable : false                        // link slides via hash
+        },
+
+        // merge defaults with options in new settings object
+            settings = $.extend({}, defaults, options),
+
+        // 'globals'
+            slides = elem.children('ol').children('li'),
+            header = slides.children(':first-child'),
+            slideLen = slides.length,
+            slideWidth = settings.containerWidth - slideLen * settings.headerWidth,
+
+        // public methods
+            methods = {
+
+                // start elem animation
+                play : function(index) {
+                	console.log(index);
+                    var next = core.nextSlide(index && index);
+
+                    if (core.playing) return;
+
+                    // start autoplay
+                    core.playing = setInterval(function() {
+                        header.eq(next()).trigger('click.liteAccordion');
+                    }, settings.cycleSpeed);
+                },
+
+                // stop elem animation
+                stop : function() {
+                    clearInterval(core.playing);
+                    core.playing = 0;
+                },
+
+                // trigger next slide
+                next : function() {
+                    methods.stop();
+                    header.eq(core.currentSlide === slideLen - 1 ? 0 : core.currentSlide + 1).trigger('click.liteAccordion');
+                },
+
+                // trigger previous slide
+                prev : function() {
+                    methods.stop();
+                    header.eq(core.currentSlide - 1).trigger('click.liteAccordion');
+                },
+
+                // destroy plugin instance
+                destroy : function() {
+                    // stop autoplay
+                    methods.stop();
+
+                    // remove hashchange event bound to window
+                    $(window).off('.liteAccordion');
+
+                    // remove generated styles, classes, data, events
+                    elem
+                        .attr('style', '')
+                        .removeClass('liteAccordion basic dark light stitch')
+                        .removeData('liteAccordion')
+                        .off('.liteAccordion')
+                        .find('li > :first-child')
+                        .off('.liteAccordion')
+                        .filter('.selected')
+                        .removeClass('selected')
+                        .end()
+                        .find('b')
+                        .remove();
+
+                    slides
+                        .removeClass('slide')
+                        .children()
+                        .attr('style', '');
+                },
+
+                // poke around the internals (NOT CHAINABLE)
+                debug : function() {
+                    return {
+                        elem : elem,
+                        defaults : defaults,
+                        settings : settings,
+                        methods : methods,
+                        core : core
+                    };
+                },
+                resize:function(data){
+                	settings = $.extend({}, defaults, data),
+            		slides = elem.children('ol').children('li'),
+            		header = slides.children(':first-child'),
+            		slideLen = slides.length,
+            		slideWidth = settings.containerWidth - slideLen * settings.headerWidth;
+            		
+            		
+                	core.setStyles();
+                }
+            },
+
+        // core utility and animation methods
+            core = {
+
+                // set style properties
+                setStyles : function() {
+                    // set container height and width, theme and corner style
+                    elem
+                        .width(settings.containerWidth)
+                        .height(settings.containerHeight)
+                        .addClass('liteAccordion')
+                        .addClass(settings.rounded && 'rounded')
+                        .addClass(settings.theme);
+
+                    // set slide heights
+                    slides
+                        .addClass('slide')
+                        .children(':first-child')
+                        .height(settings.headerWidth);
+
+                    // set slide positions
+                    core.setSlidePositions();
+                },
+
+                // set initial positions for each slide
+                setSlidePositions : function() {
+                    var selected = header.filter('.selected');
+
+                    // account for already selected slide
+                    if (!selected.length) header.eq(settings.firstSlide - 1).addClass('selected');
+
+                    header.each(function(index) {
+                        var $this = $(this),
+                            left = index * settings.headerWidth,
+                            margin = header.first().next(),
+                            offset = parseInt(margin.css('marginLeft'), 10) || parseInt(margin.css('marginRight'), 10) || 0;
+
+                        // compensate for already selected slide on resize
+                        if (selected.length) {
+                            if (index > header.index(selected)) left += slideWidth;
+                        } else {
+                            if (index >= settings.firstSlide) left += slideWidth;
+                        }
+
+                        // set each slide position
+                        $this
+                            .css('left', left)
+                            .width(settings.containerHeight)
+                            .next()
+                                .width(slideWidth - offset)
+                                .css({ left : left, paddingLeft : settings.headerWidth });
+
+                        // add number to bottom of tab
+                        settings.enumerateSlides && $this.append('<b>' + (index + 1) + '</b>');
+
+                    });
+                },
+
+                // bind events
+                bindEvents : function() {
+                    // bind click and mouseover events
+                    if (settings.activateOn === 'click') {
+                        header.on('click.liteAccordion', core.triggerSlide);
+                    } else if (settings.activateOn === 'mouseover') {
+                        header.on('click.liteAccordion mouseover.liteAccordion', core.triggerSlide);
+                    }
+
+                    // bind hashchange event
+                    if (settings.linkable) {
+                        $(window).on('hashchange.liteAccordion', function(e) {
+                            var url = slides.filter(function() {
+                                return $(this).attr('data-slide-name') === window.location.hash.split('#')[1];
+                            });
+
+                            // if slide name exists
+                            if (url.length) {
+                                // trigger slide
+                                core.triggerSlide.call(url.children('h2')[0], e);
+                            }
+                        });
+                    }
+
+                    // pause on hover (can't use custom events with $.hover())
+                    if (settings.pauseOnHover && settings.autoPlay) {
+                        elem
+                            .on('mouseover.liteAccordion', function() {
+                                core.playing && methods.stop();
+                            })
+                            .on('mouseout.liteAccordion', function() {
+                                !core.playing && methods.play(core.currentSlide);
+                            });
+                    }
+                },
+
+                // counter for autoPlay (zero index firstSlide on init)
+                currentSlide : settings.firstSlide - 1,
+
+                // next slide index
+                nextSlide : function(index) {
+                    var next = index + 1 || core.currentSlide + 1;
+
+                    // closure
+                    return function() {
+                        return next++ % slideLen;
+                    };
+                },
+
+                // holds interval counter
+                playing : 0,
+
+                slideAnimCompleteFlag : false,
+
+                // trigger slide animation
+                triggerSlide : function(e) {
+                    var $this = $(this),
+                        tab = {
+                            elem : $this,
+                            index : header.index($this),
+                            next : $this.next(),
+                            prev : $this.parent().prev().children('h2'),
+                            parent : $this.parent()
+                        };
+
+                    // current hash not correct?
+                    if (settings.linkable && tab.parent.attr('data-slide-name')) {
+                        if (tab.parent.attr('data-slide-name') !== window.location.hash.split('#')[1]) {
+                            // exit early and try again (prevents double trigger (issue #60))
+                            return window.location.hash = '#' + tab.parent.attr('data-slide-name');
+                        }
+                    }
+
+                    // update core.currentSlide
+                    core.currentSlide = tab.index;
+
+                    // reset onSlideAnimComplete callback flag
+                    core.slideAnimCompleteFlag = false;
+
+                    // trigger callback in context of sibling div (jQuery wrapped)
+                    settings.onTriggerSlide.call(tab.next, $this);
+
+                    // animate
+                    if ($this.hasClass('selected') && $this.position().left < slideWidth / 2) {
+                        // animate single selected tab
+                        core.animSlide.call(tab);
+                    } else {
+                        // animate groups
+                        core.animSlideGroup(tab);
+                    }
+
+                    // stop autoplay, reset current slide index in core.nextSlide closure
+                    if (settings.autoPlay) {
+                        methods.stop();
+                        methods.play(header.index(header.filter('.selected')));
+                    }
+                },
+
+                animSlide : function(triggerTab) {
+                    var _this = this;
+
+                    // set pos for single selected tab
+                    if (typeof this.pos === 'undefined') this.pos = slideWidth;
+
+                    // remove, then add selected class
+                    header.removeClass('selected').filter(this.elem).addClass('selected');
+
+                    // if slide index not zero
+                    if (!!this.index) {
+                        this.elem
+                            .add(this.next)
+                            .stop(true)
+                            .animate({
+                                left : this.pos + this.index * settings.headerWidth
+                            },
+                                settings.slideSpeed,
+                                settings.easing,
+                                function() {
+                                    // flag ensures that fn is only called one time per triggerSlide
+                                    if (!core.slideAnimCompleteFlag) {
+                                        // trigger onSlideAnimComplete callback in context of sibling div (jQuery wrapped)
+                                        settings.onSlideAnimComplete.call(triggerTab ? triggerTab.next : _this.prev.next());
+                                        core.slideAnimCompleteFlag = true;
+                                    }
+                                });
+
+                            // remove, then add selected class
+                            header.removeClass('selected').filter(this.prev).addClass('selected');
+
+                    }
+                },
+
+                // animates left and right groups of slides
+                animSlideGroup : function(triggerTab) {
+                    var group = ['left', 'right'];
+
+                    $.each(group, function(index, side) {
+                        var filterExpr, left;
+
+                        if (side === 'left')  {
+                            filterExpr = ':lt(' + (triggerTab.index + 1) + ')';
+                            left = 0;
+                        } else {
+                            filterExpr = ':gt(' + triggerTab.index + ')';
+                            left = slideWidth;
+                        }
+
+                        slides
+                            .filter(filterExpr)
+                            .children('h2')
+                            .each(function() {
+                                var $this = $(this),
+                                    tab = {
+                                        elem : $this,
+                                        index : header.index($this),
+                                        next : $this.next(),
+                                        prev : $this.parent().prev().children('h2'),
+                                        pos : left
+                                    };
+
+                                // trigger item anim, pass original trigger context for callback fn
+                                core.animSlide.call(tab, triggerTab);
+                            });
+
+                    });
+
+                    // remove, then add selected class
+                    header.removeClass('selected').filter(triggerTab.elem).addClass('selected');
+                },
+
+                ieClass : function(version) {
+                    if (version < 7) methods.destroy();
+                    if (version >= 10) return;
+                    if (version === 7 || version === 8) {
+                        slides.each(function(index) {
+                            $(this).addClass('slide-' + index);
+                        });
+                    }
+
+                    elem.addClass('ie ie' + version);
+                },
+
+                init : function() {
+                    var ua = navigator.userAgent,
+                        index = ua.indexOf('MSIE');
+
+                    // test for ie
+                    if (index !== -1) {
+                        ua = ua.slice(index + 5, index + 7);
+                        core.ieClass(+ua);
+                    }
+
+                    // init styles and events
+                    core.setStyles();
+                    core.bindEvents();
+
+                    // check slide speed is not faster than cycle speed
+                    if (settings.cycleSpeed < settings.slideSpeed) settings.cycleSpeed = settings.slideSpeed;
+
+                    // init autoplay
+                    settings.autoPlay && methods.play();
+                }
+            };
+
+        // init plugin
+        core.init();
+
+        // expose methods
+        return methods;
+
+    };
+
+    $.fn.liteAccordion = function() {
+    	var method=arguments[0];
+        var elem = this,
+            instance = elem.data('liteAccordion');
+
+        // if creating a new instance
+        if (typeof method === 'object' || !method) {
+            return elem.each(function() {
+                var liteAccordion;
+
+                // if plugin already instantiated, return
+                if (instance) return;
+
+                // otherwise create a new instance
+                liteAccordion = new LiteAccordion(elem, method);
+                elem.data('liteAccordion', liteAccordion);
+            });
+
+        // otherwise, call method on current instance
+        } else if (typeof method === 'string' && instance[method]) {
+        	 arguments = Array.prototype.slice.call(arguments, 1);		
+            // debug method isn't chainable b/c we need the debug object to be returned
+            if (method === 'debug') {
+                return instance[method].call(elem);
+            } else { // the rest of the methods are chainable though
+                instance[method].apply(elem, arguments);
+               
+                return elem;
+            }
+        }
+    };
+
+})(jQuery);
Index: other-projects/nz-flag-design/trunk/main-form/js/liteaccordion-with-resize.jquery.min.js
===================================================================
--- other-projects/nz-flag-design/trunk/main-form/js/liteaccordion-with-resize.jquery.min.js	(revision 29617)
+++ other-projects/nz-flag-design/trunk/main-form/js/liteaccordion-with-resize.jquery.min.js	(revision 29617)
@@ -0,0 +1,13 @@
+/*************************************************!
+*
+*   project:    liteAccordion - a horizontal accordion plugin for jQuery
+*   author:     Nicola Hibbert
+*   url:        http://nicolahibbert.com/liteaccordion-v2/
+*   demo:       http://www.nicolahibbert.com/demo/liteAccordion/
+*
+*   Version:    2.2.0
+*   Copyright:  (c) 2010-2013 Nicola Hibbert
+*   Licence:    MIT
+*
+**************************************************/
+(function(b){var a=function(g,l){var i={containerWidth:960,containerHeight:320,headerWidth:48,activateOn:"click",firstSlide:1,slideSpeed:800,onTriggerSlide:function(m){},onSlideAnimComplete:function(){},autoPlay:false,pauseOnHover:false,cycleSpeed:6000,easing:"swing",theme:"basic",rounded:false,enumerateSlides:false,linkable:false},h=b.extend({},i,l),c=g.children("ol").children("li"),j=c.children(":first-child"),k=c.length,f=h.containerWidth-k*h.headerWidth,e={play:function(m){var n=d.nextSlide(m&&m);if(d.playing){return}d.playing=setInterval(function(){j.eq(n()).trigger("click.liteAccordion")},h.cycleSpeed)},stop:function(){clearInterval(d.playing);d.playing=0},next:function(){e.stop();j.eq(d.currentSlide===k-1?0:d.currentSlide+1).trigger("click.liteAccordion")},prev:function(){e.stop();j.eq(d.currentSlide-1).trigger("click.liteAccordion")},destroy:function(){e.stop();b(window).off(".liteAccordion");g.attr("style","").removeClass("liteAccordion basic dark light stitch").removeData("liteAccordion").off(".liteAccordion").find("li > :first-child").off(".liteAccordion").filter(".selected").removeClass("selected").end().find("b").remove();c.removeClass("slide").children().attr("style","")},debug:function(){return{elem:g,defaults:i,settings:h,methods:e,core:d}}},d={setStyles:function(){g.width(h.containerWidth).height(h.containerHeight).addClass("liteAccordion").addClass(h.rounded&&"rounded").addClass(h.theme);c.addClass("slide").children(":first-child").height(h.headerWidth);d.setSlidePositions()},setSlidePositions:function(){var m=j.filter(".selected");if(!m.length){j.eq(h.firstSlide-1).addClass("selected")}j.each(function(n){var q=b(this),p=n*h.headerWidth,o=j.first().next(),r=parseInt(o.css("marginLeft"),10)||parseInt(o.css("marginRight"),10)||0;if(m.length){if(n>j.index(m)){p+=f}}else{if(n>=h.firstSlide){p+=f}}q.css("left",p).width(h.containerHeight).next().width(f-r).css({left:p,paddingLeft:h.headerWidth});h.enumerateSlides&&q.append("<b>"+(n+1)+"</b>")})},bindEvents:function(){if(h.activateOn==="click"){j.on("click.liteAccordion",d.triggerSlide)}else{if(h.activateOn==="mouseover"){j.on("click.liteAccordion mouseover.liteAccordion",d.triggerSlide)}}if(h.linkable){b(window).on("hashchange.liteAccordion",function(n){var m=c.filter(function(){return b(this).attr("data-slide-name")===window.location.hash.split("#")[1]});if(m.length){d.triggerSlide.call(m.children("h2")[0],n)}})}if(h.pauseOnHover&&h.autoPlay){g.on("mouseover.liteAccordion",function(){d.playing&&e.stop()}).on("mouseout.liteAccordion",function(){!d.playing&&e.play(d.currentSlide)})}},currentSlide:h.firstSlide-1,nextSlide:function(m){var n=m+1||d.currentSlide+1;return function(){return n++%k}},playing:0,slideAnimCompleteFlag:false,triggerSlide:function(o){var n=b(this),m={elem:n,index:j.index(n),next:n.next(),prev:n.parent().prev().children("h2"),parent:n.parent()};if(h.linkable&&m.parent.attr("data-slide-name")){if(m.parent.attr("data-slide-name")!==window.location.hash.split("#")[1]){return window.location.hash="#"+m.parent.attr("data-slide-name")}}d.currentSlide=m.index;d.slideAnimCompleteFlag=false;h.onTriggerSlide.call(m.next,n);if(n.hasClass("selected")&&n.position().left<f/2){d.animSlide.call(m)}else{d.animSlideGroup(m)}if(h.autoPlay){e.stop();e.play(j.index(j.filter(".selected")))}},animSlide:function(m){var n=this;if(typeof this.pos==="undefined"){this.pos=f}j.removeClass("selected").filter(this.elem).addClass("selected");if(!!this.index){this.elem.add(this.next).stop(true).animate({left:this.pos+this.index*h.headerWidth},h.slideSpeed,h.easing,function(){if(!d.slideAnimCompleteFlag){h.onSlideAnimComplete.call(m?m.next:n.prev.next());d.slideAnimCompleteFlag=true}});j.removeClass("selected").filter(this.prev).addClass("selected")}},animSlideGroup:function(m){var n=["left","right"];b.each(n,function(o,p){var r,q;if(p==="left"){r=":lt("+(m.index+1)+")";q=0}else{r=":gt("+m.index+")";q=f}c.filter(r).children("h2").each(function(){var t=b(this),s={elem:t,index:j.index(t),next:t.next(),prev:t.parent().prev().children("h2"),pos:q};d.animSlide.call(s,m)})});j.removeClass("selected").filter(m.elem).addClass("selected")},ieClass:function(m){if(m<7){e.destroy()}if(m>=10){return}if(m===7||m===8){c.each(function(n){b(this).addClass("slide-"+n)})}g.addClass("ie ie"+m)},init:function(){var n=navigator.userAgent,m=n.indexOf("MSIE");if(m!==-1){n=n.slice(m+5,m+7);d.ieClass(+n)}d.setStyles();d.bindEvents();if(h.cycleSpeed<h.slideSpeed){h.cycleSpeed=h.slideSpeed}h.autoPlay&&e.play()}};d.init();return e};b.fn.liteAccordion=function(e){var d=this,c=d.data("liteAccordion");if(typeof e==="object"||!e){return d.each(function(){var f;if(c){return}f=new a(d,e);d.data("liteAccordion",f)})}else{if(typeof e==="string"&&c[e]){if(e==="debug"){return c[e].call(d)}else{c[e].call(d);return d}}}}})(jQuery);
