(function($){
	function navhover(){
		var link = $("#nav li a");
			link.hover(function(){			
				$(this).parent().siblings().find("a").addClass("nohover");
			},function(){
				$(this).parent().siblings().find("a").removeClass("nohover");
			})
	}
	function selectChange(){
		function changeIt(){
			MagicZoom.start(document.getElementById('mz1'));
		}				
		$('.required-entry').change(function(){								
			var timeChange = window.setInterval(changeIt,1000);
			function stopIt(){
				window.clearInterval(timeChange);
			}
			window.setTimeout(stopIt,8000);
		})
	}
	function yearChange(){
		var years = $('ul.yeahs li a'),
			block = $('div.left .text'),
			index = 0,
			speed = 300;
		block.hide();
		block.eq(0).show();
		years.click(function(){
			index = years.index(this);
			block.hide().eq(index).fadeIn(speed);
		})
	}
	function slidetips(){
		var tips = $('.imgtips'),
			speed = 400;
		tips.hide();		
		$('.slides').hover(function(){
			tips.fadeIn(speed);
		},function(){
			tips.fadeOut(speed);
		});
		
		
	}
	$(document).ready(function(){
		window.nav = new navhover();
		window.selectChange = new selectChange();
		window.slidetips = new slidetips();
		window.yearChange = new yearChange();
                $('.yeahs li a').each(function(){
            $(this).click(function(){
                $('.yeahs li a').removeClass('active');
                $(this).addClass('active');
            })
        });
            $(function () {
        $('.fade').hover(function() {
            $(this).fadeTo("fast", 0.7);
        }, function() {
            $(this).fadeTo("fast", 1);
        });

        $('.s-product-image').hover(function() {
            $(this).fadeTo("fast", 0.7);
            $(this).siblings('.s-color').fadeTo('fast', 1);
        }, function() {
            $(this).fadeTo("fast", 1);
            $(this).siblings('.s-color').fadeTo('fast', 0);
        });
    });
	})
})(jQuery)



