// tvc videogallery

window.addEvent('domready', function(){
//list of target elements
var list = $$('#tvc-menu li.sub ul.submenu');
//list elements to be clicked on
var headings = $$('#tvc-menu li.sub');
//array to store all of the collapsibles
var collapsibles = new Array();

headings.each( function(heading, i) {

        //for each element create a slide effect
        var collapsible = new Fx.Slide(list[i], {
                duration: 200,
                transition: Fx.Transitions.linear
        });

        //and store it in the array
        collapsibles[i] = collapsible;

        //add event listener
				heading.addEvents({
        		'mouseenter': function(){
								for (i=0; i < collapsibles.length; i++) {
										collapsibles[i].hide();
									}
								collapsible.show();
                return false;
        		},
						'mouseleave': function(){
                collapsible.hide();
                return false;
        		}
				});
				
				//collapse all of the list items
        collapsible.hide();
});

});

/*window.addEvent('domready', function() {
	var accordion = new Accordion($$('#tvc-menu li.sub'),$$('#tvc-menu li.sub ul.submenu'), {
		opacity: 0,
		onActive: function(toggler) { toggler.setStyle('color', '#ff3300'); },
		onBackground: function(toggler) { toggler.setStyle('color', '#000000'); }
	});
});*/
