(function($){
	$.fn.tinyaccordion = function(){
		var oCurrent = null, oHeads, oAccordion = $(this);
		function initialize(){
			oHeads = oAccordion.children( '.head' );
			var oFirst = $(oHeads[0]);
			oFirst.addClass('active').next().show();
			
			oCurrent = oFirst;
			oHeads.click(control);
		};
		function control(oEvent){
			var oTarget = $(this);

			var oTcontent = oTarget.next(); 
			var	oCcontent = oCurrent.next()
			
			if(oCurrent[0] != oTarget[0] ) {
				oCurrent.removeClass('active');
				oTarget.addClass('active');
				
				oCcontent.slideUp('slow', function(){
					oTcontent.slideDown('slow');
				});
			}
			
			oCurrent = oTarget;
			return false;
		};			
		
		initialize();		
	};
})(jQuery);
