window.addEvent('domready', function() {

   			var mySlide = new Fx.Slide('features');
			var toggleCookie = new Hash.Cookie('togglestatus',{duration: 3600, path:'/'});

			if (toggleCookie.get('status') == 1) {
				mySlide.hide();	
			} else {
				toggleCookie.empty();
				toggleCookie.set('status',-1);
			}
			
			/*
			$('features_nav').addEvent('click', function(e){
				e = new Event(e);
				toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
				mySlide.toggle();
				e.stop();				
			});
			*/
			
			$('toggle01').addEvent('click', function(e){
				e = new Event(e);
				toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
				mySlide.toggle();
				e.stop();
			});
			$('toggle02').addEvent('click', function(e){
				e = new Event(e);
				toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
				mySlide.toggle();
				e.stop();
			});
			$('toggle03').addEvent('click', function(e){
				e = new Event(e);
				toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
				mySlide.toggle();
				e.stop();
			});
			$('toggle04').addEvent('click', function(e){
				e = new Event(e);
				toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
				mySlide.toggle();
				e.stop();
			});
			$('toggle05').addEvent('click', function(e){
				e = new Event(e);
				toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
				mySlide.toggle();
				e.stop();
			});

			$('feature01').addEvent('click', function(e){
				if (toggleCookie.get('status') == 1) { // only toggle if currently closed
					e = new Event(e);
					toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
					mySlide.toggle();
					e.stop();
				}
				
				var myFx = new Fx.Scroll('features').toElement('f01');
			});	
			
			$('feature02').addEvent('click', function(e){
				if (toggleCookie.get('status') == 1) { // only toggle if currently closed
					e = new Event(e);
					toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
					mySlide.toggle();
					e.stop();
				}
				
				var myFx = new Fx.Scroll('features').toElement('f02');
			});
			
			$('feature03').addEvent('click', function(e){
				if (toggleCookie.get('status') == 1) { // only toggle if currently closed
					e = new Event(e);
					toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
					mySlide.toggle();
					e.stop();
				}
				
				var myFx = new Fx.Scroll('features').toElement('f03');
			});
			
			$('feature04').addEvent('click', function(e){
				if (toggleCookie.get('status') == 1) { // only toggle if currently closed
					e = new Event(e);
					toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
					mySlide.toggle();
					e.stop();
				}
				
				var myFx = new Fx.Scroll('features').toElement('f04');
			});
			
			$('feature05').addEvent('click', function(e){
				if (toggleCookie.get('status') == 1) { // only toggle if currently closed
					e = new Event(e);
					toggleCookie.set('status',-1*toggleCookie.get('status'),{duration: 3600, path:'/'});
					mySlide.toggle();
					e.stop();
				}
				
				var myFx = new Fx.Scroll('features').toElement('f05');
			});
			
			var tip = new Tips('.f_tip',{
				offsets: {'x': -38, 'y': 20},
				hideDelay: 50,  
				showDelay: 50
			});


			$$('.f_tip').each(function(tip){
				var imgSrc = tip.retrieve('tip:text');
				var imgAlt = tip.retrieve('tip:title');
				tip.store('tip:text', new Element('img',{'src':imgSrc,'alt':imgAlt}));

			});
			
			var myFx = new Fx.Scroll('features').toElement('f05');

   });