// SeViR Simple Horizontal Accordion @2007
// http://letmehaveblog.blogspot.com
jQuery.fn.extend({
  haccordion: function(params){
    var jQ = jQuery;
    var params = jQ.extend({
      speed: 500,
      headerclass: "fold-bar",
      contentclass: "fold-content",
      contentwidth: 676

    },params);
	 jQ('.open').prev("div."+params.contentclass).animate({
          width: params.contentwidth + "px"
	   }, params.speed);




    return this.each(function(){
      jQ("."+params.headerclass,this).click(function(){
        var p = jQ(this).parent()[0];
        if(p.opened ==this) return;
		if (p.opened != "undefined"){
          jQ(p.opened).prev("div."+params.contentclass).animate({
            width: "0px"
          },params.speed);
		   jQ(p.opened).next("div."+params.contentclass).animate({
            width: "0px"
          },params.speed);
        }
        p.opened = this;
        jQ(this).prev("div."+params.contentclass).animate({
          width: params.contentwidth + "px"
        }, params.speed);
      });
    });
  }
});
