(function () {
    "use strict";
//	this function is strict...


    YUI.add('navigatepage', function (Y) {
        var header, sidenav, footer;
        Y.header = function () {
	    // header for all pages
            var headerbox = Y.one('#header3'),
                ldlogo = '<img class="logo" alt="LittleDane logo" title="LittleDane logo" src= "http://www.littledane.com/images/littledane_logo.gif" />',
                homeanchor = '<a href="/home.html">' + ldlogo + '</a>',
                navmenu = '<!-- tab menu --><ul id="menu">' + 
                        '<li id="nav-1"><a href="/index.html">home</a></li>' +
                        '<li id="nav-2"><a href="/blankets/home.html">baby/kids blankets</a></li>' +
                        '<li id="nav-3"><a href="/throws/home.html">adult throws</a></li>' +
                        '<li id="nav-4"><a href="/about.html">about</a></li>' +
                        '<li id="nav-5"><a href="https://littledane.com/php/site_login.php">sign in</a></li>' +
                        '</ul><!-- end tab menu --></div>',
                ldcontactinfoLIstyle1 = 'color: "#FF0000", padding-top: "10px"',
                ldcontactinfo = '<ul id="ldcontactinfo" ' + 
                        '><li style=' + ldcontactinfoLIstyle1 + 
                        '><strong>The Little Dane, Inc.</strong></li><li' +
                        '>postal <strong>P.O. Box 3181 Walnut Creek, CA 94598</strong></li><li' +
                        '>parcel <strong>1706 Agadir Street Concord, CA 94518</strong></li><li' +
                        '>voice <strong>925.429.0242</strong></li><li' +
                        '>fax <strong>925.429.1300</strong></li><li' +
                        '>email <strong><a href="mailto:karin@littledane.com">karin@littledane.com</a></strong></li></ul>',
                leftheaderbox = '<div class="leftheaderbox">' + homeanchor + ldcontactinfo + navmenu + '</div>';

            if (!headerbox) { return; } 
            return headerbox.setContent(leftheaderbox);
        };  // end of Y.header

        Y.footer = function () {
            // footer navigation for all pages
            var navbox = Y.one('#footer_tabs'),
                navmenu = '<!-- page footer --><br />' +
                          '<p><a href="/blankets/home.html">baby blankets</a> | ' +
                          '<a href="/blankets/home.html">kids blankets</a> | ' +
                          '<a href="/blankets/bunting/home.html">buntings</a> | ' +
                          '<a href="/blankets/cape/home.html">kids hooded capes</a> | ' +
                          '<a href="/blankets/hot water bottle/home.html">kids hot water bottles</a> | ' +
                          '<a href="/blankets/kimono/home.html">kids kimonos</a> | ' +
                          '<a href="/blankets/pillow cover/home.html">kids pillow covers</a> | ' +
                          '<a href="/blankets/seed cushion/home.html">kids seed cushions</a> | ' +
                          '<a href="/throws/home.html">adult throws</a> | ' +
                          '<a href="/throws/home.html">adult blankets</a> | ' +
                          '<a href="/throws/hot water bottle/home.html">adult hot water bottles</a> | ' +
                          '<a href="/throws/kimono/home.html">adult kimonos</a> | ' +
                          '<a href="/throws/cushion cover/home.html">adult cushion covers</a> | ' +
                          '<a href="/throws/pet blanket/home.html">pet blankets</a> | ' + 
                          '<br />' +
                          '<a href="/compliance.html">material and product standards compliance</a> | ' +
                          '<a href="/privacy.html">privacy policy</a> | ' +
                          'Copyright &copy; The Little Dane, Inc.</p>',
                _gaq = _gaq || [];

            _gaq.push(['_setAccount', 'UA-2224450-1']);
            _gaq.push(['_trackPageview']);

            (function () {
                var ga = document.createElement('script'),
                    s = document.getElementsByTagName('script')[0];
                
                ga.type = 'text/javascript';
                ga.async = true;
                ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                s.parentNode.insertBefore(ga, s);
            })();
            if (!navbox) { return; }
            return navbox.setContent(navmenu);
        };  // end of Y.footer


        Y.sidenav = function () {
            // side navigation for home page

            var navbox = Y.one('#nav_accordion'),

                sidenavhtml = '<div class="bd">' +
                              '<div id="myaccordion" class="yui3-accordion">' +
                                 '<div class="yui3-module yui3-accordion-item first-of-type">' +
                                     '<div class="yui3-hd yui3-accordion-item-hd">' +
                                         '<a href="#" class="yui3-accordion-item-trigger">category</a>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p><a href="/blankets/home.html#BLANKETS" title="baby/kids blankets" alt="baby/kids blankets">baby/kids blankets</a></p>' +
                                         '<p><a href="/throws/home.html#THROWS" title="adult throws" alt="adult throws"> adult throws</a></p>' +
                                     '</div>' +
                                 '</div>' +
                                 '<div class="yui3-module yui3-accordion-item">' +
                                     '<div class="yui3-hd yui3-accordion-item-hd">' +
                                         '<a href="#" class="yui3-accordion-item-trigger">baby/kids blankets</a>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>flannel</strong></p>' +
                                         '<p><a href="/blankets/Juwel/home.html" title="juwel" alt="juwel">juwel</a></p>' +
                                         '<p><a href="/blankets/Lili/home.html" title="lili" alt="lili">lili</a></p>' +
                                         '<p><a href="/blankets/Lena/home.html" title="lena" alt="lena">lena (organic cotton)</a></p>' +
                                         '<p><a href="/blankets/Pepe/home.html" title="pepe" alt="pepe">pepe (organic cotton)</a></p>' +
                                         '<p><a href="/blankets/Kroko/home.html" title="kroko" alt="kroko">kroko</a></p>' +
                                         '<p><a href="/blankets/Othello/home.html" title="othello" alt="othello">othello</a></p>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>velour</strong></p>' +
                                         '<p><a href="/blankets/Niki/home.html" title="niki" alt="niki">niki</a></p>' +
                                         '<p><a href="/blankets/Panda/home.html" title="panda" alt="panda">panda (organic bamboo)</a></p>' +
                                         '<p><a href="/blankets/Finn/home.html" title="finn" alt="finn">finn</a></p>' +
                                         '<p><a href="/blankets/Lara/home.html" title="lara" alt="lara">lara</a></p>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>crocheted</strong></p>' +
                                         '<p><a href="/blankets/Bambi/home.html" title="bambi" alt="bambi">bambi</a></p>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>organic</strong></p>' +
                                         '<p><a href="/blankets/Lena/home.html" title="lena" alt="lena">lena (organic cotton)</a></p>' +
                                         '<p><a href="/blankets/Pepe/home.html" title="pepe" alt="pepe">pepe (organic cotton)</a></p>' +
                                         '<p><a href="/blankets/Panda/home.html" title="panda" alt="panda">panda (organic bamboo)</a></p>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>blanket twin bed</strong></p>' +
                                         '<p><a href="/blankets/Juwel/home.html#SIZE56inx80in%20" title="juwel" alt="juwel">juwel</a></p>' +
                                         '<p><a href="/blankets/Kroko/home.html" title="kroko" alt="kroko">kroko</a></p>' +
                                         '<p><a href="/blankets/Othello/home.html" title="othello" alt="othello">othello</a></p>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>accessories</strong></p>' +
                                         '<p><a href="/blankets/bunting/home.html" title="cotton bunting" alt="cotton bunting">bunting (cotton)</a></p>' +
                                         '<p><a href="/blankets/organicbunting/home.html" title="organic cotton bunting" alt="organic cotton bunting">bunting (organic cotton)</a></p>' +
                                         '<p><a href="/blankets/hot water bottle/home.html" title="hot water bottle" alt="hot water bottle">hot water bottle</a></p>' +
                                         '<p><a href="/blankets/cape/home.html" title="hooded cape" alt="hooded cape">hooded cape</a></p>' +
                                         '<p><a href="/blankets/kimono/home.html" title="kimono" alt="kimono">kimono</a></p>' +
                                         '<p><a href="/blankets/pillow cover/home.html" title="pillow cover" alt="pillow cover">pillow cover</a></p>' +
                                         '<p><a href="/blankets/seed cushion/home.html" title="seed cushion" alt="seed cushion">seed cushion</a></p>' +
                                         '<p><a href="/blankets/stockings/home.html" title="stockings" alt="stockings">stockings</a></p>' +
                                         '<p><a href="/blankets/Advent calendar/home.html" title="Advent calendar" alt="Advent calendar">Advent calendar</a></p>' +                                     '</div>' +
                                 '</div>' +
                                 '<div class="yui3-module yui3-accordion-item">' +
                                     '<div class="yui3-hd yui3-accordion-item-hd">' +
                                         '<a href="#" class="yui3-accordion-item-trigger">adult throws</a>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>flannel</strong></p>' +
                                         '<p><a href="/throws/Silvretta/home.html" title="silvretta" alt="silvretta">silvretta</a></p>' +
                                         '<p><a href="/throws/Sylt/home.html" title="sylt" alt="sylt">sylt</a></p>' +
                                         '<p><a href="/throws/SyltAlpin/home.html" title="sylt alpin" alt="sylt alpin">sylt alpin</a></p>' +                                         '<p><a href="/throws/Diva/home.html" title="diva" alt="diva">diva</a></p>' +
                                         '<p><a href="/throws/Nova/home.html" title="nova" alt="nova">nova</a></p>' +
                                         '<p><a href="/throws/NovaPlaid/home.html" title="nova plaid" alt="nova plaid">nova plaid</a></p>' +                                         '<p><a href="/throws/Jade/home.html" title="jade" alt="jade">jade (organic cotton)</a></p>' +
                                         '<p><a href="/throws/Stella/home.html" title="stella" alt="stella">stella</a></p>' +
                                         '<p><a href="/throws/Eco/home.html" title="eco" alt="eco">eco</a></p>' +
                                         '<p><a href="/throws/Luca/home.html" title="luca" alt="luca">luca</a></p>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>velour</strong></p>' +
                                         '<p><a href="/throws/Capri/home.html" title="capri" alt="capri">capri</a></p>' +
                                         '<p><a href="/throws/Deco/home.html" title="deco" alt="deco">deco</a></p>' +
                                         '<p><a href="/throws/Luna/home.html" title="luna" alt="luna">luna</a></p>' +
                                         '<p><a href="/throws/LunaMilano/home.html" title="luna milano" alt="luna milano">luna milano</a></p>' +
                                         '<p><a href="/throws/Split/home.html" title="split" alt="split">split</a></p>' +
                                         '<p><a href="/throws/SplitEdition/home.html" title="split edition" alt="split edition">split edition</a></p>' +                                         '<p><a href="/throws/Bamboo/home.html" title="bamboo" alt="bamboo">bamboo (organic bamboo)</a></p>' +
                                         '<p><a href="/throws/BambooRelief/home.html" title="bamboo relief" alt="bamboo relief">bamboo relief (organic bamboo)</a></p>' +
                                         '<p><a href="/throws/Tasmania/home.html" title="tasmania" alt="tasmania">tasmania</a></p>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>crocheted</strong></p>' +
                                         '<p><a href="/throws/Jamaika/home.html" title="jamaika" alt="jamaika">jamaika</a></p>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>organic</strong></p>' +
                                         '<p><a href="/throws/Jade/home.html" title="jade" alt="jade">jade (organic cotton)</a></p>' +
                                         '<p><a href="/throws/Bamboo/home.html" title="bamboo" alt="bamboo">bamboo (organic bamboo)</a></p>' +
                                         '<p><a href="/throws/BambooRelief/home.html" title="bamboo relief" alt="bamboo relief">bamboo relief (organic bamboo)</a></p>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>bedspreads</strong></p>' +
                                         '<p><a href="/throws/Capri/home.html#SIZE88inx96in%20" title="capri" alt="capri">capri</a></p>' +
                                         '<p><a href="/throws/Stella/home.html" title="stella" alt="stella">stella</a></p>' +
                                     '</div>' +
                                     '<div class="yui3-bd yui3-accordion-item-bd">' +
                                         '<p style="margin-left: auto; margin-right: auto"><strong>accessories</strong></p>' +
                                         '<p><a href="/throws/cushion cover/home.html" title="cushion cover" alt="cushion cover">cushion cover</a></p>' +
                                         '<p><a href="/throws/hot water bottle/home.html" title="hot water bottle" alt="hot water bottle">hot water bottle</a></p>' +
                                         '<p><a href="/throws/kimono/home.html" title="kimono" alt="kimono">kimono</a></p>' +
                                         '<p><a href="/throws/pet blanket/home.html" title="pet blanket" alt="pet blanket">pet blanket</a></p>' +
                                     '</div>' +
                                 '</div>' +
                             '</div>' +
                             '</div>',
                df = '<div id="fussenegger">' +
                           '<ul>' +
                               '<li>collection by:</li>' +
                               '<li><img src="/images/fussenegger_logo.gif" title="David Fussenegger, textil" /></li>' +
                           '</ul>' +
                      '</div>';
           
            Y.one('body').addClass('yui3-skin-sam');
                 
            if (!navbox) { return; }

            navbox.setContent(sidenavhtml + df);
            YUI({gallery: 'gallery-2011.03.02-20-58'},
                {useConsoleOutput: true,
                    logInclude: {TestRunner: true}
                    }).use('test', 'gallery-node-accordion', 'event-mouseenter', 'console', function (Y) {
                var node; 

                node = Y.on('contentready', function () {
                    //alert('this=' + this);  //  <div id="myaccordion">        
                    this.plug(Y.Plugin.NodeAccordion, {});                    
                }, '#myaccordion');
                // expanding on mouseenter
                node.delegate('mouseenter', function (e) {
                    node.accordion.expandItem(e.currentTarget);
                }, '.yui3-accordion-item');
                // collapsing on mouseleave
                node.delegate('mouseleave', function (e) {
                    node.accordion.collapseItem(e.currentTarget);
                }, '.yui3-accordion-item');
        
                // finally, we might want to have a mouseleave event at the global level to collapse all items 
                // when the mouse is out of the accordion area to guarantee no problems
                // collapsing all items on mouseleave
                node.on('mouseleave', function (e) {
                    node.accordion.collapseAllItems();
                });


                // starting the testing process
		
		// add the test cases and suites 
		        Y.Test.Runner.add(new Y.Test.Case({
			
			        name: "Node Accordion Tests",
			
			        test_init: function () {
				
				        Y.Assert.isObject(node, "accordion plug fails...");
			
			        },
			        test_expanding_all: function () {
				
				        node.expandAllItems();
			        },
			        test_collapsing_all: function () {
				
				        node.collapseAllItems();
			        },
			        test_expanding_second_item: function () {
				
				        node.expandItem(1);
			        },
			        test_toggle_first_item: function () {
				
				        node.toggleItem(0);
			        },
			        test_collapse_first_item: function () {
				
				        node.collapseItem(0);
			        }
			
		        })); 
		//run all tests 
		        Y.Test.Runner.run();

            });  //  end of Y.use          
        };  // end of Y.sidenav

    },// module version, 
        // meta
        {
            requires: ['node', 'event']
        }
        );  //  end of YUI.add



    YUI().use('node', 'event', 'navigatepage', function (Y) {

        Y.header();
        Y.sidenav();
        Y.footer();
    }); 
                        

   
}());
