/*
	Created By: Aaron Tennyson @ BT Solutions, LLC
	Date: May 11, 2010
	Copyright 2010 BT Solutions, LLC
	Visit our Website at http://btsolutionsllc.com
*/	

function accordion(rate){
	
	var tab = $('#wrapper').find('h3'),
	visible = tab.next().filter(':last'),
	width = visible.outerWidth();
		
		//hide all but first panel, set width to zero for animate function to work
		tab.next().filter(':not(:last)').css({display:'none', width:0});
		
		//attach click handler
		tab.click(function(){
			if(visible.prev()[0] == this){
				return;
			}
			visible.animate({width:0},{duration:rate});
			visible = $(this).next().animate({width:width},{duration:rate});
		});
	};

$(document).ready(function(){
	accordion(350);
});

