﻿/*************************导航效果***************************/
$(document).ready(function() {
	$("#topmenu ul > li").hover(
		function(){
			$(this).children("ul").slideToggle("fast");
		},
		function(){$(this).children("ul").slideUp("fast");}
	);
	
});
/*************************首页图片切换***************************/
$(document).ready(function(){   
	var speed = 1000, timeout = 5000;
	var $img = $("#PicFade img");
	//图片容器样式
	$("#PicFade").css({
		position:"absolute",
		overflow:"hidden"
	});
	//图片样式
	$("#PicFade img").css({
		position:"absolute",
		top:"0",
		left:"0",
		opacity: "0.0"
	});	
	$("#PicFade img:first").css({
		opacity: "1.0"
	});	

	
		
	var T = setTimeout(function(){ showNext(0, 1); }, timeout);
	$("#PicFade").hover(
		  function () {
		    clearTimeout(T);
		  },
		  function () {
		    T = setTimeout(function(){ showNext(0, 1); }, timeout);
		  }
	);
	function showNext(c, n){
		$($img[c]).animate({opacity: 0.0}, speed);  
		$($img[n]).animate({opacity: 1.0}, speed);
		c = n;
		n = (n >= $img.length - 1) ? 0 : n+1;
		T = setTimeout(function(){ showNext(c, n); }, timeout);
	};
});
