// 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: "header",
      contentclass: "content",
      contentwidth: 250
    },params);
    return this.each(function(i){   
	
	  jQ("."+params.contentclass,this).click(function() {
		 
		var link =  jQ(this).attr('link');
		//window.location = link;
		window.open(link);
		 
	  });
	
      jQ("."+params.headerclass,this)./*click*/mouseover(function(){
	
		jQ("#haccordion_content_img").attr('src',jQ(this).attr('rel'));    
		jQ("#haccordion_content_a").attr('href',jQ(this).attr('link'));
		
	
        var p = jQ(this).parent()[0];
        if (p.opened != "undefined"){
          jQ(p.opened).next("div."+params.contentclass).animate({
            width: "0px"
          },params.speed);
        }
        p.opened = this;
        jQ(this).next("div."+params.contentclass).animate({
          width: params.contentwidth + "px"
        }, params.speed);
      }); 
       
    }); 
 

  }
});
