//**************************************************************
// Horizontal Accordion allows you to show your banners
//
// mail: service@jeemoo.net
//**************************************************************

(function($){
		$.fn.haccordion = function(options){	    
		var settings = {
				maxWidth: 800,		
				minWidth: 50,		
				height: 200,
				duration:600
			};

			if(options) {
				$.extend(settings, options);
			};
			
   		//Set the style of the elements
	    $(this).css({
	    	width: settings.maxWidth+settings.minWidth*2,
	    	position: "relative",
				overflow: "hidden"});  
				
	    $(this).find("ul").css({
	    	  "list-style": "none",
				  cursor: "pointer",  
				  margin: "0",
				  padding: "0"}); 	    
				  
	    $(this).find("li").css({ 
	    	"width":settings.minWidth,
	    	"height": settings.height, 
	    	float:"left", 
	    	display:"block", 
	    	"margin-right":"0px"}); 
	    
	    $(this).find("li img").css({ 
	    	  position: "absolute",
  				border: "0px"}); 
	    $(this).find("li a").css({ 
	    	 	float:"left",
  				display: "block",
  				overflow: "hidden"	}); 
  				
  		//Set the logic to show the images
  		lastBlock = $(this).find("li").get(0); 
	    $(lastBlock).animate({width: settings.maxWidth+"px"}, { queue:false, duration:0});    

	    $(this).find("li").hover(
	      function(){
	        $(lastBlock).animate({width: settings.minWidth+"px"}, {queue:false, duration:settings.duration });
					$(this).animate({width: settings.maxWidth+"px"}, {queue:false, duration:settings.duration});
					lastBlock = this;
	      });
		}
})(jQuery);

