(function($) {    // Compliant with jquery.noConflict()
	$.fn.Slwi = function(opt) {
		opt = $.extend({
			height: 200,
			transparent: 0.8,
			expandheight: 120,
			collapseheight: 30,
			iwidth: 150,
			iheight: 200,
			textcolor : '#FFFFFF',
			bgcolor : '#4F4F4F'
		}, opt || {});	
		
		var currentItem = null;
		/*Init*/
		$(this).css({height : opt.height + 'px'});
		
		$(this).find('ul > li').each(function() {
				/*Init for li element*/
				$(this).css({width : opt.iwidth + 'px' , height : opt.iheight + 'px'});
				var item_desc = $(this).find('.jm_item_desc');
				item_desc.css({'opacity': opt.transparent, 'height' : opt.collapseheight + 'px', width : opt.iwidth + 'px', 'color' : opt.textcolor, 'background-color' : opt.bgcolor});
				
				var a_link = $(this).find('a');
				var product_item = $(this).find('.jm_product_item');
				$(product_item).css('cursor', 'pointer');
				$(product_item).click(function(){
					location.href = $(a_link).attr('href');
				});
				
				$(this).hoverIntent({
					sensitivity: 7, 
					interval: 100,   
					over: function() {
						
						if ( $(this).attr('id') == currentItem) {
							return;
						}
						
						item_desc.animate({'height': opt.expandheight + 'px'}, 'slow');	
						currentItem = $(this).attr('id');
					},  
					timeout: 0,   
					out: function() {
						item_desc.animate({'height': opt.collapseheight + 'px'}, 'fast');	
						currentItem = '';
					} 
				 });
				
				/*$(this).hover(
					function() {
						
						if ( $(this).attr('id') == currentItem) {
							return;
						}
						
						item_desc.animate({'height': opt.expandheight + 'px'}, 'slow');	
						currentItem = $(this).attr('id');
					}, function() {
						item_desc.animate({'height': opt.collapseheight + 'px'}, 'fast');	
						currentItem = '';
					}
				 );*/
		});
	}
})(jQuery);
