//add url Hash access to open/close states
//add persistence/memory to open close state(s)?
//SWFAddress for project overlays
//Incorporate AJAX load of project data as well as loading animation/slide-in

//Fix toggle state for otherEl morph...CANNOT figure out how to do it on the same link as the myVerticalSlide.toggle(); design hacked for now.

//7/29 @ 4:30PM | 10 hours and counting...

window.addEvent('domready', function() {

	var status = {'true': '<img src=images/minus.gif>', 'false': '<img src=images/plus.gif>'};

	var myVerticalSlide = new Fx.Slide('mainMessaging', {duration: 0});
	var otherEl = $('projectMenu');
/*
	$('v_toggle').addEvent('click', function(e){
		e.stop();
		myVerticalSlide.toggle();
		otherEl.morph('.projectMenuClose');
	});
*/
	$('v_close').addEvent('click', function(e){
		e.stop();
		myVerticalSlide.slideOut();
		otherEl.morph('.projectMenuClose');
		Cookie.write('myVerticalSlide', 'closed');
	});

	$('v_open').addEvent('click', function(e){
		e.stop();
		myVerticalSlide.slideIn();
		otherEl.morph('.projectMenuOpen');
		Cookie.write('myVerticalSlide', 'opened');
	});

	if(Cookie.read('myVerticalSlide') == 'closed') {
		$('vertical_status').set('html', '<img src=images/plus.gif>');
		myVerticalSlide.slideOut();
		otherEl.setStyle('padding-top', 100);
	} else {
		$('vertical_status').set('html', '<img src=images/minus.gif>');
		myVerticalSlide.slideIn();
		otherEl.setStyle('padding-top', 150);
	}

	var myVerticalSlide = new Fx.Slide('mainMessaging', {duration: 500});

	// When Vertical Slide ends its transition, we check for its status
	// note that complete will not affect 'hide' and 'show' methods
	myVerticalSlide.addEvent('complete', function() {
		$('vertical_status').set('html', status[myVerticalSlide.open]);
	});

	
});