//center function
(function($){
    $.fn.extend({
        center: function (mintop,moretop) {
        	if(moretop == undefined){moretop = -50;}
            return this.each(function() {
                var top = ($(window).height() - $(this).outerHeight()) / 2 + moretop;
              
                //var left = ($(window).width() - $(this).outerWidth()) / 2;
                //$(this).css({position:'absolute', margin:0, top: (top > 0 ? top : 0)+'px', left: (left > 0 ? left : 0)+'px'});
                $(this).css({position:'absolute', margin:0, top: (top > mintop ? top : mintop)+'px'});
            });
        }
    }); 
})(jQuery);


(function($){
    $.fn.extend({
        floatpatch: function (mintop) {
            return this.each(function() {
                var top = ($(window).height() - 200);
                $(this).css({position:'absolute', margin:0, top: (top > mintop ? top : mintop)+'px'});
            });
        }
    }); 
})(jQuery);

jQuery(document).ready(function(){
	if ($('.ie').length == 0){
	
		$('#patches_group ul li')
		.hover(
			function(){
				var _li = $(this);
				
				_li.stop().animate(
					{backgroundPosition:"0px 0px"},
					300,
					function(){
						_li.addClass('active');
					}
				);
				
			},
			function(){
				var _li = $(this);
				$(_li)
					.stop()
					.animate(
						{backgroundPosition:"0 60px"},
						300
					)
					.removeClass('active')
					.find('span')
						.stop()
						.animate(
							{height : '0'},
							200
						);
			}
		)
	}

});
