window.addEvent('domready', function(){    
	
   /*
	var accordion = new Accordion("h2", "ul.strands_session_list", {
		opacity: true, 
		alwaysHide: true,
		display: 0, 
		fixedHeight: "auto", 
		onActive: function(toggler, element){
				element.setStyles({
				overflow: "visible",
				height: "auto", 
				borderLeft: "1px solid #ccc"
			});
		},

		onBackground: function(toggler, element){ 
			element.setStyle('margin', '0 0 0 25px');
			toggler.setStyle('margin-left', '15px');
		}
	}, $('main'));
	
    */


		var accordion = new Accordion($$('h2'),$$('ul.strands_session_list'), {
			opacity: 0, 
			alwaysHide: true,  
			 display: -1,
			onActive: function(toggler, element) { 
                element.setStyle("borderLeft","1px solid #ccc" ); 
				toggler.setStyles({
					cursor: 'pointer',
					borderBottom: '1px solid #7D1D13',
					color: '#000',
					background: "url('images/close.gif') left center no-repeat",
					paddingLeft: "75px"
				 });
			  },
			onBackground: function(toggler,element) { 
				element.setStyle('margin', '0 0 0 25px');
				toggler.setStyles({
					marginLeft: '0px',
					cursor: 'pointer',
					borderBottom: '1px solid #7D1D13',
					color: '#7D1D13',
					background: "url('images/open.gif') left center no-repeat",
					paddingLeft: "75px"
				 });
		   }
		});

	
   	
	var links = $$('ul.strands_session_list li a'); 
	links.each(function(link){
		 url = link.href;
		 link.href = url.replace('sessions','get_strand');
		 
	});
	
	new MultiBox('strand_box', {showNumbers: false, showControls: false, useOverlay: true});   
	/* 
	links.each(function(link){  
	   
	   link.addEvent('click', function(e){
		e = new Event(e).stop();

		 	if(link.getNext() !== null){
			    link.getNext().remove()
			}else{
				url = link.href;
				url = url.replace('sessions','get_strand');

				new Ajax(url, {
					method: 'get',
					onComplete: function() {
						new Element('div',{'class': 'box'}).setHTML(this.response.text).injectAfter(link);
						
						
						close_links = new Array();
					   	close_links = $$('.close'); 
						close_links.each(function(close_link, num){ 
					     	   close_link.removeEvents();
							   close_link.addEvent('click', function(e){ 
									close_link.getParent().remove();
							   		e = new Event(e).stop(); 
                               }); 
						});
					  
					}  															
				}).request();    
  
			} 
			
										
		}); 
		
	}); 
	*/
   
}); 




