window.addEvent('domready', function(){	
	//just an habit, not necessary but i make less mistakes this way than when using $ or $$ each time... always end forgetting a ' somewhere :)
	var myToggler = $('openslider');
 
	var mySlide = new Fx.Slide('slider', {
		//duration: 1000, //i let you add the other options, let's just concentrate on that cookie issue, don't need mode: vertical, it's the default mode
		onComplete: function(){
			if(this.wrapper.offsetHeight != 0) {
				Cookie.set('toggleState', 'opened');
			}
			else {
				Cookie.set('toggleState', 'closed');
			}
		}
	})
	//here you check existence and value of 'toggleState' in a cookie
	if ( (Cookie.get('toggleState')) && (Cookie.get('toggleState') == 'opened') ) {
		mySlide.show();
	}
	else {
		mySlide.hide();
	}
	//here is you simple toggling link click event
	myToggler.addEvent('click', function(e){
		e = new Event(e).stop();
		mySlide.toggle();
	});
	
	
	
	
	
	
	
	//var myToggler2 = $('openslider2');
 
	//var mySlide2 = new Fx.Slide('slider2', {
		//duration: 1000, //i let you add the other options, let's just concentrate on that cookie issue, don't need mode: vertical, it's the default mode
		//onComplete: function(){
			//if(this.wrapper.offsetHeight != 0) {
			//	Cookie.set('toggleState2', 'opened');
			//}
			//else {
			//	Cookie.set('toggleState2', 'closed');
			//}
		//}
	//})
	//here you check existence and value of 'toggleState' in a cookie
	//if ( (Cookie.get('toggleState2')) && (Cookie.get('toggleState2') == 'opened') ) {
	//	mySlide2.show();
	//}
	//else {
	//	mySlide2.hide();
	//}
	//here is you simple toggling link click event
	//myToggler2.addEvent('click', function(e){
//		e = new Event(e).stop();
//		mySlide2.toggle();
//	});
	
	
 
});

