jQuery.fn.extend({
  haccordion: function(params){
    var jQ = jQuery;
    var params = jQ.extend({
      speed: 300,
      headerclass: "header",
      contentclass: "content"
      //contentwidth: 300
    },params);
	
	return this.each(function(){
		//this.opened = jQ("."+params.contentclass,this).filter(".visible").prev();
		jQ(".yowzer").hide();
		jQ("."+params.contentclass,this).click(function(){
			var p = jQ(this).parent()[0];
			if (p.opened == this) return
        	if (p.opened != "undefined"){
		  		jQ(".desc").fadeOut();
				jQ(".yowzer").hide();
		  		jQ(p.opened).animate({
            		width: "20px",
					opacity: "0.1"
          		},params.speed);
				jQ(p.opened).removeClass('visible');
        	}
        	p.opened = this;
			s = parseInt(jQ(this).attr("ord"));
        	jQ(this).animate({
				width: jQ(this).attr("contentwidth"),
				opacity: "1.0"
        	}, params.speed);
			jQ(this).addClass('visible');
			jQ(".desc",this).css({width:jQ(this).attr("contentwidth")});
			jQ(".desc",this).fadeIn();
			jQ(".yowzer",this).show();
      	});
    });
  }
});
