var LogosBar = function() {
	this.init();
}

LogosBar.prototype = {
	init: function() {
		this.imageWrapperWidth = 115;
		this.imageWrapperHeight = 120;
		this.imageWidth = 90;
		this.imageHoverWidth = 100;
		this.imagePadding = 20;
		this.imageHoverPadding = 10;
		this.imageAnimateTime = 150;
		this.imageWrappers = $('.logoWrapper');
		this.images = $('.logoImage');
		
		this.setDefaultStyles();
		this.bindHoverEffects();
	},
	setDefaultStyles: function() {
		var self = this;
		this.imageWrappers.each(function() {
			$(this).width(self.imageWrapperWidth);
			$(this).height(self.imageWrapperHeight);
		});
		
		this.images.each(function() {
			$(this).width(self.imageWidth);
		});
		this.images.each(function() {
			$(this).width(self.imageWidth);
			$(this).css('padding-top', self.imagePadding + 'px');
		});
	},
    
	bindHoverEffects: function() {
		var self = this;

		
		this.images.each(function() {

			var star = $(this).parent().siblings(".star").first();

			var wrapper = $(this).parent().parent();
			wrapper.mouseenter(

				function(event) {

					star.stop()
						.fadeIn("normal", function(){
							$(this).css('opacity',1);
							star.animate({'opacity': 0.1});
						})
						.rotate({
							duration: 600,
							angle:90,
							animateTo:-45,
							callback: function() {

							},
							easing: function (x,t,b,c,d){        // t: current time, b: begInnIng value, c: change In value, d: duration
								return c*(t/d)+b;
							}
						});

					$(this).find('.logoImage').stop().animate({width:self.imageHoverWidth, 'padding-top':self.imageHoverPadding}, self.imageAnimateTime);
				
				}
			);

			wrapper.mouseleave(
				function(event) {
					$(this).find('.logoImage').stop().animate({width:self.imageWidth, 'padding-top':self.imagePadding}, self.imageAnimateTime);
				}
			);

		});
	}
}
