//jQuery.fn.slideFadeToggle = function(speed, easing, callback) {   
//	return this.animate({opacity: 'toggle', width: 'toggle'}, speed, easing, callback);  
//};

jQuery.fn.slideToggle = function(speed, easing, callback) {   
	return this.animate({width: 'toggle'}, speed, easing, callback);
};

//jQuery.fn.fadeToggle = function(speed, easing, callback) {
//	return this.animate({opacity: 'toggle'}, speed, easing, callback);
//};

$(function() {
	$('.accordion .heading').click(function() {
    // Calculate the width of the panel based on how many headings
    var panelwidth = $(this).parent().width() - (($(this).parent().find('.heading').size() + 1) * $(this).outerWidth(true));
    
    // Reset the CSS for the panel size to the calculated size
    $(this).parent().find('.panel:hidden').css({'width':panelwidth});  
    
    // Toggle visibility
		$(this).parent().find('.panel:visible').slideToggle(590).end().end().next('.panel:hidden').slideToggle(600);
    
	});
});


// SeViR Simple Horizontal Accordion @2007
// http://letmehaveblog.blogspot.com
//jQuery.fn.extend({
//  accordion: function(params){
//    var jQ = jQuery;
 
//    var accordion = ".accordion";
//    var header = "h1";
//    var panel = "p";
//    var speed = "500";

//    //var panelwidth = $(accordion).width() - ($(header).size() * $(header).outerWidth())
//    var panelwidth = $(accordion).width() - ($(accordion + ">" + header).size() * $(accordion + ">" + header).outerWidth(true))
      
//   return this.each(function(){
//      jQ(header,this).click(function(){
//        var panel = jQ(this).parent()[0];
//        if (panel.opened != "undefined"){
//          jQ(panel.opened).next(panel).animate({
//            width: "0px"
//          },speed);
//        }
//        panel.opened = this;
//        jQ(this).next(panel).animate({
//          width: panelwidth + "px"
//        }, speed);
//      });
//    });
//  }
//});


		//$(function(){
		//	$(".accordion").accordion();
		//});
