// JavaScript Document
$(function(){
		$("#spec-list img").bind("mouseover",function(){
					var src=$(this).attr("src");
					
					$("#spec-n1 img").attr("src",src);
					
					$(this).css({
						"border":"2px solid #CA000F",
						"padding":"1px"
					});
					
					
				}).bind("mouseout",function(){
					$(this).css({
						"border":"1px solid #ccc",
						"padding":"2px"
					});
				});	
						
					   });
			
			$(function(){			
			   $(".jqzoom").jqueryzoom({
					xzoom:350,
					yzoom:400,
					offset:10,
					position:"right",
					preload:1,
					lens:1
				});
				
				$("#spec-list").slider({
					slider:".list-h",
					autoPlay:false
				});
									
	
	$(".content_4 button").each(function(i){
			$(this).hover(function(){
				$(this).addClass("buttonHover").siblings().removeClass("buttonHover");
			},function(){})							 
		});
	
	$(".nav").each(function(i){
		$(this).hover(
			function(){
				$(this).children().addClass("selected");
				$(this).find(".secondList").show()
				$(this).find("li").show().fadeIn(300);

			},
			function(){
				$(this).children().removeClass("selected");
				$(this).find(".secondList").hide();
			}
		)
	});
	
	//焦点图切换
		var sliderView = function(i) {
			jQuery("#viewerImg a").eq(i).fadeIn().siblings().hide();
			jQuery("#triggerBox a").eq(i).addClass("selected").siblings().removeClass("selected");
		};
		
		//自动切换
		var item = 0,
			els = jQuery("#viewerImg a").length,
			timer = setInterval(function(){
			sliderView(item);
			item = (item+1) % els;
		},3000);
		
		//鼠标经过触发器切换
		jQuery("#triggerBox a").each(function(i){
			jQuery(this).hover(function(){
				clearInterval(timer);
				sliderView(i);
			}, function(){
				item = i + 1;
				timer = setInterval(function(){
					sliderView(item);
					item = (item+1) % els;
				},3000);
			});
		});		 
})
