/**
 * Functions related to begin your journey component
 * @author markdonovan
 */
var ExpanderCurrentOption = null;
var ExpanderCollapseSpeed = 300;

function ExpandCollapse(containerName, element) {
	
	var containerId = '#' + containerName; 
	
	if($(containerId).data('currentOption') != null) {
		if($.browser.msie && $.browser.version <=7) {
			$($(containerId).data('currentOption')).css('display', 'none');
		} else {		
			$($(containerId).data('currentOption')).slideUp(ExpanderCollapseSpeed, 'easeInOutQuad', function(){});
		}
		$($(containerId).data('currentOption').replace('Hidden', ''))
			.removeClass('Collapse')
			.addClass('Expand');
	}
	
	var id = element.parent().attr('id').split('-')[1];
	var selector = containerId + ' #' + containerName + 'Hidden-' + id;
	
	if(selector == $(containerId).data('currentOption')) {
		$(containerId).data('currentOption', null);
		return;
	}
	if($.browser.msie && $.browser.version <=7) {
		$(selector).css('display', 'block');
	} else {		
		$(selector).slideDown(ExpanderCollapseSpeed, 'easeInOutQuad', function(){});
	}
	$(containerId + ' #' + containerName + '-' + id)
		.removeClass('Expand')
		.addClass('Collapse');
	$(containerId).data('currentOption', selector);
	return false;
}
