(function($){
    $.fn.extend({
        //plugin name - animatemenu
        highLight: function(options) {
 
            var defaults = {
				css_main_lo:{'background-color':'black'},
                css_sub_lo: {opacity:.5},
            };
             
            var options = $.extend(defaults, options);
         
            return this.each(function() {
                var opt = options; //alert(o.select_ex);
				var panel = $(this); //alert(panel.html());
				var items = panel.children('li'); //alert(items.length);

				items.hover(function(event){ //alert($(this).html());
					items.each(function(){
						save_css($(this)); $(this).css(opt.css_main_lo); //alert('xx');
						//alert($(this).html());
						$(this).find('img').each(function(){
							save_css($(this));
							$(this).css(opt.css_sub_lo);
						});
						$(this).find('p').each(function(){
							save_css($(this));
							$(this).css(opt.css_sub_lo);
						});
					});
					restore_css($(this));
					$(this).each(function(){
						restore_css($(this));
						$(this).find('img').each(function(){
							restore_css($(this));
						});
						$(this).find('p').each(function(){
							restore_css($(this));
						});
					});
				}, function(){
					items.each(function(){
						restore_css($(this));
						$(this).find('img').each(function(){
							restore_css($(this));
						});
						$(this).find('p').each(function(){
							restore_css($(this));
						});
					});
				});
				
				function save_css(obj){
					obj.data('css_ori',obj.attr('style'));
				}
				function restore_css(obj){
					obj.attr('style',obj.data('css_ori'));
				}

			});
        }
    });
})(jQuery);

