Te Kete Ipurangi Navigation:

Te Kete Ipurangi
Communities
Schools

Te Kete Ipurangi user options:


New Zealand Curriculum Online navigation

Home
function openedMenus( cookieName ) { var cookie = $.cookie( cookieName ); var items = cookie ? cookie.split(/,/) : new Array(); return { "add": function( val ) { items.push(val); $.cookie(cookieName, items.join(','), {path: '/'}); }, "has": function( val ) { for ( var i = 0; i < items.length; i++ ) { if ( items[i] == val ) { return true; } } }, "remove": function( val ) { var new_array = new Array(); for ( var i = 0; i < items.length; i++ ) { if ( items[i] != val ) { new_array.push( items[i] ); } } items = new_array; $.cookie(cookieName, items.join(','), {path: '/'}); }, "clear": function() { items = null; $.cookie(cookieName, null, {path: '/'}); }, "items": function() { return items; } } } function createMenu( menu ) { var class_open = 'open'; var class_current_open = 'current-open'; var class_current = 'current'; var class_has_children = 'children'; var opened = openedMenus( "openedmenu" ); var ul = $(document.createElement('ul')); $.each( menu, function( index, value ) { if ( value === null || value === undefined ) return; var open = false; var span = $(document.createElement('span')).addClass('button'); var anchor = $(document.createElement('a')).text( value.title ).attr( 'href', value.url ); var containerspan = $(document.createElement('span')).addClass('container').attr('id', 'node'+value.id).append(span).append(anchor); var li = $(document.createElement('li')).append( containerspan ); if ( value.id == 2 && value.title == 'Home' ) li.addClass('home'); if ( value.id == 0 || value.id == 00 || value.id == 000 ) li.addClass('subsite'); if ( value.is_current == true ) containerspan.addClass( class_current ); if ( value.children != false ) { if ( value.is_open == true || opened.has( value.id ) ) { if (containerspan.hasClass( class_current )) { containerspan.addClass( class_current_open ); } else { containerspan.addClass( class_open ); } open = true; } var child = createMenu( value.children ); span.addClass( class_has_children ); span.click( function() { if ( open ) { if (containerspan.hasClass( class_current )) { containerspan.removeClass( class_current_open ); } else { containerspan.removeClass( class_open ); } child.slideUp('fast'); opened.remove( value.id ); } else { if (containerspan.hasClass( class_current )) { containerspan.addClass( class_current_open ); } else { containerspan.addClass( class_open ); } child.slideDown('fast'); opened.add( value.id ); } //child.toggle( ! open ); //child.slideToggle('fast'); open = !open; } ) if ( ! open ) child.hide(); li.append( child ); } ul.append( li ); } ); return ul; } var menu = getObjects(); m = createMenu( menu ); m.addClass('nav jsnav match'); $('#menulist').replaceWith( m ); $("#node2").addClass('open current current-open').next().toggle(); $("#node2010").addClass('open current current-open').next().toggle(); $("#node2620").addClass('open current current-open').next().toggle(); $("#node3696").addClass('open current current-open').next().toggle(); $("#node4682").addClass('open current current-open').next().toggle(); $("#node4454").addClass('open current current-open').next().toggle(); $("#node4456").addClass('open current current-open').next().toggle(); $("span.container").each(function(index) { if($(this).hasClass('open')){ $(this).parent().find('ul:first').slideDown('fast'); } }); -->

Footer: