/*---powered by league-stu.com  author:偶然音  QQ:49501808---*/

/*------------导航栏仿flash动画-----------*/
jQuery(function(){
	jQuery(".nav ul li").hover(
		function(){
			jQuery(this).stop(true).animate({height:"90px",opacity:"0.7"},200);
		},
		function(){
			jQuery(this).stop(true).animate({height:"100px",opacity:"1"},200);
		}
	).click(
		function(){
			jQuery(this).stop(true).animate({height:"100px",opacity:"1"},200);
		}
	);
});

/*---------------flash效果--------------------*/
jQuery(function(){
	jQuery(".flash_con img:eq(0)").fadeIn(400);//图片初始化
	
	var adTimer=setInterval(function(){left();},12000);
	jQuery(".flash_arrow:eq(0) a img").mousedown(function(){
		jQuery(this).attr("src","images/arrow_lh.jpg");
		left();
		//return false;
	}).mouseup(function(){
		jQuery(this).attr("src","images/arrow_l.jpg");
	});
	jQuery(".flash_arrow:eq(1) a img").mousedown(function(){
		jQuery(this).attr("src","images/arrow_rh.jpg");
		right();
			//return false;
	}).mouseup(function(){
		jQuery(this).attr("src","images/arrow_r.jpg");
	});
	jQuery(".flash_arrow:eq(1) a").click(	  
		function(){
			//left();
			return false;
		}
	);
	jQuery(".flash_arrow:eq(0) a").click(	  
		function(){
			//right();
			return false;	
		}
	);
});

function left(){//左箭头功能
	if(!jQuery(".flash_con img").is(":animated")){
		jQuery(".flash_con img:eq(0)").fadeOut(400,function(){ //产品图显示下一张
			jQuery(".flash_con img:eq(0)").appendTo(".flash_con");
			jQuery(".flash_con img:eq(0)").fadeIn(400);
		});
	}
};
function right(){//右箭头
	if(!jQuery(".flash_con img").is(":animated")){
		jQuery(".flash_con img:eq(0)").fadeOut(400,function(){ //产品图显示上一张
			jQuery(".flash_con img:last").prependTo(".flash_con");
			jQuery(".flash_con img:eq(0)").fadeIn(400);	
		});
	}
};

	
//产品页右边按钮放大效果
jQuery(function(){
	jQuery(".right_btns a img").mouseover(function(){
		jQuery(this).animate({width:"+=5px",height:"+=5px"},100);
	});
	jQuery(".right_btns a img").mouseleave(function(){
		jQuery(this).animate({width:"-=5px",height:"-=5px"},100);
	});
});

//参数表格效果
//jQuery(function(){
	jQuery(".spe").find("li:even").css({"background-color":"#cbd4e1"}).end().find("li:eq(0)").css({"background-color":"#53709a","font-weight":"bold","color":"white"}).end();
	//jQuery(".spe li:nth-child(odd)").css("background-color","#d6dce4");
	//jQuery(".spe li:nth-child(1)").css("background-color","#597594").css("color","white").css("font-weight","bold");
	//jQuery(".spe:eq(0)").css("margin-right","1px");
//});

//内容页左边产品列表自动与导航匹配
jQuery(function(){
	//var pro_name=jQuery(".pro_name").html();
	//jQuery(".left_nav2 li a[name="+pro_name+"]").css("color","red");
	/*var list_title;
	var n=jQuery(".left_nav li").length;
	for(var i=0;i<n;i++){
		list_title=jQuery(".left_nav li:eq("+i+") a").attr("title");
		if(pro_name==list_title){
			jQuery(".left_nav li:eq("+i+") a").addClass("thispro");
		}
	}*/
	var pro_name=jQuery(".pro_name").html();
	jQuery("a[title="+pro_name+"]").css({"background-color":"#d6dce4","cursor":"default"});
	jQuery("a[title="+pro_name+"]").parent().parent(".left_ul2,.left_ul3").show();
	jQuery("a[title="+pro_name+"]").parent().parent().parent().parent(".left_ul2").show();
	jQuery(".left_li1").click(function(){
		jQuery(".left_ul2:visible").slideUp(400);
		jQuery(this).next().find(".left_ul2").slideDown(400);
		return false;
	});
	jQuery(".list3").click(function(){
		jQuery(".left_ul3:visible").slideUp(400);
		jQuery(this).parent().next().find(".left_ul3").slideDown(400);
		return false;
	});
});
//产品线大图效果
jQuery(function(){
	jQuery("a.pro").mouseover(function(e){
		var tooltip="<img id='tooltip' />";
		jQuery("body").append(tooltip);
		var offset=jQuery(".top_con_box").offset();
		var a=offset.left;
		var b=offset.top;
		var src=jQuery(this).find("img").attr("src");
		jQuery("#tooltip").css({"top":(e.pageY-b+10)+"px","left":(e.pageX-a+a*1.02)+"px"}).show("fast").attr("src",src);
		//jQuery("#tooltip img").css({"top":(offset.top-225)+"px","left":(offset.left-290)+"px"}).show("fast").attr("src",src);
		}
	).mouseout(function(){
		jQuery("#tooltip").remove();
		}
	).mousemove(function(e){
		var offset=jQuery(".top_con_box").offset();
		var a=offset.left;
		var b=offset.top;
		jQuery("#tooltip").css({"top":(e.pageY-b+10)+"px","left":(e.pageX-a+a*1.02)+"px"});
		//jQuery("#tooltip img").css({"top":(offset.top-225)+"px","left":(offset.left-290)+"px"});
		});
});

/*--------产品列表背景效果---------*/
jQuery(function(){
	jQuery(".pro_list li,.news_list2 li").mouseover(function(){
		jQuery(this).css("border","1px solid red");
	})
	.mouseout(function(){
		jQuery(this).css({"border-top":"none","border-left":"none","border-right":"none","border-bottom":"1px dotted #999"});
	});
});
